/*
 * legal.css - styling for terms.html and privacy.html ONLY.
 *
 * Deliberately self-contained, same philosophy as index.html/landing.css's
 * own doc-comment: these two pages carry their own colors/typography and
 * don't <link> dashboard.css or site.css, so they stay copy-and-host-
 * anywhere static files (e.g. if the user later wants them served from a
 * separate marketing/CDN domain, or swapped out entirely once a lawyer has
 * finalized the real wording) with nothing else to break if those other
 * stylesheets change shape later.
 *
 * Color tokens mirror the ones already established in dashboard.css/
 * site.css :root (same indigo brand palette), duplicated here rather than
 * shared, again to keep this pair of pages fully standalone.
 */

:root {
    --bg: #f2f2fb;
    --panel: #ffffff;
    --border: #ecebf6;
    --text: #22223a;
    --text-strong: #14141f;
    --muted: #8b8fa7;
    --accent: #6c5ce7;
    --accent-dark: #4b3fa0;
    --accent-2: #16c2af;
    --ph-bg: #fef3c7;
    --ph-border: #f3dfa0;
    --ph-text: #92400e;
    --shadow-card: 0 10px 26px rgba(45, 32, 100, 0.08);
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
}

/* ---- Layout --------------------------------------------------------- */

.legal-wrap {
    max-width: 46rem;
    margin: 0 auto;
    /* extra top padding keeps the title clear of the fixed home button */
    padding: 5.5rem 1.5rem 5rem;
}

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

.legal-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

.legal-updated {
    color: var(--muted);
    font-size: 0.875rem;
    margin: 0;
}

.legal-intro {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    font-size: 0.9375rem;
    color: var(--text);
}

/* ---- Table of contents ---------------------------------------------- */

.legal-toc {
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0 2.5rem;
}

.legal-toc h2 {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.legal-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    columns: 1;
    font-size: 0.9375rem;
}

.legal-toc li { margin-bottom: 0.375rem; }

.legal-toc a { color: var(--accent-dark); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }

/* ---- Content sections ------------------------------------------------ */

.legal-section {
    margin-bottom: 2.25rem;
    scroll-margin-top: 5.5rem;
}

.legal-section h2 {
    font-size: 1.25rem;
    color: var(--text-strong);
    margin: 0 0 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.legal-section h3 {
    font-size: 1rem;
    color: var(--text-strong);
    margin: 1.25rem 0 0.5rem;
}

.legal-section p { margin: 0 0 0.875rem; font-size: 0.9375rem; }

.legal-section ul, .legal-section ol.legal-list {
    margin: 0 0 0.875rem;
    padding-left: 1.25rem;
    font-size: 0.9375rem;
}

.legal-section li { margin-bottom: 0.375rem; }

.legal-section a { color: var(--accent-dark); }

.legal-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1rem;
    font-size: 0.875rem;

    /* a wide table scrolls inside itself on a phone instead of pushing
       the whole page sideways */
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.legal-section code { overflow-wrap: anywhere; }

.legal-section th, .legal-section td {
    text-align: left;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border);
    vertical-align: top;
}

.legal-section th { background: var(--bg); color: var(--text-strong); }

/* Bracketed [placeholder] text the account holder must fill in / confirm
   before this page goes live - see the doc-comment at the top of
   terms.html / privacy.html for the full checklist. Deliberately loud so
   none get missed during a final read-through, but this class (and only
   this class) is stripped of its highlight in print/export via the
   @media print rule below, so a printed/PDF'd copy doesn't look "marked
   up" once every placeholder has actually been replaced with real text. */
.legal-ph {
    background: var(--ph-bg);
    border: 1px solid var(--ph-border);
    color: var(--ph-text);
    padding: 0.05em 0.35em;
    font-weight: 600;
    font-size: 0.92em;
}

.legal-back-to-top {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted);
    text-decoration: none;
}
.legal-back-to-top:hover { color: var(--accent-dark); }

/* ---- Footer ----------------------------------------------------------- */

.legal-footer {
    max-width: 46rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.8125rem;
}

.legal-footer a { color: var(--accent-dark); text-decoration: none; }
.legal-footer a:hover { text-decoration: underline; }

@media (min-width: 40rem) {
    .legal-toc ol { columns: 2; column-gap: 2rem; }
}

@media print {
    .legal-toc, .legal-back-to-top { display: none; }
    body { background: #fff; }
    .legal-intro { box-shadow: none; }
    .legal-ph { background: none; border: 1px dashed #999; }
}
