:root {
    --primary:  #5D5AC3;
    --secondary: #27b627;
    --txt_dark: #6f6f6f;
    --txt_light: white;
    --grey: #eee;
    --bar: rgba(222, 222, 222, 0.3);
    --purple: #5D5AC3;
    --purple_alt: #4542A1;
    --orange: #e28500;
    --orange_alt: #ff9601;
    --grey_alt: #E2E2E2;
    --grey_light: #f5f5fa;
    --grey_blue: #D3DCF0;
    --grey_blue_2: rgb(150, 165, 211);
}

/* GLOBAL RESET */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    display:flex;
    font-family: "Lucida Grande", Verdana, sans-serif;
    font-size: 16px;
    background-color: #dedde6;
    background-image: url(img/bck.jpg);
    background-size:cover;
    background-position: center;
}

/* DEFAULT: Desktop layout */
.qa_template{
    margin:  auto;
    width:640px;
    max-width: 100%;
    height: 100%;
    padding:1rem;
    display:flex;
    min-height:400px;
}

.qa_container {
    position: relative;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    overflow: hidden;
    background-color: #fff;
    border: 1px solid var(--grey);
    border-radius: 1.4rem;
    height:100%;
    max-height:75%;
    width:100%;
    margin:auto;
  
}
@media (max-width: 1200px) {
  .qa_container{
        max-height:100%;
    }
}

/* Header */

.qa_tool{
    padding:0.25rem;
    display: flex;
    justify-content: flex-end;
}
@media (max-width: 1200px) {
  .qa_tool{
       justify-content: center;
    }
}
.qa_welcome {
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--txt_dark);
    background-color: var(--bar);
}

/* Login area */
.qa_login {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.qa_login_form {
    width: 80%;
    text-align: center;
}

/* Chat area */
.qa_chat {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scroll-behavior: smooth;
    gap: 1rem;
    min-height:4rem
}

.qa_waiting {
    text-align: center;
    color: var(--txt_dark);
    font-size: 0.75rem;
    margin-top: 2rem;
}

.qa_row {
    max-width: 80%;
    text-align: right;
    align-self: flex-end;
    margin: 0;      
}

.qa_row.qa_reverse {
    align-self: flex-start;
    margin: 0;      
}

.qa_name {
    font-size: 0.7rem;
    color: var(--txt_dark);
    margin: 0 0 0.25rem 0;
    padding-right: 0.5rem;
    text-align: right;
}

.qa_message {
    display: inline-block;
    padding: 0.75rem;
    border-radius: 1.5rem;
    font-size: 0.9rem;
    color: var(--txt_light);
    background-color: var(--primary);
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    vertical-align: top;
    text-align: left;
}


.qa_row.qa_reverse .qa_message {
    background-color: var(--secondary);
}
.qa_row.qa_reverse .qa_name {
    padding-left: 0.5rem;
    text-align: left;
}
.qa_row.qa_reverse{
    text-align: left;
}

/* Input area */
.qa_question_bar {
    background-color: var(--bar);
    padding: 0.75rem 1rem;
    height: 7rem;
    overflow: hidden;
}

.qa_form_row {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
}

.qa_question,
.qa_textarea {
    flex: 1;
    height: 2rem;
    padding: 0.625rem 1rem;
    font-family: inherit;
    font-size: 0.825rem;
    border-radius: 1.5rem;
    border: 1px solid #ccc;
    background-color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    line-height: 1.25rem;
}

/* Prevent zoom on mobile tap */
input, textarea {
    font-size: 16px;
}

/* Send button */
.qa_send_button {
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, var(--purple), var(--purple_alt));
    color: white;
    font-weight: bold;
    font-size: 0.825rem;
    padding:0 1rem;
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    transition: all 0.2s ease-in;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-decoration:none;
}

.qa_send_button:hover {
    background: linear-gradient(to right, var(--purple), var(--purple_alt));
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Hint */
.qa_hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
    text-align: right;
}

/* Admin Page */
.qa_admin_page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    background-color: var(--grey_light);
    font-family: "Lucida Grande", Verdana, sans-serif;
}

.qa_admin_title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
    text-align: center;
}

.qa_admin_button {
    font-size: 1.5rem;
    padding: 1.5rem 3rem;
    border-radius: 3rem;
    height: auto;
}

.qa_success {
    margin-top: 1rem;
    color: green;
    font-size: 1rem;
}