/* NDWS student registration – standalone, no framework */
:root {
  --red: #e8590c; --red-ink: #b84508; --sun: #fbcb79; --ink: #122325; --muted: #5b6475; --line: #e3e6ec;
  --bg: #f5f6f9; --card: #fff; --ok: #1d8a4a; --bad: #c62828; --focus: rgba(232, 89, 12, .18);
  --r: 12px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --head: "Poppins", var(--font);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.wrap { width: min(880px, 100% - 32px); margin-inline: auto; }
.top { background: #fff; border-bottom: 3px solid var(--sun); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.brand img { display: block; height: 42px; width: auto; }
.secure-note { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ok); font-weight: 600; }
.hero { padding: 28px 0 18px; }
.eyebrow { margin: 0 0 4px; color: var(--red); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
h1, h2, legend { font-family: var(--head); }
h1 { margin: 0 0 6px; font-size: clamp(24px, 4vw, 32px); line-height: 1.2; }
.lead { margin: 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.05); }
.reg-form { padding: 8px 28px 24px; }

/* steps */
.stepbar { margin: 0 0 14px; }
.step-meta { display: none; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 3px solid var(--line); cursor: pointer; }
.steps li em { font-style: normal; }
.no-js .steps li { cursor: default; }
.steps li span { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--muted); font-size: 12px; }
.steps li.on { color: var(--ink); border-color: var(--red); }
.steps li.on span { background: var(--red); color: #fff; }
.steps li.ok span { background: var(--ok); color: #fff; }
.steps li.ok { border-color: var(--ok); }
.no-js .steps { display: none; }

fieldset { border: 0; margin: 0; padding: 18px 0 6px; border-bottom: 1px dashed var(--line); }
fieldset:last-of-type { border-bottom: 0; }
legend { font-size: 18px; font-weight: 600; padding: 0; margin-bottom: 14px; }
.js .step { display: none; border-bottom: 0; }
.js .step.on { display: block; animation: in .2s ease; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
label, .label { font-weight: 600; font-size: 14px; }
label b, .label b { color: var(--red); }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd4dd; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px var(--focus); }
.is-invalid, .is-invalid input { border-color: var(--bad) !important; }
.field-error { margin: 0; color: var(--bad); font-size: 13px; font-weight: 500; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
fieldset > .hint { margin-bottom: 14px; }
.prefix { display: flex; }
.prefix span { display: grid; place-items: center; padding: 0 12px; border: 1px solid #cfd4dd; border-right: 0; border-radius: 10px 0 0 10px; background: #f3f4f7; color: var(--muted); font-weight: 600; }
.prefix input { border-radius: 0 10px 10px 0; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: grid; place-items: center; min-height: 46px; border: 1px solid #cfd4dd; border-radius: 10px; cursor: pointer; font-weight: 500; }
.seg input:checked + span { border-color: var(--red); background: #fff3ec; color: var(--red-ink); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: 0 0 0 4px var(--focus); }
.seg.is-invalid span { border-color: var(--bad); }
.pw { position: relative; }
.pw input { padding-right: 68px; }
.pw-toggle { position: absolute; right: 6px; top: 6px; bottom: 6px; border: 0; background: #f3f4f7; border-radius: 8px; padding: 0 10px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--muted); padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.check input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; accent-color: var(--red); }

/* file drop */
.drop { position: relative; display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 12px; border: 1.5px dashed #c3c9d4; border-radius: 12px; background: #fafbfc; cursor: pointer; font-weight: 400; }
.drop:hover { border-color: var(--red); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.drop img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.drop-txt { display: flex; flex-direction: column; min-width: 0; }
.drop-txt strong { color: var(--red); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-txt small { color: var(--muted); }
.drop.has-file { border-style: solid; border-color: var(--ok); background: #f3fbf6; }
.drop.has-file strong { color: var(--ok); }
.drop:focus-within { box-shadow: 0 0 0 4px var(--focus); border-color: var(--red); }

/* buttons / nav */
.nav { display: flex; justify-content: flex-end; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 10px; border: 1px solid transparent; font: 600 15px var(--font); text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-ink); }
.btn-primary[disabled] { opacity: .7; cursor: progress; }
.btn-ghost { background: #fff; border-color: #cfd4dd; color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.js #prev { margin-right: auto; }
.progress { margin-top: 14px; }
.progress span { display: block; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--red) var(--p, 0%), var(--line) var(--p, 0%)); }
.progress small { color: var(--muted); }

.alert { background: #fdecee; border: 1px solid #f5c2c9; color: var(--bad); padding: 12px 16px; border-radius: 10px; margin-bottom: 14px; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* success */
.done-card { padding: 36px 28px; text-align: center; }
.done-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: #e8f6ee; color: var(--ok); font-size: 36px; font-weight: 700; }
.done-card h2 { margin: 0 0 8px; }
.done-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; margin: 18px auto; text-align: left; }
.done-box div { background: #f7f8fa; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.done-box dt { font-size: 12px; color: var(--muted); }
.done-box dd { margin: 0; font-weight: 700; font-family: var(--head); word-break: break-all; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 32px; }

/* phones: compact header, sticky "Step x of 5" bar with segmented progress, sticky bottom buttons */
@media (max-width: 640px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; } /* 16px stops iOS from zooming into fields */
  .wrap { width: calc(100% - 24px); }
  .top-in { padding: 6px 0; }
  .brand img { height: 30px; }
  .secure-note { font-size: 12px; }
  .hero { padding: 16px 2px 10px; }
  .eyebrow { font-size: 12px; }
  h1 { font-size: 22px; margin-bottom: 2px; }
  .lead { font-size: 14px; }
  .js .stepbar { position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 0 -12px 10px; padding: 10px 12px 10px; box-shadow: 0 6px 12px -10px rgba(16,24,40,.25); }
  .js .step-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 14px; }
  .step-meta b { color: var(--red); font-family: var(--head); font-weight: 600; }
  .step-meta span { color: var(--ink); font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .js .steps { gap: 4px; }
  .js .steps li { padding: 0; height: 6px; border: 0; border-radius: 6px; background: var(--line); }
  .js .steps li span, .js .steps li em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .js .steps li.on { background: var(--red); }
  .js .steps li.ok { background: var(--ok); }
  .steps li { flex-direction: column; gap: 4px; font-size: 11px; text-align: center; padding: 8px 2px; }
  .reg-form { padding: 0 14px 0; border-radius: 14px; }
  fieldset { padding-top: 14px; }
  legend { font-size: 17px; margin-bottom: 10px; }
  .js legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* shown in the step bar instead */
  .js fieldset.step { padding-top: 16px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .field { margin-bottom: 14px; }
  input, select { min-height: 50px; }
  .seg span { min-height: 50px; }
  .drop { min-height: 80px; }
  .nav { position: sticky; bottom: 0; z-index: 4; background: #fff; margin: 4px -14px 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-radius: 0 0 14px 14px; box-shadow: 0 -6px 12px -10px rgba(16,24,40,.3); }
  .nav .btn { flex: 1; padding: 0 12px; min-height: 52px; }
  .js #prev { flex: 0 0 34%; margin-right: 0; }
  .progress { padding-bottom: 12px; }
  .alert { font-size: 14px; }
  .done-card { padding: 28px 16px; }
  .done-box { grid-template-columns: 1fr; }
  .foot { font-size: 12px; margin: 14px 0 24px; }
}
@media (prefers-reduced-motion: reduce) { .js .step.on { animation: none; } }
