:root {
  --bg1: #071b16;
  --bg2: #0b2f25;
  --bg3: #134c3c;
  --gold-400: #d7b66a;
  --gold-500: #e0c078;
  --gold-600: #f0d88f;
  --dur: 1300ms;
  --ease: linear;
  --gapZ: 18px;
  --lift: 24px;
  --glow: 0 0 18px rgba(240, 216, 143, 0.25), 0 0 42px rgba(223, 199, 126, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html,
body {
  overflow-x: hidden;
}
body {
  margin: 0;
  color: #f5f7f4;
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter;
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  min-height: 100svh;
  overflow-y: auto;
  display: grid;
  place-items: center;
}

/* ambient */
.grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}
canvas#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

/* overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    90% 70% at 50% 45%,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.58) 55%,
    rgba(0, 0, 0, 0.8) 100%
  );
}
.overlay.active {
  pointer-events: auto;
}
@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes overlayOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* stage */
.wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(10px, 4vw, 20px);
}
.stage {
  width: min(100%, 820px);
  margin: 0 auto;
  perspective: 2000px;
  -webkit-perspective: 2000px;
  perspective-origin: 50% 50%;
}

.float {
  will-change: transform;
  animation: floatMove 14s ease-in-out infinite alternate;
}
@keyframes floatMove {
  0% {
    transform: translate3d(0, 0, 0) rotateZ(0deg);
  }
  35% {
    transform: translate3d(0.6px, -1.2px, 0) rotateZ(-0.05deg);
  }
  70% {
    transform: translate3d(-0.8px, 1px, 0) rotateZ(0.06deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotateZ(0deg);
  }
}

/* 3D chain */
.card3d,
.card-inner,
.face,
.front,
.back,
.ctas,
.headline,
.btn {
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  will-change: transform;
}
.ctas,
.form-head,
.steps,
.back-ctas {
  /* interactive zones only */
  pointer-events: all;
}
.card3d {
  transform: rotateX(var(--tiltX, 0deg)) rotateY(var(--tiltY, 0deg));
  transition: transform 120ms ease-out;
  pointer-events: none;
  &:hover {
    .card-inner {
      &:before {
        transform: translateZ(30px);
        border: 4px solid rgba(255, 255, 255, 0.9);
      }
    }
  }
}
.card-inner {
  transition: transform var(--dur) var(--ease);
  &:before {
    content: "";
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
    top: 13px;
    left: 13px;
    right: 13px;
    bottom: 13px;
    z-index: 2;
    transition: ease all 0.8s;
    transform-style: preserve-3d;
    transform: translateZ(10px);
  }
  &:after {
    content: "";
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    z-index: 2;
    transition: ease all 0.3s;
    background: transparent;
  }
}
.card-inner::before,
.card-inner::after {
  pointer-events: none;
}
.card3d.is-back .card-inner {
  transform: rotateY(180deg);
}

.face {
  position: relative;
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 100%;
  background: #0d2c23;
  min-height: 520px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}
.face {
  background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.02),
        rgba(255, 255, 255, 0)
      )
      padding-box,
    linear-gradient(
        145deg,
        rgba(223, 199, 126, 0.35),
        rgba(223, 199, 126, 0.08)
      )
      border-box;
  backdrop-filter: blur(60px) saturate(120%);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.35), var(--glow);
  -webkit-backdrop-filter: blur(60px) saturate(120%);
}
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0) 35%,
    rgba(0, 0, 0, 0) 65%,
    rgba(0, 0, 0, 0.08)
  );
  mix-blend-mode: overlay;
}
.front {
  transform: translateZ(0.5px);
}
.back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg) translateZ(0.5px);
  display: flex;
  flex-direction: column;
  background: #0d2c23;
}
/* utility */
.hidden {
  display: none !important;
}

/* Qualify banner — visible, opaque, near top */
.qualify-banner {
  position: relative;
  margin: 8px 20px 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0d2c23; /* solid, opaque */
  border: 1px solid rgba(223, 199, 126, 0.35);
  color: #f5f7f4;
  z-index: 2; /* above step contents */
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  max-height: 100px;
}
.qualify-banner.show {
  opacity: 1;
  transform: translateY(0);
}
.form-errors {
    color: #f0d88f;
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
  .form-errors.show {
    opacity: 1;
    transform: translateY(0);
  }
.pl-thanks {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(223, 199, 126, 0.28);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color: #f5f7f4;
}
.pl-thanks-sub {
  opacity: 0.9;
  margin-top: 4px;
  font-size: 0.95rem;
}

/* post-lead view */
.post-lead {
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: all;
}
.post-lead-scroll {
  /* Internal scroll area for post-lead content (events + FAQs) */
  overflow: auto;
  padding-right: 6px;
  /* Ensure it never overgrows the viewport even when FAQs expand */
  max-height: clamp(260px, calc(100svh - 260px), 60vh);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.pl-title,
.faq-title {
  margin: 8px 0 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.events {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}
.event {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(223, 199, 126, 0.28);
}
.event-when {
  font-size: 0.9rem;
  opacity: 0.85;
}
.event-what {
  font-size: 1.05rem;
  font-weight: 700;
}
.faq {
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(223, 199, 126, 0.2);
}
.faq + .faq {
  margin-top: 8px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
}
.faq-a {
  margin-top: 6px;
}
.faq {
  overflow: hidden;
  transition: max-height 1.2s ease;
  max-height: 2.6em; /* summary line visible */
}

.faq[open] {
  max-height: 1000px; /* big enough to hold full answer */
}

/* Optional nicety: fade in the answer */
.faq .faq-a {
  max-height: none; /* let the parent control the clipping */
  opacity: 0.01;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

.faq[open] .faq-a {
  opacity: 1;
}
/* inner clipping wrapper for front content only */

.post-lead {
  padding-bottom: 8px;
}
.front-surface {
  position: relative;
  border-radius: inherit;
  overflow: hidden;
  transform: translateZ(1px);
  padding: 24px 20px 10px;
}

/* header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: #09241d;
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brandname {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.85rem;
}
.badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: #666;
  background: linear-gradient(
        180deg,
        rgba(20, 80, 63, 0.35),
        rgba(20, 80, 63, 0.05)
      )
      padding-box,
    linear-gradient(145deg, var(--gold-600), var(--gold-400)) border-box;
  box-shadow: 0 2px 8px rgba(223, 199, 126, 0.35);
  white-space: nowrap;
}

/* headline + body */
.headline {
  font-size: clamp(28px, 5.5vw, 52px);
  font-weight: 800;
  margin: 6px 0 12px;
  text-align: center;
  transform: translateZ(var(--gapZ)) translateZ(0.001px);
}
.copy {
  max-width: 62ch;
  margin: 0 auto;
  text-align: center;
  opacity: 0.95;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* CTAs */
.ctas {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 14px 20px 0;
  transform: translateZ(var(--gapZ));
  pointer-events: all;
}
.ctas::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 26px;
  pointer-events: none;
  /*  background: radial-gradient(70% 90% at 50% 0%, rgba(0,0,0,.34), rgba(0,0,0,0));*/
  transform: translateZ(calc(-1 * var(--gapZ)));
  opacity: 0.65;
}
.btn {
  position: relative;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0)
  );
  color: #f7f4ea;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}
.primary {
  color: #0b201a;
  background: linear-gradient(180deg, var(--gold-600), var(--gold-500));
}
.secondary {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04),
    rgba(255, 255, 255, 0.01)
  );
  opacity: 0.6;
  font-weight: 400;
  font-size: 10px;
}
.prominent {
  font-size: 1rem;
  padding: 13px 20px;
}
.buttons-up .btn {
  transform: translateZ(calc(var(--gapZ) + var(--lift)));
}

/* fine print */
.fine {
  margin: 10px 20px 16px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.35;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* back face (wizard) */
.form-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 14px 20px 10px;
  pointer-events: all;
}
.nav-btn {
  background: transparent;
  color: #f6f6f4;
  border: 1px solid rgba(223, 199, 126, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}
.nav-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.close-btn {
  position: absolute;
  right: 0px;
  top: 5px;
  background: transparent;
  color: #f6f6f4;
  border: none;
  font-size: 35px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.3;
}
.close-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.06);
}

.steps {
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  flex: 1 1 auto;
  min-height: 320px;
  display: grid;
  padding: 0 20px 10px;
}
.step {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 14px;
  opacity: 0;
  transform: translateX(22%);
  pointer-events: none;
  text-align: center;
  transition: transform 1000ms cubic-bezier(0.2, 0.8, 0.15, 1),
    opacity 1000ms ease;
}
.step.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.step.is-exit-left {
  opacity: 0;
  transform: translateX(-22%);
  pointer-events: none;
}
.q {
  font-size: clamp(18px, 3.8vw, 24px);
  font-weight: 800;
  max-width: 44ch;
}
.explain {
  max-width: 60ch;
  opacity: 0.92;
}

.slider {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.switch {
  --w: 58px;
  --h: 32px;
  position: relative;
  inline-size: var(--w);
  block-size: var(--h);
  display: inline-block;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  outline: 1px solid rgba(223, 199, 126, 0.28);
  transition: background 0.25s;
}
.thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  inline-size: 24px;
  block-size: 24px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    var(--gold-600),
    var(--gold-400)
  );
  box-shadow: 0 0 8px rgba(240, 216, 143, 0.45);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.15, 1);
}
.switch input:checked ~ .track {
  background: rgba(20, 80, 63, 0.45);
}
.switch input:checked ~ .thumb {
  transform: translateX(26px);
}
/* ===== Micro “Yes” feedback: ripple + ephemeral YES badge ===== */

/* Soft ripple under the track when toggled to Yes */
@keyframes switchRipple {
  0% {
    opacity: 0.45;
    transform: scale(0.6);
  }
  75% {
    opacity: 0.15;
    transform: scale(1.45);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}

/* Track ripple canvas (right-biased radial to align with the 'Yes' side) */
.track::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  pointer-events: none;
  background: radial-gradient(
    circle at 70% 50%,
    rgba(240, 216, 143, 0.45) 0%,
    rgba(240, 216, 143, 0) 55%
  );
  opacity: 0;
  transform: scale(0.6);
}

/* Trigger ripple when switched ON */
.switch input:checked ~ .track::before {
  animation: switchRipple 0.45s ease-out;
}

/* Ephemeral YES badge next to the slider (CSS-only using :has) */
.slider {
  position: relative;
}

/* Hidden by default */
.slider::after {
  content: "✅";
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(6px) scale(0.92);
  background: linear-gradient(
    180deg,
    var(--gold-600, #f0d88f),
    var(--gold-500, #e0c078)
  );
  color: #0b201a;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(223, 199, 126, 0.35);
  opacity: 0;
  pointer-events: none;
}

/* Pop in/out animation */
@keyframes yesPop {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(6px) scale(0.92);
  }
  20% {
    opacity: 1;
    transform: translateY(-50%) translateX(6px) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%) translateX(6px) scale(1);
  }
}

/* Show the badge briefly when the inner switch is ON */
.slider:has(.switch input:checked)::after {
  animation: yesPop 600ms ease-out;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .switch input:checked ~ .track::before,
  .slider:has(.switch input:checked)::after {
    animation: none !important;
    opacity: 0 !important;
  }
}
.contact-scroll {
  width: 100%;
  max-width: 680px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 6px;
}
.fields {
  display: grid;
  gap: 12px;
}
.fld {
  display: grid;
  gap: 6px;
  text-align: left;
}
.fld label {
  font-size: 0.9rem;
  opacity: 0.85;
}
.fld input {
  border-radius: 10px;
  border: 1px solid rgba(223, 199, 126, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  padding: 12px 14px;
  outline: none;
}
.phone-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dial {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(223, 199, 126, 0.28);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}
.phone {
  flex: 1 1 auto;
}

.back-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  justify-content: center;
}
.ghost {
  background: transparent;
  border-color: rgba(223, 199, 126, 0.28);
}

.back-bottom-rail {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 10px 20px 16px;
  pointer-events: all;
}

/* progress chip (safe, tiny) */
.progress {
  margin-left: auto;
  margin-right: 48px;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.9;
  user-select: none;
}
@media (max-width: 420px) {
  .progress {
    margin-right: 42px;
    font-size: 0.95rem;
  }
}
/* small screens */
@media (max-width: 480px) {
  :root {
    --gapZ: 26px;
    --lift: 28px;
  }
  .stage {
    perspective: 2200px;
    -webkit-perspective: 2200px;
  }
}
@media (max-width: 380px) {
  .face {
    min-height: 520px;
    padding: 16px;
  }
  .front-surface {
    padding: 16px 14px 8px;
  }
  .headline {
    font-size: clamp(22px, 7vw, 36px);
  }
  .copy {
    font-size: 0.95rem;
  }
  .ctas {
    gap: 10px;
    margin: 12px 12px 0;
  }
  .btn.prominent {
    padding: 12px 16px;
    font-size: 0.95rem;
  }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .float {
    animation: none !important;
  }
  .card3d {
    transition: none !important;
    transform: none !important;
  }
  .card-inner,
  .overlay {
    transition: none !important;
    animation: none !important;
  }
  .step {
    transition: none !important;
  }
}

/* Yes-state micro feedback */
@keyframes thumbGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 216, 143, 0);
    transform: translateX(26px) scale(1);
  }
  30% {
    box-shadow: 0 0 12px rgba(240, 216, 143, 0.75);
    transform: translateX(26px) scale(1.07);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 216, 143, 0);
    transform: translateX(26px) scale(1);
  }
}
@keyframes trackPulse {
  0% {
    filter: brightness(1);
  }
  35% {
    filter: brightness(1.25);
  }
  100% {
    filter: brightness(1);
  }
}
.switch input:checked ~ .thumb {
  animation: thumbGlow 0.45s ease-out;
}
.switch input:checked ~ .track {
  animation: trackPulse 0.45s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .switch input:checked ~ .thumb,
  .switch input:checked ~ .track {
    animation: none !important;
  }
}
