/* FLR Contact page — "The Engineering Brief" (loaded only on contact.html)
   Naming: .cx-* prefix. Tokens come from core.css.
   Motion contract: content is fully visible by default; GSAP (js/contact-page.js)
   sets initial hidden states at runtime, so no-JS and reduced-motion users always
   see a complete static page. */

/* ═══ SCROLL PROGRESS RAIL ═══ */
.cx-progress {
  position: fixed;
  top: 0;
  right: 0;
  width: 3px;
  height: 100vh;
  height: 100dvh;
  z-index: 60;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.cx-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, var(--lime), var(--red));
  box-shadow: 0 0 12px var(--lime-glow);
  transform: scaleY(0);
  transform-origin: top center;
}

/* No-JS / reduced motion: hide the rail rather than show a stuck bar */
.no-js .cx-progress { display: none; }

@media (prefers-reduced-motion: reduce) {
  .cx-progress { display: none; }
}

/* ═══ BLUEPRINT BACKGROUND LAYER ═══ */
.cx-blueprint {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Single FLR chevron outline, proportionately sized and centred on screen */
.cx-bp-mark {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(88vw, 1500px);
  height: fit-content;
  color: var(--lime);
  opacity: 0.12;
}

.cx-bp-mark svg { width: 100%; height: auto; display: block; overflow: visible; }

.cx-bp-mark path,
.cx-bp-mark polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: miter;
}

/* Neon light pulses travelling along the outline. Hidden until the motion
   system initialises (JS reveals it), so static/reduced-motion pages show
   only the plain outline. */
.cx-bp-runner {
  visibility: hidden;
}

.cx-bp-runner path,
.cx-bp-runner polygon {
  stroke: var(--lime-bright);
  stroke-width: 2.25;
  filter: drop-shadow(0 0 6px var(--lime)) drop-shadow(0 0 14px var(--lime-glow));
}

@media (max-width: 768px) {
  .cx-bp-mark { width: 92vw; }
}

/* ═══ SHARED SECTION FURNITURE ═══ */
.cx-index {
  display: block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.cx-index em {
  font-style: normal;
  color: var(--lime);
}

.cx-rule {
  height: 1px;
  background: linear-gradient(90deg, var(--border-bright), transparent 70%);
  border: none;
  margin: 0 0 clamp(28px, 4vw, 44px);
  transform-origin: left center;
}

.cx-header-left { text-align: left; margin-left: 0; }
.cx-header-tight { margin-bottom: 28px; }

/* ═══ 01 · HERO ═══ */
.cx-hero {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + clamp(40px, 6vw, 72px)) 0 clamp(56px, 7vw, 88px);
  overflow: visible;
}

.cx-hero-inner { position: relative; z-index: 2; }

.cx-hero h1 {
  font-size: clamp(44px, 7.5vw, 96px);
  font-weight: 700;
  font-style: italic;
  line-height: 0.96;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin: 0 0 clamp(20px, 3vw, 32px);
  max-width: 15ch;
}

.cx-hero h1 .cx-line { display: block; overflow: hidden; }
.cx-hero h1 .cx-line > span { display: block; }
.cx-hero h1 .cx-accent { color: var(--lime); text-shadow: 0 0 34px var(--lime-glow); }

.cx-hero-lead {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--muted);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.cx-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: clamp(32px, 4vw, 52px);
}

.cx-hero-note {
  flex-basis: 100%;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-family: var(--font-display);
}

.cx-hero-note strong { color: var(--lime); font-weight: 700; }

/* Live-response badge */
.cx-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: var(--lime-dim);
  clip-path: var(--clip-tag);
  box-shadow: inset 0 0 0 1px var(--border-bright);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 24px;
}

.cx-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
  animation: cx-pulse 2.2s infinite;
}

@keyframes cx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Scroll cue */
.cx-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  transition: color var(--transition);
}

.cx-scroll-cue:hover,
.cx-scroll-cue:focus-visible { color: var(--lime); }

.cx-scroll-cue::before {
  content: '';
  width: 1px;
  height: 44px;
  background: linear-gradient(180deg, var(--lime), transparent);
  animation: cx-cue 2.4s ease-in-out infinite;
}

@keyframes cx-cue {
  0%, 100% { transform: scaleY(0.4); transform-origin: top; opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ═══ 02 · WHY FLR (sticky rail + scrolling proof cards) ═══ */
.cx-why-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.cx-why-rail {
  position: sticky;
  top: calc(var(--header-h) + 48px);
}

.cx-why-rail h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: 18px;
}

.cx-why-rail p { color: var(--muted); font-size: 15px; line-height: 1.7; max-width: 40ch; }

/* Rail meter — fills as the cards scroll past (GSAP scrub) */
.cx-why-meter {
  margin-top: 28px;
  width: 120px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cx-why-meter span {
  display: block;
  height: 100%;
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime-glow);
  transform: scaleX(0);
  transform-origin: left center;
}

.cx-why-cards { display: grid; gap: clamp(18px, 2.5vw, 28px); }

.cx-why-card {
  position: relative;
  padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(145deg, rgba(18, 18, 26, 0.9), rgba(8, 8, 12, 0.95));
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.cx-why-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 0 32px rgba(200, 255, 0, 0.07);
}

.cx-why-card .cx-card-no {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--muted-2);
}

.cx-why-card h3 {
  font-size: clamp(17px, 1.8vw, 20px);
  text-transform: uppercase;
  font-style: italic;
  margin: 0 0 10px;
  padding-right: 64px;
}

.cx-why-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }

.cx-why-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.cx-why-stat strong {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  font-style: italic;
  color: var(--lime);
  text-shadow: 0 0 18px var(--lime-glow);
}

.cx-why-stat span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

@media (max-width: 860px) {
  .cx-why-grid { grid-template-columns: 1fr; }
  .cx-why-rail { position: static; }
  .cx-why-meter { display: none; }
}

/* ═══ 03 · CHANNELS ═══ */
.cx-channels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(14px, 2vw, 22px);
}

.cx-channel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 2.6vw, 32px) clamp(18px, 2.2vw, 26px);
  background: linear-gradient(160deg, rgba(18, 18, 26, 0.85), rgba(8, 8, 12, 0.95));
  border: 1px solid var(--border);
  color: var(--white);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.cx-channel::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}

.cx-channel:hover,
.cx-channel:focus-visible {
  border-color: var(--border-bright);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5), 0 0 30px rgba(200, 255, 0, 0.06);
  transform: translateY(-4px);
}

.cx-channel:hover::after,
.cx-channel:focus-visible::after { transform: scaleX(1); }

.cx-channel:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

.cx-channel-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--lime);
  background: var(--lime-dim);
  clip-path: var(--clip-tag);
}

.cx-channel-icon svg { width: 20px; height: 20px; }

.cx-channel h3 {
  font-size: 16px;
  font-style: italic;
  text-transform: uppercase;
  margin: 0;
}

.cx-channel .cx-channel-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--lime);
  word-break: break-word;
}

.cx-channel p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 0; }

.cx-channel .cx-channel-hint {
  margin-top: auto;
  padding-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
}

@media (max-width: 1000px) { .cx-channels-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cx-channels-grid { grid-template-columns: 1fr; } }

/* ═══ 04 · ENQUIRY (form + aside) ═══ */
.cx-form-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

.cx-form-aside { position: sticky; top: calc(var(--header-h) + 48px); display: grid; gap: 18px; }

.cx-aside-block {
  padding: 22px 24px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 16, 0.7);
}

.cx-aside-block h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 8px;
}

.cx-aside-block a,
.cx-aside-block p {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  transition: color var(--transition);
}

.cx-aside-block a:hover,
.cx-aside-block a:focus-visible { color: var(--lime); }

.cx-aside-block small { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); font-family: var(--font); font-weight: 400; }

@media (max-width: 900px) {
  .cx-form-grid { grid-template-columns: 1fr; }
  .cx-form-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

/* ── Premium form variant (markup from mountContactForm variant:'premium') ── */
.contact-form-wrap--premium { padding: clamp(26px, 3.4vw, 44px); }

.contact-form-wrap--premium .cx-form-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.contact-form-wrap--premium h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-style: italic;
  text-transform: uppercase;
  margin: 0;
}

.cx-form-ref {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.cx-fieldset {
  border: none;
  margin: 0 0 clamp(20px, 2.6vw, 30px);
  padding: 0;
  min-width: 0;
}

.cx-fieldset legend {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 18px;
  padding-top: 18px;
}

.cx-fieldset legend::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-bright), transparent);
}

/* Floating-label field. Controls are styled via direct-child selectors so the
   nested VRN plate input (inside .vrn-plate) keeps its own styling. */
.cx-field { position: relative; margin-bottom: 18px; }

/* Grid rows already provide the gap */
.contact-form-wrap--premium .form-grid .cx-field { margin-bottom: 0; }

.cx-field > input,
.cx-field > textarea,
.cx-field > select {
  width: 100%;
  padding: 22px 14px 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--white);
  font-family: var(--font);
  font-size: 14.5px;
  transition: border-color var(--transition), background var(--transition);
}

.cx-field > textarea { min-height: 116px; resize: vertical; }

.cx-field > label {
  position: absolute;
  left: 14px;
  top: 16px;
  font-size: 13.5px;
  color: var(--muted);
  pointer-events: none;
  transition: transform 0.18s ease, font-size 0.18s ease, color 0.18s ease;
  transform-origin: left top;
}

.cx-field > input:focus + label,
.cx-field > input:not(:placeholder-shown) + label,
.cx-field > textarea:focus + label,
.cx-field > textarea:not(:placeholder-shown) + label,
.cx-field.cx-field--select > label,
.cx-field.is-filled > label {
  transform: translateY(-10px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

/* Placeholder is required for :placeholder-shown but stays invisible until focus */
.cx-field > input::placeholder,
.cx-field > textarea::placeholder { color: transparent; transition: color 0.18s ease; }
.cx-field > input:focus::placeholder,
.cx-field > textarea:focus::placeholder { color: var(--muted-2); }

/* Focus underline sweep */
.cx-field::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--lime);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.cx-field:focus-within::after { transform: scaleX(1); }

/* The VRN plate is self-styled; no underline sweep behind it */
.cx-field--plate::after { display: none; }

/* Full-size UK plate input — mirrors core.css's .form-row .vrn-input rules,
   which are scoped to containers this premium form doesn't use */
.cx-field--plate .vrn-input {
  flex: 1;
  width: auto;
  min-width: 0;
  border: none;
  background: transparent;
  color: #0b0b0b;
  font-family: var(--font-display), 'Arial Black', 'Impact', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(40px, 8vw, 54px);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  text-align: center;
  padding: 6px 10px;
  outline: none;
}

.cx-field--plate .vrn-input::placeholder {
  color: rgba(11, 11, 11, 0.35);
  letter-spacing: 0.05em;
}

.cx-field--plate .vrn-input:focus {
  border: none;
  background: transparent;
  box-shadow: none;
}

.cx-field > input:focus,
.cx-field > textarea:focus,
.cx-field > select:focus {
  outline: none;
  border-color: var(--border-bright);
  background: rgba(0, 0, 0, 0.6);
}

/* Select uses a static (non-floating) compact label inside the border */
.cx-field--select > select { padding: 22px 14px 10px; appearance: none; cursor: pointer; }

.cx-field--select::before {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--lime);
  border-bottom: 2px solid var(--lime);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* VRN plate + non-floating rows reuse core.css .form-row label styling */
.contact-form-wrap--premium .cx-static-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-display);
}

/* Validation states */
.cx-field.is-invalid > input,
.cx-field.is-invalid > textarea,
.cx-field.is-invalid > select { border-color: rgba(225, 6, 0, 0.6); }

.cx-field--plate.is-invalid .vrn-plate { box-shadow: 0 0 0 2px rgba(225, 6, 0, 0.6); }

.cx-field.is-invalid::after { background: var(--red); transform: scaleX(1); }

.cx-field.is-valid::after { background: var(--lime); transform: scaleX(1); opacity: 0.5; }

.cx-field-error {
  display: none;
  margin: 6px 0 0;
  font-size: 12px;
  color: #ff6d68;
  line-height: 1.4;
}

.cx-field.is-invalid .cx-field-error { display: block; }

/* Submit row */
.cx-form-submit {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.cx-form-submit .btn { flex: 1 1 260px; padding: 18px 34px; }

.cx-form-submit small {
  font-size: 11.5px;
  color: var(--muted-2);
  line-height: 1.5;
  flex: 1 1 200px;
}

/* ═══ 05 · COVERAGE / BUSINESS SPEC ═══ */
.cx-coverage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.cx-spec { border-top: 1px solid var(--border); }

.cx-spec-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) 1.3fr;
  gap: 16px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}

.cx-spec-row dt {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-top: 3px;
}

.cx-spec-row dd { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--white); }
.cx-spec-row dd a { color: var(--lime); }
.cx-spec-row dd a:hover { text-decoration: underline; }
.cx-spec-row dd .cx-spec-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Coverage radius diagram */
.cx-radius { position: relative; max-width: 420px; margin-inline: auto; width: 100%; }
.cx-radius svg { width: 100%; height: auto; display: block; overflow: visible; }

.cx-radius .cx-r-ring { fill: none; stroke: rgba(200, 255, 0, 0.35); stroke-width: 1; }
.cx-radius .cx-r-ring--dash { stroke-dasharray: 4 6; stroke: rgba(255, 255, 255, 0.2); }
.cx-radius .cx-r-core { fill: var(--lime); }
.cx-radius .cx-r-label { font-family: var(--font-display); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; fill: rgba(255, 255, 255, 0.55); }
.cx-radius .cx-r-town { font-family: var(--font-display); font-size: 10px; fill: rgba(255, 255, 255, 0.75); }
.cx-radius .cx-r-dot { fill: rgba(200, 255, 0, 0.8); }

@media (max-width: 860px) {
  .cx-coverage-grid { grid-template-columns: 1fr; }
  .cx-radius { max-width: 340px; }
}

/* ═══ 06 · FAQ ═══ */
.cx-faq .faq-list { max-width: 780px; margin-inline: auto; }

.cx-faq-more {
  display: block;
  text-align: center;
  margin-top: 28px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lime);
}

.cx-faq-more:hover { text-decoration: underline; }

/* ═══ 07 · FINAL CTA ═══ */
.cx-final {
  position: relative;
  text-align: center;
  padding: clamp(96px, 12vw, 160px) 0;
  /* overflow must stay visible — hidden on a GSAP-pinned section causes early pin glitches */
}

.cx-final-mark {
  width: min(560px, 78vw);
  margin: 0 auto clamp(28px, 4vw, 44px);
}

.cx-final-mark svg { width: 100%; height: auto; display: block; }

/* Outline strokes drawn by GSAP; fills fade in afterwards ("ink in") */
.cx-final-mark .cx-fm-stroke path,
.cx-final-mark .cx-fm-stroke polygon {
  fill: none;
  stroke: rgba(255, 255, 255, 0.4);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.cx-final-mark .cx-fm-fill { opacity: 0; }

/* No-JS: show the brand mark fully (motion system never runs to ink it in) */
.no-js .cx-final-mark .cx-fm-fill { opacity: 1; }

.cx-final h2 {
  font-size: clamp(30px, 4.4vw, 54px);
  font-style: italic;
  text-transform: uppercase;
  line-height: 1.02;
  margin: 0 auto clamp(14px, 2vw, 22px);
  max-width: 18ch;
}

.cx-final h2 .cx-accent { color: var(--lime); text-shadow: 0 0 30px var(--lime-glow); }

.cx-final p { color: var(--muted); max-width: 52ch; margin: 0 auto clamp(28px, 3.6vw, 40px); font-size: 15.5px; line-height: 1.7; }

.cx-final-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; }

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  .cx-badge::before,
  .cx-scroll-cue::before { animation: none; }

  .cx-channel,
  .cx-channel::after,
  .cx-field > label,
  .cx-field::after,
  .cx-why-card { transition: none; }

  .cx-final-mark .cx-fm-fill { opacity: 1; }
}
