:root {
  --navy: #1B4F72;
  --navy-dark: #143B56;
  --ink: #2C3E50;
  --teal: #1A6A8A;
  --green: #27AE60;
  --green-ink: #1E8449;
  --rule: #AABBCC;
  --line: #E5ECF1;
  --muted: #5D6D7E;
  --tint: #F2F6F9;
  --err: #B03A2E;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* Chrome */
.top {
  position: fixed; inset: 0 0 auto; z-index: 10;
  height: 60px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top img { display: block; height: 30px; width: auto; }
.top a { color: var(--navy); font-weight: 600; font-size: 15px; text-decoration: none; }
.progress { position: fixed; top: 60px; left: 0; z-index: 10; width: 100%; height: 3px; background: var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: var(--green); transition: width .4s ease; }

main {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 96px 24px;
}
.screen { width: 100%; max-width: 620px; animation: in .35s cubic-bezier(.2, .7, .2, 1) both; }
.screen.back { animation-name: in-back; }
@keyframes in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes in-back { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: none; } }

/* Question */
.qn { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: var(--green-ink); font-weight: 700; font-size: 15px; }
.qt { margin: 0; font-size: clamp(22px, 5.2vw, 30px); line-height: 1.3; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.qt:focus { outline: none; }
.req { margin-left: 4px; color: var(--green-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.help { margin: 10px 0 0; font-size: 17px; line-height: 1.5; color: var(--muted); }
.lead { margin: 14px 0 0; font-size: 18px; line-height: 1.55; color: var(--muted); }
.lead a { color: var(--navy); font-weight: 600; white-space: nowrap; }
.field { margin-top: 28px; }
.detail {
  margin: 16px 0 0; padding: 14px 16px;
  font-size: 19px; line-height: 1.45; font-weight: 600; color: var(--navy);
  background: var(--tint); border-left: 3px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0;
}

input {
  width: 100%; padding: 8px 0 10px;
  font: inherit; font-size: clamp(20px, 4.8vw, 26px); color: var(--navy);
  background: transparent; border: 0; border-bottom: 2px solid var(--rule); border-radius: 0;
  outline: none; transition: border-color .2s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder { color: #B6C3CF; }
input:focus { border-bottom-color: var(--navy); }
input[type="date"] { min-height: 52px; }
[aria-invalid="true"] { border-bottom-color: var(--err); }

/* Multi-input screen (address) */
.fields { display: grid; grid-template-columns: 1fr 96px 128px; gap: 20px 16px; }
.sub { display: block; }
.sub span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sub-street_address { grid-column: 1 / -1; }
.fields input { font-size: clamp(18px, 4.4vw, 22px); }

.welcome .hero {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  margin-bottom: 24px; border-radius: 12px; background: var(--tint);
}

.choices { display: grid; gap: 10px; max-width: 360px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; text-align: left; cursor: pointer;
  font: inherit; font-size: 19px; color: var(--navy);
  background: var(--tint); border: 1.5px solid rgba(27, 79, 114, .28); border-radius: var(--radius);
  transition: background .15s, border-color .15s, color .15s;
}
.choice:hover { border-color: var(--navy); }
.choice kbd {
  display: grid; place-items: center; width: 24px; height: 24px; flex: none;
  font: 600 13px/1 var(--font); color: var(--navy);
  background: #fff; border: 1.5px solid rgba(27, 79, 114, .4); border-radius: 4px;
}
.choice.is-on { color: #fff; background: var(--navy); border-color: var(--navy); }
.choice.is-on kbd { color: #fff; background: var(--green); border-color: var(--green); }
.choice.is-on::after { content: "\2713"; margin-left: auto; font-weight: 700; }

.err { min-height: 22px; margin: 10px 0 0; color: var(--err); font-size: 15px; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.btn {
  min-height: 48px; padding: 12px 22px; cursor: pointer;
  font: inherit; font-size: 18px; font-weight: 600; color: #fff;
  background: var(--navy); border: 0; border-radius: var(--radius);
}
.btn:hover { background: var(--navy-dark); }
.btn:disabled { opacity: .6; cursor: progress; }
.hint { font-size: 13px; color: var(--muted); }
.hint b { font-weight: 600; }
.link {
  padding: 6px 4px; cursor: pointer;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--teal);
  background: none; border: 0;
  text-decoration: underline; text-underline-offset: 3px;
}
.btn:focus-visible, .choice:focus-visible, .link:focus-visible, .nav button:focus-visible, .top a:focus-visible {
  outline: 3px solid var(--green); outline-offset: 2px;
}

.nav { position: fixed; right: 20px; bottom: 20px; z-index: 10; display: flex; gap: 2px; }
.nav[hidden] { display: none; }
.nav button { width: 44px; height: 40px; cursor: pointer; font-size: 18px; color: #fff; background: var(--navy); border: 0; }
.nav button:first-child { border-radius: 6px 0 0 6px; }
.nav button:last-child { border-radius: 0 6px 6px 0; }
.nav button:disabled { opacity: .35; cursor: default; }

/* Review */
.review { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.review li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rl { grid-column: 1; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rv { grid-column: 1; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.rv em { color: var(--rule); font-style: normal; }
.review .link { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

/* Status screens */
.status { text-align: center; }
.status .qt { margin-top: 20px; }
.status .lead { max-width: 460px; margin-inline: auto; }
.status .actions { justify-content: center; }
.badge { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto; font-size: 34px; color: #fff; background: var(--green); border-radius: 50%; }
.badge.info { background: var(--navy); }
.spinner { width: 36px; height: 36px; margin: 0 auto; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.preview { position: fixed; left: 12px; bottom: 12px; z-index: 10; padding: 6px 10px; font-size: 12px; color: #6B5300; background: #FFF4D6; border-radius: 6px; }

@media (pointer: coarse) { .hint { display: none; } }
@media (max-width: 560px) {
  main { align-items: flex-start; padding: 100px 20px 96px; }
  .fields { grid-template-columns: 1fr 1fr; }
  .sub-city { grid-column: 1 / -1; }
  .top { padding: 0 16px; }
  .top img { height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .progress > i { transition: none; }
}
