:root {
    --primary-color: #005f73;
    --secondary-color: #0a9396;
    --background-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-color: #343a40;
    --light-gray: #dee2e6;
    --font-family: 'Inter', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 1rem;
}

#app-container {
    width: 100%;
    max-width: 800px;
    height: 95vh;
    background-color: var(--surface-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--light-gray);
}

.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
}

.app-header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.app-header .header-highlight {
    font-weight: 900;
    color: #94d2bd;
}

.app-header p {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

#chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex-grow: 1;
}

.message {
    display: flex;
    margin-bottom: 1.5rem;
    max-width: 85%;
    align-items: flex-start;
}

.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
}

.message .text {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    line-height: 1.6;
}

.ia-message {
    align-self: flex-start;
}

.ia-message .avatar {
    background-color: var(--primary-color);
    color: white;
}

.ia-message .text {
    background-color: #e9ecef;
    border-top-left-radius: 0;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: auto;
}

.user-message .avatar {
    background-color: var(--secondary-color);
    color: white;
    margin-right: 0;
    margin-left: 1rem;
}

.user-message .text {
    background-color: var(--primary-color);
    color: white;
    border-top-right-radius: 0;
}

#chat-input-container {
    padding: 1rem;
    background-color: #f1f3f5;
    border-top: 1px solid var(--light-gray);
}

#file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    max-height: 100px;
    overflow-y: auto;
}

.file-pill {
    display: inline-flex;
    align-items: center;
    background-color: #e9ecef;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 0.85rem;
    color: #495057;
    border: 1px solid #dee2e6;
}

.file-pill span {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-file-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 8px;
    font-size: 1.2rem;
    color: #6c757d;
    padding: 0;
    line-height: 1;
}

.remove-file-btn:hover {
    color: #343a40;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 25px;
    padding: 0.3rem;
    border: 1px solid var(--light-gray);
}

#message-input {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 0.8rem 1rem;
    background: transparent;
    resize: none;
    font-family: var(--font-family);
    font-size: 1rem;
    max-height: 120px;
    overflow-y: auto;
}

#chat-input-container button {
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.8rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.2s;
}

#chat-input-container button:hover {
    transform: scale(1.1);
}

#send-button {
    color: var(--secondary-color);
}

#loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #6c757d;
}

#loading-indicator.hidden {
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s ease infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- ESTILOS PARA A PÁGINA DE LOGIN --- */

.login-container {
    max-width: 500px;
    height: auto;
}

.login-main {
    padding: 2rem;
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: #6c757d;
    margin-bottom: 2rem;
}

.page-container {
  display: flex;
  justify-content: center; /* centraliza horizontalmente */
  align-items: center;     /* centraliza verticalmente */
  min-height: 10vh;
  background-color: #f9f9f9; /* opcional, para melhorar contraste */
}

.login-wrapper {
  /* estilos opcionais, dependendo do Clerk */
  padding: 2rem;
}

/* --- ESTILO PARA A MENSAGEM DE ERRO --- */
.login-error {
    color: #991b1b; 
    background-color: #fee2e2;
    border: 1px solid #fca5a5;
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
}

#sign-in-button-container .cl-root-box {
    margin: 0 auto; /* Centra o botão do Clerk */
}
