:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-page: #0b1120;
    --bg-card: #1e293b;
    --bg-chat: #111827;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --bot-bubble: #2a3347;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Container Principal - Adaptado para Iframe */
.app-card {
    width: 100%;
    height: 100vh;
    background: var(--bg-card);
    border: none;
    /* Remove bordas para parecer parte da página pai */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
header {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    overflow: hidden;
    /* Garante que a imagem siga o arredondamento */
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-info h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.brand-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Área de Chat */
.chat-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.chat-container::-webkit-scrollbar {
    width: 5px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.message {
    max-width: 75%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: var(--bot-bubble);
    color: var(--text-main);
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

/* Fontes e Tags */
.sources {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.source-tag {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

/* Barra de Input */
.input-area {
    padding: 1.5rem 2rem;
}

.input-bar {
    background: var(--bg-chat);
    border-radius: 16px;
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    gap: 1rem;
    border: 1px solid var(--border);
}

.attach-btn {
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.attach-btn:hover {
    color: white;
}

input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

.send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.send-btn:hover {
    transform: scale(1.05);
}

/* Helpers */
.typing {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 2.5rem 1rem;
    display: none;
}

#authOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
