/* Theme for the two vendored PerksWallet policy documents in this directory.
 *
 * OURS, unlike terms.html and privacy.html, whose <body> is copied byte for byte from
 * site-redeem-collectsavings and must not be edited. This file exists so those documents can look
 * like games.perkswallet.com without anyone retyping fifteen sections of legal prose to do it. It
 * replaces the v7 site's 28KB style.css, which carried nav, hero and button rules these two pages
 * never use, and whose green/teal palette belongs to a different property.
 *
 * Tokens mirror public/games-app/index.html: navy #1E1F4B, red #dd352e, Inter. Keep them in step.
 *
 * Loaded AFTER each document's own <style> block, on purpose. That block hardcodes #333, #555,
 * #888 and #eee, which are invisible in dark mode, and equal-specificity rules are decided by
 * document order. Move this <link> above the <style> block and dark mode silently breaks.
 */

:root {
    /* Load-bearing in dark mode, not cosmetic. Without it the frame's own SCROLLBAR renders in the
     * light UA palette, which puts a bright strip down the right edge of an otherwise dark sheet.
     * Caught by screenshot; a computed-style probe never sees it, because the scrollbar is UA
     * chrome rather than a styled element. */
    color-scheme: light;

    --navy: #1E1F4B;
    --bg: #F9FAFB;
    --card: #ffffff;
    --tile: #f3f4f6;
    --line: #e5e7eb;
    --ink: #111827;
    --muted: #4b5563;
    --heading: var(--navy);
    --link: #b62a24;
    --radius: 16px;

    /* Named by the vendored <style> blocks, so they have to resolve here. */
    --card-bg: var(--card);
    --accordion-bg: var(--tile);
    --primary-color: var(--heading);
    --link-color: var(--link);
}

/* Dark mode twice over, because these pages are reached two ways. In the capture modal the parent
 * knows the resolved theme (theme-toggle.js writes it to html[data-theme]) and passes it as ?theme,
 * which the inline script turns into data-theme here; that path must win even when it disagrees
 * with the OS. Opened straight from the footer in a new tab there is no parent to ask, so the media
 * query is the fallback. The [data-theme="light"] guard keeps an explicit light choice from being
 * overridden by a dark OS. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0b0d12;
        --card: #141821;
        --tile: #1f2937;
        --line: #2a2f3a;
        --ink: #e8eaf0;
        --muted: #a8b0bf;
        --heading: #cdd3e6;
        --link: #ff8b85;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0d12;
    --card: #141821;
    --tile: #1f2937;
    --line: #2a2f3a;
    --ink: #e8eaf0;
    --muted: #a8b0bf;
    --heading: #cdd3e6;
    --link: #ff8b85;
}

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

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

body {
    margin: 0;
    /* Inter to match the dashboard, with a system stack in front of the generic fallback so a
     * blocked webfont degrades to the platform UI face rather than to Times. */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header. Brand navy keeps its hue in both themes, matching the dashboard's own header. */
header {
    background: var(--navy);
    padding: 30px 20px 26px;
    text-align: center;
}
header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #ffffff;
}
header p {
    margin: 6px 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #b9bbd6;
}

main {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 20px 8px;
}

.policy-card {
    background-color: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    /* No drop shadow. The v7 card floated on a white page; here it sits on a tinted ground and a
     * border reads cleaner, and a shadow tuned for light mode turns into a smudge in dark. */
    box-shadow: none;
    margin-bottom: 28px;
}

.policy-card h2 {
    color: var(--heading);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-top: 30px;
    margin-bottom: 14px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}
.policy-card h2:first-of-type { margin-top: 0; }

.policy-card h3 {
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 9px;
}

.policy-card p,
.policy-card li {
    color: var(--muted);
    line-height: 1.65;
    margin-bottom: 12px;
    font-size: 15px;
}

.policy-card ul { padding-left: 22px; margin-bottom: 20px; }
.policy-card li { margin-bottom: 8px; }

.policy-card strong { color: var(--ink); font-weight: 600; }

/* Company and dates block. */
.company-info {
    background-color: var(--tile);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 28px;
    font-size: 14px;
}
/* Tighter than body prose. This is an address and two dates set as separate paragraphs, so the
 * 1.65 leading that suits running text opens visible gaps between what reads as one block. */
.company-info p { margin: 0 0 2px; line-height: 1.45; color: var(--muted); }
.company-info p:last-child { margin-bottom: 0; }
.company-info br { line-height: 0.7; }
.company-info strong { color: var(--ink); }

address { font-style: normal; line-height: 1.6; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Tables. Only privacy.html has one, and it has to survive a 390px viewport, so it scrolls inside
 * its own box rather than pushing the page sideways. */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0 20px;
    font-size: 14px;
    display: block;
    overflow-x: auto;
}
th, td {
    text-align: left;
    padding: 9px 14px 9px 0;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    vertical-align: top;
}
th { color: var(--ink); font-weight: 600; white-space: nowrap; }

.simple-footer {
    text-align: center;
    padding: 18px 20px 28px;
    color: var(--muted);
    font-size: 13px;
    margin-top: auto;
}

@media (max-width: 480px) {
    header { padding: 24px 16px 20px; }
    header h1 { font-size: 22px; }
    main { padding: 16px 14px 4px; }
    .policy-card { padding: 20px 16px; border-radius: 12px; }
    .policy-card h2 { font-size: 17px; margin-top: 26px; }
}

@media print {
    body { background: #fff; color: #000; }
    header { background: #fff; }
    header h1, header p { color: #000; }
    .policy-card { border: 0; padding: 0; }
}
