/* ─────────────────────────────────────────────────────────────────
   CRO Block 8 — Savings Calculator (token-bound, mobile-first)
   Scoped exclusively under .block-cro-block-8 to avoid bleed.
   All visuals derive from design-system tokens — no hardcoded
   hex / hardcoded px (other than icon sizing primitives).
   ───────────────────────────────────────────────────────────────── */

.block-cro-block-8 {
  font-family: var(--ds-font-body);
  color: var(--scheme-fg);
  background: var(--scheme-bg);
}

/* Section header eyebrow + title color in dark scheme
   WAVE3-F08 (2026-05-08): same fix as CH-09a on cro-block-9 — was using
   --ds-cta (#e36218) on tinted-cream pill bg yielding ~3.0:1 (AA-Large
   boundary). Bumped to --ds-cta-dk (#b94e12) for ~4.5:1 and lifted
   font-weight 600 → 700 so the eyebrow stays AA-Large bold on every
   scheme. Identical to CH-09a / WAVE3-F08 fix on cro-block-10 and -14. */
.section.block-cro-block-8.dark .section-header .section-tag,
.section.block-cro-block-8 .section-header .section-tag,
.block-cro-block-8 .section-header .section-tag,
.block-cro-block-8 .section-tag {
  display: inline-block;
  font-family: var(--ds-font-mono);
  font-size: var(--ds-fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-cta-dk, #b94e12);
  background: color-mix(in srgb, var(--ds-cta) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--ds-cta) 35%, transparent);
  border-radius: var(--ds-radius-pill);
  padding: var(--ds-space-2) var(--ds-space-4);
  margin-bottom: var(--ds-space-3);
}
.section.block-cro-block-8 .section-header .section-title,
.section.block-cro-block-8.dark .section-header .section-title,
.block-cro-block-8 .section-header h2,
.block-cro-block-8 .section-title {
  font-family: var(--ds-font-display);
  color: var(--scheme-fg);
}
.section.block-cro-block-8 .section-header .section-subtitle,
.section.block-cro-block-8.dark .section-header .section-subtitle,
.block-cro-block-8 .section-subtitle {
  color: var(--scheme-fg-soft);
  font-size: var(--ds-fs-body-lg);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* Calculator card surface — opaque white card on dark scheme for contrast
   WAVE3-F08 (2026-05-08) — Pattern-B INVERTED local rebind: this is a
   light card that must remain light on every outer section scheme. The
   global guardrail in design-system.css rebinds --ds-ink → var(--scheme-fg)
   on dark schemes (steel/ink/accent/trust), which would flip every
   descendant ink-token text to white inside this WHITE card → white-on-white.
   Pin --ds-ink* to dark literals locally so descendants reading --ds-ink
   stay readable on this opaque-white surface regardless of outer scheme.
   The browser audit confirmed exactly this defect (cro-block-8 h4 / p /
   label rendering rgb(255,255,255) on rgb(255,255,255)). */
.block-cro-block-8 .savings-calculator-cro {
  --ds-ink: #0e0f0c;
  --ds-ink-soft: #4a4842;
  --ds-ink-mute: #76736a;
  background: #fff;
  color: var(--ds-ink);
  max-width: 640px;
  margin: var(--ds-space-6) auto 0;
  padding: var(--ds-space-6) var(--ds-space-5);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-lg);
  border: 1px solid rgba(0,0,0,0.06);
}

.block-cro-block-8 .calculator-header h4 {
  font-family: var(--ds-font-display);
  font-size: var(--ds-fs-display-sm);
  color: var(--ds-ink);
  margin: 0 0 var(--ds-space-2);
  letter-spacing: 0.01em;
}
.block-cro-block-8 .calculator-header p {
  font-size: var(--ds-fs-body);
  color: var(--ds-ink-soft);
  margin: 0;
}
.block-cro-block-8 .calculator-header p strong {
  color: var(--ds-cta);
  font-weight: 700;
}

/* Input group */
.block-cro-block-8 .calculator-input-group {
  margin: var(--ds-space-5) 0 var(--ds-space-4);
}
.block-cro-block-8 .calculator-input-group label {
  display: block;
  font-size: var(--ds-fs-body-sm);
  font-weight: 600;
  color: var(--ds-ink);
  margin-bottom: var(--ds-space-2);
}
.block-cro-block-8 .input-hint {
  margin-left: var(--ds-space-2);
  font-weight: 400;
  color: var(--ds-ink-mute);
  font-size: var(--ds-fs-body-sm);
  font-style: italic;
}
.block-cro-block-8 .input-wrapper {
  display: flex;
  align-items: stretch;
  background: var(--ds-paper);
  border: 1.5px solid var(--ds-rule);
  border-radius: var(--ds-radius);
  overflow: hidden;
  transition: border-color var(--ds-duration) var(--ds-ease-out),
              box-shadow var(--ds-duration) var(--ds-ease-out);
}
.block-cro-block-8 .input-wrapper:focus-within {
  border-color: var(--ds-cta);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-cta) 22%, transparent);
}
.block-cro-block-8 .currency-symbol {
  display: inline-flex;
  align-items: center;
  padding: 0 var(--ds-space-4);
  font-family: var(--ds-font-display);
  font-size: var(--ds-fs-display-sm);
  color: var(--ds-ink-soft);
  background: transparent;
  border-right: 1px solid var(--ds-rule);
}
.block-cro-block-8 .input-wrapper input[type="number"] {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  background: transparent;
  padding: var(--ds-space-4) var(--ds-space-4);
  font-family: var(--ds-font-display);
  /* SWEEP-C3: explicit ≥18px font-size prevents iOS auto-zoom on focus
     (1.6rem = 25.6px which exceeds the 16px threshold) and explicit
     min-height ≥48px guarantees senior 45-70+ tap-target floor regardless
     of computed line-height. */
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  min-height: var(--ds-touch-target, 48px);
  color: var(--ds-ink);
  outline: none;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: textfield;
}
.block-cro-block-8 .input-wrapper input::-webkit-outer-spin-button,
.block-cro-block-8 .input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.block-cro-block-8 .input-wrapper input::placeholder {
  color: var(--ds-ink-mute);
  font-weight: 500;
}

/* Social proof hint row */
.block-cro-block-8 .social-proof-hint {
  margin-top: var(--ds-space-3);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ds-space-2);
  /* SWEEP-C3: ≥14px floor (was --ds-fs-body-sm 14px) explicit + soft ink
     promoted from mute for AAA. Live social proof must be readable. */
  font-size: 0.95rem;
  color: var(--ds-ink-soft);
}
.block-cro-block-8 .social-proof-hint strong {
  color: var(--ds-cta);
  font-weight: 700;
}
.block-cro-block-8 .social-proof-hint svg,
.block-cro-block-8 .social-proof-hint img,
.block-cro-block-8 .social-proof-hint .icon-preset {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Result panel — uses trust scheme highlight for emphasis */
.block-cro-block-8 .savings-results {
  margin-top: var(--ds-space-5);
  padding: var(--ds-space-5);
  background: color-mix(in srgb, var(--ds-trust) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--ds-trust) 30%, transparent);
  border-left: 4px solid var(--ds-trust);
  border-radius: var(--ds-radius);
}
.block-cro-block-8 .savings-amount {
  text-align: center;
}
.block-cro-block-8 .savings-amount__label {
  font-family: var(--ds-font-mono);
  font-size: var(--ds-fs-eyebrow);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ds-trust);
  margin-bottom: var(--ds-space-2);
}
.block-cro-block-8 .savings-amount__value,
.block-cro-block-8 #calc-savings-amount {
  font-family: var(--ds-font-display);
  /* SWEEP-C3: floor at 1.75rem so the result remains ≥1.5rem
     even on the narrowest viewport (clamp would otherwise yield
     1.5rem under the 6vw breakpoint at 250px width). */
  font-size: clamp(1.75rem, 6vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ds-trust);
  letter-spacing: -0.01em;
}
.block-cro-block-8 .savings-breakdown {
  margin-top: var(--ds-space-4);
  font-size: var(--ds-fs-body-sm);
  color: var(--ds-ink-soft);
}
.block-cro-block-8 .savings-breakdown__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--ds-space-2) 0;
  border-bottom: 1px dashed var(--ds-rule);
}
.block-cro-block-8 .savings-breakdown__row:last-child { border-bottom: 0; }
.block-cro-block-8 .savings-breakdown__row strong { color: var(--ds-ink); font-weight: 700; }

/* Guarantee badge — CTA accent */
.block-cro-block-8 .savings-guarantee {
  margin-top: var(--ds-space-5);
  padding: var(--ds-space-4);
  background: color-mix(in srgb, var(--ds-cta) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--ds-cta) 28%, transparent);
  border-radius: var(--ds-radius);
  text-align: center;
}
.block-cro-block-8 .savings-guarantee__title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-space-2);
  font-family: var(--ds-font-body);
  font-weight: 700;
  font-size: var(--ds-fs-body);
  color: var(--ds-cta);
  margin-bottom: var(--ds-space-2);
  line-height: 1.35;
}
.block-cro-block-8 .savings-guarantee__title .guarantee-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--ds-cta);
}
.block-cro-block-8 .savings-guarantee__title svg,
.block-cro-block-8 .savings-guarantee__title img {
  width: 22px;
  height: 22px;
  display: block;
}
.block-cro-block-8 .savings-guarantee__subtitle {
  font-size: var(--ds-fs-body-sm);
  color: var(--ds-ink-soft);
}

/* Post-CTA */
.block-cro-block-8 .post-calc-cta {
  margin-top: var(--ds-space-5);
  text-align: center;
}
.block-cro-block-8 .post-calc-cta__lead {
  font-size: var(--ds-fs-body);
  color: var(--ds-ink-soft);
  margin-bottom: var(--ds-space-4);
}
.block-cro-block-8 .post-calc-cta__lead strong { color: var(--ds-cta); font-weight: 700; }
.block-cro-block-8 .post-calc-cta__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--ds-space-3);
}
.block-cro-block-8 .post-calc-cta .btn-primary,
.block-cro-block-8 .post-calc-cta .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ds-space-4) var(--ds-space-5);
  font-family: var(--ds-font-body);
  font-size: var(--ds-fs-body);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--ds-radius);
  transition: background var(--ds-duration) var(--ds-ease-out),
              transform var(--ds-duration-fast) var(--ds-ease-out),
              box-shadow var(--ds-duration) var(--ds-ease-out);
  cursor: pointer;
  letter-spacing: 0.01em;
}
.block-cro-block-8 .post-calc-cta .btn-primary {
  background: var(--ds-cta-aa, var(--ds-cta-dk));
  color: #fff;
  border: 1px solid var(--ds-cta);
  box-shadow: var(--ds-shadow-cta);
}
.block-cro-block-8 .post-calc-cta .btn-primary:hover {
  background: var(--ds-cta-dk);
  border-color: var(--ds-cta-dk);
  transform: translateY(-1px);
}
.block-cro-block-8 .post-calc-cta .btn-secondary {
  background: transparent;
  color: var(--ds-ink);
  border: 1.5px solid var(--ds-ink);
}
.block-cro-block-8 .post-calc-cta .btn-secondary:hover {
  background: var(--ds-ink);
  color: #fff;
  transform: translateY(-1px);
}

/* Trust list */
.block-cro-block-8 .calculator-trust {
  margin-top: var(--ds-space-5);
  padding-top: var(--ds-space-4);
  border-top: 1px solid var(--ds-rule);
  display: flex;
  justify-content: center;
  gap: var(--ds-space-4);
  flex-wrap: wrap;
  /* SWEEP-C3: bumped from --ds-fs-body-sm (14px) to 0.95rem (15.2px) and
     promoted color from ink-mute → ink-soft for AAA contrast.
     Senior ICP (45-70+) needs disclaimer/trust copy at ≥14px AND
     adequate contrast — ink-mute on white was failing 4.5:1 at small sizes. */
  font-size: 0.95rem;
  color: var(--ds-ink-soft);
}
.block-cro-block-8 .calculator-trust__item {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-space-2);
  font-weight: 600;
}
/* WAVE3-F08 (2026-05-08): hard-pin checkmark to #fff on moss bg.
   The previous var(--scheme-fg, #fff) fallback only fires when --scheme-fg
   is unset, but --scheme-fg IS set on every scheme — and inside the white
   .savings-calculator-cro card which now locally pins --ds-ink to dark,
   the guardrail map can leave --scheme-fg pointing at moss/ink in some
   nested chains. Browser audit caught this as moss-on-moss (1.0). Use
   explicit #fff since the moss bg is invariant. */
.block-cro-block-8 .calculator-trust__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ds-trust);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

/* Tablet+ */
@media (min-width: 768px) {
  .block-cro-block-8 .savings-calculator-cro {
    padding: var(--ds-space-7) var(--ds-space-6);
    max-width: 720px;
  }
  .block-cro-block-8 .post-calc-cta__buttons {
    flex-direction: row;
    justify-content: center;
  }
  .block-cro-block-8 .post-calc-cta .btn-primary,
  .block-cro-block-8 .post-calc-cta .btn-secondary {
    flex: 0 1 auto;
    min-width: 220px;
  }
  .block-cro-block-8 .calculator-header h4 {
    font-size: 1.6rem;
  }
}
@media (min-width: 1024px) {
  .block-cro-block-8 .savings-calculator-cro {
    max-width: 760px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .block-cro-block-8 *, .block-cro-block-8 *::before, .block-cro-block-8 *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Validate-2026-05-08 fix: sticky-CTA bottom clearance for in-page CTAs (Group A). ── */
@media (max-width: 900px) {
  .block-cro-block-8 {
    padding-bottom: calc(var(--ds-space-5, 1.5rem) + var(--ds-sticky-cta-clearance, 96px));
  }
}
