/* HAMCOL training request form
   Layout: brand top bar, then a two-column page — sticky intro on the left, form card on the right; one column on phones. */
:root {
  --navy: #0d5591;
  --navy-deep: #0a2f52;
  --blue: #3389cb;
  --cyan: #00b4ef;
  --sun: #fdd423;
  --amber: #f5a524;
  --ink: #13233a;
  --muted: #5a6b80;
  --line: #d8e2ec;
  --field: #f7fafd;
  --bg: #f1f5fa;
  --card: #ffffff;
  --danger: #c2372f;
  --danger-bg: #fdecea;
  --ok: #1f8a4c;
  --radius: 12px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.55;
}
img { max-width: 100%; height: auto; }
a { color: var(--navy); }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: relative; }
.topbar::after { /* brand stripe from the logo shield */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--sun), var(--amber) 30%, var(--cyan) 30%, var(--blue) 65%, var(--navy));
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand img { display: block; width: 200px; height: auto; }
.topbar__phone { font-weight: 600; text-decoration: none; color: var(--navy); white-space: nowrap; }

/* Page layout */
.layout { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 40px; padding-block: 44px 56px; align-items: start; }
.intro { position: sticky; top: 24px; display: grid; gap: 16px; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.intro h1 { margin: 0; font-family: var(--display); font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; color: var(--navy-deep); text-wrap: balance; }
.lede { margin: 0; color: var(--muted); font-size: 17px; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; column-gap: 12px; }
.steps li::before {
  content: counter(s); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: var(--navy); color: #fff;
}
.steps li:first-child::before { background: var(--sun); color: var(--navy-deep); }
.steps span { font-weight: 600; }
.steps small { color: var(--muted); font-size: 14px; }
.intro__note { margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

/* Card */
.card { background: var(--card); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 18px 40px -24px rgba(13, 50, 90, .35); padding: 8px 32px 32px; min-width: 0; }

.section { border: 0; margin: 0; padding: 26px 0; border-bottom: 1px solid var(--line); display: grid; gap: 18px; min-width: 0; }
.section__title { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 4px; font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--navy-deep); }
.num { width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center; font-family: var(--body); font-size: 14px; font-weight: 700; background: #e3eef8; color: var(--navy); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-weight: 600; font-size: 15px; }
.label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 4px; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: #97a5b5; }
input:focus, textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(51, 137, 203, .16); }
.is-invalid input, .is-invalid textarea { border-color: var(--danger); }
.error { margin: 0; font-size: 13px; color: var(--danger); font-weight: 500; }
.error:empty { display: none; }

/* Segmented control */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: #eaf1f8; border-radius: 12px; justify-self: start; max-width: 100%; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: 9px 18px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.segmented input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(13, 50, 90, .18); }
.segmented input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.chip span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); transition: background .15s; }
.chip:hover span { border-color: var(--blue); }
.chip input:checked + span { border-color: var(--navy); background: var(--navy); color: #fff; }
.chip input:checked + span::before { background: var(--sun); }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.chips--cats .chip span { padding: 10px 16px; font-weight: 600; }

/* Course list */
.courses-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.count { font-size: 13px; font-weight: 600; color: var(--navy); background: #e3eef8; padding: 2px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.course-list { display: grid; gap: 14px; }
.empty { margin: 0; padding: 22px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--field); }
.course-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.course-group__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; background: #fff8dc; border-bottom: 1px solid var(--line); }
.course-group__name { font-weight: 700; color: var(--navy-deep); }
.linkbtn { font: inherit; font-size: 13px; font-weight: 600; background: none; border: 0; color: var(--navy); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn:focus-visible { outline: 2px solid var(--blue); }
.course-group ul { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
.course { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.course:hover { background: var(--field); }
.course input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); cursor: pointer; }
.course:has(input:checked) { background: #eaf3fb; }
.course:has(input:checked) .course__title { font-weight: 600; color: var(--navy-deep); }
.course__also { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

/* Consent + submit */
.consent { padding-top: 22px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding-top: 22px; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 32px; border: 0; border-radius: 12px; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 700; font-size: 16px; color: #fff; background: var(--navy);
  box-shadow: 0 8px 18px -8px rgba(13, 85, 145, .7); transition: background .15s, transform .1s;
}
.btn:hover { background: #0b4a7f; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
.btn[disabled] { cursor: progress; opacity: .85; }
.btn--ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); box-shadow: none; }
.btn--ghost:hover { background: #eaf3fb; }
.spinner { display: none; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.recaptcha-note { margin: 0; font-size: 12px; color: var(--muted); max-width: 34ch; }
.grecaptcha-badge { visibility: hidden; } /* allowed because the notice above is shown */

.alert { margin: 20px 0 0; padding: 12px 16px; border-radius: 10px; font-size: 15px; }
.alert--error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c3bf; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Success */
.success { text-align: center; padding: 48px 12px 24px; display: grid; justify-items: center; gap: 6px; }
.success:focus { outline: none; }
.success__icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; color: #fff; background: var(--ok); margin-bottom: 8px; }
.success h2 { margin: 0; font-family: var(--display); font-size: 30px; color: var(--navy-deep); }
.success p { margin: 0; color: var(--muted); max-width: 46ch; }
.success__ref { font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--navy) !important; letter-spacing: .04em; margin: 4px 0 12px !important; font-variant-numeric: tabular-nums; }
.success .btn { margin-top: 18px; }

.footer { padding-block: 0 32px; color: var(--muted); font-size: 13px; text-align: center; }

/* Responsive */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 28px 40px; }
  .intro { position: static; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .steps li { grid-template-columns: 1fr; row-gap: 6px; }
  .steps li::before { grid-row: auto; }
}
@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  .brand img { width: 150px; }
  .card { padding: 4px 18px 24px; border-radius: 14px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li { grid-template-columns: 32px 1fr; }
  .steps li::before { grid-row: span 2; }
  .segmented { display: flex; }
  .segmented label { flex: 1 1 auto; }
  .segmented span { text-align: center; padding-inline: 12px; }
  .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 2s !important; }
}
