/* ==========================================================================
   XyberGate — XYBERNA Tester Registration Portal
   --------------------------------------------------------------------------
   Design system, components and responsive layout for the XyberGate web
   front end. Uses the official XYBERNA palette with controlled blue, red
   and gold accents. Optimized for mobile-first performance.
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* Color — surfaces */
  --color-bg: #050506;
  --color-bg-raised: #09090c;
  --color-surface: #0e0e11;
  --color-surface-elevated: #131319;
  --color-surface-hover: #181820;

  /* Color — steel */
  --color-border: rgba(240, 244, 250, 0.08);
  --color-border-strong: rgba(240, 244, 250, 0.16);
  --color-border-faint: rgba(240, 244, 250, 0.05);

  /* Color — text */
  --color-text-primary: #f7f8fa;
  --color-text-secondary: #aeb6c2;
  --color-text-muted: #848d9d;

  /* Color — brand accents */
  --color-blue: #0a7dff;
  --color-blue-bright: #4da3ff;
  --color-blue-deep: #0068d6;
  --color-red: #e3281a;
  --color-red-bright: #ff5f4a;
  --color-gold: #efa43c;
  --color-gold-bright: #ffc873;

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Elevation */
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.04),
                 0 30px 70px -30px rgba(0, 0, 0, 0.75);
  --shadow-raise: inset 0 1px 0 rgba(255, 255, 255, 0.05),
                  0 20px 44px -20px rgba(0, 0, 0, 0.6);

  /* Motion */
  --transition-fast: 150ms cubic-bezier(0.25, 0.6, 0.3, 1);
  --transition-base: 220ms cubic-bezier(0.25, 0.6, 0.3, 1);

  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;

  /* Typography */
  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont,
                  "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 1rem;
  --text-lead: clamp(1.0625rem, 1.4vw, 1.1875rem);
  --text-h2: clamp(1.375rem, 2.4vw, 1.8125rem);
  --text-h1: clamp(2.25rem, 5vw, 3.5rem);

  /* Layout */
  --container: 1160px;
  --gutter: clamp(20px, 5vw, 40px);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
svg { display: block; }

a {
  color: var(--color-blue-bright);
  text-decoration: none;
}

button { font: inherit; }

[hidden] { display: none !important; }

::selection {
  background: rgba(10, 125, 255, 0.35);
  color: #fff;
}

:focus-visible {
  outline: 3px solid var(--color-blue-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

[id] { scroll-margin-top: 96px; }

/* Screen-reader-only utility */
.sr-only {
  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 */
.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 200;
  padding: 12px 18px;
  background: var(--color-bg-raised);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-150%);
  transition: transform var(--transition-fast);
}

.skip-link:focus-visible { transform: translateY(0); }

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

/* ==========================================================================
   3. Ambient background
   ========================================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);
  pointer-events: none;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 520px at 10% -5%, rgba(10, 125, 255, 0.09), transparent 65%),
    radial-gradient(640px 480px at 95% -10%, rgba(227, 40, 26, 0.07), transparent 62%),
    radial-gradient(560px 420px at 78% 110%, rgba(239, 164, 60, 0.045), transparent 60%);
}

.bg-glow {
  position: absolute;
  width: 46vw;
  height: 46vw;
  min-width: 420px;
  min-height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.6;
  will-change: transform;
}

.bg-glow--blue {
  top: -22%;
  left: -14%;
  background: rgba(10, 125, 255, 0.12);
  animation: drift-a 26s ease-in-out infinite alternate;
}

.bg-glow--red {
  top: -18%;
  right: -16%;
  background: rgba(227, 40, 26, 0.09);
  animation: drift-b 32s ease-in-out infinite alternate;
}

.bg-glow--gold {
  bottom: -30%;
  left: 30%;
  width: 30vw;
  height: 30vw;
  background: rgba(239, 164, 60, 0.045);
  animation: drift-a 38s ease-in-out infinite alternate-reverse;
}

.bg-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(to right, rgba(240, 244, 250, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(240, 244, 250, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6%, 4%, 0) scale(1.06); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.04); }
  to   { transform: translate3d(-5%, 5%, 0) scale(1); }
}

/* Signature brim: electric blue (left) bleeding into electric red (right) */
.bg-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 120;
  background: linear-gradient(90deg,
    var(--color-blue) 0%,
    rgba(10, 125, 255, 0.08) 34%,
    rgba(240, 244, 250, 0.03) 50%,
    rgba(227, 40, 26, 0.1) 66%,
    var(--color-red) 100%);
  pointer-events: none;
}

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 3px;
  z-index: 90;
  background: rgba(5, 5, 6, 0.82);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border-faint);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-primary);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid var(--color-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.brand__icon { width: 30px; height: 30px; object-fit: contain; }

.brand__text { display: flex; flex-direction: column; line-height: 1.15; }

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: var(--color-text-primary);
}

.brand__parent {
  margin-top: 2px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.42em;
  color: var(--color-text-muted);
}

.site-nav { display: flex; align-items: center; gap: var(--space-5); }

.site-nav__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.site-nav__link:hover { color: var(--color-text-primary); }

/* ==========================================================================
   5. Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(44px, 7vw, 92px) clamp(56px, 8vw, 104px);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(44px, 6vw, 88px);
  align-items: center;
}

.hero-copy,
.hero-points { position: relative; min-width: 0; }

.gateway {
  position: absolute;
  top: -70px;
  left: -66px;
  z-index: 0;
  color: rgba(240, 244, 250, 0.07);
  opacity: 0.75;
  pointer-events: none;
  animation: gateway-float 14s ease-in-out infinite;
}

.gateway .gateway__dot { fill: rgba(239, 164, 60, 0.9); }
.gateway .gateway__dot--blue { fill: rgba(10, 125, 255, 0.85); }
.gateway .gateway__dot--red { fill: rgba(227, 40, 26, 0.85); }

.hero-copy > *:not(.gateway) { position: relative; z-index: 1; }

@keyframes gateway-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.eyebrow__tick {
  width: 22px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-blue);
  box-shadow: 0 0 12px rgba(10, 125, 255, 0.5);
}

.eyebrow__tick--gold {
  background: var(--color-gold);
  box-shadow: 0 0 12px rgba(239, 164, 60, 0.4);
}

.hero__title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.hero__lead {
  margin-top: var(--space-5);
  max-width: 46ch;
  font-size: var(--text-lead);
  color: var(--color-text-secondary);
}

.hero__points {
  margin-top: var(--space-7);
  display: grid;
  gap: var(--space-3);
}

.hero__point {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

.hero__point-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-blue);
  box-shadow: 0 0 10px rgba(10, 125, 255, 0.55);
}

.hero__point-dot--red {
  background: var(--color-red);
  box-shadow: 0 0 10px rgba(227, 40, 26, 0.5);
}

.hero__point-dot--gold {
  background: var(--color-gold);
  box-shadow: 0 0 10px rgba(239, 164, 60, 0.5);
}

.hero__footnote {
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ==========================================================================
   6. Registration card
   ========================================================================== */
.registration {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

.registration__accent {
  position: absolute;
  top: -3px;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: linear-gradient(90deg, var(--color-blue), transparent 55%, var(--color-red));
  opacity: 0.85;
}

.registration__form,
.registration__success {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 4vw, 40px);
}

.registration__head { margin-bottom: var(--space-4); }

.registration__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-blue-bright);
}

.registration__eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: currentColor;
}

.registration__title {
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}

/* --- Form sections --- */
.form-section + .form-section {
  margin-top: var(--space-7);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

.form-section__title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.form-section__optional {
  color: var(--color-text-muted);
  font-weight: 600;
}

.form-section__required {
  color: var(--color-gold);
  font-weight: 600;
}

/* --- Fields --- */
.field { margin-top: var(--space-5); }

.field:first-of-type { margin-top: var(--space-5); }

.field__label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.field__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text-primary);
  caret-color: var(--color-blue);
  transition: border-color var(--transition-fast),
              box-shadow var(--transition-fast),
              background var(--transition-fast);
}

.field__input::placeholder { color: var(--color-text-muted); }

.field__input:hover {
  border-color: rgba(240, 244, 250, 0.26);
  background: var(--color-bg-raised);
}

.field__input:focus {
  outline: none;
  border-color: var(--color-blue);
  background: var(--color-bg-raised);
  box-shadow: 0 0 0 3px rgba(10, 125, 255, 0.22),
              inset 0 0 0 1px rgba(10, 125, 255, 0.55);
}

.field__hint {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.field__error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-red-bright);
}

.field.is-invalid .field__input {
  border-color: rgba(255, 95, 74, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 95, 74, 0.14);
}

.field.is-invalid .field__input:hover {
  border-color: var(--color-red-bright);
}

.field.is-valid .field__input {
  border-color: rgba(10, 125, 255, 0.4);
}

/* --- Checkboxes --- */
.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: flex-start;
  cursor: pointer;
  margin-top: var(--space-5);
}

.choice:first-of-type { margin-top: var(--space-5); }

.choice__input {
  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;
}

.choice__box {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: 7px;
  background: var(--color-bg-raised);
  transition: border-color var(--transition-fast),
              background var(--transition-fast),
              box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.choice:hover .choice__box {
  border-color: rgba(240, 244, 250, 0.4);
}

.choice__input:focus-visible + .choice__box {
  outline: 3px solid var(--color-blue-bright);
  outline-offset: 2px;
}

.choice__input:checked + .choice__box {
  background: var(--color-blue);
  border-color: var(--color-blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 5 8.7 9.5 3.5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 0 14px rgba(10, 125, 255, 0.45);
}

.choice__input:active + .choice__box { transform: scale(0.92); }

.choice__text {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-secondary);
}

.choice__link {
  color: var(--color-blue-bright);
  border-bottom: 1px solid rgba(77, 163, 255, 0.35);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.choice__link:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

#consent-group.is-invalid .choice__box {
  border-color: rgba(255, 95, 74, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 95, 74, 0.14);
}

.consent-error { margin-top: var(--space-2); }

/* --- Privacy note --- */
.registration__privacy-note {
  margin-top: var(--space-6);
  padding-left: var(--space-4);
  border-left: 2px solid rgba(10, 125, 255, 0.4);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text-muted);
}

/* --- Actions / alert / button --- */
.registration__actions { margin-top: var(--space-6); }

.form-alert {
  padding: 13px 16px;
  margin-bottom: var(--space-4);
  border: 1px solid rgba(255, 95, 74, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 95, 74, 0.08);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  color: #ffd9d2;
}

.form-alert--config {
  border-color: rgba(239, 164, 60, 0.4);
  background: rgba(239, 164, 60, 0.07);
  color: #ffe3bd;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--transition-fast),
              background var(--transition-fast),
              box-shadow var(--transition-fast),
              opacity var(--transition-fast);
}

.btn--primary {
  color: #fff;
  background: var(--color-blue);
  box-shadow: 0 14px 30px -12px rgba(10, 125, 255, 0.55),
              inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn--primary:hover {
  background: var(--color-blue-bright);
  box-shadow: 0 18px 38px -12px rgba(10, 125, 255, 0.62),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 10px 22px -12px rgba(10, 125, 255, 0.5);
}

.btn--primary:focus-visible {
  outline: 3px solid var(--color-blue-bright);
  outline-offset: 3px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn.is-loading .btn__spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   7. Success state
   ========================================================================== */
.success {
  text-align: center;
  padding: var(--space-5) var(--space-2);
}

.success__mark {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto var(--space-6);
  display: grid;
  place-items: center;
}

.success__icon {
  position: relative;
  z-index: 2;
  width: 104px;
  height: 104px;
  object-fit: contain;
  animation: success-pop 480ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.success__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(239, 164, 60, 0.75);
  animation: ring-pulse 1.6s cubic-bezier(0.3, 0.6, 0.3, 1) infinite;
}

.success__ring::before,
.success__ring::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px solid rgba(239, 164, 60, 0.22);
}

.success__ring::after { inset: -38px; border-color: rgba(77, 163, 255, 0.14); }

.success__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
  animation: success-rise 500ms 140ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.success__lead {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-primary);
  animation: success-rise 500ms 220ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.success__body {
  margin: var(--space-3) auto 0;
  max-width: 42ch;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
  animation: success-rise 500ms 300ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes success-pop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes success-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ring-pulse {
  0%   { transform: scale(1); opacity: 0.9; }
  60%  { transform: scale(1.28); opacity: 0; }
  100% { transform: scale(1.28); opacity: 0; }
}

/* ==========================================================================
   8. Tester program section
   ========================================================================== */
.program {
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--color-border-faint);
}

.program__head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto var(--space-9);
}

.program__head .eyebrow { justify-content: center; }

.program__title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-h2);
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--color-text-primary);
}

.program__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.program-card {
  position: relative;
  padding: 28px 26px 30px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
  transition: transform var(--transition-base),
              border-color var(--transition-base);
}

.program-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 26px;
  width: 28px;
  height: 3px;
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  background: var(--color-blue);
}

.program-card:nth-child(2)::before { background: var(--color-red); }
.program-card:nth-child(3)::before { background: var(--color-gold); }

.program-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border-strong);
}

.program-card__index {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-gold);
}

.program-card__title {
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-text-primary);
}

.program-card__body {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

/* ==========================================================================
   9. Trust / privacy section
   ========================================================================== */
.trust {
  padding-block: var(--space-9) clamp(64px, 9vw, 112px);
  border-top: 1px solid var(--color-border-faint);
}

.trust__inner {
  max-width: 720px;
  margin-inline: auto;
  padding: clamp(28px, 5vw, 44px);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
}

.trust__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  letter-spacing: -0.015em;
  color: var(--color-text-primary);
}

.trust__body {
  margin: var(--space-3) auto 0;
  max-width: 54ch;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-text-secondary);
}

.trust__links {
  margin-top: var(--space-6);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.trust__link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-blue-bright);
  border-bottom: 1px solid rgba(77, 163, 255, 0.35);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.trust__link:hover { color: #fff; border-color: rgba(255, 255, 255, 0.6); }

.trust__sep { color: var(--color-text-muted); }

/* ==========================================================================
   10. Legal document pages (terms.html / privacy.html)
   ========================================================================== */
.legal {
  padding-block: clamp(44px, 7vw, 88px) clamp(64px, 9vw, 112px);
}

.legal__head,
.legal__doc {
  max-width: 720px;
  margin-inline: auto;
}

.legal__back { margin-bottom: var(--space-6); }

.legal__back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-blue-bright);
  border-bottom: 1px solid rgba(77, 163, 255, 0.35);
  transition: color var(--transition-fast),
              border-color var(--transition-fast);
}

.legal__back-link::before {
  content: "";
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(1px) rotate(45deg);
}

.legal__back-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.legal__title {
  margin-top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 5.4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
}

.legal__intro {
  margin-top: var(--space-5);
  max-width: 62ch;
  font-size: var(--text-lead);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.legal__updated {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.legal__doc {
  margin-top: var(--space-9);
  padding: clamp(24px, 4.5vw, 44px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raise);
}

.legal__section + .legal__section {
  margin-top: var(--space-8);
  padding-top: var(--space-7);
  border-top: 1px solid var(--color-border);
}

.legal__section h2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--color-text-primary);
}

.legal__section h2::before {
  content: "";
  flex: none;
  width: 22px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-blue);
}

/* Accent ticks echo the official blue / red / gold palette */
.legal__section:nth-of-type(3n+2) h2::before { background: var(--color-red); }
.legal__section:nth-of-type(3n)   h2::before { background: var(--color-gold); }

.legal__section p {
  margin-top: var(--space-3);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.legal__section ul {
  margin-top: var(--space-3);
  display: grid;
  gap: var(--space-2);
}

.legal__section li {
  position: relative;
  padding-left: var(--space-5);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.legal__section li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-blue);
}

.legal__link {
  color: var(--color-blue-bright);
  border-bottom: 1px solid rgba(77, 163, 255, 0.35);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.legal__link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.legal__mark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-9);
}

.legal__mark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legal__mark-dot:nth-child(1) { background: var(--color-blue); box-shadow: 0 0 10px rgba(10, 125, 255, 0.55); }
.legal__mark-dot:nth-child(2) { background: var(--color-red); box-shadow: 0 0 10px rgba(227, 40, 26, 0.5); }
.legal__mark-dot:nth-child(3) { background: var(--color-gold); box-shadow: 0 0 10px rgba(239, 164, 60, 0.5); }

/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--color-border);
}

.site-footer__inner {
  padding-block: clamp(36px, 6vw, 56px);
}

.site-footer__brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.site-footer__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--color-text-primary);
}

.site-footer__separator { color: var(--color-text-muted); }

.site-footer__parent {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--color-text-secondary);
}

.site-footer__tagline {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.site-footer__nav {
  margin-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.site-footer__link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.site-footer__link:hover { color: var(--color-text-primary); }

.site-footer__legal {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-faint);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* No-JavaScript banner */
.noscript {
  position: fixed;
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: 150;
  padding: 14px 18px;
  background: #1a0b06;
  border: 1px solid rgba(255, 95, 74, 0.5);
  border-radius: var(--radius-sm);
  color: #ffd9d2;
  font-size: var(--text-sm);
  text-align: center;
  box-shadow: var(--shadow-card);
}

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (min-width: 640px) {
  .program__grid { grid-template-columns: repeat(2, 1fr); }
  .program-card:last-child { grid-column: 1 / -1; }
}

@media (min-width: 860px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
    grid-template-rows: auto auto;
    grid-template-areas:
      "copy form"
      "points form";
    align-items: center;
  }

  .hero-copy    { grid-area: copy; }
  .hero-points  { grid-area: points; }
  .registration { grid-area: form; }

  .program__grid { grid-template-columns: repeat(3, 1fr); }
  .program-card:last-child { grid-column: auto; }

  .site-footer__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-6) var(--space-9);
  }

  .site-footer__tagline { grid-column: 2; grid-row: 1; align-self: start; }
  .site-footer__nav { margin-top: 0; grid-column: 2; grid-row: 2; }
  .site-footer__legal { grid-column: 1 / -1; }
}

@media (max-width: 639px) {
  .site-nav { display: none; }
}

/* ==========================================================================
   13. Entrance animations
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .hero__title,
  .hero__lead,
  .hero__points,
  .hero__footnote,
  .registration,
  .legal__head,
  .legal__doc {
    animation: rise-in 560ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
  }

  .hero__title   { animation-delay: 60ms; }
  .hero__lead    { animation-delay: 140ms; }
  .hero__points  { animation-delay: 220ms; }
  .hero__footnote{ animation-delay: 280ms; }
  .registration  { animation-delay: 120ms; }
  .legal__doc    { animation-delay: 160ms; }

  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ==========================================================================
   14. Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .gateway,
  .bg-glow,
  .success__ring { animation: none !important; }
}