/* Landing do César. Mesma identidade do app (Cesar.Web/wwwroot/css/app.css), mas folha
   independente: a landing não compartilha componentes com o chat e precisa carregar o
   mínimo — uma folha só, sem webfont, tudo em cima da pilha de fontes do sistema. */

:root {
    color-scheme: light;

    --canvas: #f3f1eb;
    --surface: #fffefa;
    --surface-strong: #ffffff;
    --ink: #17201b;
    --ink-muted: #5c665e;
    --line: #d9dcd5;
    --panel-line: #c8cec8;

    --green: #176b45;
    --green-dark: #0f4d32;
    --green-soft: #e4f0e8;
    --on-accent: #ffffff;
    --accent-ink: #0f4d32;
    --user-bubble: #0f4d32;
    --on-user-bubble: #ffffff;
    --glow-accent: rgba(23, 107, 69, 0.26);

    --shadow-1: 0 2px 8px rgba(23, 32, 27, 0.06);
    --shadow-2: 0 12px 36px rgba(23, 32, 27, 0.09);

    /* Texto pequeno; em toque sobe um degrau (ver pointer: coarse abaixo). */
    --text-xs: 0.78rem;
    --text-sm: 0.88rem;
    --radius: 14px;
    --max-width: 68rem;
}

/* Tema: sem escolha guardada segue o sistema; com data-theme no <html> (gravado pelo botão
   do header em localStorage e aplicado antes da pintura) a escolha vence nos dois sentidos. */
@media (pointer: coarse) {
    :root {
        --text-xs: 0.85rem;
        --text-sm: 0.94rem;
    }
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        --canvas: #12181a;
        --surface: #1a2124;
        --surface-strong: #20282b;
        --ink: #e8ebe6;
        --ink-muted: #9aa69c;
        --line: #2c3538;
        --panel-line: #364043;

        --green: #3ba873;
        --green-dark: #2c9161;
        --green-soft: #1c2f26;
        --on-accent: #0c1512;
        --accent-ink: #64c295;
        --user-bubble: #2c9161;
        --on-user-bubble: #0c1512;
        --glow-accent: rgba(59, 168, 115, 0.22);

        --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
        --shadow-2: 0 12px 36px rgba(0, 0, 0, 0.45);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --canvas: #12181a;
    --surface: #1a2124;
    --surface-strong: #20282b;
    --ink: #e8ebe6;
    --ink-muted: #9aa69c;
    --line: #2c3538;
    --panel-line: #364043;

    --green: #3ba873;
    --green-dark: #2c9161;
    --green-soft: #1c2f26;
    --on-accent: #0c1512;
    --accent-ink: #64c295;
    --user-bubble: #2c9161;
    --on-user-bubble: #0c1512;
    --glow-accent: rgba(59, 168, 115, 0.22);

    --shadow-1: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 12px 36px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    line-height: 1.15;
    margin: 0 0 0.75rem;
    text-wrap: balance;
    letter-spacing: -0.015em;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent-ink);
}

/* Anel de foco único para todo controle: sem isto cada navegador desenha o seu (e o Safari
   quase nada), e quem navega por teclado perde o rastro entre botões, links e o <select>. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--accent-ink);
    outline-offset: 2px;
}

/* Toque: sem o atraso/zoom de duplo toque e sem o realce azul do WebKit; o :active de cada
   controle é quem responde. */
a,
button,
select,
summary,
label {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Sem ponteiro que paira, o "levantar" ficaria preso após o toque. */
@media (hover: none) {
    .button:hover,
    .card:hover,
    .integration-tile:hover {
        transform: none;
    }
}

/* ---------- utilidades ---------- */

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--green-dark);
    color: var(--on-accent);
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--radius) 0;
    z-index: 10;
}

.skip-link:focus {
    left: 0;
}

.eyebrow {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--accent-ink);
    margin: 0 0 0.6rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: var(--green-dark);
    color: var(--on-accent);
    box-shadow: 0 8px 24px var(--glow-accent);
}

.button-primary:hover {
    background: var(--green);
}

.button-ghost {
    border: 1px solid var(--panel-line);
    color: var(--ink);
}

.button-ghost:hover {
    border-color: var(--green);
    color: var(--accent-ink);
}

.button-lg {
    padding: 0.95rem 2.2rem;
    font-size: 1.1rem;
}

/* ---------- header ---------- */

.site-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
}

/* Três <img> e o CSS escolhe: o tema pode vir da preferência do sistema ou do data-theme
   salvo pelo botão, e o <picture> só saberia da primeira. */
.brand-logo {
    display: block;
    height: 36px;
    width: auto;
}

.brand-logo-dark,
.brand-logo-mark {
    display: none;
}

:root[data-theme="dark"] .brand-logo-light {
    display: none;
}

:root[data-theme="dark"] .brand-logo-dark {
    display: block;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .brand-logo-light {
        display: none;
    }

    :root:not([data-theme="light"]) .brand-logo-dark {
        display: block;
    }
}

/* Cabeçalho estreito: só o círculo, para sobrar espaço às ações. O rodapé mantém o wordmark. */
@media (max-width: 640px) {
    .site-header .brand-logo-light,
    .site-header .brand-logo-dark {
        display: none !important;
    }

    .site-header .brand-logo-mark {
        display: block;
    }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.nav-link {
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--accent-ink);
}

/* Celular: em vez de sumir com a navegação (o visitante perdia Integrações e Contato sem
   nenhum menu para recuperá-los), o cabeçalho vira duas linhas — marca e ações em cima, os
   links numa faixa discreta embaixo. Sem JS e sem hambúrguer para dois links. */
@media (max-width: 640px) {
    .site-header {
        flex-wrap: wrap;
        padding: 0.8rem 1rem 0.5rem;
        row-gap: 0.15rem;
    }

    /* Os filhos do <nav> passam a ser itens do próprio cabeçalho, para os links poderem
       cair numa segunda linha e as ações continuarem ao lado da marca. */
    .header-nav {
        display: contents;
    }

    /* Quebra de linha forçada entre as ações (order 1) e os links (order 10). */
    .site-header::after {
        content: "";
        order: 5;
        flex-basis: 100%;
    }

    .header-nav > :not(.nav-link) {
        order: 1;
    }

    .theme-toggle {
        margin-left: auto;
    }

    .nav-link {
        order: 10;
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        margin-right: 1.4rem;
        font-size: 0.95rem;
    }

    .nav-link:last-of-type {
        margin-right: auto;
    }
}

/* ---------- hero ---------- */

.hero {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3.5rem 1.5rem 4.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 3rem;
    align-items: center;
}

@media (max-width: 860px) {
    .hero {
        grid-template-columns: 1fr;
        padding-top: 2rem;
    }
}

.hero h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.4rem);
}

.hero h1 em {
    font-style: normal;
    color: var(--accent-ink);
}

.hero-lede {
    font-size: 1.2rem;
    color: var(--ink-muted);
    max-width: 34rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.6rem;
}

.hero-note {
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

/* ---------- mock do chat ---------- */

.chat-window {
    background: var(--surface);
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

.chat-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

.chat-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--green);
}

.chat-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.bubble {
    margin: 0;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    max-width: 88%;
    font-size: 0.98rem;
}

.bubble-user {
    align-self: flex-end;
    background: var(--user-bubble);
    color: var(--on-user-bubble);
    border-bottom-right-radius: 4px;
}

.bubble-assistant {
    align-self: flex-start;
    background: var(--green-soft);
    color: var(--ink);
    border-bottom-left-radius: 4px;
}

/* ---------- seções ---------- */

.section {
    padding: 4.25rem 1.5rem;
}

.section > .eyebrow,
.section > h2,
.section > .card-grid,
.section > .steps,
.section > .trust-grid,
.section > .faq-list {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
}

.section > h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.35rem);
    margin-bottom: 2rem;
}

.section-alt {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

/* ---------- capacidades ---------- */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-1);
}

.section-alt .card {
    background: var(--surface-strong);
}

.card h3 {
    font-size: 1.12rem;
    color: var(--accent-ink);
}

.card p {
    margin: 0;
    color: var(--ink-muted);
}

/* ---------- passos ---------- */

.steps {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 2rem;
}

.step-number {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--green-dark);
    color: var(--on-accent);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
}

.step h3 {
    font-size: 1.12rem;
}

.step p {
    margin: 0;
    color: var(--ink-muted);
}

/* ---------- confiança ---------- */

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2rem;
}

.trust-item {
    border-left: 3px solid var(--green);
    padding-left: 1.25rem;
}

.trust-item h3 {
    font-size: 1.12rem;
}

.trust-item p {
    margin: 0;
    color: var(--ink-muted);
}

/* ---------- FAQ ----------
   Título à esquerda (fixo enquanto a lista rola, em telas largas) e perguntas à direita, cada
   uma com um "+" que vira "×" ao abrir. A resposta abre com animação de altura via grid-rows,
   que é o único jeito de animar altura desconhecida sem JS. */

.section-faq {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
    gap: 3rem 4rem;
    align-items: start;
    max-width: var(--max-width);
    margin: 0 auto;
}

.faq-side {
    position: sticky;
    top: 5.5rem;
}

.faq-side .eyebrow {
    margin-bottom: 0.6rem;
}

.faq-side h2 {
    margin: 0 0 0.9rem;
    font-size: clamp(1.7rem, 3.5vw, 2.35rem);
    line-height: 1.15;
    text-wrap: balance;
}

.faq-intro {
    margin: 0;
    color: var(--ink-muted);
    max-width: 24rem;
    line-height: 1.6;
}

.faq-list {
    display: grid;
    gap: 0.6rem;
}

.faq-item {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.faq-item:hover {
    border-color: color-mix(in srgb, var(--accent-ink) 45%, var(--line));
}

.faq-item[open] {
    border-color: var(--accent-ink);
    box-shadow: 0 8px 28px rgba(15, 77, 50, 0.08);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.25rem;
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.4;
    cursor: pointer;
    list-style: none;
    transition: color 120ms ease, background 120ms ease;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: var(--accent-ink);
    background: var(--surface);
}

.faq-item summary:focus-visible {
    outline: 3px solid var(--accent-ink);
    outline-offset: -3px;
    border-radius: var(--radius);
}

.faq-item[open] summary {
    color: var(--accent-ink);
}

/* O "+" desenhado com dois traços: gira 45° e vira "×" quando aberto. */
.faq-marker {
    position: relative;
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: transform 220ms ease, background 160ms ease, border-color 160ms ease;
}

.faq-marker::before,
.faq-marker::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.75rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.faq-marker::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq-item[open] .faq-marker {
    transform: rotate(45deg);
    background: var(--green-soft);
    border-color: transparent;
}

.faq-answer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 260ms ease;
}

.faq-item[open] .faq-answer {
    grid-template-rows: 1fr;
}

.faq-answer > p {
    overflow: hidden;
    margin: 0;
    padding: 0 1.25rem;
    color: var(--ink-muted);
    line-height: 1.65;
    max-width: 60ch;
}

.faq-item[open] .faq-answer > p {
    padding-bottom: 1.15rem;
}

/* Sem JS, o [open] entra sem transição intermediária, então o padding precisa animar junto para
   não "pular" — os dois em transição, o padding acompanha a altura. */
.faq-answer > p {
    transition: padding-bottom 260ms ease;
}

@media (max-width: 860px) {
    .section-faq {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }

    .faq-side {
        position: static;
    }
}

@media (max-width: 640px) {
    .faq-item summary {
        padding: 0.95rem 1rem;
        font-size: 0.98rem;
    }

    .faq-answer > p {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-item,
    .faq-marker,
    .faq-answer,
    .faq-answer > p {
        transition: none;
    }
}

/* ---------- CTA final ---------- */

.cta-final {
    text-align: center;
    padding-bottom: 5.5rem;
}

.cta-final h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.cta-final p {
    color: var(--ink-muted);
    margin-bottom: 1.75rem;
}

/* ---------- rodapé ---------- */

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: space-between;
}

.footer-nav {
    display: flex;
    gap: 1.4rem;
}

.footer-nav a {
    color: var(--ink-muted);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--accent-ink);
}

.footer-note {
    margin: 0;
    color: var(--ink-muted);
    font-size: var(--text-sm);
}

/* ---------- página de erro ---------- */

.error-page {
    min-height: 80vh;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 2rem;
}

/* ---------- páginas internas (Contato) ---------- */

.page-article,
.page-wide {
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.page-article {
    max-width: 44rem;
}

.page-wide {
    max-width: var(--max-width);
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
}

.page-lede {
    font-size: 1.15rem;
    color: var(--ink-muted);
    max-width: 38rem;
}

.page-section {
    margin-top: 2.25rem;
}

.page-section h2 {
    font-size: 1.35rem;
}

.page-section p {
    color: var(--ink-muted);
}

.page-list {
    padding-left: 1.2rem;
    color: var(--ink-muted);
}

.page-list li + li {
    margin-top: 0.5rem;
}

.contact-primary {
    font-size: 1.35rem;
    font-weight: 600;
}

.contact-primary a {
    color: var(--accent-ink);
}

.page-cta {
    margin-top: 3rem;
}

.section-more {
    max-width: var(--max-width);
    margin: 1.5rem auto 0;
    font-weight: 600;
}

.section-more a {
    text-decoration: none;
}

/* ---------- catálogo de integrações ---------- */

.integration-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.integration-filter label {
    font-weight: 600;
    color: var(--ink-muted);
}

.integration-filter select {
    font: inherit;
    padding: 0.5rem 2rem 0.5rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--panel-line);
    background: var(--surface-strong);
    color: var(--ink);
}

.integration-group + .integration-group {
    margin-top: 3rem;
}

.integration-group-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.integration-group-header p:last-child {
    color: var(--ink-muted);
    margin-bottom: 1.25rem;
}

.integration-tile-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 0.9rem;
}

.integration-tile {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1rem;
    text-align: left;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.integration-tile:hover {
    border-color: var(--green);
    transform: translateY(-1px);
    box-shadow: var(--shadow-1);
}

.integration-tile-logo {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--accent-ink);
    font-weight: 700;
    font-size: 1.15rem;
}

.integration-tile-logo-google {
    background: var(--surface-strong);
    border: 1px solid var(--panel-line);
    color: var(--ink);
}

.integration-tile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.integration-tile-name {
    font-size: 1rem;
}

.integration-tile-category {
    font-size: var(--text-sm);
    color: var(--ink-muted);
}

.integration-group-empty {
    color: var(--ink-muted);
    font-style: italic;
}

/* ---------- dialog de detalhe ---------- */

.integration-modal {
    width: min(40rem, calc(100vw - 2rem));
    max-height: calc(100vh - 3rem);
    max-height: calc(100dvh - 3rem);
    overscroll-behavior: contain;
    padding: 2rem;
    border: 1px solid var(--panel-line);
    border-radius: var(--radius);
    background: var(--surface-strong);
    color: var(--ink);
    box-shadow: var(--shadow-2);
    overflow: auto;
}

.integration-modal::backdrop {
    background: rgba(23, 32, 27, 0.5);
}

.integration-modal-close-form {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: flex-end;
    margin: -0.5rem -0.5rem 0 0;
}

.modal-close {
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--green-soft);
    color: var(--accent-ink);
}

.integration-modal-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.integration-modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.integration-modal-summary {
    color: var(--ink-muted);
    margin-bottom: 0.6rem;
}

.integration-modal-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
}

.integration-category-chip {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--accent-ink);
}

.integration-modal section + section {
    margin-top: 1.5rem;
}

.integration-modal h3 {
    font-size: 1.15rem;
}

.integration-modal section > p:last-child {
    color: var(--ink-muted);
    margin: 0;
}

.integration-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.integration-feature-list li {
    display: flex;
    gap: 0.7rem;
}

.integration-feature-list p {
    margin: 0;
    color: var(--ink-muted);
}

.integration-feature-check {
    flex: none;
    color: var(--green);
    font-weight: 700;
}

.integration-modal-footer {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- hero: demo animada ---------- */

.chat-scene-label {
    margin-left: auto;
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-ink);
    background: var(--green-soft);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
}

/* Sem script todas as bolhas aparecem; com script, cada uma entra quando recebe .is-shown.
   A classe no <html> é o sinal de que o script assumiu. */
.demo-live [data-demo] .bubble:not(.bubble-typing) {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 260ms ease, transform 260ms ease;
}

.demo-live [data-demo] .bubble.is-shown {
    opacity: 1;
    transform: none;
}

.bubble-transcript {
    align-self: flex-end;
    background: transparent;
    color: var(--ink-muted);
    font-style: italic;
    font-size: var(--text-sm);
    padding: 0 0.4rem;
}

.bubble-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 13rem;
}

.audio-play {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--on-user-bubble);
    color: var(--user-bubble);
    font-size: 0.7rem;
}

.audio-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 1.2rem;
}

.audio-wave i {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: currentcolor;
    opacity: 0.85;
    height: 40%;
    animation: wave 1.1s ease-in-out infinite;
}

.audio-wave i:nth-child(2n) { animation-delay: 0.15s; height: 70%; }
.audio-wave i:nth-child(3n) { animation-delay: 0.3s; height: 55%; }
.audio-wave i:nth-child(4n) { animation-delay: 0.45s; height: 90%; }

@keyframes wave {
    0%, 100% { transform: scaleY(0.6); }
    50% { transform: scaleY(1.2); }
}

.audio-time {
    font-size: var(--text-sm);
    opacity: 0.9;
}

.bubble-attachment {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}

.attachment-thumb {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 3rem;
    height: 3.6rem;
    padding: 0.4rem 0.35rem;
    border-radius: 6px;
    background: #fff;
    color: #17201b;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.attachment-line {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: #c9cec9;
}

.attachment-line.short {
    width: 60%;
}

.attachment-total {
    margin-top: auto;
    font-size: 0.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.attachment-name {
    font-size: var(--text-sm);
    opacity: 0.92;
}

.bubble-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 0.8rem 1rem;
}

.bubble-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ink-muted);
    animation: typing 1s ease-in-out infinite;
}

.bubble-typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .audio-wave i,
    .bubble-typing i {
        animation: none;
    }
}

/* ---------- 8 cards: 4 colunas no desktop, 2 no tablet ---------- */

@media (min-width: 1000px) {
    .card-grid-8 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 560px) and (max-width: 999px) {
    .card-grid-8 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- hero: três janelas pequenas empilhadas ---------- */

.hero-demo {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.chat-window-sm .chat-titlebar {
    padding: 0.45rem 0.85rem;
    font-size: var(--text-xs);
}

.chat-window-sm .chat-body {
    padding: 0.85rem 0.9rem;
    gap: 0.55rem;
    min-height: 7.5rem;
}

.chat-window-sm .bubble {
    font-size: var(--text-sm);
    padding: 0.55rem 0.85rem;
}

.chat-window-sm .bubble-typing {
    padding: 0.7rem 0.85rem;
}

.chat-window-sm .attachment-thumb {
    width: 2.6rem;
    height: 3.1rem;
}

/* Com script, só a janela ativa aparece; a altura mínima segura o layout para o hero não
   pular quando a cena troca. Sem script (.demo-live ausente) as três ficam empilhadas. */
.demo-live [data-demo]:not(.is-active) {
    display: none;
}

.demo-live .chat-window-sm .chat-body {
    min-height: 11rem;
}

.demo-live [data-demo].is-active {
    animation: demo-in 320ms ease;
}

@keyframes demo-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- bolinhas da demo ---------- */

.demo-dots {
    display: flex;
    justify-content: center;
    gap: 0;
    order: 1;
}

/* A bolinha visível tem 10px, mas o botão tem 44px: o alvo de toque é o botão, o desenho
   é o ::before. */
.demo-dot {
    position: relative;
    width: 44px;
    height: 44px;
    margin: -14px 0;
    padding: 0;
    border-radius: 50%;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.demo-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--line);
    transform: translate(-50%, -50%);
    transition: background-color 150ms ease, transform 150ms ease;
}

.demo-dot:hover::before {
    background: var(--green);
    transform: translate(-50%, -50%) scale(1.2);
}

.demo-dot[aria-selected="true"]::before {
    background: var(--green-dark);
    transform: translate(-50%, -50%) scale(1.25);
}

.demo-dot:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 3px;
}

/* ---------- bolha de aviso proativo ---------- */

.bubble-proactive {
    border-left: 3px solid var(--green);
}

.proactive-tag {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 0.2rem;
}

.demo-live .chat-window-sm .chat-body {
    min-height: 12.5rem;
}

@media (pointer: coarse) {
    .theme-toggle {
        width: 44px;
        height: 44px;
    }

    .lang-switch,
    .nav-link,
    .footer-nav a,
    .integration-filter select {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ---------- ritmo vertical em telas estreitas ----------
   4.25rem de respiro por seção é generoso em desktop e um deserto de rolagem no celular. */
@media (max-width: 640px) {
    .section {
        padding: 2.75rem 1.1rem;
    }

    .section > h2 {
        margin-bottom: 1.4rem;
    }

    .hero {
        padding: 1.5rem 1.1rem 3rem;
        gap: 2rem;
    }

    .hero-lede {
        font-size: 1.08rem;
    }

    .hero-actions .button {
        flex: 1 1 auto;
    }

    .footer-inner {
        padding: 1.5rem 1.1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 0.5rem 1.4rem;
    }

    .page-article,
    .page-wide {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .integration-filter {
        flex-wrap: wrap;
    }

    .integration-filter select {
        flex: 1 1 100%;
    }

    /* Diálogo vira folha na base da tela, onde o polegar está. */
    .integration-modal {
        width: 100vw;
        max-width: none;
        max-height: calc(100dvh - 1.5rem);
        margin: auto 0 0;
        padding: 1.5rem 1.1rem max(1.25rem, env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
        border-bottom: 0;
    }

    .integration-modal::before {
        content: "";
        display: block;
        width: 36px;
        height: 4px;
        margin: -0.4rem auto 0.9rem;
        border-radius: 999px;
        background: var(--panel-line);
    }
}

/* ---------- troca de idioma ---------- */

.lang-switch {
    color: var(--ink-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--text-sm);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.lang-switch:hover {
    border-color: var(--green);
    color: var(--accent-ink);
}

/* ---------- botão de tema ---------- */

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-muted);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.theme-toggle:hover {
    border-color: var(--green);
    color: var(--accent-ink);
}

.theme-toggle .theme-icon-dark,
:root[data-theme="dark"] .theme-toggle .theme-icon-light {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .theme-icon-dark {
    display: inline;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .theme-icon-light {
        display: none;
    }

    :root:not([data-theme="light"]) .theme-toggle .theme-icon-dark {
        display: inline;
    }
}
