/* ==========================================================================
   Wakeland Mobility Access Program
   Palette lifted from wakelandhdc.com:
     blue #006892 · orange #E8941A · navy #1B2833 · sand #EDEAE5
   ========================================================================== */

:root {
  --blue:        #006892;
  --blue-dark:   #005074;
  --blue-darker: #003d59;
  --blue-tint:   #e6f0f5;
  --orange:      #E8941A;
  --orange-dark: #c87a0c;
  --orange-tint: #fdf3e3;
  --navy:        #1B2833;
  --navy-soft:   #545E66;
  --sand:        #EDEAE5;
  --sand-deep:   #ded9d1;
  --white:       #ffffff;
  --paper:       #fbfaf8;

  --ink:         #1B2833;
  --ink-muted:   #5c666e;
  --ink-faint:   #8a9299;
  --line:        #dfdcd6;
  --line-soft:   #ebe8e3;

  --green:       #0a7d3e;
  --green-tint:  #e7f4ec;
  --red:         #b3261e;
  --red-tint:    #fbeae9;

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow:    0 1px 2px rgba(27,40,51,.06), 0 4px 16px rgba(27,40,51,.06);
  --shadow-lg: 0 2px 4px rgba(27,40,51,.06), 0 12px 32px rgba(27,40,51,.10);
  --wrap: 1120px;

  --sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.85rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue-dark); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 660px; }
.wrap--mid    { max-width: 860px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- header ---------- */
.masthead {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.masthead__bar {
  display: flex; align-items: center; gap: 24px;
  min-height: 74px; padding: 10px 20px;
  max-width: var(--wrap); margin: 0 auto;
}
.masthead__logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.masthead__logo img { height: 42px; width: auto; display: block; }
.masthead__logo span {
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy-soft); border-left: 2px solid var(--sand-deep);
  padding-left: 12px; line-height: 1.25; max-width: 130px;
}
.masthead__nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.masthead__nav a {
  padding: 9px 13px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: .94rem; color: var(--navy); text-decoration: none;
}
.masthead__nav a:hover { background: var(--sand); }
.masthead__nav a.is-current { color: var(--blue); background: var(--blue-tint); }
.masthead__nav a.btn--primary { color: #fff; background: var(--blue); }
.masthead__nav a.btn--primary:hover { color: #fff; background: var(--blue-dark); }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 12px; font: inherit; font-weight: 600;
  cursor: pointer; color: var(--navy);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .96rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s;
}
.btn--primary   { background: var(--blue); color: #fff; }
.btn--primary:hover   { background: var(--blue-dark); color: #fff; }
.btn--accent    { background: var(--orange); color: #24170a; }
.btn--accent:hover    { background: var(--orange-dark); color: #24170a; }
.btn--ghost     { background: transparent; color: var(--blue); border-color: #c2d4dd; }
.btn--ghost:hover     { background: var(--blue-tint); }
.btn--quiet     { background: var(--sand); color: var(--navy); }
.btn--quiet:hover     { background: var(--sand-deep); color: var(--navy); }
.btn--danger    { background: var(--red); color: #fff; }
.btn--block     { width: 100%; }
.btn--lg        { padding: 14px 28px; font-size: 1.03rem; }
.btn[disabled], .btn--disabled { opacity: .5; pointer-events: none; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue-darker) 55%, var(--blue) 100%);
  color: #fff; padding: 72px 0 80px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -90px; bottom: -110px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,148,26,.22), transparent 68%);
}
.hero__inner { position: relative; z-index: 1; max-width: 680px; }
.hero__eyebrow {
  display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--orange);
  border: 1px solid rgba(232,148,26,.42); border-radius: 100px;
  padding: 6px 14px; margin-bottom: 20px;
}
.hero h1 { color: #fff; margin-bottom: .45em; }
.hero p { font-size: 1.12rem; color: #d3dee5; max-width: 56ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

/* ---------- cards & panels ---------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 18px; }
/* ...but inside a grid the gap already does that job. Left in place, the
   sibling margin pushes every card after the first down inside its own cell,
   so the boxes end up shorter than the first one and their tops no longer
   line up -- the "cards are different sizes" effect. */
.grid > .card + .card { margin-top: 0; }
.card__title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card--flush { padding: 0; overflow: hidden; }

.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-lg);
}

.section { padding: 62px 0; }
.section--sand { background: var(--sand); }
.section__head { max-width: 60ch; margin-bottom: 34px; }
.section__head p { color: var(--ink-muted); font-size: 1.05rem; }

.grid { display: grid; gap: 20px; }
/* min() so a card can never be wider than its column on a narrow phone. */
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
/* Fixed at two: auto-fit fitted three across a wide screen, which turned a
   four-item sequence into 3 + 1 orphan. */
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .grid--2 { grid-template-columns: 1fr; } }

/* ---------- steps ---------- */
/* The number used to be absolutely positioned at the card's top-left with the
   text cleared by padding-left. The responsive `.card { padding: 20px }` reset
   that padding, so on a phone the circle sat on top of the heading. A flex row
   needs no clearance to be kept in sync. */
.step { display: flex; align-items: flex-start; gap: 16px; }
.step__num {
  flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
  line-height: 1;
}
.step__body { min-width: 0; }          /* let long words wrap instead of overflowing */
.step h3 { margin-bottom: .25em; margin-top: 6px; }
.step p { color: var(--ink-muted); margin: 0; }
@media (max-width: 400px) {
  .step { gap: 12px; }
  .step__num { width: 34px; height: 34px; font-size: .95rem; }
  .step h3 { margin-top: 3px; }
}

/* ---------- status / badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  font-size: .8rem; font-weight: 700; letter-spacing: .02em;
}
.badge::before { content: "●"; font-size: .68em; }
.badge--neutral { background: var(--sand); color: var(--navy-soft); }
.badge--pending { background: var(--orange-tint); color: #8a5a05; }
.badge--good    { background: var(--green-tint); color: var(--green); }
.badge--bad     { background: var(--red-tint); color: var(--red); }
.badge--info    { background: var(--blue-tint); color: var(--blue-dark); }

.statusline {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--blue-tint); border-left: 4px solid var(--blue);
}
.statusline--pending { background: var(--orange-tint); border-left-color: var(--orange); }
.statusline--good    { background: var(--green-tint); border-left-color: var(--green); }
.statusline--bad     { background: var(--red-tint);   border-left-color: var(--red); }
.statusline h2 { font-size: 1.15rem; margin: 0 0 4px; }
.statusline p  { margin: 0; color: var(--ink-muted); }

/* ---------- progress rail ---------- */
.rail { display: flex; gap: 4px; margin: 22px 0 6px; }
.rail__seg { flex: 1; height: 6px; border-radius: 3px; background: var(--sand-deep); }
.rail__seg.is-done   { background: var(--blue); }
.rail__seg.is-active { background: var(--orange); }
.rail__labels {
  display: flex; gap: 4px;
  font-size: .78rem; color: var(--ink-faint); font-weight: 600;
}
.rail__labels > span { flex: 1; text-align: center; }

/* ---------- forms ---------- */
.field { margin-bottom: 22px; }
.field__label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .95rem; }
.field__req { color: var(--red); margin-left: 3px; }
.field__help { font-size: .87rem; color: var(--ink-muted); margin: 0 0 8px; }
.field__input {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 1rem;
  color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.field__input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,104,146,.15);
}
.field__input--code {
  font-size: 1.7rem; letter-spacing: .5em; text-align: center;
  font-variant-numeric: tabular-nums; padding: 14px 13px 14px 26px; max-width: 280px;
}
textarea.field__input { resize: vertical; min-height: 92px; }
select.field__input { appearance: none; background-image:
  url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235c666e' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px;
  padding-right: 38px; }

.field__input[aria-invalid="true"] { border-color: var(--red); background: var(--red-tint); }
input[type="checkbox"][aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }
.field__error { color: var(--red); font-size: .88rem; font-weight: 600; margin-top: 6px; }
.field__error ul { margin: 0; padding-left: 18px; }

.choices { display: grid; gap: 8px; margin-top: 4px; }
.choices label {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; background: #fff;
  transition: border-color .12s, background .12s;
}
.choices label:hover { border-color: #b9cad3; background: var(--paper); }
.choices input { margin-top: 4px; accent-color: var(--blue); width: 17px; height: 17px; flex-shrink: 0; }
.choices ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.field__file {
  width: 100%; padding: 10px; border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm); background: var(--paper); font-size: .93rem;
}

.form-actions {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line-soft);
}
.form-actions .spacer { margin-left: auto; }

fieldset.qgroup { border: 0; padding: 0; margin: 0 0 8px; }
.qheading {
  margin: 38px 0 20px; padding-bottom: 10px; border-bottom: 2px solid var(--sand-deep);
  font-size: 1.12rem; font-weight: 700; color: var(--blue-dark);
}
.qheading:first-child { margin-top: 0; }

/* ---------- messages ---------- */
.messages { margin: 22px 0; display: grid; gap: 10px; }
.msg {
  padding: 13px 18px; border-radius: var(--radius-sm); font-weight: 600;
  border-left: 4px solid; font-size: .95rem;
}
.msg--success { background: var(--green-tint); border-color: var(--green); color: #08602f; }
.msg--error   { background: var(--red-tint);   border-color: var(--red);   color: #8f1e17; }
.msg--warning { background: var(--orange-tint);border-color: var(--orange);color: #8a5a05; }
.msg--info    { background: var(--blue-tint);  border-color: var(--blue);  color: var(--blue-dark); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th, table.data td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
table.data th {
  background: var(--sand); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--navy-soft); font-weight: 700;
  border-bottom: 1px solid var(--line);
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--paper); }

.answers dt {
  font-weight: 700; font-size: .87rem; color: var(--navy-soft);
  text-transform: uppercase; letter-spacing: .04em; margin-top: 20px;
}
.answers dd { margin: 4px 0 0; padding-bottom: 14px; border-bottom: 1px solid var(--line-soft); }

/* ---------- pricing ---------- */
.price-card { display: flex; flex-direction: column; height: 100%; }
.price-card__amount {
  font-size: 2.3rem; font-weight: 800; color: var(--navy);
  letter-spacing: -.03em; line-height: 1.05; margin: 8px 0 2px;
}
.price-card__amount small { font-size: .88rem; font-weight: 600; color: var(--ink-muted); letter-spacing: 0; }
.price-card__desc { color: var(--ink-muted); font-size: .95rem; flex: 1; }
.price-card form { margin-top: 18px; }
.qty { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qty label { font-size: .88rem; font-weight: 600; color: var(--ink-muted); }
.qty input { width: 76px; }

/* ---------- footer ---------- */
.footer {
  margin-top: auto; background: var(--navy); color: #b8c4cc;
  padding: 46px 0 30px; font-size: .92rem;
}
.footer a { color: #fff; }
.footer__grid {
  display: grid; gap: 30px; grid-template-columns: 1.6fr 1fr 1fr;
  padding-bottom: 28px; border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer__grid h4 {
  color: #fff; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: 12px;
}
.footer__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer img { height: 40px; margin-bottom: 14px; filter: brightness(0) invert(1); opacity: .95; }
.footer__legal {
  padding-top: 22px; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; font-size: .85rem; color: #8f9da8;
}

/* ---------- auth pages ---------- */
.auth { padding: 54px 0 70px; }
.auth__card { max-width: 470px; margin: 0 auto; }
.auth__head { text-align: center; margin-bottom: 28px; }
.auth__head img { height: 46px; margin-bottom: 18px; }
.auth__alt { text-align: center; margin-top: 22px; font-size: .95rem; color: var(--ink-muted); }

.totp-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--sand); padding: 11px 14px; border-radius: var(--radius-sm);
  word-break: break-all; font-size: .95rem; letter-spacing: .05em; user-select: all;
}
.qr { text-align: center; margin: 22px 0; }
.qr img {
  width: 200px; height: 200px; image-rendering: pixelated;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: #fff;
}

.muted { color: var(--ink-muted); }
.small { font-size: .88rem; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .masthead__nav {
    display: none; width: 100%; flex-direction: column;
    align-items: stretch; padding: 10px 0 4px; gap: 2px;
  }
  .masthead__nav.is-open { display: flex; }
  .masthead__bar { flex-wrap: wrap; }
  .masthead__logo span { display: none; }
  .hero { padding: 52px 0 58px; }
  .panel { padding: 24px 20px; }
  .card { padding: 20px; }
  .section { padding: 44px 0; }
  .form-actions .spacer { margin-left: 0; width: 100%; }
  .form-actions .btn { flex: 1; }
}

@media print {
  .masthead, .footer, .form-actions, .btn { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* --- Agreement document ------------------------------------------------- */
.doc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 34px 38px 30px; max-height: 62vh;
  overflow-y: auto; overscroll-behavior: contain;
}
.doc__head { text-align: center; border-bottom: 1px solid var(--line-soft); padding-bottom: 18px; margin-bottom: 22px; }
.doc__org { font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--blue); margin: 0 0 6px; }
.doc__title { font-size: 1.32rem; margin: 0 0 4px; }
.doc__rev { font-size: .82rem; color: var(--ink-muted); margin: 0; }
.doc__body { font-size: .93rem; line-height: 1.62; color: var(--ink); }
.doc__body h2 { font-size: 1rem; color: var(--blue); margin: 26px 0 8px; }
.doc__body h2:first-child { margin-top: 0; }
.doc__body h3 { font-size: .95rem; margin: 18px 0 6px; }
.doc__body p { margin: 0 0 11px; }
.doc__body ul, .doc__body ol { margin: 0 0 13px; padding-left: 22px; }
.doc__body li { margin-bottom: 5px; }
.doc__body u { text-underline-offset: 3px; }
.doc__initials {
  background: var(--orange-tint); border: 1px solid #f0d4a3; border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 6px 0 18px;
}
.doc__initials .field__label { margin-bottom: 6px; }
.doc__initials .field__input { max-width: 140px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
@media (max-width: 640px) { .doc { padding: 22px 20px; max-height: 56vh; } }

/* --- Signature pad ------------------------------------------------------ */
.sigpad {
  position: relative; margin-top: 16px; background: var(--white);
  border: 2px dashed #b9cad3; border-radius: var(--radius); height: 190px;
  overflow: hidden; touch-action: none;
}
.sigpad.is-signed { border-style: solid; border-color: var(--blue); }
.sigpad__canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.sigpad__baseline {
  position: absolute; left: 26px; right: 26px; bottom: 42px;
  border-bottom: 1px solid var(--sand-deep); pointer-events: none;
}
.sigpad__hint {
  position: absolute; left: 30px; bottom: 16px; margin: 0; pointer-events: none;
  font-size: .82rem; color: var(--ink-faint); letter-spacing: .04em;
}
.sigpad__actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.sigpad__status { font-size: .87rem; color: var(--green); font-weight: 600; }

/* --- Assigned items ----------------------------------------------------- */
.price-card--locked { opacity: .62; }
.price-card__lock {
  display: block; font-size: .84rem; font-weight: 600; color: #8a5a05;
  background: var(--orange-tint); border-radius: var(--radius-sm);
  padding: 9px 11px; margin-top: 14px;
}
.price-card__note { font-size: .84rem; color: var(--ink-muted); margin: 8px 0 0; }

/* --- "Other" write-in, tucked under its choice list ---------------------- */
.field--other {
  margin: -12px 0 22px 14px; padding-left: 14px;
  border-left: 2px solid var(--sand-deep);
}
.field--other .field { margin-bottom: 0; }
.field--other .field__label { font-weight: 600; font-size: .88rem; color: var(--ink-muted); }

/* A choice group is a fieldset, so it needs the browser defaults stripped. */
.field__group { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
.field__group > .field__label { padding: 0; }

/* Dashboard "updated by staff" notice (static/js/dashboard-refresh.js) */
.dash-updated { display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
                justify-content: space-between; margin-bottom: 20px; }
.dash-updated[hidden] { display: none; }
