/* --- 1. CONFIGURAÇÕES GLOBAIS E FONTE --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Estilização da barra de scroll */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #d1d5db; /* cinza-300 */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.dark ::-webkit-scrollbar-thumb {
    background-color: #4b5563; /* cinza-600 */
}
::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af; /* cinza-400 */
}
.dark ::-webkit-scrollbar-thumb:hover {
    background-color: #6b7280; /* cinza-500 */
}


/* --- 2. ESTILOS DA PÁGINA DO CHAT --- */

/* Estilos para a lista de conversas */
#conversation-list li .conversation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.delete-convo-btn {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

#conversation-list li:hover .delete-convo-btn {
    opacity: 1;
    visibility: visible;
    color: #ef4444; /* Cor vermelha */
}
#conversation-list li:hover .delete-convo-btn:hover {
    color: #b91c1c; /* Vermelho mais escuro */
}

/* Estilos para as bolhas de mensagem */
.message-bubble {
    padding: 10px 16px;
    border-radius: 20px;
    margin-bottom: 8px;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
}

.user-bubble {
    background-color: #4f46e5; /* Indigo-600 */
    color: white;
    border-bottom-right-radius: 5px;
    align-self: flex-end;
}

.ai-bubble {
    background-color: #f3f4f6; /* cinza-100 */
    color: #1f2937; /* cinza-800 */
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.dark .ai-bubble {
    background-color: #374151; /* cinza-700 */
    color: #f3f4f6; /* cinza-100 */
}

#chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Animação de "a pensar" da IA */
.thinking-indicator {
    display: flex; align-items: center; justify-content: center; gap: 6px; height: 24px;
}
.thinking-indicator .sparkle-star {
    width: 20px; height: 20px; color: #4f46e5; animation: sparkle 1.6s infinite cubic-bezier(0.4, 0, 0.6, 1);
}
.dark .thinking-indicator .sparkle-star { color: #818cf8; }
.thinking-indicator .sparkle-star:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator .sparkle-star:nth-child(3) { animation-delay: 0.4s; }

@keyframes sparkle {
    0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.6; }
    50% { transform: scale(1.1) rotate(15deg); opacity: 1; }
}

/* Efeito de cursor a piscar */
.ai-bubble.typing-cursor::after {
    content: '▋'; display: inline-block; vertical-align: baseline; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { color: inherit; } from, to { color: transparent; } }

/* Botões de sugestão */
.suggestions-container { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; align-self: flex-start; }
.suggestion-btn { padding: 8px 16px; border-radius: 20px; background-color: transparent; border: 1px solid #d1d5db; color: #4b5563; font-size: 0.875rem; cursor: pointer; transition: all 0.2s ease-in-out; }
.suggestion-btn:hover { background-color: #f3f4f6; border-color: #9ca3af; }
.dark .suggestion-btn { border-color: #4b5563; color: #d1d5db; }
.dark .suggestion-btn:hover { background-color: #374151; border-color: #6b7280; }


/* --- 3. NOVOS ESTILOS PARA LOGIN/REGISTO --- */

.auth-container-new {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: #f3f4f6; /* cinza-100 */
}
.dark .auth-container-new {
    background-color: #111827; /* cinza-900 */
}

.auth-panel {
    display: flex;
    width: 100%;
    max-width: 1024px; /* lg */
    margin: 1rem;
    border-radius: 1rem; /* xl */
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    overflow: hidden;
    background-color: white;
}
.dark .auth-panel {
    background-color: #1f2937; /* cinza-800 */
}

.auth-branding {
    display: none; /* Escondido em mobile por defeito */
    width: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); /* gradiente de indigo a roxo */
    padding: 3rem;
    color: white;
    position: relative;
    justify-content: center;
    align-items: center;
}

/* Mostra o painel da marca em ecrãs maiores */
@media (min-width: 768px) {
    .auth-branding {
        display: flex;
    }
}

.branding-content {
    text-align: center;
}

.auth-form-container {
    width: 100%;
    padding: 2rem;
}
/* Ajusta o padding em ecrãs maiores */
@media (min-width: 768px) {
    .auth-form-container {
        width: 50%;
        padding: 3rem;
    }
}

.auth-form-wrapper {
    width: 100%;
    max-width: 384px;
    margin: auto;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem; /* Input mais arredondado */
    border: 1px solid #d1d5db;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
}

.dark .auth-form .form-control {
    border-color: #4b5563;
    background-color: #374151;
    color: #f3f4f6;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
}

.auth-form .btn-primary {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.75rem; /* Botão mais arredondado */
    background-color: #4f46e5; /* indigo-600 */
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.auth-form .btn-primary:hover {
    background-color: #4338ca; /* indigo-700 */
}

