/* CM Streamlined — styled to match communitymobilizers.com
   Navy #192A4A, cream #F5F3E5, campaign red, campaign blue. Condensed
   uppercase display type over a clean geometric sans, cream cards on navy. */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@600;700&family=Poppins:wght@400;500;600;700&display=swap');

/* display rules on nav/main would otherwise beat the hidden attribute */
[hidden] { display: none !important; }

:root {
  /* ⚠️ THIS DESIGN IS LIGHT-ONLY, AND IT HAS TO SAY SO. Without a
   * `color-scheme`, a browser in OS dark mode renders NATIVE controls with dark
   * chrome while our own CSS keeps painting cream cards underneath them — so a
   * checkbox becomes a dark box on a cream card and a radio's selected dot
   * disappears entirely. The whole progress rail, both tag panels and the Reach
   * yes/no are native checkboxes and radios, so in dark mode the parts of the
   * workspace a fellow actually ticks were the parts that stopped being
   * visible. Text inputs escaped it only because they are painted explicitly
   * (background:#fff) further down. Declaring the scheme fixes every control on
   * every page at once, and costs nothing in light mode. */
  color-scheme: light;
  --navy: #192A4A;
  --navy-deep: #101C34;
  --cream: #F5F3E5;
  --cream-2: #FBFAF3;
  --red: #E23B34;
  --blue: #3070B0;
  --blue-dark: #245A8F;
  --ink: #1B2434;
  --muted: #5C6B80;
  --rule: #DCD8C6;
  --green: #1E7B4F;
  --amber: #B07D1E;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--navy); color: var(--ink); line-height: 1.55;
  font-family: Poppins, "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}
/* ⚠️ THERE WAS NO `a` RULE AT ALL, ANYWHERE. Every link a component did not
 * colour itself fell through to the browser's own #0000EE, and #551A8B once
 * visited — so the tablet's sign-in card, the Blueprint's "open this route"
 * links and the in-page help all rendered default blue for one staffer and
 * purple for the next, on cream cards, in a navy-and-blue brand. Keeping the
 * colour across :visited is the point: a staff tool should not change colour
 * because of where somebody has already been.
 *
 * DECLARED HERE, ABOVE THE COMPONENTS, ON PURPOSE. `a:visited` and
 * `nav.staff a` have the SAME specificity, so whichever comes last would win —
 * put this after them and every visited nav link turns blue on the navy bar.
 * The two places that own their colour (nav.staff a, footer.site a) sit below
 * and keep it. */
a, a:visited { color: var(--blue-dark); }
a:hover { color: var(--blue); }
.display, h1.display, .card h2, header.site h1, .kpi b {
  font-family: Oswald, "Alternate Gothic", Impact, sans-serif;
  text-transform: uppercase; letter-spacing: .01em; font-weight: 700;
}

/* ---------- site chrome ---------- */
header.site {
  background: var(--navy); color: var(--cream);
  padding: 18px 22px; border-bottom: 3px solid rgba(245,243,229,.12);
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
header.site .mark {
  width: 34px; height: 34px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; color: var(--cream); font-weight: 700;
  font-family: Oswald, sans-serif; font-size: 17px; flex: 0 0 auto;
}
header.site h1 { margin: 0; font-size: 22px; line-height: 1.05; }
header.site p { margin: 2px 0 0; font-size: 13.5px; color: #B9C6DA; width: 100%; }

/* hero used on the applicant page */
.hero { background: var(--navy); color: var(--cream); padding: 40px 22px 34px; }
.hero .wrap { max-width: 720px; margin: 0 auto; }
.hero h1 {
  font-family: Oswald, sans-serif; text-transform: uppercase; font-weight: 700;
  font-size: clamp(34px, 7vw, 62px); line-height: .95; margin: 0 0 12px;
}
.hero .pay {
  display: inline-block; background: var(--red); color: var(--cream);
  padding: 7px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  margin: 0 8px 8px 0;
}
.hero .pay.alt { background: var(--blue); }
.hero p.lede { font-size: 17px; color: #D9E2EE; max-width: 560px; margin: 14px 0 0; }

main { max-width: 720px; margin: 0 auto; padding: 26px 16px 60px; }
main.wide { max-width: 1120px; }

/* ---------- cards ---------- */
.card {
  background: var(--cream); border: none; border-radius: 22px;
  padding: 26px 28px; margin-bottom: 20px; box-shadow: 0 6px 22px rgba(0,0,0,.16);
}
.card h2 { margin: 0 0 6px; font-size: 23px; color: var(--navy); }
.card .sub { margin: 0 0 18px; font-size: 14.5px; color: var(--muted); }
.card.tight { padding: 18px 20px; }

/* step cards, like "How it works" */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 22px; }
.step { background: var(--cream); border-radius: 20px; padding: 18px; }
.step .ico { font-size: 22px; line-height: 1; }
.step b { display: block; font-family: Oswald, sans-serif; text-transform: uppercase;
          font-size: 17px; color: var(--navy); margin: 8px 0 4px; }
.step span { font-size: 13.5px; color: var(--muted); }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; color: var(--navy); }
.field .muted { font-weight: 400; color: var(--muted); }
.field-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time],
input[type=number], input[type=password], input:not([type]), select, textarea {
  width: 100%; padding: 13px 14px; font-size: 16px; font-family: inherit;
  border: 1.5px solid var(--rule); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(48,112,176,.16); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.btn {
  background: var(--blue); color: #fff; border: none; border-radius: 999px;
  padding: 14px 26px; font-size: 16px; font-weight: 600; cursor: pointer;
  font-family: Poppins, sans-serif;
}
.btn:hover { background: var(--blue-dark); }
.btn.lg { width: 100%; padding: 16px; font-size: 17px; }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--rule); }
.btn:disabled { opacity: .55; cursor: default; }

.req { color: var(--red); }
.err { color: var(--red); font-size: 14px; margin: 8px 0 0; font-weight: 500; }
.ok { color: var(--green); font-weight: 600; }
.pill {
  display: inline-block; background: #fff; border: 1.5px solid var(--rule);
  border-radius: 999px; padding: 4px 14px; font-size: 13.5px; margin-right: 6px;
}
.banner { background: #fff; border: 1.5px solid var(--rule); border-radius: 14px; padding: 13px 16px; font-size: 14px; margin-bottom: 16px; }
.banner.warn { background: #FDF4E3; border-color: #E9C787; }
.banner.offline { background: #FBE9EB; border-color: #E6A8AF; }

/* ---------- tables / dashboard ---------- */
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th { text-align: left; background: var(--navy); color: var(--cream); padding: 9px 10px; font-weight: 600; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--cream); border-radius: 18px; padding: 16px 18px; }
.kpi b { display: block; font-size: 30px; color: var(--navy); line-height: 1.05; }
.kpi span { font-size: 13px; color: var(--muted); }
.bar { display: flex; height: 16px; border-radius: 6px; overflow: hidden; background: #E7E3D2; }
.bar div { height: 100%; }

/* staff nav */
nav.staff {
  background: var(--navy-deep); padding: 10px 18px; display: flex; gap: 6px;
  align-items: center; flex-wrap: wrap; position: sticky; top: 0; z-index: 30;
}
nav.staff .brand { font-family: Oswald, sans-serif; text-transform: uppercase;
  color: var(--cream); font-size: 15px; margin-right: 12px; }
nav.staff a {
  color: #C7D4E6; text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
}
nav.staff a:hover { background: rgba(255,255,255,.1); }
nav.staff a.active { background: var(--cream); color: var(--navy); }
nav.staff .spacer { flex: 1; }
nav.staff .who { color: #9FB3CC; font-size: 12.5px; margin-right: 10px; }

footer.site { text-align: center; padding: 26px 18px 40px; font-size: 13px; color: #A9B8CD; }
footer.site a { color: var(--cream); }
footer.site p { margin: 4px 0; }

/* rows in the pipeline's attention / payroll / fellow cards */
.person-line {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--rule);
}
.person-line:last-child { border-bottom: 0; }
.person-line > span:first-child { color: var(--navy); font-weight: 600; }
.warn-tag {
  display: inline-block; font-size: 11.5px; font-weight: 500; color: var(--red);
  border: 1px solid #E6A8AF; border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
table.mini { width: 100%; border-collapse: collapse; font-size: 14px; }
table.mini th {
  text-align: left; font-family: 'Oswald', sans-serif; text-transform: uppercase;
  letter-spacing: .04em; font-size: 12.5px;
  /* a navy header bar comes from the shared table styling — keep the text
     readable on it rather than fighting it */
  background: var(--navy); color: var(--cream);
  border-bottom: 0; padding: 8px 10px;
}
table.mini th:first-child { border-radius: 8px 0 0 8px; }
table.mini th:last-child { border-radius: 0 8px 8px 0; }
table.mini td { padding: 8px 10px; }
table.mini td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--rule); color: var(--navy); }
table.mini tr:last-child td { border-bottom: 0; }
table.mini td:not(:first-child), table.mini th:not(:first-child) { text-align: right; }

/* campaign mark */
.hero .logo { display: block; width: 260px; max-width: 62%; height: auto; margin: 0 0 22px; }
@media (max-width: 640px) { .hero .logo { width: 200px; margin-bottom: 16px; } }
nav.staff .brand img { height: 26px; width: auto; display: block; }
nav.staff .brand { display: flex; align-items: center; gap: 12px; }
nav.staff .brand span { font-size: 13px; }
@media (max-width: 760px) { nav.staff .brand span { display: none; } }

/* SMS disclosure — sits with the form, not behind a checkbox */
.consent-note {
  font-size: 12.5px; line-height: 1.55; color: var(--muted);
  background: #FBFAF4; border: 1px solid var(--rule); border-radius: 10px;
  padding: 11px 13px; margin: 4px 0 18px;
}
.consent-note a { color: var(--blue-dark); }

/* a Deputy Director looking at the fellow view */
.preview-note {
  background: #FFF6E0; border: 1.5px solid #E8C97A; color: #6B4E12;
  border-radius: 12px; padding: 10px 14px; margin: 0 0 16px; font-size: 13.5px;
}
.preview-note a { color: #6B4E12; }

/* ---- phones ---------------------------------------------------------- */
/* Wide tables scroll inside their own box; the page itself must never
   scroll sideways, which is what made the dashboard feel broken on a phone. */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tscroll table { min-width: 100%; }

/* clip, not hidden: hidden turns the body into a scroll container, which
   silently kills every position:sticky on the site (the workspace rail, the
   admin nav). clip blocks sideways scroll without doing that; the hidden
   line stays first as the fallback for browsers that don't know clip. */
html, body { max-width: 100%; overflow-x: hidden; overflow-x: clip; }

/* Thumb-sized controls, in OUR blue rather than the browser's. `accent-color`
 * was set on exactly three of them (the public form's registered-voter choice
 * and two on the tablet); every other checkbox and radio in the system — the
 * eight-step progress rail, the interview and training tag sets, the Reach
 * yes/no — took whatever the platform felt like. That is both off-brand and,
 * in dark mode, close to invisible. One rule, every control. */
input[type="checkbox"], input[type="radio"] {
  width: 22px; height: 22px; accent-color: var(--blue);
}

@media (max-width: 760px) {
  main, main.wide { padding-left: 14px; padding-right: 14px; }
  .card { padding: 18px 16px; border-radius: 16px; }
  .hero h1 { font-size: clamp(30px, 9vw, 46px); }
  .hero .wrap { padding-top: 26px; padding-bottom: 26px; }
  .row { grid-template-columns: 1fr; }          /* side-by-side fields stack */
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the staff nav becomes a scrollable strip rather than a wrapped pile */
  nav.staff {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 14px; padding-left: 14px; padding-right: 14px;
  }
  nav.staff a, nav.staff .who { white-space: nowrap; flex: 0 0 auto; }
  nav.staff .spacer { display: none; }
  /* every real control is at least a comfortable thumb tap */
  .btn, .filters button, select, input[type="text"], input[type="email"],
  input[type="tel"], input[type="password"], input[type="date"],
  input[type="time"], input[type="number"], input[type="url"], textarea {
    min-height: 46px;
  }
  footer.site a { display: inline-block; padding: 6px 2px; }
  table.mini th, table.mini td { padding: 8px 8px; }
  /* inside a scrolling box, one line per row reads far better than a
     ragged wrap — the box scrolls, so nothing is lost */
  .tscroll table th, .tscroll table td { white-space: nowrap; }
  .tscroll table td span { white-space: nowrap; }
}

@media (max-width: 420px) {
  .kpis, .steps { grid-template-columns: 1fr; }
}

/* the applicant's reference number on the confirmation screen */
.ref {
  background: #EEF4FB; border: 1.5px solid var(--blue); border-radius: 12px;
  padding: 11px 14px; margin: 0 0 16px; color: var(--navy);
  font-size: 14.5px; font-weight: 600;
}
