/* =============================================================
   MAGIC Engineering — design system
   Precise, calm, technical, operational.
   Tokens first; components below build on Bootstrap 5's reset/grid.
   ============================================================= */

:root {
  /* Brand tokens */
  --magic-blue: #0707D9;      /* primary action / navigation emphasis */
  --magic-blue-dark: #0505A8; /* hover state for primary actions */
  --magic-red: #F21515;       /* small signal / active accent only */
  --navy: #12213D;            /* headings / high-contrast panels */
  --ink: #202A3A;             /* body text */
  --pale: #EEF3FB;            /* pale technical blue surfaces */
  --surface: #FFFFFF;
  --grey-line: #D8DFE9;
  --grey-mid: #5A6678;

  /* Type */
  --font-stack: "Sarabun", "Noto Sans Thai", "Noto Sans SC", Arial, sans-serif;
  --measure: 70ch;

  /* Spacing rhythm */
  --space-1: 0.375rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 3.25rem;
  --space-6: 5rem;

  --radius: 0.5rem;
  --focus-ring: 3px solid var(--magic-blue);
}

/* Self-hosted Sarabun (SIL Open Font License; see /fonts/OFL.txt).
   Latin and Thai subsets per weight; the stack falls through to system
   fonts for anything not covered. */
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-regular-latin.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-regular-thai.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-semibold-latin.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-semibold-thai.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-bold-latin.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Sarabun";
  src: url("../fonts/sarabun-bold-thai.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

/* ---------- Base ---------- */

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

body {
  font-family: var(--font-stack);
  color: var(--ink);
  background: var(--surface);
  line-height: 1.65;
  font-size: 1.0625rem;
}

h1, h2, h3, h4, h5, h6, .h3, .h4, .h5 {
  color: var(--navy);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: var(--space-3);
}
h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); max-width: 24ch; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3, .h3 { font-size: 1.3rem; }
h4, .h4 { font-size: 1.15rem; }
h5, .h5 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--grey-mid); }

p, li, dd { max-width: var(--measure); }

a {
  color: var(--magic-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { color: var(--magic-blue-dark); }

:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-2); color: #fff; }

.container { max-width: 72rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--magic-blue);
  margin-bottom: var(--space-2);
}

/* ---------- Buttons ---------- */

.btn-magic-primary {
  background: var(--magic-blue);
  border: 2px solid var(--magic-blue);
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
}
.btn-magic-primary:hover,
.btn-magic-primary:focus-visible {
  background: var(--magic-blue-dark);
  border-color: var(--magic-blue-dark);
  color: #fff;
}

.btn-magic-light {
  background: #fff;
  border: 2px solid #fff;
  color: var(--navy);
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
}
.btn-magic-light:hover,
.btn-magic-light:focus-visible {
  background: var(--pale);
  color: var(--navy);
}

.text-link { font-weight: 600; align-self: center; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--grey-line);
}
.site-header.is-scrolled {
  box-shadow: 0 2px 12px rgba(18, 33, 61, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  flex-wrap: wrap;
}

/* Logo pinned left; everything else packs to the right. */
.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand-logo { height: 3rem; width: auto; }

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--magic-red); color: var(--navy); }

/* Header CTA button (sibling of the nav, so .site-nav link rules do not apply). */
.header-cta {
  padding-left: 1.0rem;
  padding-right: 1.0rem;
  text-align: center;
}

/* Language switcher: "EN | ไทย".
   Each option is its own touch target, comfortably above the 24x24 px minimum. */
.nav-lang {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  white-space: nowrap;
}
.nav-lang a,
.nav-lang .lang-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.75rem;
  padding: 0 0.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  color: var(--navy);
}
.nav-lang a:hover { color: var(--navy); text-decoration: underline; background: var(--pale); }
.nav-lang .lang-current { font-weight: 700; }
.lang-sep { color: var(--grey-line); }

/* Mobile nav: collapsed only when JS is available (html.js). Without JS the
   menu simply renders expanded, so the site stays fully usable. */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  color: var(--navy);
  align-items: center;
  gap: 0.5rem;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--navy);
  content: "";
}
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before { position: absolute; top: -5px; }
.nav-toggle-bars::after { position: absolute; top: 5px; }

/* Header breakpoint is 72rem, not the 62rem used elsewhere: the full row only fits
   once the container is at its maximum width, because the Thai menu labels are the
   longest. Below this the menu collapses behind the button — the language switcher
   and logo stay in the bar.

   Wide screens: reorder the header row to menu → language → CTA.
   (Markup order is the small-screen order: logo → language → menu button.) */
@media (min-width: 72rem) {
  .header-inner { justify-content: flex-end; gap: 1rem; }
  .brand { order: 1; }
  .site-nav { order: 2; }
  .site-nav ul { gap: 0.9rem; }
  .nav-lang { order: 3; }
  .header-cta { order: 4; }
}

@media (max-width: 71.99rem) {
  html.js .nav-toggle { display: inline-flex; }
  html.js .site-nav { display: none; width: 100%; }
  html.js .site-nav.is-open { display: block; }
  html.js .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-2) 0;
  }
  html.js .site-nav a { display: block; padding: 0.6rem 0.25rem; }

  /* The language switcher stays in the header bar, left of the menu button —
     it is never folded into the collapsed menu. */
  .nav-lang { margin-left: 0; }

  /* The CTA belongs to the collapsed menu: it appears only when the menu is open. */
  html.js .header-cta { display: none; }
  html.js .site-nav.is-open ~ .header-cta {
    display: block;
    width: 100%;
    margin-bottom: var(--space-2);
  }
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  background: var(--pale);
  border-bottom: 1px solid var(--grey-line);
  font-size: 0.85rem;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0.45rem 0;
}
.breadcrumbs li + li::before { content: "›"; margin-right: 0.4rem; color: var(--grey-mid); }
.breadcrumbs a { color: var(--grey-mid); }

/* ---------- Sections ---------- */

.section { padding: var(--space-5) 0; }
.section-tight { padding: var(--space-3) 0; }
.section-pale { background: var(--pale); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h2, .section-navy h3 { color: #fff; }
.section-navy a { color: #fff; }

.section-lead { font-size: 1.1rem; margin-bottom: var(--space-4); }
.section-more { margin-top: var(--space-4); font-weight: 600; }
.section-note { margin-top: var(--space-4); color: var(--grey-mid); }

/* ---------- Hero ---------- */

/* Full-bleed photograph with the copy overlaid on the left. The image is a real <img>
   (not a CSS background) so srcset still lets the browser pick the right file size. */
.hero {
  position: relative;
  isolation: isolate;
  background: var(--navy);
  border-bottom: 1px solid var(--grey-line);
  padding: var(--space-6) 0;
  min-height: 31rem;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
}
.hero-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
}
/* Scrim: near-opaque under the text, clearing toward the right so the scene stays visible. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg,
    rgba(9, 17, 33, 0.95) 0%,
    rgba(9, 17, 33, 0.90) 34%,
    rgba(9, 17, 33, 0.58) 62%,
    rgba(9, 17, 33, 0.32) 100%);
}
.hero-inner { width: 100%; }
.hero-copy { max-width: 44rem; }
.hero h1 { color: #fff; }
.hero .eyebrow { color: #9FC0FF; }
.hero-lead { font-size: 1.2rem; margin: var(--space-3) 0 var(--space-4); color: #E4ECF9; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero .text-link { color: #fff; text-decoration: underline; }
.hero .text-link:hover { color: #fff; }

@media (max-width: 47.99rem) {
  .hero { padding: var(--space-5) 0; min-height: 26rem; }
  /* Portrait screens leave no clear side, so the scrim covers the whole frame instead. */
  .hero::after {
    background: linear-gradient(180deg,
      rgba(9, 17, 33, 0.92) 0%,
      rgba(9, 17, 33, 0.84) 55%,
      rgba(9, 17, 33, 0.90) 100%);
  }
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--pale) 100%);
  border-bottom: 1px solid var(--grey-line);
  padding: var(--space-5) 0;
}
.page-definition { font-weight: 600; color: var(--navy); font-size: 1.1rem; }
.page-lead { font-size: 1.15rem; }
.legal-meta { color: var(--grey-mid); font-size: 0.95rem; }

/* Page hero with a photograph beside the copy. Pages without an image are untouched. */
.responsive-media { display: block; }
.page-hero--media .page-hero-inner {
  display: grid;
  gap: var(--space-4);
  align-items: center;
}
.page-hero--media .page-hero-copy > :last-child { margin-bottom: 0; }
.page-hero--media .responsive-media > img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--grey-line);
}
@media (min-width: 62rem) {
  .page-hero--media .page-hero-inner {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-5);
  }
}

/* ---------- Signature band ---------- */

.signature-band {
  background: var(--navy);
  color: #fff;
  padding: var(--space-5) 0;
}
.signature-band h2 { color: #fff; margin-bottom: var(--space-1); }
.signature-tagline {
  color: #AFC3E8;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}
.signature-definitions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--space-4);
  margin: 0;
}
.signature-definition dt {
  font-size: 1.1rem;
  font-weight: 700;
  border-left: 3px solid var(--magic-red);
  padding-left: var(--space-2);
  margin-bottom: var(--space-1);
}
.signature-definition dd { margin: 0; color: #DCE6F7; }
.section-navy .signature-definition dd { color: #DCE6F7; }

/* ---------- Card grids ---------- */

.card-grid {
  display: grid;
  gap: var(--space-3);
}
.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(22rem, 100%), 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.card-grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }

.pillar-card,
.why-card,
.insight-card,
.proof-card {
  background: var(--surface);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.section-pale .pillar-card,
.section-pale .insight-card,
.section-pale .proof-card { border-color: #C8D4E6; }

.pillar-card h3 a, .pillar-card h2 a {
  color: var(--navy);
  text-decoration: none;
}
.pillar-card h3 a:hover, .pillar-card h2 a:hover { color: var(--magic-blue); text-decoration: underline; }
.card-definition { color: var(--grey-mid); font-size: 0.95rem; margin-bottom: 0; }

/* ---------- Capability chain diagram ---------- */

.capability-chain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--space-3);
  list-style: none;
  counter-reset: chain;
  margin: 0;
  padding: 0;
}
.chain-stage {
  position: relative;
  background: var(--surface);
  border: 1px solid #C8D4E6;
  border-top: 3px solid var(--magic-blue);
  border-radius: var(--radius);
  padding: var(--space-3);
  counter-increment: chain;
}
.chain-stage::before {
  content: counter(chain);
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--magic-blue);
  border: 1px solid var(--magic-blue);
  border-radius: 50%;
  width: 1.5rem; height: 1.5rem;
  line-height: 1.4rem;
  text-align: center;
  margin-bottom: var(--space-2);
}
.chain-stage a { text-decoration: none; }
.chain-stage-name { font-weight: 700; color: var(--navy); display: block; }
.chain-stage a:hover .chain-stage-name { color: var(--magic-blue); text-decoration: underline; }
.chain-stage-desc { font-size: 0.9rem; color: var(--grey-mid); margin: var(--space-1) 0 0; }

/* Connector arrows between stages on wide screens */
@media (min-width: 62rem) {
  .chain-stage:not(:last-child)::after {
    content: "→";
    position: absolute;
    right: -1.05rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--magic-blue);
    font-weight: 700;
    z-index: 1;
  }
}

/* ---------- Proof cards ---------- */

.evidence-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  margin-bottom: var(--space-2);
  border: 1px solid;
}
.evidence-namedcasestudy { color: #0B6B3A; border-color: #0B6B3A; background: #EDF9F2; }
.evidence-anonymiseddeliverypattern { color: var(--magic-blue-dark); border-color: var(--magic-blue-dark); background: var(--pale); }
.evidence-capabilitypattern { color: var(--grey-mid); border-color: var(--grey-mid); background: #F4F6FA; }

.proof-card-details dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-mid);
  margin-top: var(--space-2);
}
.proof-card-details dd { margin: 0.15rem 0 0; }
.component-list { margin: 0; padding-left: 1.1rem; }
.proof-card-link { margin: var(--space-3) 0 0; font-weight: 600; }

/* ---------- Industry list ---------- */

.industry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
}
.industry-item {
  border-left: 3px solid var(--magic-blue);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
}
.industry-item h3 a, .industry-item h2 a { color: var(--navy); text-decoration: none; }
.industry-item h3 a:hover, .industry-item h2 a:hover { color: var(--magic-blue); text-decoration: underline; }
.industry-item p { margin-bottom: 0; color: var(--grey-mid); }

/* ---------- Insight cards ---------- */

.insight-lane {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--magic-blue);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}
.insight-status {
  color: var(--grey-mid);
  border: 1px solid var(--grey-line);
  border-radius: 1rem;
  padding: 0 0.6rem;
  font-weight: 600;
}

/* ---------- Lists on solution / industry pages ---------- */

.problem-list, .takeaway-list, .question-list, .covers-list {
  padding-left: 1.25rem;
}
.problem-list li, .takeaway-list li, .question-list li, .covers-list li {
  margin-bottom: var(--space-2);
}
.question-list li { font-style: italic; color: var(--navy); }

.integrates-grid, .modes-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr));
  gap: var(--space-3);
  margin: 0;
}
.integrates-item, .mode-item {
  background: var(--surface);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: var(--space-3);
}
.section-pale .integrates-item { border-color: #C8D4E6; }
.integrates-item dt, .mode-item dt {
  font-weight: 700;
  color: var(--navy);
  margin-bottom: var(--space-1);
}
.integrates-item dd, .mode-item dd { margin: 0; }

.scope-note {
  border-left: 4px solid var(--magic-red);
  background: var(--pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
}
.scope-note p:last-child { margin-bottom: 0; }

.fallback-note {
  border-left: 4px solid var(--magic-blue);
  background: var(--pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-4);
}
.fallback-note p { margin: 0; font-weight: 600; color: var(--navy); }

.differentiator { font-size: 1.15rem; max-width: var(--measure); }

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr));
  gap: var(--space-4);
}
.related-links { list-style: none; margin: 0; padding: 0; }
.related-links li { margin-bottom: var(--space-2); }
.related-links-spaced li { margin-bottom: var(--space-3); }
.related-rationale { color: var(--grey-mid); }

/* ---------- Capability modules ---------- */

.capability-module { scroll-margin-top: 6rem; }
.capability-module + .capability-module { border-top: 1px solid var(--grey-line); }

/* ---------- Timeline ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--magic-blue);
}
.timeline-item {
  position: relative;
  padding: 0 0 var(--space-4) var(--space-4);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.4rem;
  top: 0.35rem;
  width: 0.75rem; height: 0.75rem;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--magic-blue);
}
.timeline-item:last-child::before { background: var(--magic-red); border-color: var(--magic-red); }
.timeline-item h3 { text-transform: none; letter-spacing: 0; color: var(--navy); font-size: 1.05rem; }
.timeline-item p { margin-bottom: 0; }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--magic-blue);
  color: #fff;
  padding: var(--space-5) 0;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { margin: 0 auto var(--space-4); max-width: 55ch; }

/* ---------- Contact form ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}
@media (max-width: 61.99rem) {
  .contact-layout { grid-template-columns: 1fr; }
}

.contact-aside {
  background: var(--pale);
  border-radius: var(--radius);
  padding: var(--space-4);
  position: sticky;
  top: 6rem;
}
.contact-aside h2 { margin-top: var(--space-3); }
.contact-aside h2:first-child { margin-top: 0; }

fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 var(--space-4);
}
legend {
  font-weight: 700;
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: var(--space-3);
  padding: 0;
}

.form-field { margin-bottom: var(--space-3); }
.form-field label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  max-width: 34rem;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 0.55rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
}
.form-field input:focus-visible,
.form-field select:focus-visible,
.form-field textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
}
.form-field .input-validation-error { border-color: var(--magic-red); }

.field-helper { font-size: 0.9rem; color: var(--grey-mid); margin: 0.3rem 0 0; }
.field-error { display: block; color: #B00020; font-size: 0.9rem; margin-top: 0.25rem; }

.form-field-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
}
.form-field-check input { width: 1.15rem; height: 1.15rem; margin-top: 0.3rem; }
.form-field-check label { font-weight: 400; margin: 0; }
.form-field-check .field-error { grid-column: 1 / -1; }

.form-legal { font-size: 0.9rem; color: var(--grey-mid); max-width: var(--measure); }

.form-error-summary:not(:empty) {
  border: 1px solid var(--magic-red);
  border-left-width: 4px;
  background: #FDF0F0;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  color: #7A1010;
}
.form-error-summary ul { margin: 0; padding-left: 1.1rem; }

/* Honeypot: removed from visual flow and from the accessibility tree. */
.hp-field {
  position: absolute !important;
  left: -600rem;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy);
  color: #C9D6EC;
  padding: var(--space-5) 0 var(--space-4);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--space-5);
}
@media (max-width: 61.99rem) {
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}

.footer-logo {
  height: 2.6rem;
  width: auto;
  background: #fff;
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  margin-bottom: var(--space-3);
}
.footer-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8FA5CC;
  margin-bottom: var(--space-2);
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.35rem; }
.site-footer a { color: #E4ECF9; }
.site-footer a:hover { color: #fff; }
.footer-contact { font-style: normal; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.footer-legal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.footer-copyright { margin: 0; }
