/* The Independence Plan. Type scale: 14 / 16 / 20 / 28. Weights: 400 / 600 / 700. Spacing on a 4px grid. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1c2430;      /* 15.5:1 on white */
  --muted: #4b5563;    /* 7.6:1 on white, 7.1:1 on --bg */
  --line: #cfd6df;
  --accent: #1a5fb4;   /* white text on it: 6.4:1 */
  --accent-soft: #eaf1fb;
  --focus: #0b3d7a;
  --off-bg: #d5dce5;
  --off-ink: #3a4452;
  --r: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 0 16px 32px; }

/* header: brand + language */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.brand { font-size: 14px; font-weight: 700; color: var(--ink); }
.lang { display: flex; align-items: center; gap: 0; font-size: 14px; color: var(--muted); flex-shrink: 0; }
.lang button {
  min-height: 48px; min-width: 48px; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font: inherit; color: var(--muted);
}
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* progress ticker */
.progress { margin: 0 0 16px; }
.ticker { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 300ms ease; }

/* card */
main {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 24px 20px; outline: none;
}
main > :first-child { margin-top: 0; }
main > :last-child { margin-bottom: 0; }
h1, h2 { margin: 0 0 12px; line-height: 1.25; font-weight: 700; }
h1:focus { outline: none; }
.t-xl { font-size: 28px; }
.t-lg { font-size: 20px; }
.q2 { margin-top: 32px; }
p { margin: 0 0 16px; }
.small { font-size: 14px; color: var(--muted); }
a { color: var(--accent); text-underline-offset: 2px; }

.benefits { list-style: none; margin: 0 0 20px; padding: 0; }
.benefits li { position: relative; padding-left: 28px; margin-bottom: 12px; }
.benefits li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 12px; height: 6px;
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg);
}
.price { font-size: 20px; font-weight: 700; margin-bottom: 24px; }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px;
  padding: 12px 16px; border: 0; border-radius: 8px; background: var(--accent); color: #fff;
  font: 600 16px/1.25 -apple-system, "Segoe UI", Roboto, sans-serif; text-align: center; text-decoration: none;
  cursor: pointer; margin: 8px 0 12px;
}
.btn:disabled { background: var(--off-bg); color: var(--off-ink); cursor: default; }
.btn[aria-busy="true"] { background: var(--accent); color: #fff; }
.btn-quiet { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }

.choice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px;
  margin: 0 0 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--ink); font: 600 16px/1.35 -apple-system, "Segoe UI", Roboto, sans-serif; text-align: left; cursor: pointer;
}
.choice[aria-pressed="true"] { border: 2px solid var(--accent); padding: 11px 15px; background: var(--accent-soft); }
.choice[aria-pressed="true"]::after {
  content: ""; flex-shrink: 0; width: 12px; height: 6px; margin: 0 4px 4px 0;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.units { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.choice-num { justify-content: center; margin: 0; font-size: 20px; }
.choice-num[aria-pressed="true"]::after { display: none; }
.stack { margin-bottom: 12px; }
.addr { font-weight: 600; padding: 12px 16px; background: var(--bg); border-radius: 8px; }
.total { font-size: 20px; font-weight: 700; margin: 0 0 8px; }

.link {
  min-height: 48px; padding: 0 4px; margin: -12px 0 4px -4px; border: 0; background: none; cursor: pointer;
  font: 400 16px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}
.link:disabled { color: var(--muted); }

.summary { margin: 0 0 16px; }
.summary .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary .row:first-child { padding-top: 0; }
.summary dt { color: var(--muted); flex-shrink: 0; }
.summary dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.pay { font-weight: 600; }
.terms { margin: 0 0 16px; padding-left: 20px; font-size: 14px; color: var(--muted); }
.terms li { margin-bottom: 4px; }

.mark { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-soft); position: relative; margin-bottom: 16px; }
.mark::after {
  content: ""; position: absolute; left: 14px; top: 16px; width: 18px; height: 9px;
  border-left: 3px solid var(--accent); border-bottom: 3px solid var(--accent); transform: rotate(-45deg);
}

.loading { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.spin {
  width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

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

@media (prefers-reduced-motion: reduce) {
  .bar > div { transition: none; }
  .spin { animation: none; border-right-color: currentColor; opacity: .6; }
  html { scroll-behavior: auto; }
}

main > .back { margin-top: -12px; }
