/* R2 Funnel — email opt-in (R2-03) + 3-question quiz (R2-08).
 *
 * All new R2 funnel styles live in this single file so the email opt-in
 * (Stage 2 — newsletter capture) and the diagnostic quiz (Stage 3) ship
 * together without racing for lines in css/styles.css. Page-level CSS only
 * — no design-token redefinitions; we consume brand.css variables.
 *
 * Conventions:
 *   - Text on the dark navy panels uses var(--pulse-blue-400) (#5E9DE8),
 *     the R2-09 contrast-safe blue against navy-900.
 *   - Primary amber button uses navy text (R2-09 WCAG fix — amber-on-white
 *     and amber-on-navy with white text both fail 4.5:1).
 *   - Mobile breakpoint mirrors the rest of the site: 640px.
 *   - We deliberately avoid `display:none → display:flex` transitions; we
 *     toggle `[hidden]` (a11y) and use opacity for the visible state.
 */

/* ─────────────────────────────────────────────────────────────────────
   Email opt-in — drops onto the parent home + every product subdomain
   home. Compact dark-glass panel sized similar to .bo-anchor-strip.
   ───────────────────────────────────────────────────────────────────── */

.email-opt-in {
  --r2-card-bg: rgba(11, 20, 38, 0.92);
  --r2-card-border: rgba(94, 157, 232, 0.22);
  --r2-focus-ring: 0 0 0 3px rgba(94, 157, 232, 0.45);
  display: block;
  padding: 4.5rem 0;
  background:
    radial-gradient(ellipse 60% 70% at 30% 20%, rgba(53, 116, 212, 0.18), transparent 65%),
    radial-gradient(ellipse 55% 50% at 80% 80%, rgba(245, 158, 11, 0.10), transparent 60%),
    var(--pulse-navy-900, #0B1426);
  color: var(--pulse-white, #FFFFFF);
}

.email-opt-in__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.email-opt-in__panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2.25rem;
  background: var(--r2-card-bg);
  border: 1px solid var(--r2-card-border);
  border-radius: 14px;
  box-shadow:
    0 24px 60px rgba(6, 11, 22, 0.45),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
}

.email-opt-in__kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* R2-09: blue-400 for kicker text on navy-900 ≥ 4.5:1 */
  color: var(--pulse-blue-400, #5E9DE8);
}

.email-opt-in__industry-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(94, 157, 232, 0.18);
  color: var(--pulse-blue-400, #5E9DE8);
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

.email-opt-in__title {
  margin: 0 0 0.55rem;
  font-family: var(--pulse-font-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--pulse-white, #FFFFFF);
}

.email-opt-in__body {
  margin: 0 0 1.4rem;
  /* slate-300 reads on navy with comfortable contrast */
  color: var(--pulse-slate-300, #CBD5E1);
  font-size: 1rem;
  line-height: 1.6;
}

.email-opt-in__form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
}

.email-opt-in__field {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
}

.email-opt-in__label {
  /* Screen-reader only — the input has a visible placeholder for sighted
     users, but every input still has a <label> for a11y compliance. */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.email-opt-in__input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(6, 11, 22, 0.65);
  border: 1px solid rgba(94, 157, 232, 0.28);
  border-radius: 8px;
  color: var(--pulse-white, #FFFFFF);
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.email-opt-in__input::placeholder {
  color: var(--pulse-slate-400, #94A3B8);
}

.email-opt-in__input:focus {
  outline: none;
  border-color: var(--pulse-blue-400, #5E9DE8);
  box-shadow: var(--r2-focus-ring);
}

.email-opt-in__button {
  flex: 0 0 auto;
  padding: 0.9rem 1.4rem;
  background: linear-gradient(135deg, var(--pulse-amber-400, #F59E0B), var(--pulse-amber-500, #D97706));
  /* R2-09: navy text on amber clears 4.5:1; white-on-amber does NOT. */
  color: var(--pulse-navy-900, #0B1426);
  border: 1px solid rgba(245, 158, 11, 0.65);
  border-radius: 8px;
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.email-opt-in__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.28);
}

.email-opt-in__button:focus-visible {
  outline: none;
  box-shadow:
    var(--r2-focus-ring),
    0 12px 26px rgba(245, 158, 11, 0.22);
}

.email-opt-in__button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.email-opt-in__feedback {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.email-opt-in__success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.32);
  /* Light green text on navy — chosen for ≥4.5:1 contrast against navy-900. */
  color: #86EFAC;
}

.email-opt-in__error {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.34);
  /* Light red text for contrast on navy. */
  color: #FCA5A5;
}

.email-opt-in__fineprint {
  margin: 0.85rem 0 0;
  color: var(--pulse-slate-400, #94A3B8);
  font-size: 0.82rem;
  line-height: 1.55;
}

.email-opt-in__fineprint a {
  color: var(--pulse-blue-400, #5E9DE8);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .email-opt-in {
    padding: 3rem 0;
  }
  .email-opt-in__panel {
    padding: 1.5rem 1.25rem;
  }
  .email-opt-in__form {
    flex-direction: column;
  }
  .email-opt-in__field,
  .email-opt-in__button {
    flex: 1 1 auto;
    width: 100%;
  }
}

/* ─────────────────────────────────────────────────────────────────────
   3-question quiz (R2-08) — standalone /quiz/ page.
   ───────────────────────────────────────────────────────────────────── */

.quiz-shell {
  background:
    radial-gradient(ellipse 70% 55% at 50% 15%, rgba(53, 116, 212, 0.22), transparent 65%),
    var(--pulse-navy-950, #060B16);
  color: var(--pulse-white, #FFFFFF);
  padding: 6rem 0 5rem;
  min-height: calc(100vh - 200px);
}

.quiz-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.quiz-kicker {
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pulse-blue-400, #5E9DE8);
  margin-bottom: 0.75rem;
}

.quiz-headline {
  font-family: var(--pulse-font-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
  margin: 0 0 0.85rem;
  color: var(--pulse-white, #FFFFFF);
}

.quiz-lede {
  margin: 0 0 2rem;
  color: var(--pulse-slate-300, #CBD5E1);
  font-size: 1.08rem;
  line-height: 1.65;
  max-width: 640px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 2rem;
}

.quiz-progress__dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(94, 157, 232, 0.25);
  transition: background 150ms ease, transform 150ms ease;
}

.quiz-progress__dot[aria-current="step"] {
  background: var(--pulse-blue-400, #5E9DE8);
  transform: scale(1.25);
}

.quiz-progress__dot[data-state="done"] {
  background: var(--pulse-amber-400, #F59E0B);
}

.quiz-step {
  background: rgba(11, 20, 38, 0.78);
  border: 1px solid rgba(94, 157, 232, 0.18);
  border-radius: 14px;
  padding: 2rem 2.25rem;
  box-shadow: 0 24px 60px rgba(6, 11, 22, 0.45);
}

.quiz-step[hidden] {
  display: none;
}

.quiz-step__legend {
  display: block;
  padding: 0;
  margin: 0 0 0.4rem;
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pulse-blue-400, #5E9DE8);
}

.quiz-step__question {
  font-family: var(--pulse-font-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  line-height: 1.18;
  margin: 0 0 1.4rem;
  color: var(--pulse-white, #FFFFFF);
}

.quiz-step__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.1rem;
  background: rgba(6, 11, 22, 0.55);
  border: 1px solid rgba(94, 157, 232, 0.22);
  border-radius: 10px;
  color: var(--pulse-white, #FFFFFF);
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  outline: none;
  border-color: var(--pulse-blue-400, #5E9DE8);
  background: rgba(94, 157, 232, 0.1);
  transform: translateY(-1px);
}

.quiz-option[aria-checked="true"] {
  border-color: var(--pulse-blue-400, #5E9DE8);
  background: rgba(94, 157, 232, 0.14);
  box-shadow: 0 0 0 1px var(--pulse-blue-400, #5E9DE8) inset;
}

.quiz-step__nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}

.quiz-back {
  background: none;
  border: 0;
  color: var(--pulse-slate-300, #CBD5E1);
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.92rem;
  cursor: pointer;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
}

.quiz-back:hover,
.quiz-back:focus-visible {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--pulse-white, #FFFFFF);
}

.quiz-back[hidden] {
  visibility: hidden;
}

.quiz-step__hint {
  margin: 0;
  color: var(--pulse-slate-400, #94A3B8);
  font-size: 0.82rem;
}

.quiz-result {
  background: rgba(11, 20, 38, 0.85);
  border: 1px solid rgba(94, 157, 232, 0.22);
  border-radius: 14px;
  padding: 2.25rem 2.25rem;
  box-shadow: 0 24px 60px rgba(6, 11, 22, 0.45);
}

.quiz-result[hidden] {
  display: none;
}

.quiz-result__kicker {
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pulse-amber-400, #F59E0B);
  margin-bottom: 0.55rem;
}

.quiz-result__title {
  font-family: var(--pulse-font-display, "Bricolage Grotesque", system-ui, sans-serif);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.12;
  margin: 0 0 0.85rem;
  color: var(--pulse-white, #FFFFFF);
}

.quiz-result__title strong {
  /* Blue-400 highlight for the routed subdomain so the eye lands there. */
  color: var(--pulse-blue-400, #5E9DE8);
  font-weight: 700;
}

.quiz-result__body {
  margin: 0 0 1.5rem;
  color: var(--pulse-slate-300, #CBD5E1);
  line-height: 1.65;
}

.quiz-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.quiz-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.4rem;
  border-radius: 8px;
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-weight: 700;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.quiz-cta--primary {
  background: linear-gradient(135deg, var(--pulse-amber-400, #F59E0B), var(--pulse-amber-500, #D97706));
  /* R2-09: navy text on amber for ≥4.5:1 contrast. */
  color: var(--pulse-navy-900, #0B1426);
  border: 1px solid rgba(245, 158, 11, 0.65);
}

.quiz-cta--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.28);
}

.quiz-cta--secondary {
  background: transparent;
  color: var(--pulse-blue-400, #5E9DE8);
  border: 1px solid var(--pulse-blue-400, #5E9DE8);
}

.quiz-cta--secondary:hover {
  background: rgba(94, 157, 232, 0.1);
  transform: translateY(-1px);
}

.quiz-restart {
  background: none;
  border: 0;
  color: var(--pulse-slate-300, #CBD5E1);
  font-family: var(--pulse-font-body, "Outfit", system-ui, sans-serif);
  font-size: 0.92rem;
  cursor: pointer;
  margin-top: 1.4rem;
  padding: 0.4rem 0.6rem;
  text-decoration: underline;
}

.quiz-restart:hover,
.quiz-restart:focus-visible {
  outline: none;
  color: var(--pulse-white, #FFFFFF);
}

@media (max-width: 640px) {
  .quiz-shell {
    padding: 4rem 0 3.5rem;
  }
  .quiz-step,
  .quiz-result {
    padding: 1.5rem 1.25rem;
  }
  .quiz-step__options {
    grid-template-columns: 1fr;
  }
}
