/* COMTEQ Online Enrollment */
:root {
  --navy: #0a1fb3;
  --navy-2: #07158a;
  --gold: #e60000;
  --ink: #1b2430;
  --muted: #5b6676;
  --line: #d9dee6;
  --bg: #f3f5f8;
  --card: #ffffff;
  --ok: #1f7a4d;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }

/* header / footer */
.site-header { background: #fff; border-bottom: 4px solid var(--gold); padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--muted); max-width: 720px; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub { font-size: .8rem; line-height: 1.2; border-left: 1px solid var(--line); padding-left: 12px; }
@media (max-width: 360px) { .brand-sub { display: none; } }
.site-footer { color: var(--muted); font-size: .9rem; text-align: center; padding: 24px 10px 40px; }
.site-footer strong { white-space: nowrap; }
.site-footer .fine { font-size: .8rem; }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; margin: 40px auto; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(16, 24, 40, .08); padding: 20px; }

/* home */
.hero { padding: 12px 0 8px; }
.hero p { color: var(--muted); margin: 0; }
.choices { display: grid; gap: 14px; margin: 18px 0; }
@media (min-width: 640px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius); padding: 22px 20px; border: 2px solid transparent;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .08); border-left: 6px solid var(--gold);
}
.choice:hover, .choice:focus-visible { border-color: var(--navy); border-left-color: var(--gold); outline: none; }
.choice-tag { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.choice-title { font-size: 1.45rem; font-weight: 700; color: var(--navy); }
.choice-meta { color: var(--muted); }
.choice-go { margin-top: 10px; font-weight: 700; color: var(--navy); }
.choice.closed { opacity: .7; border-left-color: var(--line); }
.choice.closed .choice-go { color: var(--muted); }
.info-card { background: #eef1ff; border-radius: var(--radius); padding: 16px 20px; }
.info-card ul { margin: 0; padding-left: 20px; }
.info-card h2 { font-size: 1.05rem; }

/* form page */
.form-title { margin: 4px 0 14px; }
.form-title p { margin: 0; color: var(--muted); font-weight: 600; }
.form-card { padding: 0 0 4px; overflow: hidden; }
.form-card form { padding: 18px 18px 8px; }
.loading { padding: 24px; color: var(--muted); }
.step-head { padding: 14px 18px 0; }
.progress { height: 8px; background: #e7ebf1; border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--navy); transition: width .25s; }
.step-jump {
  margin-top: 10px; width: 100%; font-size: .9rem; color: var(--navy); font-weight: 600;
  border: 1px solid var(--line); background: #f8fafc; border-radius: 8px; padding: 8px 10px;
}
.intro { color: var(--muted); margin-top: -4px; }

.field { margin: 18px 0; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.req { color: var(--bad); }
.opt { color: var(--muted); font-weight: 400; font-size: .85rem; }
.help { color: var(--muted); font-size: .88rem; margin: -2px 0 8px; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=date], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iPhone zoom */
  padding: 12px; border: 1px solid #b9c2cf; border-radius: 10px; background: #fff; color: var(--ink);
  min-height: 48px;
}
input.short { max-width: 220px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(18, 58, 107, .25); border-color: var(--navy); }
input:disabled, select:disabled { background: #eef1f5; color: var(--muted); }
.other-input { margin-top: 10px; }

.options { display: grid; gap: 8px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid #c9d1dc;
  border-radius: 10px; cursor: pointer; background: #fff; min-height: 48px;
}
.option input { margin: 3px 0 0; width: 20px; height: 20px; flex: none; accent-color: var(--navy); }
.option.selected { border-color: var(--navy); background: #eef1ff; box-shadow: inset 0 0 0 1px var(--navy); }
.inline-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; cursor: pointer; }
.inline-check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.inline-check.big { font-weight: 600; }

.has-error input, .has-error select, .has-error .option { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: .9rem; margin: 6px 0 0; font-weight: 600; }
.error-box { background: var(--bad-bg); color: var(--bad); padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.ok-box { background: #e8f5ee; color: var(--ok); padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.note-box { background: #eef3fa; border-left: 4px solid var(--navy); padding: 12px 14px; border-radius: 8px; margin: 14px 0; }
.note-box p { margin: 4px 0; }

.nav {
  display: flex; justify-content: space-between; gap: 10px; margin: 22px -18px 0; padding: 12px 18px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
}
.nav.center { justify-content: center; flex-wrap: wrap; position: static; border: 0; margin: 16px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px;
  border-radius: 10px; border: 1px solid #b9c2cf; background: #fff; color: var(--navy); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.danger { color: var(--bad); border-color: #e4a29b; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: wait; }

/* review */
.review-sec { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.review-sec.has-error { border-color: var(--bad); background: #fffafa; }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.review-head h3 { margin: 0; }
.review-sec dl { margin: 8px 0 0; display: grid; grid-template-columns: 1fr; }
.review-sec dt { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.review-sec dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 640px) {
  .review-sec dl { grid-template-columns: 45% 55%; }
  .review-sec dt, .review-sec dd { margin-top: 6px; }
}
.certify { background: #eef1ff; border-radius: 10px; padding: 14px; margin-top: 18px; }
.certify p { font-size: .9rem; }
.certify.has-error { outline: 2px solid var(--bad); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* finished */
.done { text-align: center; padding: 28px 20px; }
.done-icon {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; font-size: 2.4rem; font-weight: 700;
}
.ref { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); }
.ref strong { font-size: 1.8rem; letter-spacing: .08em; color: var(--navy); background: #eef3fa; padding: 6px 16px; border-radius: 10px; }
.closed-card { text-align: center; }

/* ---------- staff pages ---------- */
.admin-body { background: #eef1f5; }
.topbar { background: var(--navy); color: #fff; padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 600; padding: 6px 2px; }
.topbar a.on { border-bottom: 3px solid var(--gold); }
.topbar .who { margin-left: auto; font-size: .9rem; opacity: .9; }
.admin-wrap { max-width: 1200px; margin: 0 auto; padding: 16px; }
.stack { display: grid; gap: 14px; }
.stack label { display: grid; gap: 6px; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.filters input, .filters select { min-height: 42px; padding: 8px 10px; width: auto; }
.filters input[type=search] { min-width: 220px; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.stat { background: #fff; border-radius: 10px; padding: 10px 14px; min-width: 120px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.stat b { display: block; font-size: 1.4rem; color: var(--navy); }
.stat span { font-size: .8rem; color: var(--muted); }
.table-wrap { overflow-x: auto; background: #fff; border-radius: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th, table.list td { padding: 10px 12px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: top; }
table.list th { background: #f7f9fb; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
table.list tr:hover td { background: #fafbfd; }
table.list td a { font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: #e7ebf1; color: var(--ink); white-space: nowrap; }
.badge.New { background: #fff1cc; color: #7a5300; }
.badge.Reviewed { background: #e0ecff; color: #1d4ed8; }
.badge.Emailed { background: #ede4ff; color: #5b21b6; }
.badge.Called { background: #ede4ff; color: #5b21b6; }
.badge.Complete { background: #dcfce7; color: #166534; }
.badge.Enrolled { background: #166534; color: #fff; }
.badge.Withdrawn, .badge.Duplicate { background: #f1f1f1; color: #777; text-decoration: line-through; }
.badge.warn { background: var(--bad-bg); color: var(--bad); }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 2fr 1fr; } }
.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; color: var(--muted); font-weight: 500; width: 42%; padding: 6px 8px 6px 0; vertical-align: top; font-size: .9rem; }
.kv td { padding: 6px 0; font-weight: 600; overflow-wrap: anywhere; }
.kv tr + tr th, .kv tr + tr td { border-top: 1px solid #f0f2f5; }
.sec-title { margin: 18px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 14px 0; }
.edit-form .field { margin: 12px 0; }
.edit-form .options { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.log { font-size: .85rem; padding-left: 18px; }
.log li { margin-bottom: 6px; }
@media print { .topbar, .no-print { display: none !important; } }

/* footer map pop-up */
.map-btn {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px; vertical-align: 1px;
  font: inherit; font-size: .8rem; font-weight: 700; color: var(--navy); background: #fff;
  border: 1px solid #b9c2cf; border-radius: 99px; cursor: pointer;
}
.map-btn:hover { border-color: var(--navy); }
body.no-scroll { overflow: hidden; }
.map-layer {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.map-layer[hidden], .zoom-layer[hidden] { display: none; }
.map-card {
  width: min(92vw, 440px); max-height: 78vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .3); padding: 14px 16px 12px; text-align: left;
}
.map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.map-head h2 { margin: 0; font-size: 1.1rem; color: var(--ink); }
.map-close {
  width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: #eef1f5;
  font-size: 1.6rem; line-height: 1; color: var(--ink); cursor: pointer;
}
.map-addr { margin: 4px 0 10px; color: var(--muted); font-size: .9rem; }
.map-card figure { margin: 0 0 12px; }
.map-card figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.map-thumb { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #f3f5f8; cursor: zoom-in; }
.map-thumb img { display: block; width: 100%; height: 190px; object-fit: cover; }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; padding: 3px 8px; border-radius: 99px; }
.map-actions { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.zoom-layer {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .8);
  display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out;
}
.zoom-layer img { max-width: 94vw; max-height: 86vh; border-radius: 8px; background: #fff; }
.zoom-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; background: #fff; }
.map-thumb img.top { object-position: center 12%; }

/* statuses */
.badge.st-new { background: #fff1cc; color: #7a5300; }
.badge.st-flagged { background: #fde2e1; color: #b42318; }
.badge.st-for-review { background: #ffedd5; color: #9a3412; }
.badge.st-for-calling { background: #e0f2fe; color: #075985; }
.badge.st-reviewed { background: #e0ecff; color: #1d4ed8; }
.badge.st-emailed, .badge.st-called { background: #ede4ff; color: #5b21b6; }
.badge.st-complete { background: #dcfce7; color: #166534; }
.badge.st-enrolled { background: #166534; color: #fff; }
.badge.st-withdrawn, .badge.st-duplicate { background: #f1f1f1; color: #777; text-decoration: line-through; }
.flag-list { margin: 6px 0 0; padding-left: 18px; color: var(--bad); font-size: .9rem; }
.meter { height: 8px; background: #e7ebf1; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.meter span { display: block; height: 100%; background: var(--navy); }

/* Facebook preview page */
.share-grid { display: grid; gap: 18px; }
@media (min-width: 900px) { .share-grid { grid-template-columns: 1fr 1fr; } }
.fb-preview { border: 1px solid #ccd0d5; border-radius: 8px; overflow: hidden; background: #f0f2f5; max-width: 520px; }
.fb-preview img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; background: #ddd; }
.fb-meta { padding: 8px 12px 10px; display: grid; gap: 2px; }
.fb-meta span { font-size: .75rem; color: #65676b; }
.fb-meta strong { font-size: .95rem; color: #050505; }
.stack label.inline-check { display: flex; font-weight: 600; }
