/* style.css — Clark College Adjunct Pay Estimator */

/* ========== FONT ==========
   Atkinson Hyperlegible (Braille Institute, SIL Open Font License; see
   fonts/OFL.txt), served from our own fonts/ folder rather than Google Fonts,
   and preloaded in pay.html so it's ready before the page first paints.
   Only the Latin character set at regular and bold is included; nothing on
   the page uses italics. */
@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/atkinson-hyperlegible-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Atkinson Hyperlegible';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/atkinson-hyperlegible-700.woff2') format('woff2');
}

/* Stand-in shown for the split second before the font arrives on a slow
   connection: Arial resized to take up the same space as Atkinson, so
   text doesn't jump or rewrap when the real font swaps in. */
@font-face {
    font-family: 'Atkinson Fallback';
    font-weight: 400;
    src: local('Arial'), local('ArialMT');
    size-adjust: 97.8%;
    ascent-override: 97%;
    descent-override: 30%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Atkinson Fallback';
    font-weight: 700;
    src: local('Arial Bold'), local('Arial-BoldMT');
    size-adjust: 99.7%;
    ascent-override: 95%;
    descent-override: 29%;
    line-gap-override: 0%;
}

/* ========== DESIGN TOKENS ========== */
:root {
    /* Brand */
    --navy: #002855;
    --navy-2: #003d7a;
    /* money / "higher" — 5.5:1 on white */
    --green: #047857;
    --green-bg: #ecfdf5;
    /* accents on navy only */
    --mint: #6ee7b7;

    /* Neutrals */
    --ink: #1e293b;
    /* 7.5:1 on white */
    --muted: #475569;
    --line: #e2e8f0;
    /* 4.8:1 — visible control edges */
    --control-border: #64748b;
    --page-bg: #f4f6fa;
    --subtle-bg: #f1f5f9;

    /* Interaction */
    --focus-ring: #0066cc;

    /* Shape & depth */
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    /* Fainter, for boxes inside a card (the intro boxes, the result cards) */
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.15);

    /* Roles. Light and dark mode use the same names with different colors
       (the dark ones are in "LIGHT / DARK MODE" below). Use these, not
       --navy for text or #fff for backgrounds, or dark mode will break. */
    /* cards, boxes and controls */
    --surface: #fff;
    /* headings, amounts and links */
    --heading: var(--navy);
    /* smaller accents: "What's this?" links, chart lines */
    --accent: var(--navy-2);
    /* selected / hover backgrounds, and the text on them */
    --fill: var(--navy);
    --on-fill: #fff;
    /* green backgrounds (badges, finished steps), and the text on them */
    --green-fill: var(--green);
    --on-green: #fff;
    /* a − or + button that can't go further, and one being pressed */
    --disabled: #94a3b8;
    --pressed: #cbd5e1;

    /* Legacy names still used by older rules */
    --clark-navy: var(--navy);
    --green-text: var(--green);
    --text-dark: var(--ink);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Atkinson Hyperlegible', 'Atkinson Fallback', sans-serif;
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    min-height: 100vh;
}

/* ========== FOCUS ========== */
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.close-modal:focus-visible {
    outline-color: #fff;
}

/* ========== HERO ========== */
.hero {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 0 4.5rem;
    background:
        radial-gradient(600px 300px at 85% -10%, rgba(16, 185, 129, 0.18), transparent 70%),
        radial-gradient(500px 260px at 0% 110%, rgba(14, 165, 233, 0.16), transparent 70%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
}



.hero-text p {
    margin: 0;
}

.hero-eyebrow {
    color: var(--mint);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0.5rem 0 0.75rem;
    font-size: clamp(1.9rem, 1.2rem + 2.75vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: #fff;
}

.hero-subtitle {
    max-width: 38rem;
    font-size: 1.15rem;
    line-height: 1.5;
    /* 8:1 or better on the navy */
    color: #cbd5e1;
    /* On narrow phones, where a sentence has to wrap, avoid leaving one word
       alone on the last line */
    text-wrap: pretty;
}

/* Each sentence starts its own line, so the subtitle reads as two lines
   instead of leaving "of the two." on its own */
.hero-subtitle span {
    display: block;
}

/* The second sentence is the point, so it stands out */
.hero-subtitle span+span {
    margin-top: 0.15rem;
    font-weight: 700;
    color: #fff;
}


@media (max-width: 575.98px) {
    .hero {
        padding: 1.75rem 0 3.75rem;
    }
}

/* ========== LIGHT / DARK MODE ==========
   The little inline script in the <head> of pay.html sets data-theme on
   <html> to "light" or "dark" before the page draws: the person's saved
   choice, or else their device setting. js/script.js runs the switch.
   Dark mode only swaps the color roles defined in :root; the navy hero, the
   navy results box and the rates-table header stay navy in both.
   Only on screen: printouts are always black on white. Every pair here
   meets WCAG AA (body text 7:1 or better, borders and focus rings 3:1+). */
@media screen {
    :root[data-theme="dark"] {
        color-scheme: dark;
        --page-bg: #0b1220;
        --surface: #131c2e;
        --subtle-bg: #1c2740;
        --line: #2c3a54;
        --control-border: #7c8aa3;
        --ink: #e6ebf2;
        --muted: #a7b3c6;
        --heading: #cfe0ff;
        --accent: #93bbff;
        --fill: #93bbff;
        --on-fill: #0b1220;
        --green: #4ade80;
        --green-fill: #34d399;
        --on-green: #04281a;
        --green-bg: #0f2b22;
        --focus-ring: #7ab8ff;
        --disabled: #5b6880;
        --pressed: #33425e;
        --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.25);
    }
}

/* The "Dark mode" switch, top right of the navy hero (its own row on
   phones). A real button with role="switch", so screen readers say
   "Dark mode, switch, on/off". */
.hero .container {
    position: relative;
}

.theme-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
    .theme-bar {
        position: absolute;
        top: 0;
        right: calc(var(--bs-gutter-x) * 0.5);
        margin: 0;
    }
}

.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.25rem;
    padding: 0.3rem 0.5rem 0.3rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
}

.theme-switch:hover {
    background: rgba(255, 255, 255, 0.18);
}

.theme-switch:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* The track and knob: knob on the left and hollow = off; on the right on
   a mint track = on (position shows it, not just color) */
.theme-switch-track {
    position: relative;
    flex: none;
    width: 2.4rem;
    height: 1.35rem;
    border: 2px solid #fff;
    border-radius: 999px;
}

.theme-switch-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(1.35rem - 8px);
    height: calc(1.35rem - 8px);
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.theme-switch[aria-checked="true"] .theme-switch-track {
    border-color: var(--mint);
    background: var(--mint);
}

.theme-switch[aria-checked="true"] .theme-switch-knob {
    background: var(--navy);
    transform: translateX(1.05rem);
}

/* ========== SURFACES ========== */
.main {
    position: relative;
    /* cards float over the hero */
    margin-top: -2.5rem;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .surface {
        padding: 2rem;
    }
}

.section-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--heading);
}

.subsection-title {
    margin: 1.5rem 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading);
}

/* ========== HOW PAY WORKS + RATES ========== */
.info-copy p {
    /* Keeps lines to a comfortable reading length on wide screens */
    max-width: 48rem;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 0.75rem;
    text-wrap: pretty;
}

/* Parity pay and hourly pay side by side, stacked when there isn't room.
   min(16rem, 100%) stops them overflowing on very narrow screens. They span
   the full card, lining up with the rates table below; each box is still
   narrow enough for a comfortable line length. */
.pay-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
    gap: 1rem;
    margin: 0 0 1rem;
}

.pay-method {
    background: var(--subtle-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 0.85rem 1rem;
}

.pay-method dt {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading);
    margin-bottom: 0.25rem;
}

.pay-method dd {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    /* Avoid leaving one word (such as "$19,866.") alone on the last line */
    text-wrap: pretty;
}

.table-note {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* "This is an estimate" note at the bottom of the results panel */
.results-disclaimer {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--muted);
}

.results-disclaimer a {
    color: var(--ink);
}

.rates-table {
    width: 100%;
    margin: 0.75rem 0 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    table-layout: fixed;
    background: var(--surface);
}

.rates-table thead {
    background: var(--navy);
    color: #fff;
}

.rates-table th,
.rates-table td {
    padding: 0.7rem 1rem;
    overflow-wrap: break-word;
    text-align: left;
    font-size: 0.95rem;
}

.rates-table th {
    font-weight: 700;
}

.rates-table td {
    border-top: 1px solid var(--line);
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.rates-table tbody tr:nth-child(even) {
    background: var(--subtle-bg);
}

.rates-table td.rate-label {
    font-weight: 700;
    color: var(--ink);
}

@media (max-width: 768px) {
    .table-responsive {
        overflow-x: visible;
    }

    .rates-table th,
    .rates-table td {
        padding: 0.5rem 0.35rem;
        font-size: 0.85rem;
    }

    .rates-table th {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .rates-table th:first-child,
    .rates-table td:first-child {
        width: 31%;
        padding-left: 0.6rem;
        hyphens: auto;
    }
}

/* ========== FORM ========== */
.calculator {
    margin-top: 1.5rem;
}

.form-step {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--line);
}

.form-step:last-of-type {
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Numbered step headings; the number becomes a check mark when done */
.step-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading);
}

.step-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 1rem;
    transition: background-color 0.25s ease;
}

.step-num .step-check {
    display: none;
}

.step-num.is-done {
    background: var(--green-fill);
    color: var(--on-green);
    animation: pop 0.3s ease-out;
}

.step-num.is-done .step-digit {
    display: none;
}

.step-num.is-done .step-check {
    display: block;
}

.field-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

.field-hint {
    margin: -0.15rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.form-select {
    min-height: 52px;
    border: 2px solid var(--control-border);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    background-color: var(--surface);
    color: var(--ink);
    transition: border-color 0.2s ease;
}

.form-select:hover {
    border-color: var(--heading);
}

.form-select:focus {
    border-color: var(--focus-ring);
    box-shadow: none;
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Status: segmented control built on real radio buttons */
.segmented {
    min-width: 0;
    margin: 0 0 1.5rem;
    padding: 0;
    border: 0;
}

.segmented legend {
    float: none;
    width: auto;
    padding: 0;
}

.segmented-options {
    position: relative;
    display: grid;
    gap: 0.5rem;
}

/* Status buttons: one column, 2 × 2, or 4 across, depending on how much
   room the form has. These measure the form (a container query), not the
   screen, and in rem, so larger text gets fewer columns instead of
   overflowing (WCAG 1.4.4, 1.4.10). */
fieldset.segmented {
    container-type: inline-size;
}

@container (min-width: 17rem) {
    .segmented-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@container (min-width: 34rem) {
    .segmented-options {
        grid-template-columns: repeat(4, 1fr);
    }
}

.segmented-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.segmented-options label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--control-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

@media (max-width: 575.98px) {
    .segmented-options label {
        justify-content: flex-start;
        text-align: left;
        padding-left: 1rem;
    }
}

.segmented-options label:hover {
    border-color: var(--heading);
    background: var(--subtle-bg);
}

/* Selected: filled navy plus a check mark, so it isn't shown by color alone */
.segmented-options input:checked+label {
    border-color: var(--fill);
    background: var(--fill);
    color: var(--on-fill);
}

.segmented-options input:checked+label::before {
    content: "";
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    /* Drawn in the label's own text color, so it matches in dark mode */
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
    /* Windows high-contrast mode would otherwise blank the background */
    forced-color-adjust: none;
}

.segmented-options input:focus-visible+label {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* − / + steppers */
.stepper-grid {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 576px) {
    .stepper-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stepper-grid-single {
        grid-template-columns: minmax(0, 16rem);
    }
}

.stepper {
    display: flex;
    flex-direction: column;
}

/* Phones: label on the left, control on the right for the three hourly fields */
@media (max-width: 575.98px) {
    .stepper-grid:not(.stepper-grid-single) {
        gap: 0.9rem;
    }

    .stepper-grid:not(.stepper-grid-single) .stepper {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 1rem;
    }

    .stepper-grid:not(.stepper-grid-single) .field-label,
    .stepper-grid:not(.stepper-grid-single) .field-hint {
        grid-column: 1;
        margin: 0;
    }

    .stepper-grid:not(.stepper-grid-single) .stepper-control {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: 10.5rem;
    }
}

.stepper-control {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 15rem;
    height: 52px;
    margin-top: auto;
    border: 2px solid var(--control-border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.stepper-control:hover {
    border-color: var(--heading);
}

.stepper-control:focus-within {
    border-color: var(--focus-ring);
}

.stepper-btn {
    position: relative;
    flex: none;
    display: grid;
    place-items: center;
    width: 48px;
    padding: 0;
    border: 0;
    background: var(--subtle-bg);
    color: var(--heading);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.stepper-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.stepper-btn:last-child {
    border-radius: 0 8px 8px 0;
}

.stepper-btn:hover {
    background: var(--line);
}

.stepper-btn:active {
    background: var(--pressed);
}

.stepper-btn:focus-visible {
    z-index: 1;
}

.stepper-btn[aria-disabled="true"] {
    color: var(--disabled);
    background: var(--subtle-bg);
    cursor: not-allowed;
}

.stepper-input {
    flex: 1;
    min-width: 0;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: var(--surface);
    color: var(--heading);
    font: inherit;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    appearance: textfield;
    -moz-appearance: textfield;
}

.stepper-input::-webkit-inner-spin-button,
.stepper-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stepper-input:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: -3px;
}

/* Reset */
.form-actions {
    margin-top: 1rem;
}

.btn-reset-small {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--control-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-reset-small:hover {
    background: var(--subtle-bg);
    color: var(--ink);
    border-color: var(--ink);
}

.btn-reset-small svg {
    transition: transform 0.3s ease;
}

.btn-reset-small:hover svg {
    transform: rotate(-180deg);
}

/* ========== RESULTS ========== */
.results-panel {
    margin-top: 1.5rem;
    scroll-margin-top: 1rem;
}

@media (min-width: 992px) {
    .results-panel {
        margin-top: 0;
    }
}

@media (min-width: 992px) and (min-height: 800px) {
    .results-panel {
        position: sticky;
        top: 1.5rem;
    }
}

.results-title:focus {
    outline: none;
}

.results-title:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* The answer: one big number on navy */
.results-hero {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: 12px;
    background:
        radial-gradient(320px 160px at 100% 0%, rgba(16, 185, 129, 0.18), transparent 70%),
        linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #fff;
}

.results-hero.is-empty {
    background: var(--subtle-bg);
    border: 2px dashed var(--control-border);
    color: var(--ink);
}

.results-hero.is-updated {
    animation: glow 0.8s ease-out;
}

.results-hero p {
    margin: 0;
}

.results-empty {
    font-size: 1rem;
    line-height: 1.5;
}

.results-kicker {
    font-size: 1rem;
    color: #e2e8f0;
}

.results-amount {
    margin: 0.2rem 0 0.35rem !important;
    font-size: clamp(2.25rem, 1.6rem + 2.5vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.results-method {
    font-size: 1rem;
    font-weight: 700;
    color: var(--mint);
}

/* Comparison bars (amounts are also given as text in the cards below) */
.results-bars {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.results-bars[hidden] {
    display: none;
}

.bar-row {
    display: grid;
    grid-template-columns: 3.75rem 1fr auto;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.bar-label {
    color: #e2e8f0;
}

.bar-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
}

.bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: #cbd5e1;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-row.is-win .bar-fill {
    background: var(--mint);
}

.bar-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Method cards */
.method-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .method-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.method-card {
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.method-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}

.method-card.is-higher {
    border: 2px solid var(--green);
    background: var(--green-bg);
}

.method-card.is-pending {
    border: 2px dashed var(--control-border);
}

.badge-higher {
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--green-fill);
    color: var(--on-green);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.method-amount {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.method-hint {
    margin: 0.5rem 0 0;
    font-size: 0.95rem;
    color: var(--muted);
}

/* Show the math */
.math {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: var(--ink);
}

.math li {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.15rem 0.75rem;
    padding: 0.4rem 0;
    border-top: 1px dashed var(--control-border);
}

.math-note {
    color: var(--muted);
}

.math-amount {
    margin-left: auto;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.math-footnote {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
}

/* Phone-only bar that keeps the estimate in view */
.results-bar {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 12px;
    background: var(--clark-navy);
    color: #fff;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.15), var(--shadow-lg);
    font: inherit;
    text-align: left;
    animation: slideInUp 0.25s ease-out;
}

.results-bar[hidden] {
    display: none;
}

.results-bar:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
}

.results-bar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.results-bar-label {
    font-size: 0.85rem;
}

.results-bar-amount {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A chip, not an underline: the whole bar is a button, not a link */
.results-bar-cta {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.35rem 0.6rem 0.35rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
    font-weight: 700;
}

@media (min-width: 992px), (max-height: 499.98px) {
    .results-bar {
        display: none !important;
    }
}

/* Leave room for the bar so it never covers the footer or the top button */
body.has-results-bar {
    padding-bottom: 6rem;
}

html.has-results-bar {
    scroll-padding-bottom: 9.5rem;
}

body.has-results-bar .scroll-to-top {
    bottom: calc(5.75rem + env(safe-area-inset-bottom));
}

/* ========== MORE TOOLS (browser extensions) ========== */
.tools {
    margin-top: 3rem;
}

.tools-intro {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

/* Short "what's an extension?" note for people who haven't used one */
.tools-explainer {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--subtle-bg);
}

.tools-explainer-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
}

.tools-explainer p {
    margin: 0 0 0.5rem;
}

.tools-explainer p:last-child {
    margin-bottom: 0;
}

.tools-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .tools-list {
        grid-template-columns: 1fr 1fr;
    }
}

.tool {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 6px 16px rgba(15, 23, 42, 0.08);
}

.tool p {
    margin: 0 0 0.75rem;
}

/* Screenshot of the extension. width/height in the HTML reserve its space,
   so nothing below jumps when it loads. */
.tool-shot {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 1.25rem;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) - 4px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18), 0 2px 5px rgba(15, 23, 42, 0.1);
}

.tool-audience {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tool-name {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading);
}

/* Store links look like small buttons and sit at the bottom of each card */
.tool .tool-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: auto 0 0;
    padding-top: 0.25rem;
}

.tool-links a {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    border: 1px solid var(--control-border);
    border-radius: 999px;
    color: var(--heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.tool-links a:hover {
    border-color: var(--fill);
    background: var(--fill);
    color: var(--on-fill);
}

.tools-more {
    margin: 1.25rem 0 0;
}

.tools-more a {
    color: var(--heading);
    font-weight: 700;
}

/* ========== FOOTER ========== */
/* The extra bottom padding keeps the footer buttons clear of the round
   scroll-to-top button, which sits in the bottom-right corner on phones. */
footer {
    margin-top: 4rem;
    padding: 1rem 1rem 6rem;
    text-align: center;
    color: var(--muted);
}

/* Accessibility statement above the credits */
.footer-a11y {
    max-width: 36rem;
    margin: 0 auto 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    text-wrap: pretty;
}

.footer-a11y a {
    color: var(--ink);
}

footer a.text-dark {
    color: var(--ink) !important;
}

/* "Install as App" and "Report a Bug" sit side by side, and stack on narrow phones */
footer .footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Footer buttons: Bootstrap's gray is only 4.4:1 on this background */
footer .btn-outline-secondary {
    border-color: var(--control-border);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

footer .btn-outline-secondary:hover {
    border-color: var(--fill);
    background: var(--fill);
    color: var(--on-fill);
}

/* Scroll to Top Button */
/* When Tab scrolls the page, stop above the "Back to top" button (30px
   from the bottom + 50px tall) so it doesn't cover what has focus
   (WCAG 2.4.11). With the phone results bar showing, the bigger gap under
   "PHONE RESULTS BAR" applies instead. */
html {
    scroll-padding-bottom: 6rem;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--clark-navy);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
}

.scroll-to-top.show {
    display: flex;
    opacity: 1;
    animation: fadeInUp 0.4s ease-out;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    background: var(--green-text);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
    }
}

/* ========== KEYFRAME ANIMATIONS ========== */
/* The cards deliberately have no entrance animation: they overlap the bottom
   of the navy hero, and sliding them in exposed the hero's edge on load. */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pop {
    0% {
        transform: scale(0.7);
    }

    70% {
        transform: scale(1.12);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
    }

    100% {
        box-shadow: 0 0 0 14px rgba(16, 185, 129, 0);
    }
}

/* Install Modal Styles */
.install-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.install-modal.show {
    display: block;
}

.install-modal-content {
    background-color: var(--surface);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 600px;
    animation: slideUp 0.3s ease;
}

.install-modal-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--clark-navy) 0%, #003a75 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.install-modal-header h3 {
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-modal:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.install-modal-body {
    padding: 2rem;
}

.platform-instructions h4 {
    color: var(--heading);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.platform-instructions ol {
    padding-left: 1.5rem;
    line-height: 1.8;
}

.platform-instructions ol li {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.platform-instructions strong {
    color: var(--heading);
    font-weight: 700;
}

/* "Benefits" box in the install dialog (themed, unlike Bootstrap's bg-light) */
.install-benefits {
    background: var(--subtle-bg);
    color: var(--ink);
}

/* Bootstrap's grey "text-muted" notes in the dialog, in our own muted color
   so they meet contrast in both modes */
.install-modal .text-muted {
    color: var(--muted) !important;
}


@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile adjustments for modal */
@media (max-width: 768px) {
    .install-modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .install-modal-header {
        padding: 1rem;
    }

    .install-modal-header h3 {
        font-size: 1.25rem;
    }

    .install-modal-body {
        padding: 1.5rem;
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .scroll-to-top:hover,
    .btn-reset-small:hover svg {
        transform: none;
    }
}

/* ========== GLOSSARY ("What the terms mean") ========== */
.glossary {
    margin-top: 2rem;
}

.glossary-intro {
    max-width: 48rem;
    margin: 0 0 0.5rem;
}

.glossary-intro a,
.info-copy a {
    color: var(--heading);
}

/* Three groups side by side on wide screens, stacked on phones */
.glossary-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.5rem 2rem;
}

.glossary dl {
    margin: 0.5rem 0 0;
}

.glossary dt {
    margin-top: 0.75rem;
    color: var(--heading);
    font-weight: 700;
}

.glossary dd {
    margin: 0.15rem 0 0;
    line-height: 1.55;
}

/* ========== "WHAT'S THIS?" DEFINITIONS ==========
   Plain-language explanations that open in place (<details>), so the form
   stays short for people who already know the terms. */
.define {
    margin-top: 0.75rem;
    font-size: 0.95rem;
}

.define summary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    /* at least 24px tall to tap (WCAG 2.5.8) */
    min-height: 24px;
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    list-style: none;
}

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

/* Arrow: points right when closed, down when open */
.define summary::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

.define[open] summary::before {
    transform: rotate(45deg);
}

.define summary:hover {
    color: var(--heading);
}

.define summary:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 4px;
}

.define-body {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--subtle-bg);
    line-height: 1.55;
}

.define-body p,
.define-body dl {
    margin: 0 0 0.5rem;
}

.define-body> :last-child {
    margin-bottom: 0;
}

.define-body dt {
    font-weight: 700;
}

.define-body dd {
    margin: 0 0 0.4rem;
}

/* ========== WHAT ONE MORE WOULD ADD ========== */
.whatif {
    margin-top: 1rem;
}

.whatif h3 {
    margin-bottom: 0.4rem;
}

/* On a narrow card the label wraps, rather than pushing the amount onto a
   line of its own */
.whatif .math li>span:first-child {
    flex: 1 1 8rem;
}

/* "New estimate: …" goes on its own line under the row */
.whatif-note {
    flex-basis: 100%;
}

/* ========== HOW YOUR PAY GROWS (chart) ========== */
.growth {
    margin-top: 1rem;
}

.growth-sentence {
    margin: 0.35rem 0 0.6rem;
    font-size: 0.95rem;
    /* Avoid leaving "week." alone on the last line */
    text-wrap: pretty;
}

.growth-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin: 0 0 0.25rem;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--ink);
}

.growth-legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Little line samples matching the chart: solid green, dashed navy */
.growth-swatch {
    width: 1.6rem;
    border-top: 3px solid var(--green);
}

.growth-swatch-hourly {
    border-top: 3px dashed var(--accent);
}

.growth-plot svg {
    display: block;
    max-width: 100%;
    height: auto;
    overflow: visible;
}

.growth-plot text {
    font-family: inherit;
    font-size: 12px;
    fill: var(--muted);
}

.growth-grid {
    stroke: var(--line);
    stroke-width: 1;
}

.growth-parity {
    stroke: var(--green);
    stroke-width: 3;
    stroke-linecap: round;
}

.growth-hourly {
    stroke: var(--accent);
    stroke-width: 3;
    stroke-dasharray: 7 5;
}

.growth-you {
    stroke: var(--muted);
    stroke-width: 1.5;
    stroke-dasharray: 2 3;
}

.growth-plot .growth-you-label {
    font-weight: 700;
    fill: var(--ink);
}

.growth-dot-parity,
.growth-dot-hourly {
    stroke: var(--surface);
    stroke-width: 2;
}

.growth-dot-parity {
    fill: var(--green);
}

.growth-dot-hourly {
    fill: var(--accent);
}

.growth-axis {
    margin: 0;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
}

.growth-table {
    width: 100%;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}

.growth .define-body {
    padding: 0.5rem 0.5rem;
}

.growth-table th,
.growth-table td {
    padding: 0.2rem 0.3rem;
    text-align: right;
}

.growth-table thead th {
    vertical-align: bottom;
}

.growth-table tbody th {
    font-weight: 400;
}

.growth-table tr.is-you {
    font-weight: 700;
}

.growth-table tr.is-you th {
    font-weight: 700;
}

/* ========== COPY LINK ========== */
.share-status {
    flex-basis: 100%;
    margin: 0;
    color: var(--green);
    font-weight: 700;
}

.share-fallback {
    flex-basis: 100%;
}

.share-fallback label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.share-fallback input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--control-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 0.9rem;
}

/* ========== PRINT / SAVE AS PDF ========== */
/* "Print or save as PDF" and "Save as Word document" under the results */
.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--control-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--heading);
    font: inherit;
    font-weight: 700;
}

.btn-print:hover {
    border-color: var(--fill);
    background: var(--fill);
    color: var(--on-fill);
}

/* Only exists on paper (see the @media print rules below) */
.print-only {
    display: none;
}

/* What gets printed: a one-page summary with the person's entries, the
   estimate and the math, in black on white. Everything else is hidden. */
@media print {
    @page {
        margin: 1.5cm;
    }

    html,
    body {
        background: #fff !important;
        color: #000;
        font-size: 11pt;
    }

    /* min-height: 100vh on screen would push a blank second page */
    body {
        min-height: 0;
        padding: 0 !important;
    }

    .hero,
    .info-card,
    #calculator-form,
    .tools,
    .glossary,
    footer,
    .results-bar,
    .scroll-to-top,
    .install-modal,
    .results-actions,
    .results-bars {
        display: none !important;
    }

    .print-only {
        display: block;
    }

    .main {
        margin-top: 0;
    }

    .calculator>div {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .results-panel {
        position: static;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .print-title {
        margin: 0;
        font-size: 18pt;
        font-weight: 700;
    }

    .print-meta {
        margin: 0.25rem 0 1rem;
        color: #333;
        font-size: 9.5pt;
    }

    .print-heading {
        margin: 0 0 0.35rem;
        font-size: 12pt;
        font-weight: 700;
    }

    .print-entries {
        display: grid;
        grid-template-columns: max-content 1fr;
        gap: 0.15rem 1.5rem;
        margin: 0 0 1.25rem;
    }

    .print-entries dt {
        font-weight: 700;
    }

    .print-entries dd {
        margin: 0;
    }

    /* Two pairs per line, so the page still fits on one sheet */
    .print-entries {
        grid-template-columns: max-content 1fr max-content 1fr;
    }

    .method-grid {
        margin-top: 0.75rem;
    }

    .method-card {
        padding: 0.6rem 1rem;
    }

    .math li {
        padding: 0.25rem 0;
    }

    /* The chart is for the screen; the Word document has its summary */
    .growth {
        display: none !important;
    }

    /* "What one more would add": the note sits beside the row on paper */
    .whatif {
        margin-top: 0.75rem;
    }

    .whatif-note {
        flex-basis: auto;
    }

    .results-hero {
        border: 2px solid #000;
        background: #fff !important;
        color: #000 !important;
        animation: none !important;
    }

    .results-hero * {
        color: #000 !important;
    }

    .method-card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    /* The "Higher" tag is white on green on screen; backgrounds don't print */
    .badge-higher {
        border: 1px solid #000;
        background: #fff !important;
        color: #000 !important;
    }

    /* Paper can't be clicked, so print where the contract link goes */
    .results-disclaimer a::after {
        content: " (" attr(href) ")";
        word-break: break-all;
    }
}