/* ==========================================================================
   TáOnde — páginas de texto (Termos, Privacidade, Suporte) e a página
   "abrir no app" (fallback de links e do QR do bar).
   Carregado DEPOIS de styles.css: reaproveita os tokens de :root, o header
   (.top), os botões (.btn, .btn-ghost) e o rodapé (.foot).
   ========================================================================== */

/* Header das páginas internas: a nav continua visível no celular. */
.top-nav--doc {
    gap: 20px;
}

.top-nav a[aria-current="page"] {
    color: var(--text);
}

/* styles.css esconde .top-nav abaixo de 900px (a landing tem botão no
   lugar); aqui a nav é a única navegação, então fica. */
@media (max-width: 900px) {
    .top-nav--doc {
        display: flex;
    }
}

/* Documento ---------------------------------------------------------------- */

.doc {
    max-width: 52rem;
    padding: clamp(40px, 8vw, 88px) 0 clamp(56px, 9vw, 104px);
}

.doc-head h1 {
    margin-top: 10px;
    font-size: clamp(2.1rem, 6vw, 3.4rem);
}

.doc-head .lead {
    max-width: 40rem;
    margin-top: 16px;
    color: var(--muted);
    font-size: 1.08rem;
}

.doc-meta {
    margin-top: 14px;
    color: var(--faint);
    font-size: 0.92rem;
}

.doc-toc {
    margin-top: 34px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.doc-toc p {
    color: var(--faint);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.doc-toc ol {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 6px 24px;
    margin-top: 10px;
    font-size: 0.95rem;
}

.doc-toc a {
    color: var(--muted);
}

.doc-toc a:hover {
    color: var(--text);
}

/* Texto corrido ------------------------------------------------------------ */

.prose {
    margin-top: 12px;
    color: var(--muted);
}

.prose h2 {
    margin-top: 56px;
    color: var(--text);
    font-size: clamp(1.45rem, 3.4vw, 1.9rem);
    scroll-margin-top: 96px;
}

.prose h3 {
    margin-top: 30px;
    color: var(--text);
    font-size: 1.12rem;
    scroll-margin-top: 96px;
}

.prose p,
.prose ul,
.prose ol,
.prose .table-wrap {
    margin-top: 14px;
}

.prose strong {
    color: var(--text);
    font-weight: 700;
}

.prose a {
    color: var(--indigo-2);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.prose a:hover {
    color: var(--text);
}

.prose code {
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.9em;
}

.prose ul,
.prose ol {
    display: grid;
    gap: 8px;
    padding-left: 1.3em;
}

.prose ul {
    list-style: disc;
}

.prose ol {
    list-style: decimal;
}

.prose li::marker {
    color: var(--indigo-2);
}

/* Tabelas: rolam de lado no celular em vez de estourar a página. */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.prose th {
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
}

.prose tr:last-child td {
    border-bottom: 0;
}

/* No celular a tabela vira cartões (rótulo vindo de data-label). */
@media (max-width: 680px) {
    .table-wrap {
        overflow: visible;
        border: 0;
    }

    .prose table,
    .prose tbody,
    .prose tr,
    .prose td {
        display: block;
        width: 100%;
    }

    .prose thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .prose tr {
        margin-top: 10px;
        padding: 6px 0;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
    }

    .prose td {
        padding: 6px 14px;
        border: 0;
    }

    .prose td::before {
        content: attr(data-label);
        display: block;
        color: var(--faint);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    .top-nav--doc {
        display: flex;
        gap: 14px;
        font-size: 0.86rem;
    }
}

@media (max-width: 420px) {
    .top-nav--doc {
        gap: 10px;
        font-size: 0.8rem;
    }

    .doc-page .brand img {
        height: 20px;
    }
}

/* Suporte: FAQ e cartões de contato ----------------------------------------- */

.faq {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.faq details {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.2s var(--ease);
}

.faq details[open] {
    border-color: var(--line-2);
}

.faq summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

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

.faq summary::after {
    content: "+";
    flex: none;
    color: var(--indigo-2);
    font-size: 1.3rem;
    line-height: 1;
    transition: transform 0.2s var(--ease);
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq .faq-body {
    padding: 0 18px 18px;
}

.faq .faq-body p:first-child,
.faq .faq-body ol:first-child,
.faq .faq-body ul:first-child {
    margin-top: 0;
}

.contact-card {
    margin-top: 22px;
    padding: 22px;
    border: 1px solid rgba(109, 94, 252, 0.4);
    border-radius: var(--radius-sm);
    background: rgba(109, 94, 252, 0.1);
}

.contact-card .btn {
    margin-top: 16px;
}

/* Abrir no app (fallback de links e do QR) ---------------------------------- */

.open-app {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 200px);
    padding: clamp(40px, 8vw, 80px) 0;
}

.open-card {
    width: min(30rem, 100%);
    text-align: center;
}

.open-card h1 {
    margin-top: 10px;
    font-size: clamp(2rem, 8vw, 2.8rem);
}

.open-card .lead {
    margin-top: 14px;
    color: var(--muted);
}

.open-code {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 22px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--amber);
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    overflow-wrap: anywhere;
}

.open-actions {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.open-actions .btn,
.open-actions .btn-ghost {
    width: 100%;
}

.open-note {
    margin-top: 22px;
    color: var(--faint);
    font-size: 0.9rem;
}

[hidden] {
    display: none !important;
}
