/* Fonts copied from the PVIS website (Latin subset). SIL Open Font License 1.1. */
@font-face { font-family: 'DM Sans'; font-weight: 100 1000; font-display: swap; src: url(assets/dm-sans-normal-3.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 100 900; font-display: swap; src: url(assets/montserrat-normal-4.woff2) format('woff2'); }

/* Colors follow the printed form's cover and the PVIS website. */
:root {
  color-scheme: light;
  --navy: #1c2b55;
  --sky: #4fbbdf;
  --sky-deep: #1a6f92;
  --sky-soft: #e8f5fa;
  --paper: #f8f8f8; /* the cover art's own background, so the two meet without a seam */
  --white: #fff;
  --ink: #2a3553;
  --muted: #5c6780;
  --line: #d5dbe5;
  --error: #b3261e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 'DM Sans', system-ui, sans-serif; }
h1, h2, h3 { font-family: 'Montserrat', system-ui, sans-serif; color: var(--navy); }
h1 { font-weight: 400; font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.4rem); line-height: 1.2; margin: 0 0 .5rem; }
h1:focus { outline: none; }
a { color: var(--sky-deep); }
.nowrap { white-space: nowrap; }

.shell { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 100vh; }
.pane { padding: 2rem clamp(1rem, 5vw, 5rem) 2rem; width: 100%; max-width: 46rem; margin-inline: auto; display: flex; flex-direction: column; }
#app { flex: 1; }
.art { position: sticky; top: 0; height: 100vh; }
.art img { display: block; height: 100vh; width: auto; mask-image: linear-gradient(to right, transparent, #000 18%); }
@media (max-width: 960px) { .shell { grid-template-columns: minmax(0, 1fr); } .art { display: none; } }

.brand img { display: block; width: 8.5rem; height: auto; margin-bottom: 2rem; }
.foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }

/* welcome */
.cover-title { margin: 0 0 1.75rem; font-weight: 300; }
.cover-title span { display: block; text-transform: uppercase; }
.cover-small { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem); letter-spacing: .12em; line-height: 1.3; }
.cover-big { font-size: clamp(3rem, 2.2rem + 4vw, 4.75rem); line-height: 1.08; letter-spacing: .02em; }
.cover-big.sky { color: var(--sky); }
.sky-text { color: var(--sky-deep); }
.lede { font-size: 1.15rem; color: var(--navy); margin: 0 0 .75rem; }
.handy { margin: 1.5rem 0; padding: 1rem 1.25rem; background: var(--sky-soft); border-radius: .75rem; }
.handy h2 { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 .5rem; }
.handy ul { margin: 0; padding-left: 1.15rem; }
.note { color: var(--muted); font-size: .95rem; }

/* progress */
.progress { list-style: none; display: flex; gap: .35rem; padding: 0; margin: 0 0 1.5rem; }
.seg { flex: 1; height: .3rem; border-radius: 1rem; background: var(--line); }
.seg.done { background: var(--navy); }
.seg.now { background: var(--sky); }
.eyebrow { font: 600 .78rem/1.4 'Montserrat', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--sky-deep); margin: 0 0 .4rem; }
.intro { color: var(--muted); margin: 0 0 1.75rem; overflow-wrap: anywhere; }

/* fields */
.field { margin-bottom: 1.5rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 500; color: var(--navy); margin-bottom: .35rem; padding: 0; }
.req { font-weight: 400; color: var(--muted); font-size: .85rem; }
.hint { color: var(--muted); font-size: .9rem; margin: -.15rem 0 .45rem; }
input[type=text], input[type=email], input[type=tel], input[type=date] {
  display: block; width: 100%; min-height: 3rem; padding: .6rem .8rem;
  font: inherit; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: .5rem;
}
input:focus-visible, button:focus-visible, .choice:has(input:focus-visible), .state:has(input:focus-visible), .unit label:has(input:focus-visible) {
  outline: 2px solid var(--sky-deep); outline-offset: 2px;
}
input[aria-invalid=true] { border-color: var(--error); }
.error { color: var(--error); font-size: .9rem; margin: .35rem 0 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.choices { display: grid; gap: .5rem; }
.choices.two-up { grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); }
.choice {
  display: flex; align-items: center; gap: .65rem; min-height: 3rem; margin: 0; padding: .55rem .85rem;
  font-weight: 400; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: .5rem; cursor: pointer;
}
.choice input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--navy); }
.choice:hover { border-color: var(--sky-deep); }
.choice:has(input:checked) { background: var(--sky-soft); border-color: var(--navy); color: var(--navy); }

.benefit-item { display: grid; gap: .35rem; }
.carrier-pick { margin-left: 1.5rem; background: var(--white); border: 1px solid var(--line); border-radius: .5rem; }
.carrier-pick summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 2.75rem; padding: .45rem .85rem; color: var(--navy); cursor: pointer; list-style: none; border-radius: .5rem; }
.carrier-pick summary::-webkit-details-marker { display: none; }
.carrier-pick summary::after { content: ''; flex: none; width: .55rem; height: .55rem; margin-right: .15rem; border-right: 2px solid var(--sky-deep); border-bottom: 2px solid var(--sky-deep); transform: translateY(-.15rem) rotate(45deg); }
.carrier-pick[open] summary::after { transform: translateY(.1rem) rotate(225deg); }
.carrier-pick summary:focus-visible { outline: 2px solid var(--sky-deep); outline-offset: 2px; }
.carrier-summary-wrap { min-width: 0; }
.carrier-summary { font-size: .95rem; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.carrier-panel { padding: .25rem .85rem .75rem; border-top: 1px solid var(--line); }
.carrier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); column-gap: .75rem; }
.carrier-option { display: flex; align-items: center; gap: .6rem; min-height: 2.5rem; margin: 0; font-weight: 400; color: var(--ink); cursor: pointer; }
.carrier-option input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--navy); }
.carrier-option:has(input:focus-visible) { outline: 2px solid var(--sky-deep); outline-offset: 2px; }
.carrier-other { margin-top: .5rem; }
@media (max-width: 520px) { .carrier-pick { margin-left: 0; } }

.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr)); gap: .35rem; }
.state { position: relative; margin: 0; font-weight: 400; cursor: pointer; border-radius: .4rem; }
.state input, .unit input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.state span { display: block; padding: .55rem 0; text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: .4rem; }
.state input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }

.contrib legend { font-family: 'Montserrat', sans-serif; font-weight: 500; margin-bottom: .6rem; }
.contrib-card { padding: .9rem 1rem; margin-bottom: .6rem; background: var(--white); border: 1px solid var(--line); border-radius: .6rem; }
.contrib-card h3 { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
.contrib-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr); align-items: center; column-gap: .75rem; padding: .25rem 0; }
.contrib-row .error { grid-column: 2; }
.who { color: var(--ink); font-size: .95rem; }
.amount { display: flex; gap: .4rem; }
.amount input[type=text] { min-height: 2.75rem; min-width: 0; }
.unit { display: flex; flex: none; border: 1px solid var(--line); border-radius: .5rem; overflow: hidden; }
.unit label { position: relative; margin: 0; }
.unit span { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 100%; min-height: 2.75rem; font-weight: 500; background: var(--white); color: var(--muted); }
.unit input:checked + span { background: var(--navy); color: var(--white); }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.btn { min-height: 3rem; padding: .6rem 1.5rem; font: 600 .95rem 'Montserrat', sans-serif; border-radius: .5rem; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--navy); color: var(--white); }
.btn.primary:hover { background: #2a3d73; }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--navy); }
.btn.danger { color: var(--error); }
.link { background: none; border: 0; padding: .25rem 0; font: 500 .95rem 'DM Sans', sans-serif; color: var(--sky-deep); text-decoration: underline; cursor: pointer; }

/* review and staff answers */
.review-card { padding: 1rem 1.25rem; margin-bottom: .75rem; background: var(--white); border: 1px solid var(--line); border-radius: .75rem; }
.review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .5rem; }
.review-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .35rem 1rem; margin: 0; font-size: .95rem; }
dt { color: var(--muted); }
dd { margin: 0; color: var(--navy); overflow-wrap: anywhere; }
dd.blank { color: var(--muted); font-style: italic; }
@media (max-width: 520px) {
  dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dd { margin-bottom: .6rem; }
}
.tagline { font: 500 .85rem 'Montserrat', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--sky-deep); }
.thanks .actions { margin: 1.25rem 0 1.75rem; }

/* staff */
.staff-pane { max-width: 52rem; margin-inline: auto; padding: 2rem 1rem; }
.staff-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.setup-steps { margin: 0; padding-left: 1.25rem; }
.setup-steps > li { margin-bottom: 1.5rem; }
.setup-steps form { margin-top: .75rem; }
.qr { display: block; width: 13rem; max-width: 100%; height: auto; margin: .75rem 0; image-rendering: pixelated; border: 1px solid var(--line); border-radius: .5rem; }
.setup-key { margin: 0; font: 600 1rem/1.5 ui-monospace, Consolas, monospace; letter-spacing: .04em; color: var(--navy); overflow-wrap: anywhere; }
.code-input { max-width: 12rem; font-size: 1.25rem; letter-spacing: .15em; }
.staff-links { display: flex; flex: none; gap: 1rem; }
.activity-row { padding: .7rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: .6rem; }
.intake-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.intake-row { display: block; width: 100%; padding: .85rem 1rem; text-align: left; font: inherit; color: inherit; background: var(--white); border: 1px solid var(--line); border-radius: .6rem; cursor: pointer; }
.intake-row:hover { border-color: var(--navy); }
.intake-name { display: block; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }
.intake-meta { display: block; font-size: .9rem; color: var(--muted); }
.tag { display: inline-block; margin-right: .5rem; padding: 0 .5rem; font: 600 .72rem/1.6 'Montserrat', sans-serif; color: var(--navy); background: var(--sky-soft); border-radius: 1rem; vertical-align: .1em; }

@media print {
  .art, .brand, .foot, .no-print, .actions, .progress { display: none !important; }
  body { background: #fff; }
  .shell { display: block; }
  .pane, .staff-pane { max-width: none; padding: 0; }
  .review-card { break-inside: avoid; border-color: #bbb; }
}
