/* Tiju's Academy — registration app. Brand: Purply Blue structure, accents as marks (yellow → blue → green → red). */
:root {
  --navy: #2E2B70;
  --navy-700: #24215A;
  --navy-50: #EEEDF7;
  --yellow: #F3D011;
  --blue: #01A1E4;
  --green: #77DD77;
  --red: #FF0D00;

  --ink: #1B1935;
  --body: #3C3956;
  --muted: #75728C;
  --rule: #E3E1EE;
  --tint: #F5F4FA;
  --field-border: #D3D0E2;

  /* Text-safe derivatives of the accents (the raw accents are too light for small text on white). */
  --link: #00709F;
  --danger: #C20B00;
  --success-ink: #1C6B2E;

  --font-display: "Montserrat", "Gilroy", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27, 25, 53, .05), 0 10px 30px rgba(27, 25, 53, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--body);
  background: var(--tint);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--navy); margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); }

/* ---------- Four-dot motif ---------- */
.dots { display: inline-flex; align-items: center; gap: .26em; font-size: 10px; flex: none; }
.dots i { display: block; border-radius: 50%; }
.dots i:nth-child(1) { width: .32em; height: .32em; background: var(--yellow); }
.dots i:nth-child(2) { width: .44em; height: .44em; background: var(--blue); }
.dots i:nth-child(3) { width: .56em; height: .56em; background: var(--green); }
.dots i:nth-child(4) { width: .72em; height: .72em; background: var(--red); }
.dots--hero { font-size: 26px; margin-top: 20px; }
.dots--title { font-size: 14px; }
.dots--empty { font-size: 34px; margin-bottom: 12px; }

/* ---------- Header / hero / footer ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--rule); }
.site-header__inner { max-width: 880px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand__logo { display: block; height: 48px; width: auto; }
.site-header__meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--muted); line-height: 1.35; }
.site-header__meta strong { font-family: var(--font-display); font-weight: 600; color: var(--ink); font-size: 13px; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.hero { background: var(--navy); color: #fff; padding: 44px 0 96px; }
.hero--short { padding-bottom: 92px; }
.kicker { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 10px; }
.kicker--dark { color: var(--muted); }
.hero h1 { color: #fff; font-size: clamp(30px, 5.4vw, 44px); font-weight: 800; letter-spacing: -0.025em; }
.standfirst { color: #CFCDE6; max-width: 640px; margin-top: 14px; font-size: 16.5px; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 16px 44px; }
.site-footer .dots { font-size: 16px; margin-bottom: 10px; }
.site-footer p + p { margin-top: 2px; }

/* ---------- Form card ---------- */
.form-card { position: relative; margin-top: -64px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.form-progress { position: sticky; top: 0; z-index: 4; height: 4px; background: var(--rule); }
.form-progress span { display: block; height: 100%; width: 0; background: var(--navy); transition: width .25s ease; }
.form-section { padding: 30px 36px; border-top: 1px solid var(--rule); }
.form-section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-head__num { font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--navy); background: var(--navy-50); border-radius: 8px; padding: 5px 8px; letter-spacing: .02em; }
.section-head h2 { font-size: 20px; font-weight: 700; }
.section-head .dots { font-size: 13px; margin-left: 2px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 22px; }
.span-2 { grid-column: 1 / -1; }

.field { min-width: 0; border: 0; padding: 0; margin: 0; }
fieldset.field + fieldset.field { margin-top: 24px; }
.field > label, .label, legend {
  display: block; font-family: var(--font-display); font-weight: 600; font-size: 13.5px; color: var(--ink);
  margin-bottom: 7px; padding: 0;
}
.legend-hint { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.req { color: var(--danger); }
.input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1.5px solid var(--field-border); border-radius: 10px; padding: 11px 14px; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #A5A2BA; }
.input:hover { border-color: #B8B4CF; }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(46, 43, 112, .13); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px rgba(194, 11, 0, .12); }
.input[readonly] { background: var(--tint); color: var(--navy); font-weight: 600; }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.5; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%232E2B70' stroke-width='2' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 15px center;
}
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.field-error { font-size: 13.5px; color: var(--danger); margin-top: 6px; font-weight: 500; }
.field-error::before { content: "! "; font-weight: 700; }

/* Choice tiles (checkbox / radio) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choices--compact { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
.choices--compact .choice span { white-space: nowrap; }
.choices--two { grid-template-columns: repeat(2, minmax(0, 220px)); }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px; cursor: pointer;
  border: 1.5px solid var(--field-border); border-radius: 12px; background: #fff;
  font-family: var(--font-display); font-weight: 600; font-size: 14.5px; color: var(--ink);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.choice span::before {
  content: ""; flex: none; width: 20px; height: 20px; border: 2px solid #B9B5D0; border-radius: 6px; background: #fff center / 12px no-repeat;
}
.choice--radio span::before { border-radius: 50%; }
.choice:hover span { border-color: #B8B4CF; }
.choice input:checked + span { border-color: var(--navy); background: var(--navy-50); }
.choice input:checked + span::before {
  border-color: var(--navy); background-color: var(--navy);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m1.5 5 3 3 6-6.5'/%3E%3C/svg%3E");
}
.choice--radio input:checked + span::before { background-image: none; box-shadow: inset 0 0 0 4px #fff; }
.choice input:focus-visible + span { box-shadow: 0 0 0 4px rgba(46, 43, 112, .18); }
/* Accent edge cycles across course tiles in brand order. */
.choices:not(.choices--compact) .choice:nth-child(4n+1) span { box-shadow: inset 3px 0 0 var(--yellow); }
.choices:not(.choices--compact) .choice:nth-child(4n+2) span { box-shadow: inset 3px 0 0 var(--blue); }
.choices:not(.choices--compact) .choice:nth-child(4n+3) span { box-shadow: inset 3px 0 0 var(--green); }
.choices:not(.choices--compact) .choice:nth-child(4n+4) span { box-shadow: inset 3px 0 0 var(--red); }
[data-group][aria-invalid="true"] .choice span { border-color: #E9A8A4; }

.field > label.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-family: var(--font-body); font-weight: 500; font-size: 15px; color: var(--ink); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }

/* Uploads */
.upload { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px dashed #C7C3DC; border-radius: var(--radius); background: var(--tint); }
.upload--doc { margin-top: 12px; }
.upload.has-file { border-style: solid; border-color: var(--green); background: #F4FCF4; }
.upload__preview {
  flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px;
  background: #fff center / cover no-repeat; border: 1px solid var(--rule); color: #A5A2BA;
}
.upload__preview--photo { width: 64px; height: 80px; }
.upload__preview.has-image svg { display: none; }
.upload__body { min-width: 0; flex: 1; }
.upload input[type="file"] { width: 100%; font: inherit; font-size: 14px; color: var(--body); }
.upload input[type="file"]::file-selector-button {
  font-family: var(--font-display); font-weight: 600; font-size: 13px; color: #fff; background: var(--navy);
  border: 0; border-radius: 8px; padding: 9px 14px; margin-right: 10px; cursor: pointer;
}
.upload .hint { margin-top: 6px; overflow-wrap: anywhere; }

/* Consent */
.consent-text { font-family: var(--font-body); font-weight: 400; font-size: 15px; color: var(--body); line-height: 1.6; margin-bottom: 14px; }

/* Terms */
.terms { display: grid; grid-template-columns: 1fr 1.4fr; gap: 26px; background: var(--tint); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.terms h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.marker-list { list-style: none; padding: 0; margin: 0; counter-reset: m; }
.marker-list li { position: relative; padding-left: 20px; font-size: 14px; line-height: 1.55; color: var(--body); }
.marker-list li + li { margin-top: 7px; }
.marker-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.marker-list li:nth-child(4n+2)::before { background: var(--blue); }
.marker-list li:nth-child(4n+3)::before { background: var(--green); }
.marker-list li:nth-child(4n+4)::before { background: var(--red); }
#f-agree_terms { margin-bottom: 24px; }

/* Signature pad */
.sig { position: relative; border: 1.5px solid var(--field-border); border-radius: var(--radius); background: #fff; overflow: hidden; -webkit-user-select: none; user-select: none; }
.sig canvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.sig::after { content: ""; position: absolute; left: 22px; right: 22px; top: 128px; border-top: 1.5px dashed #D5D2E4; pointer-events: none; }
.sig__placeholder { position: absolute; left: 22px; top: 100px; font-family: var(--font-display); font-weight: 600; color: #BDBAD0; font-size: 14px; pointer-events: none; }
.sig.is-signed .sig__placeholder { display: none; }
.sig.is-signed { border-color: var(--navy); }
.sig[aria-invalid="true"] { border-color: var(--danger); }
.sig__bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--muted); background: var(--tint); }
.link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Actions */
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 36px 30px; border-top: 1px solid var(--rule); background: #FBFBFD; }
.form-actions .hint { margin: 0; max-width: 420px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  font-family: var(--font-display); font-weight: 700; font-size: 14.5px; line-height: 1.2;
  border-radius: 11px; padding: 11px 20px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(46, 43, 112, .2); }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-700); }
.btn--primary[disabled] { opacity: .65; cursor: progress; }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--rule); }
.btn--ghost:hover { border-color: #C9C6DD; background: var(--tint); }
.btn--danger { background: #fff; color: var(--danger); border-color: #F1C9C6; }
.btn--danger:hover { background: #FFF3F2; }
.btn--lg { min-height: 54px; padding: 14px 30px; font-size: 16px; border-radius: 13px; }
.btn--sm { min-height: 38px; padding: 8px 14px; font-size: 13.5px; }
.btn--block { width: 100%; }

/* Alerts */
.alert { border-radius: var(--radius); padding: 14px 18px; border-left: 4px solid; font-size: 14.5px; }
.alert:focus { outline: none; }
.alert ul { margin: 8px 0 0; padding-left: 18px; }
.alert li + li { margin-top: 2px; }
.alert--error { background: #FFF2F1; border-color: var(--red); color: #6E1510; }
.alert--error a { color: #6E1510; }
.alert--success { background: #F0FAF0; border-color: var(--green); color: var(--success-ink); }
.alert--info { background: #EAF7FD; border-color: var(--blue); color: #0B4A66; }
.form-card > .alert { margin: 24px 36px 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Thank-you */
.success-card { padding: 40px 40px 34px; text-align: center; }
.success-card__icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: var(--ink); }
.success-card h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.success-card > p { margin: 8px auto 0; max-width: 520px; }
.form-no { display: inline-flex; flex-direction: column; gap: 2px; margin: 22px auto 0; padding: 12px 28px; border-radius: 14px; background: var(--navy); color: #fff; }
.form-no span { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--yellow); }
.form-no strong { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: .02em; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 26px 0 0; text-align: left; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.summary div { padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.summary div:nth-child(odd) { border-right: 1px solid var(--rule); }
.summary div:nth-last-child(-n+2) { border-bottom: 0; }
.summary dt { font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.summary dd { margin: 2px 0 0; color: var(--ink); font-weight: 500; }
.next-steps { text-align: left; background: var(--tint); border-radius: var(--radius); padding: 18px 20px; margin-top: 18px; }
.next-steps h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.success-card > .hint { margin-top: 14px; }

/* ---------- Small screens ---------- */
@media (max-width: 680px) {
  .site-header__meta span { display: none; }
  .brand__logo { height: 42px; }
  .hero { padding: 32px 0 84px; }
  .form-section { padding: 24px 18px; }
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .terms { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; padding: 20px 18px 24px; text-align: center; }
  .form-actions .hint { max-width: none; }
  .form-card > .alert { margin: 18px 18px 0; }
  .choices--two { grid-template-columns: 1fr 1fr; }
  .success-card { padding: 30px 18px 26px; }
  .summary { grid-template-columns: 1fr; }
  .summary div:nth-child(odd) { border-right: 0; }
  .summary div:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
}
