/* ============================================================
   TarjaPDF - Estilo das páginas legais (Termos e Privacidade)
   Estética de documento oficial: papel, tinta e carimbo.
   ============================================================ */
:root {
    --paper: #F2EFE7;
    --paper-2: #FAF7EF;
    --paper-3: #EDE9DD;
    --ink: #16130D;
    --ink-soft: #3d382c;
    --ink-mute: #6b6455;
    --accent: #C8321E;
    --ok: #0F6B3B;
    --line: rgba(22, 19, 13, 0.15);
    --line-soft: rgba(22, 19, 13, 0.12);
    --mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV (apenas a barra de topo, filha direta do body — não afeta o <nav class="toc">) */
body > nav {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0 2rem;
}
.nav-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.nav-logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: -0.02em;
}
.nav-logo .ver { color: var(--ink-mute); font-weight: 400; font-family: var(--mono); font-size: 11px; }
.nav-logo strong span { color: var(--accent); }
.nav-back {
    color: var(--ink-mute);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: color 0.2s;
}
.nav-back:hover { color: var(--ink); text-decoration: none; }

/* HEADER DO DOCUMENTO */
.doc-header {
    padding: 5rem 2rem 3rem;
    text-align: center;
    border-bottom: 1px solid var(--line);
    background: var(--paper-3);
}
.doc-eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.35rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
    margin-bottom: 1.4rem;
}
.doc-header h1 {
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1.12;
    margin-bottom: 1rem;
    color: var(--ink);
}
.doc-meta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    max-width: 620px;
    margin: 0.5rem auto 0;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--ink-mute);
}
.doc-meta span strong { color: var(--ink); font-weight: 600; }

/* CONTAINER DE CONTEÚDO */
.doc {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.5rem 2rem 5rem;
}

/* SUMÁRIO */
.toc {
    background: var(--paper-2);
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: 1.6rem 1.8rem;
    margin-bottom: 3rem;
}
.toc h2 {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 1rem;
    font-weight: 600;
}
.toc ol {
    list-style: none;
    counter-reset: toc;
    columns: 2;
    column-gap: 2.5rem;
}
.toc li { counter-increment: toc; margin-bottom: 0.55rem; break-inside: avoid; }
.toc a {
    color: var(--ink-soft);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.toc a::before {
    content: counter(toc);
    display: inline-block;
    min-width: 1.6rem;
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--ink); text-decoration: none; }

/* SEÇÕES */
.doc section { scroll-margin-top: 90px; margin-bottom: 2.6rem; }
.doc h2.sec-title {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line-soft);
}
.doc h2.sec-title .num {
    color: var(--accent);
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 1.05rem;
}
.doc p { color: var(--ink-soft); margin-bottom: 1rem; }
.doc strong { color: var(--ink); font-weight: 700; }
.doc ul { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.doc ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.6rem;
    color: var(--ink-soft);
}
.doc ul li::before {
    content: "";
    position: absolute;
    left: 0.1rem;
    top: 0.72rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.doc code {
    background: rgba(22, 19, 13, 0.05);
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    padding: 0.1rem 0.45rem;
    font-size: 0.85em;
    color: var(--ink);
    font-family: var(--mono);
}

/* TABELAS */
.table-wrap { overflow-x: auto; margin: 0 0 1.4rem; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--paper-2); }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    min-width: 520px;
}
thead th {
    background: var(--paper-3);
    color: var(--ink);
    text-align: left;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}
tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-soft);
    vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(22, 19, 13, 0.015); }

/* CALLOUT */
.callout {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    margin: 0 0 1.4rem;
    font-size: 0.92rem;
    color: var(--ink-soft);
}
.callout.warn {
    border-left-color: #A66B00;
}

/* ASSINATURA / RODAPÉ DO DOC */
.doc-signature {
    margin-top: 3rem;
    padding-top: 1.6rem;
    border-top: 1px solid var(--line-soft);
    color: var(--ink-mute);
    font-family: var(--mono);
    font-size: 0.8rem;
    text-align: center;
}

/* FOOTER */
footer {
    background: var(--ink);
    color: #b9b19e;
    padding: 3rem 2rem;
    text-align: center;
}
footer p { font-family: var(--mono); font-size: 0.8rem; margin-bottom: 0.4rem; }
footer a { color: #F2EFE7; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.5rem;
    margin-top: 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* VOLTAR AO TOPO */
.to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent);
    color: #F2EFE7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    box-shadow: 4px 4px 0 rgba(22, 19, 13, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-2px); text-decoration: none; background: var(--ink); color: var(--paper); }

/* RESPONSIVE */
@media (max-width: 720px) {
    .doc-header { padding: 3.5rem 1.5rem 2.5rem; }
    .doc-header h1 { font-size: 2rem; }
    .doc { padding: 2rem 1.5rem 4rem; }
    .toc ol { columns: 1; }
    body > nav { padding: 0 1.2rem; }
}

/* IMPRESSÃO */
@media print {
    body > nav, .to-top, .toc, footer { display: none; }
    body { background: #fff; color: #111; }
    .doc-header { padding: 2rem 0 1rem; background: none; border: none; }
    .doc-header h1 { color: #111; }
    .doc p, .doc ul li, tbody td { color: #222; }
    a { color: #111; }
}
