/* ==========================================================================
   Gescafé — design system
   Camada única. Não acrescente blocos de "refresh" no fim do arquivo:
   ajuste os tokens ou o componente correspondente.
   ========================================================================== */

/* --- Tokens -------------------------------------------------------------- */
:root {
    /* Cor */
    --ink: #1c2117;
    --ink-2: #3c4a42;
    --muted: #5a685f;
    --faint: #5f6d65;
    --paper: #fbf9f5;
    --paper-2: #f4f1ea;
    --surface: #ffffff;
    --forest: #253f16;   /* verde do wordmark do logo */
    --forest-2: #31521d;
    --clay: #8f4a1b;      /* marrom do logo, clareado para acento */
    --clay-soft: #f1e4d6;
    --line: #e2ddd2;
    --line-strong: #cdc6b7;
    --line-track: #8f8470;   /* conectores e trilhos: 3.26:1 sobre o papel-2 */
    --line-dark: rgba(255, 255, 255, .16);

    /* Status */
    --ok: #1f6b4a;
    --ok-bg: #e8f2ec;
    --wip: #8a5a12;
    --wip-bg: #fbf0db;
    --plan: #5a6472;
    --plan-bg: #eef0f3;

    /* Tipografia */
    --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Ritmo */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 64px;
    --s-9: 96px;

    --r: 4px;
    --r-lg: 8px;
    --shadow: 0 1px 2px rgba(28, 33, 23, .04), 0 8px 24px rgba(28, 33, 23, .06);
    --header-h: 72px;
}

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

/* Componentes com display próprio (.cookie é flex) anulariam o atributo hidden
   do stylesheet do navegador. Esta regra mantém hidden funcionando. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; display: block; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
table { border-collapse: collapse; }

:focus-visible {
    outline: 2px solid var(--clay);
    outline-offset: 2px;
    border-radius: 2px;
}

::selection { background: var(--clay-soft); color: var(--ink); }

/* --- Tipografia ---------------------------------------------------------- */
h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: -.012em;
    color: var(--ink);
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.1rem); line-height: 1.12; }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.25rem); line-height: 1.18; }
h3 { font-size: 1.15rem; line-height: 1.3; }
h4 { font-size: 1rem; line-height: 1.35; }

p { margin: 0; color: var(--ink-2); }
p + p { margin-top: var(--s-4); }
strong { font-weight: 600; color: var(--ink); }

.lead {
    font-size: clamp(1.05rem, .98rem + .35vw, 1.2rem);
    line-height: 1.6;
    color: var(--ink-2);
    max-width: 62ch;
    text-wrap: pretty;
}

.eyebrow {
    display: block;
    font-family: var(--sans);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clay);
}

.prose { max-width: 68ch; }
.prose h2 { margin-top: var(--s-7); }
.prose h3 { margin-top: var(--s-6); font-family: var(--sans); font-weight: 600; }
.prose p { margin-top: var(--s-4); }
.prose ul { margin-top: var(--s-4); padding-left: var(--s-5); list-style: disc; }
.prose ol { margin-top: var(--s-4); padding-left: var(--s-5); list-style: decimal; }
.prose li { color: var(--ink-2); margin-top: var(--s-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 { scroll-margin-top: 96px; } /* âncora do índice não fica sob o cabeçalho fixo */
.prose .panel { margin-top: var(--s-5); }
.prose .panel > :first-child { margin-top: 0; }

/* --- Layout -------------------------------------------------------------- */
.container { width: min(1140px, 100% - 2 * var(--s-5)); margin-inline: auto; }

/* Toda seção carrega o próprio padding em cima e embaixo. Não zere o padding-top
   de seções consecutivas: foi o que fez blocos grudarem no de cima. */
/* 64px de cada lado: como as faixas de fundo alternam, o espaço entre dois
   blocos é a soma dos dois paddings (128px). Com os 96px anteriores dava 192px. */
.section { padding-block: var(--s-8); }
.section-alt { background: var(--paper-2); border-block: 1px solid var(--line); }

/* Duas seções seguidas de MESMO fundo não têm borda entre elas para marcar a
   transição, então o respiro somado pode ser menor. */
.section + .section:not(.section-alt):not(.section-dark),
.section-alt + .section-alt,
.section-dark + .section-dark { padding-top: var(--s-7); }

/* --- Superfícies escuras -------------------------------------------------
   Um bloco único para TODAS as superfícies escuras (.hero, .pagehead,
   .section-dark, .panel-dark). Antes só .section-dark recebia tratamento, o que
   deixava botões e dados escuros sobre o verde do hero. */
.section-dark { background: var(--forest); color: #fff; }

:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(h1, h2, h3, h4) { color: #fff; }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) p, :is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .lead { color: rgba(255, 255, 255, .82); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .eyebrow { color: #d9c08a; }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .hint { color: rgba(255, 255, 255, .64); }

/* Botão de contorno: no claro a borda é bege e o texto é forest — ambos somem
   sobre o verde. No escuro, borda e texto viram brancos. */
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .btn-primary { background: #fff; color: var(--forest); border-color: #fff; }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .btn-primary:hover { background: var(--paper-2); border-color: var(--paper-2); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .55); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .btn-outline:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }

:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .link-arrow { color: #fff; border-color: rgba(255, 255, 255, .4); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .link-arrow:hover { color: #d9c08a; border-color: #d9c08a; }

:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .crumbs li { color: rgba(255, 255, 255, .66); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .crumbs li + li::before { color: rgba(255, 255, 255, .3); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .crumbs [aria-current] { color: #fff; }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .crumbs a:hover { color: #d9c08a; }

:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .facts li { border-left-color: rgba(224, 195, 155, .55); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .facts .fact-label { color: rgba(255, 255, 255, .62); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .facts .fact-value { color: #fff; }

:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .ico-badge { border-color: rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); color: #d9c08a; }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .figure { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .05); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .figure figcaption { border-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .68); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .ruled > li { border-color: rgba(255, 255, 255, .16); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) .ruled-num { color: rgba(255, 255, 255, .58); }

/* Caixas CLARAS aninhadas dentro de uma superfície escura precisam voltar ao
   texto escuro — senão o h3 do formulário fica branco sobre branco. */
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) :is(h1, h2, h3, h4) { color: var(--ink); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) p { color: var(--ink-2); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) .eyebrow { color: var(--clay); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) .hint { color: var(--muted); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) label { color: var(--ink); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) .link-arrow { color: var(--forest); border-color: var(--line-strong); }
:is(.dark-surface, .hero, .pagehead, .section-dark, .panel-dark) :is(.form-panel, .card, .panel:not(.panel-dark)) .link-arrow:hover { color: var(--clay); border-color: var(--clay); }

.section-head { max-width: 62ch; margin-bottom: var(--s-6); }
.section-head .eyebrow { margin-bottom: var(--s-3); }
.section-head h2 + p { margin-top: var(--s-4); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: var(--s-3);
    z-index: 100;
    padding: var(--s-3) var(--s-4);
    background: var(--forest);
    color: #fff;
    border-radius: var(--r);
}
.skip-link:focus { left: var(--s-3); }

/* --- Ícones -------------------------------------------------------------- */
.ico {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ico-lg { width: 26px; height: 26px; }

.ico-badge {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    color: var(--forest);
}

/* --- Botões -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 42px;
    padding: 0 var(--s-5);
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: .94rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn .ico { width: 16px; height: 16px; }

.btn-primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.btn-primary:hover { background: var(--forest-2); border-color: var(--forest-2); }


.btn-outline { background: transparent; color: var(--forest); border-color: var(--line-strong); }
.btn-outline:hover { background: var(--surface); border-color: var(--forest); }

.btn-sm { min-height: 36px; padding: 0 var(--s-4); font-size: .88rem; }


.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Link textual com seta — usado no lugar de botões fantasma repetidos */
.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-size: .92rem;
    font-weight: 500;
    color: var(--forest);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 1px;
}
.link-arrow:hover { color: var(--clay); border-color: var(--clay); }
.link-arrow .ico { width: 14px; height: 14px; }

/* --- Header -------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(251, 249, 245, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-inner {
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--s-5);
}
.logo { display: flex; align-items: center; }
/* O logo ficou maior para o wordmark ser legível. Entre 1020 e 1200px o header
   fica apertado com 7 itens de menu + 2 ações, então encolhe antes de quebrar. */
.logo img { width: 156px; height: auto; }

.nav { display: flex; align-items: center; gap: var(--s-1); margin-left: auto; }
.nav-item { position: relative; }

.nav-link, .nav-button {
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
    padding: var(--s-2) var(--s-3);
    border: 0;
    border-radius: var(--r);
    background: transparent;
    font-size: .92rem;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
}
.nav-link:hover, .nav-button:hover { color: var(--forest); background: var(--paper-2); }
.nav-link[aria-current="page"] { color: var(--forest); box-shadow: inset 0 -2px 0 var(--clay); border-radius: 0; }
.nav-button .ico { width: 12px; height: 12px; color: var(--faint); }

.dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 248px;
    padding: var(--s-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown a {
    display: block;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r);
    font-size: .9rem;
    color: var(--ink-2);
}
.dropdown a:hover { background: var(--paper-2); color: var(--forest); }
.dropdown a small { display: block; color: var(--faint); font-size: .78rem; line-height: 1.4; }

.header-actions { display: flex; align-items: center; gap: var(--s-3); }
/* As ações aparecem duas vezes no DOM: fora da nav (desktop) e dentro (mobile). */
.nav .header-actions { display: none; }
.header-actions .btn { min-height: 38px; padding: 0 var(--s-4); font-size: .9rem; }

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 16px;
    height: 1.5px;
    margin: 3px auto;
    background: var(--ink);
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* --- Breadcrumbs --------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); list-style: none; font-size: .82rem; }
.crumbs li { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); }
.crumbs li + li::before { content: "/"; color: var(--line-strong); }
.crumbs a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }
.crumbs [aria-current] { color: var(--ink); }

/* --- Hero (home) --------------------------------------------------------- */
.hero { position: relative; background: var(--forest); color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media picture, .hero-media img { width: 100%; height: 100%; }
.hero-media img { object-fit: cover; opacity: .34; }
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(20, 34, 11, .95) 0%, rgba(20, 34, 11, .80) 48%, rgba(20, 34, 11, .54) 100%);
}
.hero-inner {
    position: relative;
    z-index: 1;
    padding-block: var(--s-7) var(--s-7);
    display: grid;
    gap: var(--s-5);
    max-width: 44rem;
}
.hero h1 { color: #fff; }
.hero .lead { color: rgba(255, 255, 255, .84); }
.hero .eyebrow { color: #d9c08a; }
.hero .actions { margin-top: var(--s-2); }

.hero-chain {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-5);
    padding-block: var(--s-5);
    border-top: 1px solid var(--line-dark);
    list-style: none;
    font-size: .86rem;
    color: rgba(255, 255, 255, .78);
}
.hero-chain li { display: flex; align-items: center; gap: var(--s-2); }
.hero-chain li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d9c08a;
}

/* --- Cabeçalho de página interna ---------------------------------------- */
/* Hero de página interna: mesma mecânica do hero da home, em escala menor.
   A foto é obrigatória — sem ela o bloco fica um retângulo verde chapado. */
.pagehead { position: relative; background: var(--forest); color: #fff; overflow: hidden; }
.pagehead-media { position: absolute; inset: 0; }
.pagehead-media picture, .pagehead-media img { width: 100%; height: 100%; }
.pagehead-media img { object-fit: cover; opacity: .3; }
.pagehead-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(20, 34, 11, .95) 0%, rgba(20, 34, 11, .84) 52%, rgba(20, 34, 11, .60) 100%);
}
/* O .container precisa de contexto posicionado: .pagehead-media é absolute e
   pintaria por cima de um container estático. */
.pagehead > .container { position: relative; z-index: 1; }
.pagehead-inner {
    display: grid;
    gap: var(--s-5);
    padding-block: var(--s-7) var(--s-8);
    /* Medida do texto. NÃO mova para o .container: lá vira largura do container e
       o bloco se centraliza, desalinhando da home. */
    max-width: 52rem;
}
.pagehead-top { display: flex; align-items: center; gap: var(--s-4); }
.pagehead h1 { max-width: 34ch; }
.pagehead .lead { margin-top: calc(-1 * var(--s-2)); }
.pagehead .facts { margin-top: var(--s-3); }

.facts { display: flex; flex-wrap: wrap; gap: var(--s-6); margin-top: var(--s-2); list-style: none; }
.facts li { display: grid; gap: 2px; padding-left: var(--s-4); border-left: 2px solid var(--clay-soft); }
.facts dt, .facts .fact-label {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.facts .fact-value { font-size: .98rem; font-weight: 500; color: var(--ink); }

/* --- Grids --------------------------------------------------------------- */
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(var(--s-6), 5vw, var(--s-9)); align-items: center; }
.split-wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.sidebar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(var(--s-6), 5vw, var(--s-8)); align-items: start; }

/* --- Cards: três variantes distintas, usadas em contextos distintos ------ */

/* 1. Card de conteúdo (superfície branca, borda fina, sem gradiente) */
.card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
}
/* Empurra o link para a base: sem isto, cards com 2 e 3 linhas de texto
   deixam o "Ver solução" em alturas diferentes na mesma linha da grade. */
.card .link-arrow { margin-top: auto; }
.card .link-arrow:only-child { margin-top: 0; }
.card h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; }
.card p { font-size: .94rem; }
.card-link:hover { border-color: var(--line-strong); background: #fff; }

/* 2. Item de lista editorial (sem caixa — régua + texto) */
.ruled { list-style: none; display: grid; }
.ruled > li { padding-block: var(--s-5); border-top: 1px solid var(--line); }
.ruled > li:last-child { border-bottom: 1px solid var(--line); }

.ruled-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--s-4); align-items: baseline; }
.ruled-num { font-family: var(--mono); font-size: .8rem; color: var(--faint); letter-spacing: .04em; }
.ruled-row h3 { font-family: var(--sans); font-size: 1.02rem; font-weight: 600; }
.ruled-row p { margin-top: var(--s-2); font-size: .94rem; }

/* 3. Painel de destaque (fundo sólido escuro ou de papel) */
.panel {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-6);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--paper-2);
}
.panel-dark { background: var(--forest); border-color: var(--forest); color: #fff; }
.panel-dark h2, .panel-dark h3 { color: #fff; }
.panel-dark p { color: rgba(255, 255, 255, .8); }
.panel-dark .eyebrow { color: #d9c08a; }

/* --- Status chip --------------------------------------------------------- */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 2px var(--s-3);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: .76rem;
    font-weight: 500;
    white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-available { background: var(--ok-bg); color: var(--ok); }
.status-implementation { background: var(--wip-bg); color: var(--wip); }
.status-planned { background: var(--plan-bg); color: var(--plan); }

.status-legend { display: flex; flex-wrap: wrap; gap: var(--s-5); list-style: none; }
.status-legend li { display: grid; gap: var(--s-2); max-width: 28ch; justify-items: start; }
.status-legend p { font-size: .86rem; }

/* --- Fluxo da cadeia (home) --------------------------------------------- */
/* --- Trilha da cadeia ----------------------------------------------------
   É um FLUXO sequencial, não uma grade: os nós ficam ligados por um conector e
   o status vira a cor do nó, em vez de oito chips repetidos. A versão em grade
   com gap de 1px lia como planilha. */
.chain { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-4); }

.chain-step { position: relative; display: grid; gap: var(--s-2); align-content: start; padding-top: 56px; }

/* Conector: da borda direita do nó até o nó seguinte, atravessando o gap. */
.chain-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 20px;
    left: 48px;
    width: calc(100% - 48px + var(--s-4));
    height: 2px;
    background: var(--line-track);
}

.chain-node {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 2px solid var(--line-track);
    border-radius: 50%;
    background: var(--surface);
    color: var(--muted);
}
.chain-node .ico { width: 20px; height: 20px; }

.chain-step[data-phase="available"] .chain-node { border-color: var(--ok); color: var(--ok); }
.chain-step[data-phase="implementation"] .chain-node { border-color: var(--wip); color: var(--wip); }
.chain-step[data-phase="planned"] .chain-node { border-color: var(--plan); color: var(--plan); border-style: dashed; }

.chain-order { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--faint); }
.chain-step strong { font-size: .95rem; font-weight: 600; }
.chain-step p { font-size: .82rem; line-height: 1.45; color: var(--muted); }
.chain-phase { font-size: .76rem; font-weight: 500; }
.chain-step[data-phase="available"] .chain-phase { color: var(--ok); }
.chain-step[data-phase="implementation"] .chain-phase { color: var(--wip); }
.chain-step[data-phase="planned"] .chain-phase { color: var(--plan); }

/* --- Moldura de imagem --------------------------------------------------- */
.figure { margin: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.figure img { width: 100%; height: auto; }
.figure figcaption { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }

/* --- Módulos: índice + tabela ------------------------------------------- */
.module-index { position: sticky; top: calc(var(--header-h) + var(--s-4)); display: grid; gap: 2px; }
.module-index .eyebrow { margin-bottom: var(--s-3); }
.module-index a {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r);
    font-size: .88rem;
    color: var(--ink-2);
}
.module-index a:hover, .module-index a.is-active { background: var(--paper-2); color: var(--forest); }
.module-index a.is-active { box-shadow: inset 2px 0 0 var(--clay); }
.module-index span { font-family: var(--mono); font-size: .76rem; color: var(--faint); }

.module-group { scroll-margin-top: calc(var(--header-h) + var(--s-5)); }
.module-group + .module-group { margin-top: var(--s-8); }
.module-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding-bottom: var(--s-3); border-bottom: 2px solid var(--ink); }
.module-group-head h2 { font-size: 1.4rem; }
.module-group-head span { font-size: .82rem; color: var(--muted); }

.module-list { list-style: none; }
.module-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--s-4);
    align-items: start;
    padding-block: var(--s-4);
    border-bottom: 1px solid var(--line);
}
.module-list h3 { font-family: var(--sans); font-size: .98rem; font-weight: 600; }
.module-list p { margin-top: 2px; font-size: .9rem; color: var(--muted); }

/* --- Soluções: linhas editoriais alternadas ----------------------------- */
.solution { scroll-margin-top: calc(var(--header-h) + var(--s-5)); }
.solution + .solution { margin-top: var(--s-8); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.solution-grid { display: grid; grid-template-columns: 3rem minmax(0, 1fr) minmax(0, .8fr); gap: clamp(var(--s-5), 4vw, var(--s-7)); align-items: start; }
.solution-mark { display: grid; gap: var(--s-3); color: var(--clay); }
.solution-mark span { font-family: var(--mono); font-size: .8rem; color: var(--faint); }
.solution-body h2 { font-size: 1.6rem; }
.solution-body .lead { margin-top: var(--s-3); }
.solution-body p + p { margin-top: var(--s-4); }
.solution-body .link-arrow { margin-top: var(--s-5); }
.solution-aside { display: grid; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.solution-aside .eyebrow { font-size: .7rem; }
.solution-aside ul { list-style: none; display: grid; gap: var(--s-2); }
.solution-aside li { display: flex; gap: var(--s-2); font-size: .92rem; color: var(--ink-2); }
.solution-aside li .ico { width: 15px; height: 15px; margin-top: 5px; color: var(--ok); }

.jump-nav { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; }
.jump-nav a { display: inline-flex; padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .86rem; color: var(--ink-2); }
.jump-nav a:hover { border-color: var(--forest); color: var(--forest); }

/* --- Segmentos ----------------------------------------------------------- */
.segment-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.segment-item { scroll-margin-top: calc(var(--header-h) + var(--s-5)); display: grid; gap: var(--s-3); padding: var(--s-6); background: var(--surface); }
.segment-item-head { display: flex; align-items: center; gap: var(--s-3); }
.segment-item-head .ico { color: var(--clay); }
.segment-item h2, .segment-item h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; }
.segment-item dl { display: grid; gap: var(--s-2); margin: 0; }
.segment-item dt { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.segment-item dd { margin: 0; font-size: .92rem; color: var(--ink-2); }
.segment-item .link-arrow { margin-top: var(--s-2); justify-self: start; }

/* --- Planos -------------------------------------------------------------- */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); align-items: start; }
.plan {
    position: relative;
    display: grid;
    gap: var(--s-4);
    padding: var(--s-6);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
}
.plan.is-featured { border-color: var(--forest); box-shadow: inset 0 0 0 1px var(--forest); }
.plan-badge {
    position: absolute;
    top: calc(-1 * var(--s-3));
    left: var(--s-6);
    padding: 2px var(--s-3);
    border-radius: 999px;
    background: var(--forest);
    color: #fff;
    font-size: .74rem;
    font-weight: 500;
}
.plan h2 { font-size: 1.35rem; }
.plan-audience { font-size: .92rem; min-height: 3.4em; }
.plan-price { display: grid; gap: 2px; padding-block: var(--s-4); border-block: 1px solid var(--line); }
.plan-price b { font-family: var(--display); font-size: 1.5rem; font-weight: 400; }
.plan-price span { font-size: .82rem; color: var(--muted); }
.plan-features { list-style: none; display: grid; gap: var(--s-3); }
.plan-features li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: var(--s-3); font-size: .92rem; color: var(--ink-2); }
.plan-features .ico { width: 16px; height: 16px; margin-top: 5px; color: var(--ok); }
.plan .btn { margin-top: var(--s-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.compare { width: 100%; min-width: 680px; font-size: .92rem; }
table.compare th, table.compare td { padding: var(--s-4) var(--s-5); text-align: left; border-bottom: 1px solid var(--line); }
table.compare thead th { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
table.compare tbody th { font-weight: 500; color: var(--ink); }
table.compare tbody tr:last-child th, table.compare tbody tr:last-child td { border-bottom: 0; }
table.compare td { color: var(--ink-2); }

/* --- Artigos ------------------------------------------------------------- */
.article-list { list-style: none; display: grid; }
.article-list > li { padding-block: var(--s-6); border-top: 1px solid var(--line); }
.article-list > li:last-child { border-bottom: 1px solid var(--line); }
.article-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--s-6); align-items: start; }
.article-meta { display: flex; flex-wrap: wrap; gap: var(--s-3); font-size: .8rem; color: var(--muted); }
.article-row h2 { font-size: 1.35rem; }
.article-row h2 a:hover { color: var(--clay); }
.article-row p { margin-top: var(--s-3); font-size: .96rem; }

/* --- Formulários --------------------------------------------------------- */
.form { display: grid; gap: var(--s-5); }
.form-panel { padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.section-dark .form-panel { background: var(--surface); color: var(--ink); }
.section-dark .form-panel p, .section-dark .form-panel label { color: var(--ink-2); }

.field { display: grid; gap: var(--s-2); }
.field label { font-size: .84rem; font-weight: 500; color: var(--ink); }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 42px;
    padding: var(--s-2) var(--s-3);
    border: 1px solid var(--line-strong);
    border-radius: var(--r);
    background: var(--surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 0;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(49, 82, 29, .14);
}
.field .hint { font-size: .8rem; color: var(--muted); }
.field-error input, .field-error select, .field-error textarea { border-color: #a33a2a; }
.error { font-size: .82rem; color: #a33a2a; }

.check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s-3); align-items: start; font-size: .9rem; color: var(--ink-2); }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 3px; accent-color: var(--forest); }
.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); }
.fieldset { display: grid; gap: var(--s-3); margin: 0; padding: 0; border: 0; }
.fieldset legend { padding: 0; font-size: .84rem; font-weight: 500; color: var(--ink); }
.hidden-field { position: absolute; left: -9999px; }

.notice { padding: var(--s-4); border: 1px solid var(--line); border-left: 3px solid var(--clay); border-radius: var(--r); background: var(--surface); font-size: .9rem; }

/* --- Contato ------------------------------------------------------------- */
.contact-rows { list-style: none; display: grid; gap: var(--s-4); }
.contact-rows li { display: grid; gap: 2px; padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.contact-rows li:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-rows dt, .contact-rows .fact-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-rows a:hover { color: var(--clay); }

/* --- FAQ ----------------------------------------------------------------- */
.faq-list { display: grid; }
.faq-list details { border-top: 1px solid var(--line); }
.faq-list details:last-of-type { border-bottom: 1px solid var(--line); }
.faq-list summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding-block: var(--s-5);
    font-size: 1.02rem;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: "";
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-right: 1.5px solid var(--faint);
    border-bottom: 1.5px solid var(--faint);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s ease;
}
.faq-list details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq-list details > p { padding-bottom: var(--s-5); max-width: 72ch; }

/* --- Footer -------------------------------------------------------------- */
.site-footer { margin-top: 0; padding-block: var(--s-8) var(--s-6); border-top: 1px solid var(--line); background: var(--paper-2); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: var(--s-6); }
.footer-brand { display: grid; gap: var(--s-4); align-content: start; max-width: 32ch; }
.footer-brand img { width: 200px; }
.footer-brand p { font-size: .9rem; }
.footer-col { display: grid; gap: var(--s-2); align-content: start; }
.footer-col h2 { font-family: var(--sans); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-1); }
.footer-col a { font-size: .9rem; color: var(--ink-2); }
.footer-col a:hover { color: var(--forest); text-decoration: underline; text-underline-offset: 2px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); justify-content: space-between; margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--line-strong); font-size: .84rem; color: var(--muted); }
.footer-bottom p { color: inherit; font-size: inherit; }
.footer-bottom p + p { margin-top: 0; } /* itens lado a lado: anula o espaçamento global p + p */
.footer-social { display: flex; gap: var(--s-3); list-style: none; }
.footer-social a { color: var(--muted); }
.footer-social a:hover { color: var(--forest); }

/* --- Cookies / WhatsApp -------------------------------------------------- */
.cookie {
    position: fixed;
    bottom: var(--s-4);
    left: var(--s-4);
    right: var(--s-4);
    z-index: 70;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    max-width: 760px;
    margin-inline: auto;
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.cookie p { font-size: .88rem; max-width: 52ch; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.whatsapp {
    position: fixed;
    right: var(--s-4);
    bottom: var(--s-4);
    z-index: 65;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--forest);
    color: #fff;
    box-shadow: var(--shadow);
}
.whatsapp:hover { background: var(--forest-2); }
.whatsapp .ico { width: 24px; height: 24px; }

/* --- Utilitários --------------------------------------------------------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }

/* --- Responsivo ---------------------------------------------------------- */
@media (max-width: 1200px) and (min-width: 1021px) {
    .logo img { width: 130px; }
    .nav-link, .nav-button { padding: var(--s-2); font-size: .88rem; }
}

@media (max-width: 1020px) {
    .nav-toggle { display: block; }
    .nav {
        position: fixed;
        inset: var(--header-h) 0 auto 0;
        display: none;
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        margin: 0;
        padding: var(--s-4) var(--s-5) var(--s-6);
        background: var(--paper);
        border-bottom: 1px solid var(--line);
    }
    .nav.is-open { display: grid; gap: var(--s-1); }
    .nav-link, .nav-button { width: 100%; justify-content: space-between; padding: var(--s-3); font-size: 1rem; }
    /* No mobile o submenu é acordeão: fechado até o grupo receber .is-open. */
    .dropdown {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        margin: 0 0 var(--s-3) var(--s-3);
        padding: 0 0 0 var(--s-2);
        min-width: 0;
    }
    .nav-item.is-open > .dropdown { display: block; }
    .nav-item:hover > .dropdown, .nav-item:focus-within > .dropdown { display: none; }
    .nav-item.is-open:hover > .dropdown, .nav-item.is-open:focus-within > .dropdown { display: block; }
    .nav-button[aria-expanded="true"] .ico { transform: rotate(180deg); }
    .header-actions { display: none; }
    .nav .header-actions { display: grid; gap: var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--line); }
    .nav .header-actions .btn { min-height: 44px; }
    .sidebar-layout, .solution-grid { grid-template-columns: minmax(0, 1fr); }
    .module-index { position: static; display: flex; flex-wrap: wrap; gap: var(--s-2); }
    .module-index a { grid-template-columns: auto auto; border: 1px solid var(--line); border-radius: 999px; }
    .module-index .eyebrow { width: 100%; margin: 0; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chain { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: var(--s-6); }
    /* Fim de linha: o conector apontaria para o nada. */
    .chain-step:nth-child(4n)::after { display: none; }
}

@media (max-width: 820px) {
    .section { padding-block: var(--s-7); }
    .section + .section:not(.section-alt):not(.section-dark),
    .section-alt + .section-alt,
    .section-dark + .section-dark { padding-top: var(--s-6); }
    .split, .split-wide, .grid-2, .grid-3, .plans, .segment-list, .article-row, .footer-grid { grid-template-columns: minmax(0, 1fr); }
    .split { gap: var(--s-6); }
    .footer-grid { gap: var(--s-6); }
    .facts { gap: var(--s-4); }
    .article-row { gap: var(--s-3); }
    .module-list li { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
    .plan-audience { min-height: 0; }
}

@media (max-width: 560px) {
    .grid-4 { grid-template-columns: minmax(0, 1fr); }

    /* Vertical: o conector desce pela esquerda e o texto fica ao lado do nó. */
    .chain { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .chain-step { padding: 0 0 var(--s-6) 60px; }
    .chain-step:last-child { padding-bottom: 0; }
    .chain-step:nth-child(4n)::after { display: block; }
    .chain-step:not(:last-child)::after {
        top: 48px;
        left: 20px;
        width: 2px;
        height: calc(100% - 48px);
    }
    .hero-inner { padding-block: var(--s-6) var(--s-6); }
    .cookie { flex-direction: column; align-items: stretch; }
    .cookie-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
    .site-header, .site-footer, .cookie, .whatsapp, .nav, .actions { display: none !important; }
    body { background: #fff; }
}

/* Sprite de ícones: fora do fluxo, sem estilo inline. */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }


/* --- Barra de distribuição de status ------------------------------------
   Mostra, de relance, a proporção entre disponível / em implantação /
   planejado de uma categoria — a lista sozinha não dava essa leitura. */
.status-bar {
    display: flex;
    height: 6px;
    margin-top: var(--s-3);
    border-radius: 999px;
    overflow: hidden;
    background: var(--line);
}
.status-bar span { display: block; min-width: 2px; }
.status-bar .seg-available { background: var(--ok); }
.status-bar .seg-implementation { background: #9a6a14; }
.status-bar .seg-planned { background: var(--plan); }

.status-tally { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-2); list-style: none; }
.status-tally li { display: flex; align-items: center; gap: var(--s-2); font-size: .8rem; color: var(--muted); }
.status-tally i { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.status-tally .seg-available { background: var(--ok); }
.status-tally .seg-implementation { background: #9a6a14; }
.status-tally .seg-planned { background: var(--plan); }

/* Cabeçalho de categoria com ícone */
.module-group-head { align-items: center; }
.module-group-title { display: flex; align-items: center; gap: var(--s-3); }
.module-group-title .ico { color: var(--clay); }
.module-group-meta { display: grid; justify-items: end; gap: 2px; min-width: 190px; }
.module-group-meta .status-bar { width: 100%; }

/* --- Célula da tabela comparativa ---------------------------------------- */
.cell-plain { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink-2); }
.cell-plain .ico { width: 15px; height: 15px; color: var(--ok); }
.cell-empty { color: var(--faint); }
table.compare .is-featured-col { background: rgba(49, 82, 29, .05); }
table.compare thead .is-featured-col { background: var(--forest); color: #fff; }

/* Barra geral do catálogo, dentro do hero da página de módulos.
   Os segmentos sólidos do tema claro ficam invisíveis sobre o verde — aqui a
   escala é clara, com o próprio fundo escuro como referência. */
.catalog-bar { max-width: 34rem; }
.catalog-bar .status-bar { background: rgba(255, 255, 255, .18); }
.catalog-bar .seg-available { background: #7fc8a3; }
.catalog-bar .seg-implementation { background: #d9c08a; }
.catalog-bar .seg-planned { background: #9aa6b4; }
