/* Saturday Academy registration (#162). Mobile-first. One accent (marigold, a Saturday morning)
   marks progress, the picked card and the total; plum marks the waitlist, which is not an error. */
:root {
  --ink: #18233d; --muted: #586379; --paper: #f7f9fc; --surface: #ffffff; --line: #d8dfea;
  --sun: #f5b700; --sun-soft: #fff6d6; --sun-ink: #6b4e00;
  --plum: #6b3fa0; --plum-soft: #f3ecfb; --error: #b42318; --error-soft: #fdecea; --ok: #1e7a46;
  --focus: #1f5fbf; --dock: rgba(247, 249, 252, .94);
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf7; --muted: #a3adc2; --paper: #0f1626; --surface: #172036; --line: #2b3754;
    --sun: #ffc933; --sun-soft: #3a3010; --sun-ink: #ffd666;
    --plum: #c4a3f0; --plum-soft: #2a2140; --error: #ff8a80; --error-soft: #3a1c1c; --ok: #6fd39b;
    --focus: #8ab4ff; --dock: rgba(15, 22, 38, .94);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.5 var(--body); color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h2:focus, .errors:focus { outline: none; }

.banner { background: var(--sun-soft); color: var(--sun-ink); padding: 8px 16px; font-size: .85rem; text-align: center; }
.masthead, main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.masthead { padding-top: 24px; }
.org { margin: 0; color: var(--muted); font-size: .9rem; }
h1 { font: 800 clamp(1.7rem, 6vw, 2.3rem)/1.1 var(--display); letter-spacing: -.02em; margin: 4px 0 20px; }
h2 { font: 700 1.5rem/1.2 var(--display); letter-spacing: -.01em; margin: 2px 0 6px; }
h3 { font: 700 1.1rem/1.3 var(--display); margin: 28px 0 10px; }

/* progress: the five steps as a line that fills with marigold */
#progress ol { --done: 0; list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  position: relative; }
#progress ol::before, #progress ol::after { content: ""; position: absolute; top: 15px; left: 10%; height: 3px; border-radius: 3px; }
#progress ol::before { right: 10%; background: var(--line); }
#progress ol::after { width: calc(80% * var(--done)); background: var(--sun); transition: width .3s ease; }
.pstep { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
  cursor: pointer; position: relative; z-index: 1; color: var(--muted); font-size: .78rem; text-align: center; }
.pstep:disabled { cursor: default; }
.pstep:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.pnum { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 .95rem var(--display);
  background: var(--surface); border: 2px solid var(--line); color: var(--muted); }
.pstep.done .pnum { background: var(--sun); border-color: var(--sun); color: #2a1f00; }
.pstep[aria-current="step"] .pnum { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pstep[aria-current="step"] { color: var(--ink); font-weight: 700; }
.plabel { line-height: 1.2; }
@media (max-width: 479px) { .pstep:not([aria-current]) .plabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

.step-count { margin: 0; color: var(--muted); font-size: .85rem; }
.step-help { margin: 0 0 8px; color: var(--muted); }
.step-body { padding-bottom: 8px; }

/* questions */
.q { margin: 0 0 20px; }
label, legend { display: block; font-weight: 700; margin-bottom: 6px; padding: 0; }
.help { color: var(--muted); font-size: .92rem; margin: -2px 0 8px; }
.req { color: var(--error); }
input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; min-height: 48px; border: 1.5px solid var(--line);
  border-radius: 10px; background: var(--surface); }
input[readonly] { background: var(--paper); color: var(--muted); }
textarea { min-height: 96px; resize: vertical; }
[aria-invalid="true"], [aria-invalid="true"] .card { border-color: var(--error) !important; }
.field-error { color: var(--error); font-size: .92rem; font-weight: 700; margin: 6px 0 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices { display: grid; gap: 8px; }
.choices.grid { grid-template-columns: repeat(2, 1fr); }
.choices.grid .card { gap: 8px; padding: 12px 10px; }
.choices.grid .card-title { overflow-wrap: normal; font-size: .95rem; }
.choices legend, .choices .help { grid-column: 1 / -1; }

/* cards: a native radio inside a label, so arrows, space and screen readers all work */
.card { position: relative; display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 14px 14px 14px 16px; font-weight: 400;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.card input { appearance: none; flex: none; width: 22px; height: 22px; margin: 1px 0 0; border: 2px solid var(--muted); border-radius: 50%;
  background: var(--surface); }
.card input:checked { border: 7px solid var(--ink); }
.card:has(input:checked) { border-color: var(--ink); box-shadow: inset 5px 0 0 var(--sun); }
.card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card input:focus-visible { outline: none; }
.card-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-title { font-weight: 700; overflow-wrap: anywhere; }
.card-sub { font-size: .9rem; color: var(--muted); }
.card.compact { padding: 12px 14px; align-items: center; }
.card.compact .card-title { font-weight: 400; }
.card.compact:has(input:checked) .card-title { font-weight: 700; }
.card.none .card-title { font-weight: 400; color: var(--muted); }
.card.none:has(input:checked) { box-shadow: none; }
.card.is-full .card-sub { color: var(--plum); font-weight: 700; }
.card.is-full:has(input:checked) { border-color: var(--plum); box-shadow: inset 5px 0 0 var(--plum); background: var(--plum-soft); }
.card.is-full input:checked { border-color: var(--plum); }

/* the morning: big hour numerals down the side, classes beside them */
#slots { margin-top: 16px; }
.slot { display: grid; grid-template-columns: 56px 1fr; gap: 0 12px; margin-bottom: 8px; }
.hour { position: relative; padding-top: 4px; text-align: right; }
.hour::after { content: ""; position: absolute; right: -7px; top: 58px; bottom: -8px; width: 2px; background: var(--line); }
.slot:last-child .hour::after { display: none; }
.hour-num { display: block; font: 800 2.6rem/1 var(--display); letter-spacing: -.04em; }
.hour-am { display: block; font: 700 .8rem var(--display); color: var(--muted); }
.cards { display: grid; gap: 8px; padding-bottom: 20px; min-width: 0; }
.cards .help { margin: 0; }
.slot.pk { display: grid; grid-template-columns: 1fr; gap: 8px; }
.slot-legend { font: 700 1.1rem var(--display); margin-bottom: 4px; }
.empty { color: var(--muted); padding: 16px; border: 1.5px dashed var(--line); border-radius: 12px; }

.same { display: flex; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--sun-soft); }
.same input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.same label { margin: 0; font-weight: 700; color: var(--ink); }

/* review */
.review-block { border-top: 1.5px solid var(--line); padding: 4px 0 8px; }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.review-head h3 { margin: 14px 0 8px; }
dl { margin: 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px 16px; }
dt { color: var(--muted); font-size: .92rem; overflow-wrap: anywhere; }
dd { margin: 0; overflow-wrap: anywhere; }
.tag.wait { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--plum-soft); color: var(--plum);
  font-size: .8rem; font-weight: 700; }
.note { background: var(--plum-soft); border-radius: 10px; padding: 12px 14px; margin: 16px 0 0; }
button.link { all: unset; color: var(--focus); font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
button.link:focus-visible { outline: 3px solid var(--focus); border-radius: 4px; }

/* bottom dock: estimate + back/next, pinned on phones */
.dock { position: sticky; bottom: 0; margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--dock); backdrop-filter: blur(8px); border-top: 1.5px solid var(--line); }
.estimate { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 10px; margin-bottom: 10px; }
.estimate-label { grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
.estimate-amount { font: 800 1.6rem/1.1 var(--display); letter-spacing: -.02em; }
.estimate-amount::after { content: ""; display: block; height: 4px; margin-top: 2px; border-radius: 4px; background: var(--sun); }
.estimate-detail { font-size: .9rem; color: var(--muted); }
.nav { display: flex; gap: 10px; }
button, .button { font: 700 1rem var(--body); min-height: 50px; padding: 12px 20px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--ink); color: var(--paper); text-align: center; text-decoration: none; }
.nav button { flex: 1; }
.nav #next { flex: 2; }
button.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
button[disabled] { opacity: .6; cursor: progress; }
.button { display: block; margin: 16px 0; }

.errors { background: var(--error-soft); color: var(--error); padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.errors ul { margin: 0; padding-left: 18px; }
.errors a { color: inherit; font-weight: 700; }
.errors-title { margin: 0 0 4px; font-weight: 700; }

/* result */
.panel { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0; background: var(--surface); }
.panel h3 { margin: 4px 0; }
.due { font-size: 1.1rem; }
.email { border-style: dashed; white-space: pre-wrap; }
.email .tag { color: var(--muted); font-size: .85rem; font-weight: 700; }
.ok { color: var(--ok); } .warn { color: var(--plum); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* skeleton while the model loads (#161) */
.skeleton p { color: var(--muted); }
.skeleton .bar { height: 48px; border-radius: 10px; background: var(--line); opacity: .6; margin: 0 0 16px; animation: pulse 1.2s ease-in-out infinite; }
.skeleton .bar.short { width: 60%; }
@keyframes pulse { 50% { opacity: .3; } }

@media (min-width: 600px) {
  .choices.grid { grid-template-columns: repeat(4, 1fr); }
  .slot { grid-template-columns: 76px 1fr; gap: 0 20px; }
  .hour-num { font-size: 3.4rem; }
  .hour::after { right: -11px; top: 70px; }
  .dock { margin: 24px 0 0; border: 1.5px solid var(--line); border-radius: 16px; bottom: 12px; }
  .estimate { margin-bottom: 0; }
  .dock:has(.estimate:not([hidden])) { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .dock .nav { flex: none; min-width: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton .bar { animation: none; }
  #progress ol::after { transition: none; }
}
