/* =========================================================
   ClinicBoost — Vertical Experience engine (subpages only)
   Loaded AFTER site.css. Homepage never loads this file.
   Every page sets --hue on <body>; everything tints from it.
   Each vertical's hero SCENE is unique and lives inline in
   its own page — this file only holds the shared bones.
   ========================================================= */

/* Cross-fade between subpages (progressive enhancement) */
@view-transition { navigation: auto; }

/* =========================================================
   HERO base — light, hue-washed. The scene is per-page.
   ========================================================= */
.vhero {
  position: relative;
  min-height: 92svh;
  display: flex;
  align-items: center;
  padding: clamp(7rem, 13vh, 9.5rem) 0 clamp(3rem, 6vh, 5rem);
  overflow: clip;
  background:
    radial-gradient(50% 55% at 88% 6%, color-mix(in srgb, var(--hue) 15%, transparent), transparent 70%),
    radial-gradient(42% 48% at 4% 96%, color-mix(in srgb, var(--hue) 9%, transparent), transparent 70%),
    var(--x-bg);
}
.vhero h1 {
  font-size: clamp(2.5rem, 1.2rem + 4.6vw, 4.6rem);
  margin-bottom: var(--x-s6);
}
.vhero .lead {
  font-size: var(--x-text-lg);
  max-width: 32em;
  margin-bottom: var(--x-s8);
}
.vhero .actions { display: flex; flex-wrap: wrap; gap: var(--x-s3); }

/* two-column hero (text + scene) */
.vhero .grid2 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}
@media (max-width: 980px) {
  .vhero .grid2 { grid-template-columns: 1fr; }
}

/* centered hero variant */
.vh-center { text-align: center; }
.vh-center .eyebrow, .vh-center .actions { justify-content: center; }
.vh-center .eyebrow::before { display: none; }
.vh-center .lead { margin-inline: auto; }
.vh-center h1 { margin-inline: auto; }

/* Live line — real clock, updates every minute */
.vh-live {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--x-font-display);
  font-weight: 500;
  font-size: var(--x-text-sm);
  color: color-mix(in srgb, var(--hue) 60%, var(--x-ink));
  background: color-mix(in srgb, var(--hue) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--hue) 32%, transparent);
  border-radius: var(--x-r-pill);
  padding: 0.45rem 1rem;
  margin-bottom: var(--x-s6);
}
.vh-center .vh-live { margin-inline: auto; }
.vh-live .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hue);
  box-shadow: 0 0 10px var(--hue);
  animation: blink 2s var(--x-ease) infinite;
}
.vh-live strong { color: var(--x-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  .vh-live { flex-wrap: wrap; justify-content: center; row-gap: 0.15rem; text-align: center; }
}

/* visually-hidden (real h1 behind a decorative scene) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =========================================================
   CHAT SCENE upgrades — WhatsApp meta (time + read ticks)
   ========================================================= */
.msg { position: relative; }
.msg .meta {
  display: block;
  font-size: 0.66rem;
  color: rgba(15,13,30,0.4);
  text-align: right;
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}
.msg.out .meta { color: rgba(16,38,27,0.5); }
.msg.out .meta::after {
  content: "✓✓";
  margin-left: 0.3rem;
  color: #53BDEB;
  letter-spacing: -0.12em;
}

/* =========================================================
   CALCULATOR — "¿cuánto te cuesta no responder?"
   ========================================================= */
.calc {
  background: var(--x-primary-ink);
  border-radius: var(--x-r-xl);
  padding: clamp(2rem, 5vw, 4rem);
  color: rgba(255,255,255,0.7);
  position: relative;
  overflow: clip;
}
.calc::before {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(38% 50% at 80% 20%, color-mix(in srgb, var(--hue) 32%, transparent), transparent 100%),
    radial-gradient(34% 48% at 15% 85%, rgba(124,92,255,0.28), transparent 100%);
  pointer-events: none;
}
.calc > * { position: relative; }
.calc h2 { color: #fff; }
.calc .grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  margin-top: var(--x-s8);
}
@media (max-width: 820px) { .calc .grid { grid-template-columns: 1fr; } }

.calc .ctl { margin-bottom: var(--x-s8); }
.calc .ctl label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--x-s4);
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--x-s3);
  font-size: var(--x-text-sm);
}
.calc .ctl output {
  font-family: var(--x-font-display);
  font-weight: 700;
  font-size: var(--x-text-lg);
  color: var(--hue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.calc input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 34px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.calc input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--hue) var(--fill, 50%), rgba(255,255,255,0.16) var(--fill, 50%));
}
.calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: none;
  margin-top: -10px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--hue) 45%, transparent), 0 2px 10px rgba(0,0,0,0.4);
  transition: transform var(--x-fast) var(--x-ease);
}
.calc input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }
.calc input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.16);
}
.calc input[type="range"]::-moz-range-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--hue);
}
.calc input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--hue) 45%, transparent), 0 2px 10px rgba(0,0,0,0.4);
}
.calc .fine { font-size: var(--x-text-xs); color: rgba(255,255,255,0.4); margin: 0; }

.calc .out-row {
  display: grid;
  gap: var(--x-s4);
}
.calc .stat {
  border-left: 2px solid color-mix(in srgb, var(--hue) 55%, transparent);
  padding-left: var(--x-s6);
}
.calc .stat b {
  display: block;
  font-family: var(--x-font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.2rem + 2.4vw, 3.2rem);
  line-height: 1.05;
  color: #fff;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.calc .stat span { font-size: var(--x-text-sm); }
.calc .stat.hero-num { border-color: var(--hue); }
.calc .stat.hero-num b { color: var(--hue); text-shadow: 0 0 40px color-mix(in srgb, var(--hue) 45%, transparent); }
.calc .recover {
  margin-top: var(--x-s6);
  padding: var(--x-s4) var(--x-s6);
  border-radius: var(--x-r-md);
  background: color-mix(in srgb, var(--hue) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--hue) 30%, transparent);
  color: #fff;
  font-size: var(--x-text-sm);
}
.calc .recover b { color: var(--hue); font-variant-numeric: tabular-nums; }

/* =========================================================
   COMPARE — drag the divider: hoy vs con ClinicBoost
   ========================================================= */
.vs {
  position: relative;
  border-radius: var(--x-r-xl);
  overflow: clip;
  border: 1px solid var(--x-line);
  box-shadow: var(--x-shadow-lg);
  aspect-ratio: 16 / 10;
  min-height: 460px;
  max-height: 640px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.vs .pane {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  padding: clamp(1.2rem, 4vw, 3rem);
}
.vs .pane .msg { max-width: min(340px, 78%); opacity: 1; transform: none; }
.vs .pane-a { background: #ECE9E4; }
.vs .pane-b {
  background:
    radial-gradient(70% 90% at 80% 15%, color-mix(in srgb, var(--hue) 20%, transparent), transparent 70%),
    #0D0A26;
  clip-path: inset(0 0 0 var(--pos, 50%));
}
.vs .pane-b .msg.in { background: rgba(255,255,255,0.94); }
.vs .tag {
  position: absolute;
  top: clamp(0.9rem, 3vw, 1.6rem);
  font-family: var(--x-font-display);
  font-weight: 700;
  font-size: var(--x-text-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
  border-radius: var(--x-r-pill);
  z-index: 1;
}
.vs .tag-a { left: clamp(0.9rem, 3vw, 1.6rem); background: rgba(15,13,30,0.08); color: var(--x-ink); }
.vs .tag-b { right: clamp(0.9rem, 3vw, 1.6rem); background: var(--hue); color: #fff; }
.vs .wait {
  align-self: flex-start;
  font-size: var(--x-text-xs);
  color: var(--x-faint);
  font-style: italic;
  padding-left: 0.4rem;
}
.vs .divider {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 24px rgba(8,6,26,0.45);
  z-index: 2;
  pointer-events: none;
}
.vs .knob {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--x-shadow-md);
  display: grid;
  place-items: center;
  color: var(--x-ink);
}
.vs .knob svg { width: 22px; height: 22px; }
/* the real control: a full-surface range input (native a11y + touch) */
.vs input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  background: transparent;
  cursor: ew-resize;
  z-index: 3;
}
.vs input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 52px; height: 100%; background: transparent; }
.vs input[type="range"]::-moz-range-thumb { width: 52px; height: 999px; background: transparent; border: none; }
.vs input[type="range"]:focus-visible { outline: 3px solid var(--x-primary); outline-offset: -3px; }
@media (max-width: 640px) {
  .vs { aspect-ratio: auto; height: 520px; }
  .vs .pane .msg { font-size: 0.8rem; }
}

/* =========================================================
   STATS BAND — count-up numbers
   ========================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--x-s6);
  border-block: 1px solid var(--x-line);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}
.stats .stat { text-align: center; }
.stats b {
  display: block;
  font-family: var(--x-font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.2rem);
  line-height: 1;
  color: var(--x-ink);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stats b small { font-size: 0.5em; color: var(--hue); font-weight: 700; }
.stats span { font-size: var(--x-text-sm); color: var(--x-muted); }

/* =========================================================
   Hue-aware accents for shared components on subpages
   ========================================================= */
.sub .eyebrow { color: color-mix(in srgb, var(--hue) 78%, var(--x-ink)); }
.sub .eyebrow::before { background: var(--hue); }
.sub .faq details[open] { border-color: var(--hue); }
.sub .faq summary::after { color: var(--hue); }
.sub .cta-band::before {
  background:
    radial-gradient(40% 55% at 25% 30%, color-mix(in srgb, var(--hue) 55%, transparent) 0%, transparent 100%),
    radial-gradient(35% 50% at 78% 70%, rgba(124,92,255,0.4) 0%, transparent 100%);
}
.sub .marquee span::after { color: var(--hue); }

/* Magnetic buttons (JS drives --tx/--ty on desktop) */
[data-mag] { transform: translate(var(--tx, 0), var(--ty, 0)); }

/* =========================================================
   Motion safety
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .vh-live .dot { animation: none; }
  [data-mag] { transform: none !important; }
}

/* Light-nav subpages use the dark-ink wordmark variant */
.sub .x-logo { background-image: url(/assets/logo-wordmark-dark.png?v=11); }
