/* =============================================================================
   DeWayne's Cloud — customer-facing design kit (starter stylesheet)
   -----------------------------------------------------------------------------
   For PUBLIC, customer-facing cloud apps only (Rewards, Events, ...). Internal /
   staff apps use Sneat instead. Spec: README.md next to this file, and
   Z:\Automations\Source Code\~Core\Docs\Design\2026-10-10-web-design-systems-spec.md §3.

   How to use: copy this file to wwwroot/css/ in the app, link it from _Layout
   (after the Fraunces <link> in README.md), then add app-specific CSS in a SECOND
   file. Do not fork the tokens — change them here (and in the spec) or not at all.

   Served from 'self' so it works under a strict CSP (style-src 'self'): no inline
   <style>, no inline style="" attributes. No Bootstrap / Tailwind on these pages.

   Contents
     1. Tokens (:root)        6. Cards / surfaces       11. Step indicator
     2. Reset + base          7. Buttons                12. Utilities
     3. Typography            8. Form fields            13. Accessibility
     4. Layout shell          9. Alerts                 14. Print
     5. Header + footer      10. Badges                 15. Small screens
   ============================================================================= */


/* ── 1. Tokens ───────────────────────────────────────────────────────────────
   Governing table: spec §3.2. Values below are exact; do not "tune" them.
   Contrast notes are for WCAG 2.2 AA (1.4.3 text 4.5:1, 1.4.11 controls 3:1). */
:root {
    /* Brand */
    --primary: #2B4FB5;        /* royal blue (brand) — white text on it is AA */
    --primary-deep: #1E3A82;   /* deep blue — hover/pressed, focus ring */
    --primary-tint: #E9EDF8;   /* tint / wash backgrounds */

    /* Neutrals */
    --ground: #FAFAF7;         /* off-white page background */
    --surface: #FFFFFF;        /* cards / surfaces */
    --ink: #172033;            /* primary text */
    --ink-soft: #5B6472;       /* secondary text */
    --ink-faint: #6B7280;      /* muted text (~4.8:1 on white). Do not go lighter. */
    --line: #E4E7EF;           /* borders / dividers (decorative only) */
    --field-border: #7A8299;   /* form-field resting border, >=3:1 on white (1.4.11) */

    /* Semantic */
    --save: #1b7a48;           /* savings / success green */
    --bloom: #B23A5E;          /* danger / urgent (white text on it ~5.7:1) */
    --honey: #9A6410;          /* warning (white text on it AA) */

    /* Kit extensions (derived from the above; used by components below) */
    --bloom-deep: #8E2D4A;     /* hover/pressed shade of --bloom */
    --slate: #6B7A70;          /* neutral badge / archived tone */
    --bloom-wash: #F7E9EC;     /* alert-danger background */
    --bloom-edge: #E6C3CC;     /* alert-danger border */
    --bloom-ink: #9A3B54;      /* alert-danger text on --bloom-wash */
    --honey-wash: #FBF3E3;     /* alert-warn background */
    --honey-edge: #EBD3A4;     /* alert-warn border */
    --save-wash: #E8F4EC;      /* alert-success background */
    --save-edge: #BFE0CB;      /* alert-success border */

    /* Shape + depth */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(27,46,34,.05), 0 10px 26px rgba(27,46,34,.06);

    /* Type stacks. Fraunces comes from Google Fonts (README); Georgia is the fallback. */
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --serif: "Fraunces", Georgia, "Times New Roman", serif;

    /* Layout widths: --wrap = marketing / detail pages; --wrap-flow = mobile-first flows (28rem). */
    --wrap: 1080px;
    --wrap-flow: 28rem;
}


/* ── 2. Reset + base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--ground); color: var(--ink); font-family: var(--sans);
    font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased;
    /* Sticky footer: header / main / footer stack, main absorbs spare height. */
    display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
main { flex: 1; }
img, svg { max-width: 100%; }
img { display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }


/* ── 3. Typography ───────────────────────────────────────────────────────────
   Fraunces (via --serif) for headings and the wordmark; system-ui for everything else.
   Type scale (README has the table): h1 clamp(30-46px), h2 24px, h3 19-21px, body 16px,
   lead 18px, small 14px, fine print 12.5-13.5px. */
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0; color: var(--ink); }
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.015em; }
h2 { font-size: 24px; letter-spacing: -.01em; }
h3 { font-size: 20px; }
h4 { font-family: var(--sans); font-size: 16px; }
p { margin: 0 0 1em; }
.lead { color: var(--ink-soft); font-size: 18px; max-width: 60ch; }
.text-soft { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.text-small { font-size: 14px; }
.text-fine { font-size: 12.5px; line-height: 1.45; color: var(--ink-faint); }
.eyebrow { color: var(--primary); font-weight: 600; font-size: 13.5px; }
.serif { font-family: var(--serif); }
.serif-italic { font-family: var(--serif); font-style: italic; font-weight: 500; } /* wordmark accent */
/* Money / savings figures: serif + green. Never use green as the only signal (add text/sign). */
.save { color: var(--save); font-family: var(--serif); font-weight: 600; }
/* Rich text from an editor: wrap long unbreakable runs (pasted URLs) instead of h-scrolling. */
.prose { font-size: 17px; line-height: 1.65; overflow-wrap: break-word; }
.prose h2 { font-size: 22px; margin: 18px 0 8px; }
.prose h3 { font-size: 19px; margin: 16px 0 6px; }


/* ── 4. Layout shell ─────────────────────────────────────────────────────────
   Header -> max-width shell -> footer. Two shell widths:
     .wrap        1080px  marketing / listing / detail pages
     .wrap--flow  28rem   single-column mobile flows (signup, receipt, verify)  */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap--flow { max-width: var(--wrap-flow); padding: 24px 20px 72px; }
.section { padding: 40px 0; }
.intro { padding: 48px 0 30px; }
.intro__title { /* use on the h1 */ }
.intro__lead { color: var(--ink-soft); font-size: 18px; margin-top: 10px; max-width: 60ch; }
/* Responsive card grid. min(300px,100%) stops one card exceeding a narrow phone (no h-scroll). */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 26px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }


/* ── 5. Header + footer ──────────────────────────────────────────────────── */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead__inner {
    max-width: var(--wrap); margin: 0 auto; padding: 0 24px; height: 68px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--primary); }
.brand:hover { text-decoration: none; }
.brand__logo { height: 46px; width: auto; display: block; }   /* DeWayne's logo; always give the <img> alt text */
.brand__name { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 23px; color: var(--primary); }
.masthead__nav { display: flex; align-items: center; gap: 20px; }
.masthead__link { color: var(--ink-soft); font-size: 14px; font-weight: 500; }

.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__brand { text-align: center; padding: 26px 24px 0; }
.footer__brand img { height: 48px; width: auto; display: inline-block; }
.footer__inner {
    max-width: var(--wrap); margin: 0 auto; padding: 12px 24px 26px; color: var(--ink-faint);
    font-size: 13.5px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.footer__dot { color: var(--line); }


/* ── 6. Cards / surfaces ─────────────────────────────────────────────────── */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__title { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); }
.card__meta { color: var(--ink-soft); font-size: 14px; }
/* Opt-in lift for clickable cards (<a class="card card--link">). Disabled by reduced-motion below. */
.card--link { color: inherit; transition: transform .14s ease, box-shadow .14s ease; }
.card--link:hover {
    text-decoration: none; transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(27,46,34,.06), 0 18px 36px rgba(27,46,34,.10);
}
/* Padded centered card for flows (form, confirmation) inside .wrap--flow. */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 26px 30px; }
/* Quiet inline surface (no shadow): notes, summaries, list rows. */
.well { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.well--tint { background: var(--primary-tint); border-color: transparent; color: var(--primary-deep); }
.well--ground { background: var(--ground); }
/* Confirmation mark: round tinted badge with a glyph (check) inside. */
.donemark {
    width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
    background: var(--primary-tint); color: var(--primary); font-size: 30px;
    display: flex; align-items: center; justify-content: center;
}
.donemark--save { background: var(--save-wash); color: var(--save); }


/* ── 7. Buttons ──────────────────────────────────────────────────────────────
   Pill CTA. 44px+ tap height at default size. Use <button>/<a>, never a div.        */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--sans); font-weight: 600; font-size: 15px; line-height: 1.2;
    min-height: 44px; padding: 11px 20px; border-radius: 999px;
    border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-deep); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn--secondary:hover { background: var(--primary-tint); color: var(--primary-deep); border-color: var(--primary-deep); }
.btn--danger { background: var(--bloom); color: #fff; }
.btn--danger:hover { background: var(--bloom-deep); color: #fff; }
.btn--danger-ghost { background: var(--surface); color: var(--bloom); border-color: var(--bloom); }
.btn--danger-ghost:hover { background: var(--bloom-wash); color: var(--bloom-deep); border-color: var(--bloom-deep); }
.btn--sm { min-height: 36px; padding: 8px 15px; font-size: 14px; }
.btn--block { display: flex; width: 100%; margin-top: 4px; }
/* Disabled / unavailable. Dim the control only, never the surrounding informational text. */
.btn:disabled, .btn[aria-disabled="true"] {
    background: var(--ground); color: var(--ink-faint); border-color: var(--line); cursor: not-allowed;
}
/* Quiet text-style action (resend, change, back). */
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-soft); font-size: 14px; text-decoration: underline; cursor: pointer; }


/* ── 8. Form fields ──────────────────────────────────────────────────────────
   Pattern: <div class="fld"><label class="fld__label" for="x">..</label>
            <input class="fld__input" id="x" ...><p class="fld__error" id="x-err">..</p></div>
   Always a real <label for>. Link errors with aria-describedby + aria-invalid. 16px input
   text prevents iOS zoom-on-focus.                                                      */
.fld { margin-bottom: 16px; }
.fld__label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.fld__opt { color: var(--ink-faint); font-weight: 400; }
.fld__hint { color: var(--ink-soft); font-size: 13.5px; margin: 6px 0 0; }
.fld__input {
    width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--field-border); border-radius: var(--radius-sm); padding: 12px 13px;
}
.fld__input::placeholder { color: var(--ink-faint); }
.fld__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
.fld__input[aria-invalid="true"] { border-color: var(--bloom); }
.fld__input:disabled { background: var(--ground); color: var(--ink-faint); cursor: not-allowed; }
textarea.fld__input { min-height: 96px; resize: vertical; }
/* One-time-code entry: big, centered, tracked-out. */
.fld__input--code { font-size: 26px; letter-spacing: .35em; text-align: center; font-weight: 600; }
/* Native <select> restyled to match, with a chevron in brand ink. */
.fld__select {
    appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23172033' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
}
.fld__error { color: var(--bloom-ink); font-size: 14px; margin: 6px 0 0; }   /* WCAG 3.3.1 / 4.1.3 */
/* Checkbox / radio row: tap-sized (>=44px) full-width target. */
.choice {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    margin-bottom: 8px; cursor: pointer;
}
.choice input { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
fieldset.fld { border: 0; padding: 0; min-width: 0; }
fieldset.fld legend { padding: 0 0 8px; font-weight: 600; font-size: 14px; }


/* ── 9. Alerts ───────────────────────────────────────────────────────────────
   Use role="alert" (errors, announced immediately) or role="status" (info/success).
   Always pair color with text; never color alone.                                       */
.alert { border: 1px solid transparent; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14.5px; margin-bottom: 18px; }
.alert--bloom { background: var(--bloom-wash); color: var(--bloom-ink); border-color: var(--bloom-edge); }   /* error / urgent */
.alert--honey { background: var(--honey-wash); color: var(--honey); border-color: var(--honey-edge); }      /* warning */
.alert--save  { background: var(--save-wash);  color: var(--save);  border-color: var(--save-edge); }       /* success */
.alert--info  { background: var(--primary-tint); color: var(--primary-deep); }                              /* neutral info */


/* ── 10. Badges ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--slate);
}
.badge--primary { background: var(--primary); }
.badge--bloom { background: var(--bloom); }
.badge--honey { background: var(--honey); }
.badge--save { background: var(--save); }


/* ── 11. Step indicator ──────────────────────────────────────────────────────
   Plain-text "Step 2 of 3" (preferred, accessible by default) + optional progress dots.
   Markup:  <p class="steps">Step 2 of 3</p>
            <ol class="stepdots" aria-label="Progress"><li class="is-done">..</li>
              <li class="is-current" aria-current="step">..</li><li>..</li></ol>        */
.steps { color: var(--ink-soft); font-size: 13.5px; font-weight: 600; margin: 0 0 14px; }
.stepdots { list-style: none; display: flex; gap: 8px; margin: 0 0 18px; padding: 0; }
.stepdots li { flex: 1; height: 6px; border-radius: 999px; background: var(--line); font-size: 0; }  /* text kept for screen readers */
.stepdots li.is-done { background: var(--primary); }
.stepdots li.is-current { background: var(--primary-deep); }


/* ── 12. Utilities ───────────────────────────────────────────────────────── */
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.empty { text-align: center; padding: 80px 24px; color: var(--ink-soft); }
.empty__title { font-family: var(--serif); font-size: 26px; margin-bottom: 8px; color: var(--ink); }
/* Visually hidden but available to screen readers. */
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}


/* ── 13. Accessibility ───────────────────────────────────────────────────────
   WCAG 2.2 AA is the bar: contrast (tokens above), visible focus, skip link, tap targets,
   reduced motion. Never remove focus rings; never `outline: none` without a replacement. */

/* Skip link: first focusable element in <body>; targets <main id="main" tabindex="-1">. (2.4.1) */
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 1000;
    background: var(--primary-deep); color: #fff; font-weight: 600; font-size: 14px;
    padding: 10px 16px; border-radius: var(--radius-sm); transition: top .12s ease;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; text-decoration: none; color: #fff; }

/* Visible keyboard focus on every interactive control (2.4.7). --primary-deep is >=3:1 vs the
   page and card surfaces. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.card--link:focus-visible,
.linkbtn:focus-visible {
    outline: 3px solid var(--primary-deep);
    outline-offset: 2px;
}
/* Programmatic focus target (skip link) shouldn't paint a ring around the whole region. */
main:focus { outline: none; }

/* Honor reduced motion: drop the card lift and neutralise transitions/animations. */
@media (prefers-reduced-motion: reduce) {
    .card--link { transition: none; }
    .card--link:hover { transform: none; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}


/* ── 14. Print ───────────────────────────────────────────────────────────── */
@media print {
    .masthead, .footer, .skip-link, .no-print { display: none !important; }
    body { background: #fff; }
    main { flex: none; }
    .card, .panel { box-shadow: none; break-inside: avoid; page-break-inside: avoid; }
}


/* ── 15. Small screens ───────────────────────────────────────────────────── */
@media (max-width: 640px) {
    /* Reclaim edge space and trim desktop-sized vertical padding on phones. */
    .masthead__inner, .wrap, .footer__inner { padding-left: 16px; padding-right: 16px; }
    .intro { padding-top: 28px; padding-bottom: 22px; }
    .masthead__inner { height: 60px; }
    .brand__logo { height: 38px; }
    .brand__name { font-size: 19px; }
    .masthead__nav { gap: 14px; }
    .grid { gap: 18px; }
    .panel { padding: 22px 20px 26px; }
}
