/* ==========================================================
   Train 2 Health — Design System (single source of truth)
   Direction: Trusted & clinical · Light theme only · Pill buttons
   Palette: navy #001D3D / #003566 · turquoise #1F7A8C · yellow #FFC300 · green #1F852B
   Fonts: Outfit (headings) · Inter (body)
   NOTE: this :root block is the authoritative token set. See CLAUDE.md.
   ========================================================== */

:root {
  /* ---- Brand: Navy ---- */
  --navy-900: #001d3d;
  --navy-700: #003566;
  --navy-500: #14487a;

  /* ---- Accent: Yellow (highlights / hover sweep) ---- */
  --gold-500: #ffc300;
  --gold-600: #d99a00;

  /* ---- Accent: Turquoise (secondary / interactive) ---- */
  --teal-500: #1f7a8c;
  --teal-600: #185f6d;

  /* ---- Accent: Green (primary CTA fill) ---- */
  --green-500: #1f852b;
  --green-600: #176621;

  /* ---- Accent: Maroon (narrative/problem-statement bands only — not a form error state) ---- */
  --maroon-700: #9b3a3a;
  --maroon-800: #7c2e2e;

  /* ---- Neutrals ---- */
  --ink: #001d3d;
  --slate-600: #4a5568;
  --slate-400: #8896a6;
  --line: #e2e8f0;
  --surface: #fffcf2;
  --bg: #fffcf2;
  --bg-alt: #fffcf2;
  --grey-light: #edf0f5;

  /* ---- Semantic ---- */
  --success: #1f852b;
  --warning: #e8a100;
  --error: #d64545;
  --info: var(--teal-500);

  /* ---- Legacy aliases (map old names → new tokens) ---- */
  --navy: var(--navy-700);
  --navy-mid: var(--navy-500);
  --gold: var(--gold-500);
  --gold-deep: var(--gold-600);
  --teal: var(--teal-500);
  --ink-soft: var(--slate-600);
  --cream: var(--bg-alt);
  --white: var(--surface);

  /* ---- Type scale ---- */
  --font-head: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;
  --fs-h1: clamp(2rem, 4vw, 3rem);
  --fs-h2: clamp(1.6rem, 3vw, 2.25rem);
  --fs-h3: 1.5rem;
  --fs-h4: 1.25rem;
  --fs-lead: 1.125rem;
  --fs-body: 1rem;
  /* Smallest text token. With the root font-size set to 18px on desktop / 16px
     on mobile (see html{} below), 1rem is the lowest permitted size site-wide. */
  --fs-sm: 1rem;

  /* ---- Spacing scale (4px base) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* ---- Radius scale ---- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 12px;
  --radius-card: 16px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* ---- Shadow scale (black-tinted, standardised sitewide, slightly stronger) ---- */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.09);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.2);
  /* Shared by every "floating card" component (course carousel, reviews
     carousel, testimonial grid) so they stay in sync with each other.
     Standardised to match .form-card's shadow (the booking/enquiry form) —
     the reference point for this pair. */
  --shadow-card: var(--shadow-sm);
  --shadow-card-hover: var(--shadow-md);
  --shadow-cta: none;
  --shadow: var(--shadow-sm); /* legacy alias */

  /* ---- Motion ---- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s ease;

  /* ---- Layout ---- */
  --container: 1200px;
  --gutter: clamp(16px, 5vw, 40px);
  /* Sitewide wrap width for hero/intro/body copy — 60% of the viewport on
     desktop; widened on mobile below so short lines don't get cramped. */
  --text-wrap: 60vw;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Root font-size drives every rem on the site. 18px desktop = the minimum
     18px body/floor; the mobile query below drops it to 16px (mobile floor).
     Because sizing is expressed in rem, nothing renders below these floors. */
  font-size: 18px;
  /* Safety net against stray horizontal scroll on narrow phones (e.g. a
     single grid track computing a hair wider than its container) — nothing
     on the site relies on horizontal page scroll, so clipping it here is
     always safe. */
  overflow-x: hidden;
}

@media (max-width: 768px) {
  html { font-size: 16px; }
  :root { --text-wrap: 92vw; }
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

/* Sitewide reading-width cap (--text-wrap: 60vw desktop / 92vw mobile — see
   :root) so body copy never runs edge-to-edge on wide screens. Components
   narrower than this by their own layout (cards, grid columns, form
   fields) are unaffected, since max-width only ever shrinks, never grows,
   the rendered width. */
p { max-width: var(--text-wrap); }

a {
  color: var(--teal-500);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--teal-600); }

/* Inline text-based links — ones sitting inside a paragraph of body copy —
   are underlined so they read as links within running text. UI links (nav,
   footer, buttons, cards) keep the colour-only treatment above. */
p a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 2px;
}

:focus-visible {
  outline: 3px solid rgba(31, 122, 140, 0.5);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy-700);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 600; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: clamp(3rem, 8vw, 6rem) 0;
}

.section--alt { background: var(--white); }
.section--navy {
  background: var(--navy);
}
.section--navy h2,
.section--navy p { color: var(--cream); }
.section--navy .eyebrow { color: var(--gold-500); }

/* Teal band — used for the "Join the Names Who Trust Us" trust section so it
   reads as one continuous #1F7A8C block with the logo slider beneath it. */
.section--teal {
  background: var(--teal-500);
}
.section--teal h2,
.section--teal p { color: var(--cream); }
.section--teal .eyebrow { color: var(--gold-500); }

.section-intro {
  max-width: var(--text-wrap);
  margin: 0.75rem auto 0;
  text-align: center;
  color: var(--ink-soft);
}

.section-title { text-align: center; }
.eyebrow {
  display: block;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

/* ---------- Buttons (pill) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
  padding: 0.85rem 1.9rem;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}
.btn:disabled,
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* Primary — green fill; a yellow sweep grows in left-to-right on hover */
.btn--primary,
.btn--gold {
  background: var(--green-500);
  border-color: var(--green-500);
  color: var(--bg-alt);
}
.btn--primary::before,
.btn--gold::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 0;
  background: var(--gold-500);
  transition: width var(--transition);
  z-index: -1;
}
.btn--primary:hover::before,
.btn--gold:hover::before {
  width: 100%;
}
.btn--primary:hover,
.btn--gold:hover {
  color: var(--navy-900);
  border-color: var(--gold-500);
}

/* Secondary — navy fill */
.btn--secondary,
.btn--navy {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--bg-alt);
}
.btn--secondary:hover,
.btn--navy:hover {
  background: var(--navy-900);
  border-color: var(--navy-900);
}

/* Outline — navy border on light backgrounds */
.btn--outline {
  border-color: var(--navy-700);
  color: var(--navy-700);
  background: transparent;
}
.btn--outline:hover {
  background: var(--navy-700);
  color: var(--bg-alt);
}

/* Outline — light border, for dark backgrounds */
.btn--outline-light {
  border-color: var(--bg-alt);
  color: var(--bg-alt);
  background: transparent;
}
.btn--outline-light:hover {
  background: var(--bg-alt);
  color: var(--navy-700);
}

/* Ghost — text only */
.btn--ghost {
  color: var(--teal-500);
  background: transparent;
}
.btn--ghost:hover {
  color: var(--teal-600);
  background: rgba(31, 122, 140, 0.08);
}

/* Sizes */
.btn--sm { padding: 0.55rem 1.3rem; font-size: var(--fs-sm); }
.btn--lg { padding: 1rem 2.4rem; font-size: var(--fs-lead); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: var(--cream);
  padding: 3.5rem 0;
  text-align: center;
}
.page-hero h1 {
  color: var(--white);
  max-width: var(--text-wrap);
  margin: 0 auto;
}
.page-hero p {
  max-width: var(--text-wrap);
  margin: 1rem auto 0;
  color: var(--cream);
  font-size: 1.05rem;
}

/* Photo variant — richer hero for course/in-house pages: full-bleed photo
   with a navy wash for contrast, plus room for an eyebrow tag and CTAs. */
.page-hero--photo {
  position: relative;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.page-hero--photo::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(135deg, rgba(0, 29, 61, 0.92), rgba(0, 53, 102, 0.8));
}
.page-hero--photo .container { position: relative; z-index: 2; }

/* Crossfading background layers injected by js/hero-photo-cycle.js when a
   .page-hero--photo section declares data-hero-images (multiple photos to
   cycle through). Sit behind the ::before navy wash and above nothing. */
.page-hero-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.page-hero-bg-layer.is-visible { opacity: 1; }
.page-hero--photo .eyebrow { color: var(--gold-500); margin-bottom: 0.75rem; }
.page-hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
}
/* For grids with too few cards to fill every auto-fill track, this centres
   the actual card count as a group instead of them sitting flush-left in a
   wider, mostly-empty row (e.g. the 2-card "Open Course or In-House
   Training?" choice on individual course pages). auto-fill (used above)
   reserves a track for every column that *could* fit, even an empty one —
   on wide viewports that phantom column eats the space justify-content
   would otherwise centre into, so this switches to auto-fit (collapses
   empty tracks to 0) and caps each track's width so 1fr doesn't stretch
   the remaining 2 cards to fill the entire row. */
.card-grid--center {
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 400px));
  justify-content: center;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--navy-mid), var(--teal));
  display: grid;
  place-items: center;
  color: var(--cream);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--grey-light);
  color: var(--navy-mid);
}
.tag--gold { background: rgba(255, 195, 0, 0.2); color: #7a5c00; }

.card-body p { color: var(--ink-soft); font-size: 1rem; flex: 1; }

.card-price {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  font-size: 1.15rem;
}
.card-price small { font-weight: 500; color: var(--ink-soft); font-size: 1rem; }

.card-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Course pricing (individual course detail pages) ---------- */
.course-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.25rem 0 0.5rem;
}
.course-pricing-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}
.course-pricing-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--teal-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.4rem;
}
.course-pricing-amount {
  display: block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--navy-700);
}
.course-pricing-amount small {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  color: var(--slate-600);
  margin-top: 0.2rem;
}
.course-pricing-amount small.course-pricing-prefix {
  display: inline;
  margin-top: 0;
  margin-right: 0.3rem;
}
.course-pricing-note { font-size: 1rem; color: var(--slate-600); margin-bottom: 0; }

@media (max-width: 560px) {
  .course-pricing { grid-template-columns: 1fr; }
}

/* In-house/open-course subpages only ever show one venue's price — single
   centred column instead of the two-up grid used on the parent course page. */
.course-pricing--single {
  grid-template-columns: 1fr;
  max-width: 280px;
  margin: 0 auto;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
  margin-top: 2.5rem;
}
.stat-number {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--gold);
}
.stat-label { color: var(--bg-alt); font-weight: 500; }

/* ---------- Logo strip / trust ---------- */
.logo-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  margin-top: 2.5rem;
}
.logo-strip .trust-logo {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem 2.5rem;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy-mid);
  text-align: center;
  min-width: 220px;
}
.trust-logo-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.trust-logo-img {
  display: block;
  height: 96px;
  width: auto;
  margin: 0 auto;
  border-radius: var(--radius-xs);
}

/* ---------- Forms ---------- */
/* .form-field/.form-grid/.form-section/.form-price-toggle all set their own
   `display` (flex or grid) — that class-selector rule has higher specificity
   than the UA stylesheet's `[hidden] { display: none }`, so without this
   override, toggling the `hidden` attribute via JS (js/main.js's booking-form
   show/hide logic, e.g. the "Submit a booking enquiry instead of paying now"
   checkbox) left the element just as visible as ever. */
.form-field[hidden],
.form-grid[hidden],
.form-section[hidden],
.form-price-toggle[hidden] {
  display: none !important;
}
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2.25rem;
  width: 60vw;
  max-width: 60vw;
  margin: 0 auto;
}
@media (max-width: 768px) {
  .form-card { width: 100%; max-width: 100%; }
}
.section-intro + .form-card,
.section-intro + .course-list { margin-top: 2.5rem; }
.form-required-note {
  font-size: var(--fs-sm);
  color: var(--slate-600);
  margin-bottom: 1.25rem;
}
.form-required-note span { color: var(--error); }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
/* Booking form's 3-step wizard (js/main.js's goToStep) — one .form-grid
   section rendered at a time, so this only matters on the rare frame where
   two are briefly both unhidden. */
.form-section + .form-section {
  margin-top: 1.25rem;
}

/* Step progress bar — 3 circles + connecting lines, one .form-progress-step
   per section. States (js's updateProgressBar): default (not yet reached),
   .is-active (current section) and .is-complete (already passed). */
.form-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.form-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.form-progress-dot {
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--slate-400);
  font-family: var(--font-head);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease),
              color 0.35s var(--ease), transform 0.35s var(--ease);
}
.form-progress-label {
  font-size: var(--fs-sm);
  color: var(--slate-400);
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.35s var(--ease);
}
.form-progress-step.is-active .form-progress-dot {
  border-color: var(--teal-500);
  background: var(--teal-500);
  color: var(--bg-alt);
  transform: scale(1.08);
}
.form-progress-step.is-active .form-progress-label { color: var(--navy-700); }
.form-progress-step.is-complete .form-progress-dot {
  border-color: var(--green-500);
  background: var(--green-500);
  color: var(--bg-alt);
}
.form-progress-step.is-complete .form-progress-label { color: var(--slate-600); }
/* Line is a static grey track; .form-progress-line-fill grows across it
   left-to-right (scaleX, not width, so it's compositor-friendly) as each
   step completes — same technique as the reviews carousel's rating
   dividers (see .card-rating .rating-divider in components.css). */
.form-progress-line {
  position: relative;
  flex: 1 1 auto;
  max-width: 4rem;
  height: 2px;
  margin-top: 1.1rem; /* aligns with the dots' vertical centre */
  background: var(--line);
}
.form-progress-line-fill {
  position: absolute;
  inset: 0;
  background: var(--green-500);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.form-progress-line.is-complete .form-progress-line-fill { transform: scaleX(1); }
@media (max-width: 480px) {
  .form-progress-label { display: none; }
  .form-progress-line { max-width: 2rem; }
}

/* Next/Back buttons at the foot of each step. Section 1 has only a Next
   button (right-aligned); Sections 2/3 have both. */
.form-field.form-step-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}
.form-step-nav:has(#backToStep1, #backToStep2) {
  align-items: center;
  justify-content: flex-end;
}

/* Course details card — same boxed treatment as .form-price-box, sitting
   directly above it (see the insertBefore reordering in js/main.js). */
.form-course-details {
  grid-column: 1 / -1;
  background: var(--bg-alt);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.25rem 1rem;
}
.form-course-details-heading {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: var(--fs-h4);
  color: var(--navy-700);
  margin-bottom: 0.5rem;
}
.form-course-details ul {
  color: var(--slate-600);
  padding-left: 1.25rem;
  margin: 0;
}
.form-course-details li { margin-bottom: 0.25rem; }
.form-course-details-note {
  margin-top: 0.75rem;
  font-weight: 500;
  color: var(--navy-700);
}
.form-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.form-field--full { grid-column: 1 / -1; }
.form-field label {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
}
.form-field:has(> :required) > label:not(.form-checkbox-label)::after {
  content: " *";
  color: var(--error);
}
.form-field-required-mark { color: var(--error); }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* Dropdowns (and the calendar below) use navy-900 text specifically,
   darker than the --ink used by plain text inputs. */
.form-field select { color: var(--navy-900); }
.form-field textarea { resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.15);
}
.form-field-error {
  color: var(--error);
  font-size: var(--fs-sm);
  margin-top: 0.4rem;
}
/* Invalid-field state (js/main.js's t2h_validateField / _t2hValidateBooking)
   — red border, red label (matching the required asterisk's colour) and the
   .form-field-error message underneath. Persists until the field is
   corrected, not just until resubmission. */
.form-field.has-error label {
  color: var(--error);
}
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea,
.form-field.has-error .t2h-date-trigger {
  border-color: var(--error);
}
.form-field.has-error input:focus,
.form-field.has-error select:focus,
.form-field.has-error textarea:focus,
.form-field.has-error .t2h-date-trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.15);
}
.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--slate-600);
  margin-top: 0.5rem;
}
.form-checkbox-label input {
  width: auto;
  accent-color: var(--teal-500);
}
.form-price-box {
  background: var(--bg-alt);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
}
.form-price-label {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy-700);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.form-price-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--green-500);
}
.form-price-note {
  width: 100%;
  color: var(--slate-600);
  font-size: var(--fs-sm);
}
.form-price-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-sm);
  color: var(--navy-700);
  margin-top: 0.25rem;
}
.form-price-toggle input {
  width: auto;
  accent-color: var(--teal-500);
}
.form-status {
  margin-top: 1rem;
  font-weight: 600;
  font-size: var(--fs-sm);
  display: none;
}
.form-status--success { display: block; color: var(--success); }
.form-status--error { display: block; color: var(--error); }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Booking-form date picker (js/booking-calendar.js): a compact field
   (.t2h-date-trigger) that opens a small popup calendar (.t2h-calendar) on
   click, rather than a full inline calendar section. Text sits at
   navy-900 per the design note asking for #001D3D on dropdowns and the
   calendar. */
#dateField { position: relative; }
.t2h-date-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--navy-900);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.t2h-date-trigger:hover { border-color: var(--teal-500); }
.t2h-date-trigger:focus-visible,
.t2h-date-trigger[aria-expanded="true"] {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.15);
}
.t2h-date-trigger-text.is-placeholder { color: var(--slate-400); }
.t2h-date-trigger-icon { flex-shrink: 0; color: var(--slate-600); }
.t2h-calendar {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  left: 0;
  width: min(320px, 100%);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--cream);
  box-shadow: var(--shadow-md);
  padding: 1rem;
  font-family: var(--font-body);
  color: var(--navy-900);
}
.t2h-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.t2h-cal-month {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy-900);
}
.t2h-cal-nav {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--navy-900);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
}
.t2h-cal-nav:hover { border-color: var(--teal-500); background: var(--bg-alt); }
.t2h-cal-weekdays,
.t2h-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}
.t2h-cal-weekdays {
  margin-bottom: 0.25rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--slate-600);
  text-align: center;
}
.t2h-cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: var(--radius-xs);
  background: var(--white);
  color: var(--navy-900);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}
.t2h-cal-day.is-empty { visibility: hidden; cursor: default; }
.t2h-cal-day:not(.is-disabled):hover { border-color: var(--teal-500); }
.t2h-cal-day.is-disabled {
  color: var(--slate-400);
  cursor: not-allowed;
  background: transparent;
}
.t2h-cal-day.is-available { border-color: var(--gold-600); font-weight: 600; }
.t2h-cal-day.is-selected {
  background: var(--teal-500);
  border-color: var(--teal-500);
  color: var(--bg-alt);
}
.t2h-cal-dot {
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-600);
}
.t2h-cal-day.is-selected .t2h-cal-dot { background: var(--bg-alt); }
.t2h-cal-legend {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: var(--fs-sm);
  color: var(--slate-600);
}
p.t2h-cal-legend { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; }
.t2h-cal-legend p { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.t2h-cal-key {
  position: relative;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gold-600);
  border-radius: var(--radius-xs);
  background: var(--surface);
}
.t2h-cal-key .t2h-cal-dot { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.t2h-cal-legend .t2h-cal-dot { position: static; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: stretch;
  margin-top: 2.5rem;
}
/* min-width:0 overrides the grid item default of min-width:auto (sized to
   content's intrinsic width) — without it, the contact-line text/email
   can't shrink below its unwrapped width, forcing this 1fr track (and the
   whole grid) wider than the viewport on narrow phones. */
.contact-grid .form-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-width: 0;
}
.contact-info {
  background: var(--navy-700);
  color: var(--bg-alt);
  border-radius: var(--radius-card);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}
.contact-info h3 { color: var(--surface); }
.contact-info a { color: var(--gold-500); font-weight: 600; }
.contact-line { display: flex; gap: 0.9rem; align-items: center; font-size: var(--fs-lead); }
.contact-line .icon {
  color: var(--navy-700);
  background: var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}
.contact-line .icon svg { width: 1.2em; height: 1.2em; }
.contact-info > p:last-child { margin-top: auto; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.15); }
.contact-line .icon svg { width: 1.1em; height: 1.1em; fill: currentColor; }

/* ---------- Content pages (legal / prose) ---------- */
.prose {
  max-width: var(--text-wrap);
  margin: 0 auto;
}
.prose h2 { margin: 2.2rem 0 0.8rem; font-size: var(--fs-h2); }
.prose h3 { margin: 1.6rem 0 0.5rem; }
.prose p, .prose li { color: var(--ink-soft); margin-bottom: 0.8rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin-bottom: 1rem; }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.team-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2rem 1.5rem;
  text-align: center;
}
.team-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-mid), var(--teal));
  color: var(--cream);
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.6rem;
}
.team-card .role { color: var(--teal); font-weight: 600; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: var(--bg-alt);
  padding: 3.5rem 0 1.5rem;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
}
.site-footer h3 {
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.55rem; }
.site-footer a { color: rgba(255, 252, 242, 0.8); }
.site-footer a:hover { color: var(--gold); }
.footer-legal {
  border-top: 1px solid rgba(255, 252, 242, 0.15);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1rem;
}
.footer-legal a { margin-left: 1.25rem; }
.ico-note { font-size: 1rem; margin-top: 1rem; color: var(--bg-alt); }
.footer-accred-logos {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* ---------- Utility ---------- */
/* margin auto matters here — every use is a <p>, which inherits the sitewide
   max-width: var(--text-wrap) cap (see p { } above). Without auto margins,
   that capped box stays flush-left in its parent and text-align only
   centres text within it, not the box itself in the page. */
.center { text-align: center; margin-left: auto; margin-right: auto; }
.mt-2 { margin-top: 2rem; }
.hidden { display: none !important; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: var(--navy);
  padding: 0.6rem 1rem;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------- Transparent sticky header overlays page tops ---------- */
main { margin-top: -72px; }
.page-hero { padding: calc(3.5rem + 72px) 0 3.5rem; }

/* In-page anchor targets (e.g. "#booking", "#faceToFaceCourseList") land
   with their top flush against the viewport top by default, which is
   exactly where the sticky header sits — this offsets the scroll stop so
   the heading isn't hidden underneath it. */
main [id] { scroll-margin-top: 90px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }

  /* Footer: brand full width, Company/Training side by side, Contact below.
     Applied for the whole mobile/tablet range — not just the narrowest
     phones — since the plain 2-col fallback previously used here put
     Brand+Company and Training+Contact side by side, not the intended
     stacked layout. */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand    brand"
      "company  training"
      "contact  contact";
    row-gap: 2rem;
  }
  .footer-brand    { grid-area: brand; }
  .footer-company  { grid-area: company; }
  .footer-training { grid-area: training; }
  .footer-contact  { grid-area: contact; }

  /* The copyright + links row naturally wraps onto its own line well above
     560px (their combined content is ~650px wide), so this has to share the
     same breakpoint as the rest of the mobile footer layout above — a
     narrower breakpoint left a gap where the row wrapped but still used the
     old clustered-in-the-middle layout instead of spreading edge to edge. */
  .footer-legal {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-legal span:last-child {
    /* Pulled in from a full-bleed 100vw spread (links pinned to the screen
       edges) to sit centred with roughly half a viewport width between
       them. gap guarantees breathing room between the two links once
       space-between has no extra width left to distribute (i.e. once
       min-width has taken over on narrow phones). */
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    width: 50vw;
    min-width: fit-content;
    margin: 0 auto;
  }
  .footer-legal a { margin: 0; }
}

@media (max-width: 560px) {
  .section { padding: 3rem 0; }
  .stats { grid-template-columns: 1fr; gap: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #firstAidCarousel { display: none; }
}