:root {
  --bg: radial-gradient(circle at top left, #e0f2fe 0, #f4f4fb 45%, #f9fafb 100%);
  --glass: rgba(255, 255, 255, 0.65);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --border-glass: rgba(148, 163, 184, 0.45);
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.18);
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.08);
  --ink: #0f172a;
  --ink-soft: #6b7280;
  --danger: #dc2626;
  --danger-soft: rgba(248, 113, 113, 0.1);
}

/* 1. RESET E ESTRUTURA BASE */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-attachment: fixed;
  overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth;
}

/* Exceção: Trava o scroll APENAS na página do Bot */
html.bot-mode, html.bot-mode body {
    overflow: hidden !important; height: 100% !important; overscroll-behavior: none;
}

.container {
    width: 100%; max-width: 1100px; margin: 0 auto;
    padding-left: 24px; padding-right: 24px;
}

/* 2. COMPONENTES COMUNS */
.card-glass {
  border-radius: 18px; background: var(--glass);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-soft);
  overflow: hidden; display: flex; flex-direction: column; padding: 24px;
  /* Garante que o conteúdo não quebre layout */
  height: fit-content; 
}

.card-glass h3 { margin-top: 0; margin-bottom: 8px; color: var(--accent); font-size: 1.25rem; }
.card-glass h4 { margin: 0 0 8px 0; color: var(--ink); font-size: 1.1rem; }
.card-glass p { color: var(--ink-soft); line-height: 1.35; margin: 0; font-size: 0.95rem; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent;
  color: var(--ink-soft); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.btn-icon:hover { background: rgba(148, 163, 184, 0.2); color: var(--accent); }

.btn-send {
    height: 42px; padding: 0 24px; border-radius: 99px; border: none;
    background: var(--accent); color: white; font-weight: 600; font-size: 14px;
    cursor: pointer; transition: transform 0.2s;
}
.btn-send:hover { transform: scale(1.05); }
.btn-send:disabled { opacity: 0.6; cursor: default; }

/* 3. LANDING PAGE: HEADER & NAV */
.main-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 999;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.3) 85%);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  transition: all 0.4s ease; padding: 12px 0;
}
.main-header.scrolled {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
  padding: 8px 0; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
}

.header-container { max-width: 1100px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; }
.brand-group { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.logo { height: 40px; width: auto; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.brand-title { font-size: 18px; font-weight: 800; color: #0f172a; letter-spacing: -0.5px; }
.brand-subtitle { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: #4f46e5; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.main-nav a {
    text-decoration: none; color: #334155; font-size: 14px; font-weight: 600;
    padding: 8px 16px; border-radius: 99px; transition: all 0.2s ease;
    display: flex; align-items: center; gap: 8px; border: 1px solid transparent;
}
.main-nav a:hover {
    background: rgba(255, 255, 255, 0.6); border-color: rgba(79, 70, 229, 0.15);
    color: #4f46e5; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.08); transform: translateY(-1px);
}
.nav-emoji { font-size: 16px; }

/* 4. SEÇÕES DA LANDING PAGE */
.hero { text-align: center; padding: 120px 0 60px; }
.hero h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px; }
.subtitle { font-size: 1.25rem; color: var(--ink-soft); max-width: 700px; margin: 0 auto 30px; }

.cta-button {
    display: inline-block; padding: 14px 30px; background: var(--accent); color: white;
    text-decoration: none; border-radius: 999px; font-weight: 600; transition: transform 0.3s;
}
.cta-button:hover { transform: scale(1.05); }

section { padding: 60px 0; scroll-margin-top: 120px; }
section h2 { text-align: center; margin-bottom: 40px; font-size: 2.5rem; }

/* LAYOUT E GRID (CORRIGIDO) */
.grid { 
    display: grid; 
    gap: 24px; 
    /* Esta linha conserta o bug das caixas brancas: */
    align-items: start; 
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

#sobre p {
    font-size: 1.1rem; line-height: 1.6; color: #475569;
    max-width: 800px; margin: 0 auto 20px auto; text-align: center;
}

/* 5. MODO BOT (ELENA BROOKS) */
.bot-wrapper { display: flex; justify-content: center; height: 100dvh; padding: 16px; max-width: 900px; margin: 0 auto; }
.card-glass.bot-mode {
    width: 100%; height: 100%; border-radius: 24px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.5); padding: 0;
}
.bot-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255,255,255,0.4);
}
.bot-identity { display: flex; align-items: center; gap: 12px; }
.bot-avatar { font-size: 24px; background: #e0f2fe; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.bot-name h2 { font-size: 16px; font-weight: 700; margin: 0; color: #0f172a; }
.bot-status { font-size: 12px; color: var(--accent); display: flex; align-items: center; gap: 4px; font-weight: 600; }
.bot-status::before { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.bot-actions { display: flex; gap: 8px; }

.chat-history { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.msg-wrapper { display: flex; flex-direction: column; }
.msg-wrapper.user { align-items: flex-end; }
.msg-wrapper.agent { align-items: flex-start; }

.msg-bubble { max-width: 85%; padding: 12px 18px; border-radius: 20px; font-size: 15px; line-height: 1.5; }
.msg-bubble.user { background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.msg-bubble.agent { background: white; border: 1px solid var(--border-glass); border-bottom-left-radius: 4px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; color: var(--ink-soft); }

.chat-input {
  display: flex; gap: 8px; align-items: flex-end; padding: 16px;
  background: var(--glass-strong); border-top: 1px solid var(--border-glass);
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.chat-input textarea {
  flex: 1; resize: none; border-radius: 16px; border: 1px solid var(--border-glass);
  padding: 12px; font-size: 15px; outline: none; background: white; font-family: inherit;
}
.chat-input textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.chat-actions-right { display: flex; align-items: center; gap: 8px; }

.thinking { font-family: monospace; letter-spacing: 2px; opacity: 0.6; }
.speaker-icon { cursor: pointer; opacity: 0.5; margin-left: 8px; transition: 0.2s; }
.speaker-icon:hover { opacity: 1; transform: scale(1.2); }
.alert-error { background: rgba(220, 38, 38, 0.1); color: #dc2626; padding: 10px; border-radius: 12px; margin-bottom: 10px; font-size: 13px; text-align: center; }
@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); }
}
.recording { color: var(--danger); animation: pulse 1.5s infinite; }
.menu-toggle { display: none; font-size: 24px; cursor: pointer; color: var(--ink); padding: 5px; }

@media (max-width: 900px) {
    .menu-toggle { display: block; }
    .hero h1 { font-size: 2.5rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .bot-wrapper { padding: 0; }
    .card-glass.bot-mode { border-radius: 0; border: none; }
    .main-nav {
        position: fixed; top: 70px; left: 0; right: 0;
        background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        padding: 20px 24px; box-shadow: 0 20px 40px rgba(0,0,0,0.08);
        border-bottom: 1px solid rgba(255,255,255,0.5);
        opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all 0.3s ease;
    }
    .main-nav.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
    .main-nav ul { flex-direction: column; gap: 12px; }
    .main-nav a { justify-content: flex-start; background: rgba(255,255,255,0.5); border: 1px solid rgba(0,0,0,0.05); }
}

/* 7. NOVOS COMPONENTES UX & HELPERS */
/* Botões Secundários */
.cta-button.secondary { background: transparent; border: 2px solid var(--accent); color: var(--accent); margin-left: 8px; }
.cta-button.secondary:hover { background: rgba(79, 70, 229, 0.1); color: var(--accent); }

/* Helpers de Layout */
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.micro-proof { font-size: 0.85rem; color: var(--ink-soft); margin-top: 16px; font-weight: 500; display: block; }
.bg-soft { background: rgba(79, 70, 229, 0.03); }
.text-center { text-align: center; }
.text-center-block { text-align: center; max-width: 800px; margin: 0 auto 40px auto; }
.section-tight { padding-top: 0; }
.section-title-faded { font-size: 1.5rem; margin-bottom: 20px; opacity: 0.7; }
.icon-large { font-size: 2rem; display: block; margin-bottom: 10px; }
.mt-30 { margin-top: 30px; }

/* Accordion Nativo Customizado */
details summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 8px 0; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details summary::after { content: '+'; font-size: 1.2em; }
details[open] summary::after { content: '-'; }
.accordion-content p { margin-top: 10px; font-size: 0.95rem; border-top: 1px solid rgba(0,0,0,0.05); padding-top: 10px; }
.accordion-list { font-size: 0.9rem; color: var(--ink-soft); padding-left: 20px; margin: 10px 0; }
.accordion-link { font-size: 0.9rem; font-weight: bold; text-decoration: none; color: var(--accent); }

/* Card Clicável/Hover */
.card-clickable { text-decoration: none; display: block; height: 100%; }
.card-center { align-items: center; text-align: center; transition: transform 0.2s; }
.card-clickable:hover .card-center { transform: translateY(-3px); }
.link-arrow { color: var(--accent); font-weight: bold; margin-top: 10px; font-size: 0.9rem; display: block; }