/*
 * Shared styling for the three document pages — terms, privacy, contact.
 *
 * Separate from the compiled Tailwind bundle on purpose: these pages are long
 * prose, they change on a legal cadence rather than a product one, and giving
 * them their own small stylesheet means editing them never risks the landing
 * page. Tokens are copied from public/landing.html so they cannot drift apart
 * visually.
 */

:root {
    --background: #FBF7F2;
    --panel-card: #FFFAF3;
    --text-ink: #1F2937;
    --muted-text: #6B7280;
    --brand-base: #B45309;
    --brand-hover: #D97706;
    --borders: rgba(2, 6, 23, 0.10);
}

body {
    background: var(--background);
    color: var(--text-ink);
    font-family: Inter, system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    margin: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 52rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--borders);
}

.doc-home {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-ink);
    font-weight: 700;
}

.doc-home img { height: 2.75rem; width: auto; }

.doc-back {
    color: var(--muted-text);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
}

.doc-back:hover { color: var(--text-ink); }

/* ── Document body ──────────────────────────────────────────────────────── */

.doc {
    max-width: 52rem;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.doc h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

.doc-meta {
    color: var(--muted-text);
    font-size: 0.95rem;
    margin: 0 0 2rem;
}

.doc-lead {
    font-size: 1.15rem;
    color: var(--muted-text);
    border-left: 4px solid var(--brand-base);
    padding-left: 1.1rem;
    margin: 0 0 2.5rem;
}

.doc h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 2.5rem 0 0.75rem;
}

.doc h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.75rem 0 0.5rem;
}

.doc p, .doc li { color: #374151; }
.doc p { margin: 0 0 1rem; }
/* list-style restated because the compiled Tailwind reset in app.css strips
   markers globally, and an unmarked list in a legal document reads as prose. */
.doc ul { margin: 0 0 1.25rem; padding-left: 1.35rem; list-style: disc outside; }
.doc li { margin-bottom: 0.5rem; }

.doc a { color: var(--brand-base); }
.doc a:hover { color: var(--brand-hover); }

.doc code {
    background: rgba(2, 6, 23, 0.06);
    border-radius: 0.3rem;
    padding: 0.1em 0.35em;
    font-size: 0.9em;
}

/*
 * An unfilled owner fact. Loud on purpose — see the comment at the top of
 * privacy.html. If one of these reaches production it should be obvious in a
 * screenshot, not discovered by a regulator.
 */
.todo {
    background: #FEF3C7;
    border: 1px dashed #B45309;
    border-radius: 0.35rem;
    padding: 0.05em 0.4em;
    font-weight: 700;
    font-size: 0.9em;
    color: #92400E;
}

/* ── Contact cards ──────────────────────────────────────────────────────── */

.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
}

.doc-card {
    background: var(--panel-card);
    border: 1px solid var(--borders);
    border-radius: 1rem;
    padding: 1.25rem;
}

.doc-card h3 { margin-top: 0; }
.doc-card p:last-child { margin-bottom: 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.doc-footer {
    max-width: 52rem;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--borders);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.doc-footer p { margin: 0; }
.doc-footer div { display: flex; gap: 1.5rem; }
.doc-footer a { color: var(--muted-text); text-decoration: none; }
.doc-footer a:hover { color: var(--text-ink); }

@media (min-width: 640px) {
    .doc-footer { flex-direction: row; justify-content: space-between; }
}

/* ── Cookie guide ───────────────────────────────────────────────────────────
 *
 * A table rather than a list, because the four questions a reader has about a
 * cookie — what is it, how long, what breaks — are the same four every time,
 * and a list makes them compare paragraphs to find that out.
 *
 * The wrapper scrolls rather than the page: four columns do not fit a phone,
 * and a document that slides sideways as a whole loses the reader's place in
 * the prose either side of it.
 */

.cookie-table-wrap {
    overflow-x: auto;
    margin: 0 0 1.5rem;
    border: 1px solid var(--borders);
    border-radius: 0.5rem;
    background: var(--panel-card);
}

.cookie-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 34rem;
    font-size: 0.92rem;
}

.cookie-table th,
.cookie-table td {
    text-align: left;
    vertical-align: top;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--borders);
}

.cookie-table thead th {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-text);
    white-space: nowrap;
}

.cookie-table tbody tr:last-child td { border-bottom: 0; }
.cookie-table td:first-child { white-space: nowrap; }
.cookie-table code { font-size: 0.85em; }

/* The live control on the cookie page. Sized for a thumb, not for a mouse. */
.choice-btn {
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.55rem 1.1rem;
    margin: 0 0.5rem 0.5rem 0;
    border: 0;
    border-radius: 0.4rem;
    background: var(--brand-base);
    color: #fff;
}

.choice-btn:hover { background: var(--brand-hover); }

.choice-btn--quiet {
    background: transparent;
    color: var(--text-ink);
    font-weight: 600;
    border: 1px solid var(--borders);
}

.choice-btn--quiet:hover { background: rgba(2, 6, 23, 0.04); color: var(--text-ink); }

.choice-btn:focus-visible {
    outline: 2px solid var(--brand-base);
    outline-offset: 2px;
}

/* ── Help page ──────────────────────────────────────────────────────────────
 *
 * Bigger than the legal pages, and deliberately. This one is read by somebody
 * who is stuck, possibly on a phone, possibly not comfortable with computers.
 * Small grey text is where those readers give up, so the body runs a size up
 * and the line length stays short.
 */

.doc--help { font-size: 1.08rem; }
.doc--help p, .doc--help li, .doc--help dd { color: #2C3440; }
.doc--help li { margin-bottom: 0.65rem; }
.doc--help h2 { margin-top: 2.5rem; }

/* The one thing on the page we want pressed. */
.help-cta {
    display: inline-block;
    background: var(--brand-base);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 0.45rem;
    margin: 0.25rem 0.75rem 0.5rem 0;
}

.help-cta:hover { background: var(--brand-hover); color: #fff !important; }
.help-cta:focus-visible { outline: 2px solid var(--text-ink); outline-offset: 2px; }
.help-cta-note { color: var(--muted-text); font-size: 0.95rem; }

/* A line to copy. Set apart so it reads as something to type, not as prose. */
.help-example {
    background: var(--panel-card);
    border: 1px solid var(--borders);
    border-left: 4px solid var(--brand-base);
    border-radius: 0.4rem;
    padding: 0.9rem 1.1rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.98rem;
}

/* The two or three things people get wrong. Loud enough to survive skimming. */
.help-aside {
    background: #FFF4E3;
    border: 1px solid #E9C89A;
    border-radius: 0.4rem;
    padding: 0.85rem 1.1rem;
}

/* Word list and troubleshooting: the term, then the answer under it. */
.help-words { margin: 0 0 1.5rem; }
.help-words dt { font-weight: 700; margin-top: 1.1rem; }
.help-words dd { margin: 0.2rem 0 0; padding-left: 0; }
