/* Section-specific styles for the ZimSaaS custom automation funnel. */

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

.site-header {
  position: relative;
  z-index: var(--z-header);
  background: #0A0A0F;
  border-bottom: 1px solid var(--line-dark);
  color: var(--cream);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding-block: var(--sp-3);
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  color: var(--cream);
  height: 28px;
}

.site-header__logo svg {
  height: 28px;
  width: auto;
}

.site-header__cta {
  font-size: var(--fs-body-sm);
  font-weight: 600;
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line-dark-strong);
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}

.site-header__cta:hover {
  border-color: var(--bright-blue);
  color: var(--bright-blue);
}

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

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

.hero {
  position: relative;
  padding-top: clamp(3rem, 7vw, 5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  background: var(--deep-navy);
  color: var(--cream);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse 80% 60% at 10% 0%,
      #0a0a0f 0%,
      var(--glow-soft) 38%,
      transparent 55%
    ),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(22, 44, 61, 0.55) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero__grid {
  display: grid;
  gap: var(--sp-10);
  grid-template-columns: 1fr;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1.05fr 1fr;
    gap: var(--sp-12);
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.hero__eyebrow {
  color: var(--bright-blue);
}

.hero__title {
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}

.hero__title em {
  font-style: normal;
  color: var(--bright-blue);
  background-image: linear-gradient(90deg, var(--bright-blue), var(--steel-hi));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__sub {
  font-size: var(--fs-body-lg);
  line-height: 1.55;
  color: rgba(253, 252, 249, 0.78);
  max-width: 54ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  align-items: center;
  margin-top: var(--sp-2);
}

.hero__secondary {
  font-size: var(--fs-body-sm);
  color: rgba(253, 252, 249, 0.6);
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

@media (max-width: 768px) {
  .hero__sub,
  .hero__chips {
    display: none;
  }
}

/* ---- Hero video facade ---- */

.hero__video {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  background: var(--surface-navy-raised);
  border: 1px solid var(--line-dark-strong);
  overflow: hidden;
  box-shadow:
    0 30px 80px -30px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px var(--line-dark);
}

.hero__video::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 30%,
    var(--glow) 50%,
    transparent 70%
  );
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  opacity: 0.8;
  z-index: 3;
}

.hero__video-poster,
.hero__video-el {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__video-poster {
  z-index: 1;
  transition: opacity var(--dur-3) var(--ease-out);
}

.hero__video-el {
  z-index: 2;
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
}

.hero__video.is-playing .hero__video-el {
  opacity: 1;
}

.hero__video.is-playing .hero__video-poster {
  opacity: 0;
}

/* Animated fallback diagram shown behind the poster until a real video arrives */
.hero__video-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 2px;
  padding: var(--sp-5);
  background: radial-gradient(
      ellipse at 30% 20%,
      rgba(88, 143, 220, 0.25),
      transparent 60%
    ),
    var(--surface-navy-raised);
}

.hero__video-fallback .node {
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  color: rgba(253, 252, 249, 0.6);
  text-transform: uppercase;
  padding: 4px;
  position: relative;
}

.hero__video-fallback .node.is-active {
  border-color: var(--bright-blue);
  color: var(--cream);
  background: rgba(88, 143, 220, 0.08);
  box-shadow: inset 0 0 20px var(--glow-soft);
}

.hero__video-fallback .node::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  transition: border-color 0.6s var(--ease);
}

.hero__video-fallback .node.is-pulse::after {
  border-color: var(--bright-blue);
  animation: pulse-border 2.6s var(--ease) infinite;
}

@keyframes pulse-border {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

.hero__video-play {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--cream);
  cursor: pointer;
}

.hero__video-play .play-icon {
  width: 68px;
  height: 68px;
  background: var(--bright-blue);
  color: var(--deep-navy);
  display: grid;
  place-items: center;
  transition: transform var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  box-shadow: 0 10px 40px var(--glow);
}

.hero__video-play:hover .play-icon {
  transform: scale(1.06);
  background: var(--cream);
}

.hero__video-play .play-icon::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 16px solid currentColor;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

.hero__video-caption {
  position: absolute;
  bottom: var(--sp-3);
  left: var(--sp-3);
  right: var(--sp-3);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(253, 252, 249, 0.82);
  background: rgba(10, 10, 15, 0.6);
  border: 1px solid var(--line-dark);
  padding: var(--sp-2) var(--sp-3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hero__video.is-playing .hero__video-play,
.hero__video.is-playing .hero__video-fallback {
  display: none;
}

/* -------------------- Trust strip -------------------- */

.trust {
  background: var(--ocean-blue);
  color: var(--cream);
  padding-block: var(--sp-8);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  position: relative;
}

.trust__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: flex-start;
}

.trust__label {
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--bright-blue);
  font-weight: 600;
}

.trust__copy {
  font-size: var(--fs-body-lg);
  line-height: 1.45;
  max-width: 60ch;
  color: rgba(253, 252, 249, 0.9);
  font-weight: 500;
}

.trust__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* -------------------- Pain / Outcome sections -------------------- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
  max-width: 44rem;
}

.section-head__sub {
  color: var(--fg-dim, var(--text-light));
  font-size: var(--fs-body-lg);
  line-height: 1.55;
}

.problem-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-top: 1px solid var(--line-light-strong);
}

.on-dark .problem-grid {
  border-top-color: var(--line-dark-strong);
}

.problem-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--sp-5);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--line-light);
  align-items: start;
}

.on-dark .problem-row {
  border-bottom-color: var(--line-dark);
}

.problem-row__num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--bright-blue);
  padding-top: 0.4em;
}

.problem-row__title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--fg, var(--text));
  line-height: 1.35;
  margin-bottom: var(--sp-1);
}

.problem-row__body {
  color: var(--fg-dim, var(--text-light));
  font-size: var(--fs-body);
  line-height: 1.55;
  max-width: 58ch;
}

@media (min-width: 768px) {
  .problem-grid {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--sp-8);
    border-top: 1px solid var(--line-light-strong);
  }
  .on-dark .problem-grid {
    border-top-color: var(--line-dark-strong);
  }
}

/* Pain/outcome pair band — visual contrast with bridging line */
.pair-band {
  position: relative;
}

/* -------------------- How it works -------------------- */

.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 640px) {
  .how-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .how-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* -------------------- Features -------------------- */

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 640px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  border: 1px solid var(--line-dark);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02) 0%,
    transparent 100%
  );
  transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  min-height: 240px;
  position: relative;
}

.feature-card:hover {
  border-color: var(--bright-blue);
  background: linear-gradient(
    180deg,
    rgba(88, 143, 220, 0.05) 0%,
    transparent 100%
  );
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark-strong);
  color: var(--bright-blue);
  margin-bottom: var(--sp-2);
}

.feature-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--cream);
}

.feature-card__body {
  color: rgba(253, 252, 249, 0.66);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.feature-card__list {
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-dark);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.feature-card__list li {
  font-size: 0.8125rem;
  color: rgba(253, 252, 249, 0.55);
  display: flex;
  gap: var(--sp-2);
  line-height: 1.45;
}

.feature-card__list li::before {
  content: "";
  width: 10px;
  height: 1px;
  background: var(--bright-blue);
  margin-top: 0.7em;
  flex-shrink: 0;
}

/* -------------------- Form section -------------------- */

.form-section {
  background: var(--cream);
  color: var(--text);
}

.form-section__inner {
  max-width: 640px;
  margin: 0 auto;
}

.form-section__head {
  text-align: left;
  margin-bottom: var(--sp-8);
}

.form-card {
  background: #ffffff;
  border: 1px solid var(--line-light-strong);
  box-shadow: 6px 6px 0 var(--deep-navy);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  position: relative;
}

.progress {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}

.progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
}

.progress__meta strong {
  color: var(--deep-navy);
  font-weight: 700;
}

.progress__bar {
  height: 6px;
  background: var(--line-light-strong);
  position: relative;
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 12%;
  background: var(--deep-navy);
  transition: width var(--dur-3) var(--ease-out);
}

.progress__fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3px;
  background: var(--bright-blue);
  box-shadow: 0 0 8px var(--glow);
}

.step {
  display: none;
  flex-direction: column;
  gap: var(--sp-5);
}

.step.is-active {
  display: flex;
  animation: step-in var(--dur-3) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .step.is-active {
    animation: none;
  }
}

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

.step__legend {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.step__eyebrow {
  font-size: 0.75rem;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 700;
}

.step__title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--deep-navy);
}

.step__hint {
  color: var(--text-light);
  font-size: 0.9375rem;
}

.radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 520px) {
  .radio-grid--2col {
    grid-template-columns: 1fr 1fr;
  }
}

.step__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line-light);
}

.step__back {
  background: none;
  border: 0;
  padding: var(--sp-2) 0;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  transition: color var(--dur-1) var(--ease);
}

.step__back:hover {
  color: var(--deep-navy);
}

.step__back[hidden] {
  visibility: hidden;
  display: inline-flex;
}

.step__continue {
  min-width: 160px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .step__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .step__continue {
    width: 100%;
  }
  .step__back {
    align-self: center;
  }
}

.step__privacy {
  font-size: 0.8125rem;
  color: var(--text-light);
  line-height: 1.5;
}

.step__privacy a {
  text-decoration: underline;
  color: var(--text);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}

@media (min-width: 520px) {
  .field-grid--2col {
    grid-template-columns: 1fr 1fr;
  }
}

/* Form error banner */
.form-banner {
  padding: var(--sp-4);
  border: 1px solid var(--ember);
  background: #fff5ef;
  color: #7a3715;
  font-size: 0.9375rem;
  margin-bottom: var(--sp-4);
  display: none;
}

.form-banner.is-visible {
  display: block;
}

/* -------------------- Success states -------------------- */

.success {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--deep-navy);
  color: var(--cream);
  border: 1px solid var(--line-dark-strong);
  box-shadow: 6px 6px 0 var(--deep-navy);
  display: none;
  flex-direction: column;
  gap: var(--sp-5);
  position: relative;
  overflow: hidden;
}

.success.is-visible {
  display: flex;
}

.success::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
}

.success__tier {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.75rem;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  font-weight: 700;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-dark-strong);
  align-self: flex-start;
  color: var(--bright-blue);
}

.success__tier::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--bright-blue);
  box-shadow: 0 0 8px var(--glow);
}

.success[data-tier="hot"] .success__tier {
  color: var(--bright-blue);
  border-color: var(--bright-blue);
}

.success[data-tier="warm"] .success__tier {
  color: #f2a66a;
  border-color: #f2a66a;
}

.success[data-tier="warm"] .success__tier::before {
  background: #f2a66a;
  box-shadow: 0 0 8px rgba(196, 92, 38, 0.4);
}

.success[data-tier="low_fit"] .success__tier {
  color: rgba(253, 252, 249, 0.65);
  border-color: var(--line-dark-strong);
}

.success[data-tier="low_fit"] .success__tier::before {
  background: rgba(253, 252, 249, 0.5);
  box-shadow: none;
}

.success__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.success__body {
  font-size: var(--fs-body-lg);
  line-height: 1.55;
  color: rgba(253, 252, 249, 0.78);
  max-width: 56ch;
}

.success__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line-dark);
  font-size: 0.875rem;
  color: rgba(253, 252, 249, 0.6);
}

.success__meta span strong {
  color: var(--cream);
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

.success__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* -------------------- FAQ -------------------- */

.faq-list {
  border-top: 1px solid var(--line-light-strong);
}

.faq-item {
  border-bottom: 1px solid var(--line-light);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: var(--sp-5) 0;
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--deep-navy);
  letter-spacing: -0.01em;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--bright-blue);
  font-weight: 400;
  transition: transform var(--dur-2) var(--ease);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "–";
  transform: rotate(0deg);
}

.faq-item__body {
  padding: 0 0 var(--sp-5);
  color: var(--text-light);
  font-size: var(--fs-body);
  line-height: 1.6;
  max-width: 72ch;
}

/* -------------------- Final CTA -------------------- */

.final-cta {
  background: var(--deep-navy);
  color: var(--cream);
  text-align: center;
}

.final-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-6);
  max-width: 40rem;
  margin: 0 auto;
}

.final-cta__title {
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: var(--ls-display);
}

.final-cta__sub {
  color: rgba(253, 252, 249, 0.7);
  font-size: var(--fs-body-lg);
  line-height: 1.55;
}

.final-cta__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  justify-content: center;
  font-size: 0.8125rem;
  color: rgba(253, 252, 249, 0.55);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line-dark);
  width: 100%;
}

.final-cta__trust span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.final-cta__trust span::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--bright-blue);
  border-radius: 0;
  flex-shrink: 0;
}

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

.site-footer {
  background: var(--deep-navy);
  color: rgba(253, 252, 249, 0.55);
  font-size: 0.8125rem;
  padding: var(--sp-8) 0;
  border-top: 1px solid var(--line-dark);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: rgba(253, 252, 249, 0.7);
}

.site-footer a:hover {
  color: var(--bright-blue);
}

/* -------------------- Mobile sticky CTA -------------------- */

.mobile-cta {
  position: fixed;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: var(--z-sticky);
  display: none;
  transform: translateY(120%);
  transition: transform var(--dur-3) var(--ease-out);
  background-color: #0a0a0f;
}

.mobile-cta.is-visible {
  transform: translateY(0);
}

.mobile-cta .btn {
  width: 100%;
  box-shadow: 0 12px 40px rgba(88, 143, 220, 0.25),
    0 4px 12px rgba(10, 10, 15, 0.3);
}

@media (max-width: 768px) {
  .mobile-cta {
    display: block;
  }
  body.has-mobile-cta {
    padding-bottom: calc(56px + var(--sp-6) + env(safe-area-inset-bottom));
  }

  /* Funnel: keep mobile path short (form is above the fold) */
  #pain,
  #outcome,
  #how {
    display: none;
  }
}

/* -------------------- Misc -------------------- */

.noscript-banner {
  background: var(--ember);
  color: var(--cream);
  padding: var(--sp-3);
  text-align: center;
  font-weight: 600;
}

/* When section follows hero, remove the default top padding to hug the line */
.hero + .trust {
  padding-block: var(--sp-8);
}
