/* ==========================================================================
   plain1099.com — Free 1099 Summary Generator
   Part of the spritzlive.net family

   Dark mode is the default. Light mode is opt-in via .theme-toggle (which
   adds the `theme-light` class to <html>). All colors live in CSS custom
   properties; the rest of the stylesheet uses var() so the two themes are
   defined by the two :root blocks below and nothing else needs to know.
   ========================================================================== */

:root {
    /* Spritz brand, lightened for dark-mode contrast */
    --brand: #5aa3ff;
    --brand-dark: #4d8ad0;
    --accent: #4cc28a;
    --accent-dark: #3da876;

    /* Page chrome */
    --text: #e6eaf0;
    --muted: #8a96a8;
    --bg: #0f1419;
    --bg-alt: #161c24;
    --surface: #1a2028;
    --border: #2a3340;

    /* Semantic colors */
    --good: #4cc28a;
    --warn: #f0b840;
    --warn-bg: rgba(240, 184, 64, 0.10);
    --warn-text: #e6c977;
    --warn-border: rgba(240, 184, 64, 0.4);
    --bad: #e26464;
    --bad-bg: rgba(226, 100, 100, 0.12);
    --bad-text: #f2a0a0;
    --bad-border: rgba(226, 100, 100, 0.4);
    --flag-bg: rgba(240, 184, 64, 0.15);
    --flag-text: #f0d690;
    --flag-border: rgba(240, 184, 64, 0.5);

    /* Structure */
    --max-width: 1100px;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.6);
    --transition: 0.15s ease;
}

html.theme-light {
    --brand: #336699;
    --brand-dark: #264e73;
    --accent: #28a745;
    --accent-dark: #1f8438;
    --text: #222;
    --muted: #666;
    --bg: #fff;
    --bg-alt: #f4f6f8;
    --surface: #fff;
    --border: #e1e5ea;
    --good: #28a745;
    --warn: #b66d00;
    --warn-bg: #fff4d6;
    --warn-text: #6b4a00;
    --warn-border: #e8c97a;
    --bad: #c0392b;
    --bad-bg: #fdecea;
    --bad-text: #5a1a14;
    --bad-border: #f3b3ad;
    --flag-bg: #fff4d6;
    --flag-text: #6b4a00;
    --flag-border: #e8c97a;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    transition: background-color var(--transition), color var(--transition);
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
html.theme-light a:hover { color: var(--brand-dark); }

/* ---------- Site header ---------- */
.site-header {
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    transition: background-color var(--transition), border-color var(--transition);
}
html.theme-light .site-header { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); }

.site-header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}
.site-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    line-height: 1.1;
    color: var(--text);
}
.site-logo {
    display: block;
    height: auto;
    max-height: 48px;
    width: auto;
}
.site-logo-tagline {
    font-size: 0.85rem;
    color: var(--brand);
    font-weight: 600;
    letter-spacing: 0.02em;
    border-left: 2px solid var(--border);
    padding-left: 0.85rem;
    line-height: 1.2;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-nav-link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.site-nav-link:hover { color: var(--brand-dark); text-decoration: underline; }
.site-nav-cta {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition);
}
.site-nav-cta:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
    background: transparent;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
}
.theme-toggle:hover { color: var(--brand); background: rgba(90, 163, 255, 0.10); }
html.theme-light .theme-toggle:hover { background: rgba(51, 102, 153, 0.08); }
.theme-toggle .icon { width: 20px; height: 20px; display: block; }
.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
html.theme-light .theme-toggle .icon-sun { display: none; }
html.theme-light .theme-toggle .icon-moon { display: block; }

/* ---------- Page layout ---------- */
.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px 64px;
}

.hero { text-align: center; padding: 24px 0 16px; }
.hero h1 { margin: 0 0 8px; font-size: 2.25rem; color: var(--text); }
.hero .lede { color: var(--muted); margin: 0 auto; max-width: 640px; font-size: 1.05rem; }
.hero .meta { color: var(--muted); margin: 4px 0 0; font-size: 0.95rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin: 20px 0;
    box-shadow: var(--shadow);
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.card.error { border-color: var(--bad); }
.card h2 { margin: 0 0 12px; font-size: 1.3rem; color: var(--text); }
.card h3 {
    margin: 18px 0 6px;
    font-size: 0.92rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card[id] { scroll-margin-top: 16px; }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.card-header h2 { margin: 0; }

.privacy { padding: 16px 24px; color: var(--muted); }
.privacy h2 { color: var(--text); font-size: 1.05rem; margin: 0 0 8px; }
.privacy ul { margin: 0; padding-left: 20px; }

/* ---------- Forms ---------- */
input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--bg-alt);
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text);
    margin: 10px 0;
}
button[type="submit"], main button.primary {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 22px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition);
}
button[type="submit"]:hover, main button.primary:hover { background: var(--accent-dark); }

.contact-form label {
    display: block;
    font-weight: 600;
    margin: 14px 0 4px;
    font-size: 0.95rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    display: block;
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    box-sizing: border-box;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
    border-color: var(--brand);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form .cf-turnstile { margin: 16px 0; }
.contact-form button[type="submit"] { margin-top: 8px; }

.file-label { font-weight: 600; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 14px; }
ul.hint { margin: 4px 0 12px 20px; }

/* ---------- Big number ---------- */
.big-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--good);
    margin: 8px 0;
}

/* ---------- Tables ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
th, td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 0.95rem;
}
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.kv td:first-child { color: var(--muted); }
table.tx td { font-size: 0.88rem; }

table.ref { margin-top: 12px; }
table.ref th {
    text-align: left;
    color: var(--text);
    font-weight: 600;
    vertical-align: top;
    width: 28%;
}
table.ref td { vertical-align: top; }
table.ref thead th {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}

/* ---------- Category coloring ---------- */
.cat {
    text-transform: capitalize;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}
.cat-goods_services { color: var(--good); }
.cat-gift, .cat-personal, .cat-transfer { color: var(--muted); }
.cat-unknown { color: var(--warn); }

.flag {
    background: var(--flag-bg);
    color: var(--flag-text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--flag-border);
}
.flag.warn {
    background: var(--bad-bg);
    color: var(--bad-text);
    border-color: var(--bad-border);
}

/* ---------- Info / advisory / callout blocks ---------- */
details.info {
    margin: 12px 0 4px;
    background: rgba(90, 163, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
}
html.theme-light details.info { background: rgba(51, 102, 153, 0.05); }
details.info summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 0.95rem;
    font-weight: 600;
}
details.info p, details.info ul, details.info ol {
    color: var(--text);
    font-size: 0.93rem;
    margin: 8px 0 4px;
}
details.info ul, details.info ol { padding-left: 22px; }

.advisory {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-left: 4px solid var(--warn);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0 20px;
    font-size: 0.95rem;
    color: var(--text);
}
.advisory strong { color: var(--warn); }

.callout {
    background: var(--bad-bg);
    border-left: 3px solid var(--bad);
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 0.92rem;
    color: var(--text);
}

/* ---------- Reset / bulk-apply buttons ---------- */
.reset-btn {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
}
.reset-btn:hover {
    background: rgba(90, 163, 255, 0.10);
    color: var(--brand-dark);
    border-color: var(--brand);
}
html.theme-light .reset-btn:hover { background: rgba(51, 102, 153, 0.08); }

/* ---------- Per-row category cell + bulk apply ---------- */
.cat-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
.cat-select {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.82rem;
    text-transform: capitalize;
    cursor: pointer;
    font-family: inherit;
}
.cat-select:hover { border-color: var(--brand); }
.cat-select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

td[data-tx-cat].cat-goods_services .cat-select { color: var(--good); border-color: rgba(76, 194, 138, 0.4); }
td[data-tx-cat].cat-unknown        .cat-select { color: var(--warn); border-color: rgba(240, 184, 64, 0.4); }
td[data-tx-cat].cat-gift           .cat-select,
td[data-tx-cat].cat-personal       .cat-select,
td[data-tx-cat].cat-transfer       .cat-select { color: var(--muted); }

.bulk-apply {
    background: rgba(90, 163, 255, 0.12);
    color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.78rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    max-width: 220px;
    white-space: normal;
    transition: background var(--transition), color var(--transition);
}
.bulk-apply:hover { background: var(--brand); color: #fff; }
html.theme-light .bulk-apply { background: rgba(51, 102, 153, 0.08); }

/* ---------- TOC ---------- */
.toc ol {
    margin: 4px 0 0;
    padding-left: 20px;
    line-height: 1.9;
}
.toc h2 {
    margin: 0 0 6px;
    font-size: 1rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Site footer ---------- */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 24px 20px 32px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
    transition: background-color var(--transition), border-color var(--transition);
}
.site-footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
}
.site-footer p { margin: 4px 0; }
.site-footer .family { color: var(--text); font-weight: 600; }
.disclaimer { font-size: 0.85rem; max-width: 720px; margin: 12px auto 0; color: var(--muted); }

footer { text-align: center; color: var(--muted); margin-top: 24px; }
