/* ------------------------------------------------------------------ tokens
   Palette: "landline & lamplight" — deep pine petrol for trust, porcelain
   ground, signal amber for the act of verification, plain green/rust verdicts.
   Type: Bricolage Grotesque (display) + Atkinson Hyperlegible (body — designed
   by the Braille Institute for low-vision readers; our most important user
   is a grandparent).                                                        */
:root {
  --pine: #10312F;
  --pine-deep: #0A2422;
  --porcelain: #F3F6F4;
  --card: #FFFFFF;
  --amber: #E9A13B;
  --amber-soft: #FBEED7;
  --green: #2E7D5B;
  --green-soft: #E3F0EA;
  --rust: #BE3A2B;
  --rust-soft: #F9E7E4;
  --muted: #5B7370;
  --line: #D9E3DF;
  --radius: 16px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.55;
  color: var(--pine);
  background: var(--porcelain);
}

/* ------------------------------------------------------------------ layout */
.page { max-width: 620px; margin: 0 auto; padding: 20px 16px 48px; }
.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--pine); color: #fff;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: #fff; text-decoration: none; letter-spacing: -0.01em;
}
.mark { width: 26px; height: 26px; }
.topbar nav { display: flex; align-items: center; gap: 16px; }
.topbar nav a { color: #fff; text-decoration: none; font-weight: 700; }
.topbar nav a:hover { text-decoration: underline; }
.inline { display: inline; }
.linklike {
  background: none; border: none; color: #fff; font: inherit;
  font-weight: 700; cursor: pointer; padding: 0;
}

.foot {
  max-width: 620px; margin: 0 auto; padding: 0 16px 40px;
  color: var(--muted); font-size: 15px;
}
.hotlines strong { color: var(--pine); }

/* ------------------------------------------------------------- urgent banner */
.urgent-banner {
  display: block; text-align: center; text-decoration: none;
  background: var(--amber); color: var(--pine-deep);
  padding: 14px 18px; font-weight: 700; font-size: 19px;
}
.urgent-banner:hover { filter: brightness(1.04); }

.flashes { max-width: 620px; margin: 12px auto 0; padding: 0 16px; }
.flash {
  background: var(--amber-soft); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 12px 16px; margin: 0 0 8px;
}

/* ------------------------------------------------------------------- type */
h1, h2 { font-family: var(--display); letter-spacing: -0.015em; }
.page-title { font-size: 30px; font-weight: 800; margin: 18px 0 12px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px;
  font-weight: 700; color: var(--rust); margin: 0 0 10px;
}
.lede { font-size: 20px; max-width: 34em; }
.lede-small { font-size: 18px; color: var(--muted); margin-top: 0; }
.hint { color: var(--muted); font-weight: 400; font-size: 15px; }
.warn { color: var(--rust); font-weight: 700; }
.alt { margin-top: 18px; }
.code {
  font-family: var(--display); letter-spacing: 0.18em; font-size: 20px;
  background: var(--pine); color: #fff; padding: 3px 10px; border-radius: 8px;
}

/* ------------------------------------------------------------------- hero */
.hero { padding: 44px 0 18px; }
.hero h1 {
  font-size: clamp(38px, 8vw, 58px); font-weight: 800;
  line-height: 1.04; margin: 0 0 18px;
}
.hero-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 26px; }
.btn-quiet { color: var(--pine); font-weight: 700; }
.how, .why { margin-top: 44px; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 14px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin: 18px 0;
}
.card-title { font-size: 21px; font-weight: 700; margin: 0 0 10px; }
.circle-label { font-weight: 700; margin: 14px 0 6px; }

.row-link {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--pine); font-weight: 700;
}
.row-link:last-of-type { border-bottom: none; }
.row-link:hover { background: var(--porcelain); }

.two-forms { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 560px) { .two-forms { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ forms */
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
input {
  font: inherit; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; min-height: 52px;
}
input:focus { outline: 3px solid var(--amber); outline-offset: 1px; border-color: var(--amber); }

.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--pine); color: #fff; border: none;
  border-radius: 12px; padding: 13px 22px; min-height: 52px;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { background: var(--pine-deep); }
.btn-big { font-size: 20px; padding: 16px 28px; min-height: 60px; }
.btn-small { min-height: 40px; padding: 8px 16px; background: var(--amber); color: var(--pine-deep); }
button:focus-visible, a:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ------------------------------------------------------- member tap grid */
.member-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 10px 0 14px; }
.member-btn {
  font: inherit; cursor: pointer; text-align: left;
  background: var(--porcelain); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 16px; min-height: 76px;
  display: grid; gap: 2px;
}
.member-btn:hover { border-color: var(--amber); background: var(--amber-soft); }
.member-name { font-weight: 700; font-size: 19px; }
.member-rel { color: var(--muted); font-size: 15px; }
.member-list { list-style: none; padding: 0; margin: 0 0 12px; }
.member-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.member-list li:last-child { border-bottom: none; }
.invite { margin-top: 14px; }

/* ------------------------------------------------ signature: verify ring */
.verify-stage { text-align: center; padding: 26px 0 6px; }
.ring {
  width: 230px; height: 230px; margin: 0 auto 22px;
  border-radius: 50%; display: grid; place-items: center;
  border: 10px solid var(--line); background: var(--card);
}
.ring-inner { display: grid; gap: 6px; padding: 0 24px; }
.ring-word { font-family: var(--display); font-weight: 800; font-size: 26px; }
.ring-sub { color: var(--muted); font-size: 15px; }

.ring-pending { border-color: var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.ring-real { border-color: var(--green); background: var(--green-soft); }
.ring-real .ring-word { color: var(--green); }
.ring-scam { border-color: var(--rust); background: var(--rust-soft); }
.ring-scam .ring-word { color: var(--rust); }
.ring-expired { border-color: var(--muted); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 161, 59, 0.45); }
  50%      { box-shadow: 0 0 0 22px rgba(233, 161, 59, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .ring-pending { animation: none; }
}

.verify-title { font-size: 26px; font-weight: 800; margin: 6px 0 10px; }
.story { color: var(--muted); font-style: italic; max-width: 34em; margin: 0 auto; }

/* -------------------------------------------------------- respond buttons */
.respond-actions { display: grid; gap: 14px; max-width: 420px; margin: 24px auto 0; }
.btn-respond {
  font: inherit; cursor: pointer; border: none; border-radius: 16px;
  padding: 20px; min-height: 84px; color: #fff;
  font-size: 22px; font-weight: 800; font-family: var(--display);
  display: grid; gap: 4px; text-align: center;
}
.btn-respond .sub { font-family: var(--body); font-weight: 400; font-size: 15px; opacity: 0.92; }
.btn-scam { background: var(--rust); }
.btn-scam:hover { filter: brightness(1.08); }
.btn-real { background: var(--green); }
.btn-real:hover { filter: brightness(1.08); }

/* ------------------------------------------------------------- status pills */
.pill {
  font-size: 14px; font-weight: 700; padding: 5px 12px;
  border-radius: 999px; white-space: nowrap;
}
.pill-pending { background: var(--amber-soft); color: #8a5a12; }
.pill-real { background: var(--green-soft); color: var(--green); }
.pill-scam { background: var(--rust-soft); color: var(--rust); }
.pill-expired { background: var(--line); color: var(--muted); }

/* ------------------------------------------------------------- guidance */
.guidance .rules { padding-left: 22px; margin: 0; }
.guidance .rules li { margin-bottom: 12px; }
.guidance.alarm { border-color: var(--rust); background: var(--rust-soft); }

/* ------------------------------------------------------------- safe word */
.reveal {
  font: inherit; font-weight: 800; font-family: var(--display); font-size: 20px;
  cursor: pointer; background: var(--pine); color: #fff; border: none;
  border-radius: 12px; padding: 14px 24px; min-height: 56px; margin: 8px 0 16px;
}
.reveal.revealed { background: var(--amber); color: var(--pine-deep); letter-spacing: 0.04em; }

/* ------------------------------------------------------------- v2 additions */
.member-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.member-row:last-of-type { border-bottom: none; }
.member-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-tiny { min-height: 40px; padding: 6px 12px; font-size: 15px; }
.btn-danger { background: var(--rust-soft); color: var(--rust); }
.add-member {
  display: grid; gap: 12px; margin-top: 18px; padding-top: 18px;
  border-top: 1px solid var(--line);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .add-member { grid-template-columns: 1fr 1fr; }
  .add-member button { grid-column: 1 / -1; justify-self: start; }
}

/* the parent's single screen */
.member-body { background: var(--porcelain); }
.member-main {
  max-width: 480px; margin: 0 auto; padding: 34px 18px 48px; text-align: center;
}
.member-title {
  font-family: var(--display); font-weight: 800;
  font-size: 32px; margin: 8px 0 6px; letter-spacing: -0.015em;
}
.member-sub { font-size: 20px; color: var(--muted); margin: 0 0 26px; }
.member-foot { color: var(--muted); margin-top: 30px; font-size: 17px; }

.faces { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 400px) { .faces { grid-template-columns: 1fr 1fr; } }
.face-btn {
  font: inherit; cursor: pointer; background: var(--card);
  border: 2px solid var(--line); border-radius: 20px;
  padding: 22px 14px; min-height: 150px;
  display: grid; gap: 6px; justify-items: center;
}
.face-btn:hover, .face-btn:focus-visible { border-color: var(--amber); background: var(--amber-soft); }
.face-initial {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--pine); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 30px;
  display: grid; place-items: center;
}
.face-name { font-weight: 700; font-size: 22px; }
.face-rel { color: var(--muted); font-size: 16px; }

.bigrules {
  list-style: none; padding: 0; max-width: 26em; margin: 18px auto 0;
  text-align: left; font-size: 20px;
}
.bigrules li {
  padding: 12px 16px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}

/* dev inbox */
.sms-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.sms-row:last-child { border-bottom: none; }
.sms-body { white-space: pre-wrap; }

/* ------------------------------------------------------------- guided tour */
.tour-backdrop {
  position: fixed; inset: 0; background: rgba(10, 36, 34, 0.55); z-index: 40;
}
.tour-highlight {
  position: relative; z-index: 45;
  box-shadow: 0 0 0 4px var(--amber), 0 0 0 9px rgba(233, 161, 59, 0.35);
}
.tour-pop {
  position: fixed; z-index: 50;
  left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(440px, calc(100vw - 32px));
  background: var(--card); border: 2px solid var(--amber);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: 0 14px 40px rgba(10, 36, 34, 0.35);
}
.tour-pop h3 { font-family: var(--display); font-size: 20px; margin: 4px 0 8px; }
.tour-pop p { margin: 0 0 6px; }
.tour-step-count {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.tour-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: 12px;
}
.tour-actions > div { display: flex; gap: 8px; }
.linkbtn { background: none; border: none; font: inherit; font-weight: 700;
  color: var(--muted); cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--pine); }

/* --------------------------------------------------------- v3 additions */
.story-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; max-width: 40em;
}
.story-line { margin: 0 0 14px; font-size: 19px; }
.story-line:last-child { margin-bottom: 0; }
.story-verdict { color: var(--rust); }
.demo-call { margin-bottom: 22px; text-align: left; }

.progress-steps {
  list-style: none; padding: 0; max-width: 24em; margin: 16px auto 6px;
  text-align: left;
}
.progress-steps .step {
  padding: 8px 0 8px 34px; position: relative; color: var(--muted);
  font-size: 17px;
}
.progress-steps .step::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 2.5px solid var(--line); background: var(--card);
}
.progress-steps .step.done { color: var(--pine); }
.progress-steps .step.done::before {
  content: "✓"; color: #fff; background: var(--green); border-color: var(--green);
  font-size: 12px; font-weight: 700; line-height: 16px; text-align: center;
}
.progress-steps .step:not(.done)::before { animation: pulse 1.6s ease-in-out infinite; }

.pop-in { animation: popin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes popin { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pop-in { animation: none; } }

.a2hs {
  margin-top: 22px; padding: 16px 18px; text-align: left;
  background: var(--amber-soft); border: 1.5px solid var(--amber);
  border-radius: var(--radius);
}
.a2hs p { margin: 0 0 8px; }

/* --------------------------------------------------------- v4 additions */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: hsl(var(--hue, 180), 42%, 34%); color: #fff;
  font-family: var(--display); font-weight: 800; font-size: 19px;
}
.member-btn { grid-template-columns: auto 1fr; align-items: center;
  column-gap: 12px; }
.member-btn .avatar { grid-row: 1 / span 2; }

.verdict-glyph {
  font-size: 54px; font-weight: 800; line-height: 1;
  font-family: var(--display);
}
.ring-real .verdict-glyph { color: var(--green); }
.ring-scam .verdict-glyph { color: var(--rust); }

/* countdown arc: --pct set by polling JS */
.ring-pending { position: relative; }
.ring-pending::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(var(--amber) var(--pct, 100%), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 10px), #000 calc(100% - 9px));
  pointer-events: none;
}

.contact-btns { display: grid; gap: 10px; max-width: 420px; margin: 18px auto 0; }
.contact-btns .btn { width: 100%; font-size: 19px; }

.btn-panic {
  font: inherit; font-family: var(--display); font-weight: 800;
  font-size: 20px; cursor: pointer; width: 100%;
  background: var(--card); color: var(--rust);
  border: 2.5px solid var(--rust); border-radius: 16px;
  padding: 16px; min-height: 60px;
}
.btn-panic:hover { background: var(--rust-soft); }

.member-tools { display: flex; gap: 10px; align-items: center;
  justify-content: center; margin-top: 14px; flex-wrap: wrap; }

body.big-text { font-size: 22px; }
body.big-text .face-name { font-size: 26px; }
body.big-text .member-title { font-size: 38px; }
body.big-text .bigrules { font-size: 24px; }

.qr-backdrop { position: fixed; inset: 0;
  background: rgba(10, 36, 34, 0.55); z-index: 40; }
.qr-pop {
  position: fixed; z-index: 50; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--card); border: 2px solid var(--pine);
  border-radius: var(--radius); padding: 22px; text-align: center;
}
.qr-pop h3 { font-family: var(--display); margin: 0 0 12px; }
#qrBox { display: grid; place-items: center; margin-bottom: 12px; }
#qrBox img, #qrBox canvas { border: 8px solid #fff; }

/* dark mode (#13) */
@media (prefers-color-scheme: dark) {
  :root {
    --pine: #E4EEEB;
    --pine-deep: #F2F7F5;
    --porcelain: #0F1D1B;
    --card: #162926;
    --amber: #E9A13B;
    --amber-soft: #3A2F17;
    --green: #4CAF87;
    --green-soft: #17352A;
    --rust: #E06552;
    --rust-soft: #3A1F1A;
    --muted: #93ABA6;
    --line: #2A403C;
  }
  .topbar { background: #0A1614; }
  input { background: #10201D; color: var(--pine); }
  .btn { background: #2E5F58; }
  .btn:hover { background: #38736A; }
  .reveal { background: #2E5F58; color: #fff; }
  .code { background: #2E5F58; }
  .avatar { filter: brightness(1.15); }
  #qrBox img, #qrBox canvas { border-color: #fff; }
}

/* faq */
.faq-item { max-width: 44em; margin-bottom: 26px; }
.faq-item h3 { font-family: var(--display); font-size: 20px; margin: 0 0 8px; }
.faq-item p { margin: 0; }

/* comparison table + flow + stats (v4.3) */
.compare { border-collapse: collapse; width: 100%; max-width: 640px; margin: 6px 0 26px; }
.compare th, .compare td { border: 1px solid var(--line); padding: 12px 16px; text-align: left; }
.compare th { font-family: var(--display); background: var(--card); font-size: 18px; }
.compare td:first-child { color: var(--muted); }
.compare td:last-child { background: var(--green-soft); }

.flow { max-width: 480px; }
.flow-step {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 14px 16px; font-size: 18px;
}
.flow-arrow { text-align: center; color: var(--amber); font-size: 22px; font-weight: 700; padding: 4px 0; }
.flow-verdict { border-color: var(--rust); background: var(--rust-soft); }

.stats { list-style: none; padding: 0; max-width: 40em; }
.stats li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 19px; }
.stats li:last-child { border-bottom: none; }

/* fridge card (v4.3) */
.fridge-card {
  max-width: 520px; background: #fff; color: #10312F;
  border: 3px solid #10312F; border-radius: 18px; padding: 28px;
}
.fridge-card h2 { font-family: var(--display); font-size: 28px; margin: 0 0 16px; color: #10312F; }
.fridge-card ol { padding-left: 24px; margin: 0; }
.fridge-card li { font-size: 20px; margin-bottom: 16px; color: #10312F; }
.fridge-card li span { font-size: 17px; font-weight: 400; }
.card-number { font-size: 24px; letter-spacing: 0.03em; }
.card-foot { margin: 14px 0 0; font-size: 15px; border-top: 2px dashed #10312F; padding-top: 12px; }

@media print {
  .topbar, .foot, .no-print, .flashes { display: none !important; }
  .page { max-width: none; padding: 0; }
  .fridge-card { border-width: 4px; page-break-inside: avoid; }
  body { background: #fff; }
}
