/* =============================================================
   Solmateria — CTA FINAL
   The narrative closes: the building surface now bathed in full,
   saturated light — a mirror of the Hero's cold, desaturated open.
   Warmest, most alive moment. Holds the request-a-study form.
   ============================================================= */

.cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Tighter vertical rhythm than the standard --section-pad (~80% of it) — the
     closing section reads snugger; the video is cropped by cover, not resized. */
  padding: clamp(2.4rem, 1.4rem + 4vw, 4.8rem) 0;
  /* top matches the preuves base (#5e3a31), bottom settles into the footer
     colour (#211c21). Kept as the FALLBACK behind the background image (shows
     only if cta-bg.jpg fails to load); the glow peaks ~44% down and fades to 0
     before the edges so it never cuts a hard band at either seam. */
  background:
    radial-gradient(115% 75% at 70% 44%, rgba(248, 168, 90, 0.5) 0%, rgba(238, 96, 67, 0.16) 30%, transparent 50%),
    linear-gradient(180deg, #5e3a31 0%, #512f2c 55%, #211c21 100%);
}

/* ---- Full-bleed background: warm video (climax) over a static fallback ----
   Mirrors the Hero: the fallback image is always behind; the video fades in on
   top once it plays. On phones / data-saver / reduced-motion the video never
   plays (JS gate) → the fallback stays. object-fit: cover + inset:0 → the media
   can never widen the page (overflow-x: clip stays intact, zero h-scroll). */
.cta__fallback,
.cta__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.cta__video {
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}
.cta__video.is-playing { opacity: 1; }
.cta__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Warm legibility veil. The TOP now starts opaque at #5e3a31 — the exact preuves
     base — so the preuves→CTA join is seamless and media-independent, then eases
     DOWN into the dark legibility tone. (Previously the veil was densest at the very
     top (0.86), which cut a dark trough right below the seam; starting at the preuves
     colour and darkening gradually removes it.) Kept deliberately warm; a low
     --brand-orange-red glow low-down reinforces the climax. The form keeps its own
     glass background, so fields stay legible independently of the veil. */
  background:
    radial-gradient(120% 78% at 50% 82%, rgba(238, 96, 67, 0.32) 0%, rgba(238, 96, 67, 0) 62%),
    linear-gradient(180deg,
      #5e3a31 0%,
      rgba(58, 35, 29, 0.82) 6%,
      rgba(30, 19, 16, 0.66) 20%,
      rgba(28, 17, 16, 0.58) 34%,
      rgba(28, 17, 16, 0.52) 62%,
      rgba(33, 20, 18, 0.82) 100%);
}
/* Content sits above the image + veil. */
.cta > .container { position: relative; z-index: 2; }

.cta__head { max-width: 46rem; margin: 0 auto var(--space-12); text-align: center; }
.cta__title { font-size: var(--text-3xl); margin-top: var(--space-4); }
.cta__subtitle {
  margin: var(--space-4) auto 0;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* Centred over the full-bleed image (no more split media column). */
.cta__form-wrap {
  max-width: 40rem;
  margin: 0 auto;
  position: relative;
}

/* ---- Form -------------------------------------------------- */
.cta-form {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-6);
  border-radius: var(--radius-lg);
  background: rgba(18, 15, 19, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
}
.field { display: grid; gap: var(--space-2); }
.field label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.field .opt { color: var(--color-text-subtle); font-weight: var(--weight-regular); }
.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-4);
  font: inherit;
  font-size: var(--text-base);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 104px; padding-top: var(--space-3); resize: vertical; line-height: var(--leading-body); }
.field input::placeholder,
.field textarea::placeholder { color: var(--color-text-subtle); }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-orange);
  background: rgba(255, 255, 255, 0.06);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #e0664f; }

.field--full { grid-column: 1 / -1; }

.cta-form__foot { grid-column: 1 / -1; display: grid; gap: var(--space-3); }
.cta-form .btn { width: 100%; }

.form-status {
  margin: 0;
  font-size: var(--text-sm);
  color: #f4a98f;
  text-align: center;
}
.form-rgpd {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  text-align: center;
}

/* luminous pulse on the primary CTA button */
@media (prefers-reduced-motion: no-preference) {
  .btn--pulse { animation: cta-pulse 2.6s var(--ease-in-out) infinite; }
}
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 10px 26px -10px rgba(238, 96, 67, 0.6), 0 0 0 0 rgba(246, 140, 56, 0); }
  50% { box-shadow: 0 12px 30px -10px rgba(238, 96, 67, 0.7), 0 0 26px 4px rgba(246, 140, 56, 0.4); }
}

/* ---- Confirmation ------------------------------------------ */
.cta-success {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  border-radius: var(--radius-lg);
  background: rgba(18, 15, 19, 0.6);
  border: 1px solid rgba(246, 140, 56, 0.45);
}
.cta-success:focus { outline: none; }
.cta-success__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-5);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gradient-warm);
  color: #fff;
}
.cta-success__icon svg { width: 28px; height: 28px; }
.cta-success h3 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.cta-success p { margin: 0 auto; color: var(--color-text-muted); }

/* ---- Layout ------------------------------------------------ */
@media (min-width: 560px) {
  .cta-form { grid-template-columns: 1fr 1fr; }
}
