/* ZOPE Agency — estilos basados en el Manual de Identidad Corporativa 2026 */

@font-face {
  font-family: "Syne";
  src: url("../assets/fonts/syne.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* Paleta corporativa */
  --navy: #0B1F3A;
  --navy-2: #162A45;
  --navy-3: #22385A;
  --blue: #023E8A;
  --blue-hover: #01306B;
  --gray: #E2E8F0;
  --gold: #EAB308;
  --white: #FFFFFF;
  --surface: #F8FAFC;
  --text: #0B1F3A;
  --text-body: #475569;
  --text-muted: #64748B;
  --ok: #15803D;
  --ok-bg: #DCFCE7;
  --warn-bg: #FEF3C7;
  --cancel: #B91C1C;

  --font-title: "Syne", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 128px);
  --radius-btn: 10px;
  --radius-field: 8px;
  --radius-panel: 16px;
  --nav-h: 76px;

  /* Curvas de movimiento: las de serie del navegador son demasiado flojas */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);       /* entradas y respuestas a una acción */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);   /* algo que se mueve dentro de la pantalla */
  --placeholder: #64748B;                            /* 4,8:1 sobre blanco */
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  caret-color: var(--blue);
  -webkit-tap-highlight-color: transparent;
}
/* Lo que el navegador pinta por su cuenta también lleva la marca */
::selection { background: var(--blue); color: var(--white); }
.hero ::selection, .slot ::selection, .footer ::selection, .post-cta ::selection { background: var(--gold); color: var(--navy); }
img, video, svg { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--text); margin: 0; text-wrap: balance; }
p, li, summary { text-wrap: pretty; }
h1, h2 { font-family: var(--font-title); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.75rem, 6.5vw, 5rem); line-height: 1.05; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.1; }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.1875rem; line-height: 1.35; }
p { margin: 0; }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.6; color: var(--text-body); max-width: 34em; }

/* Aro de foco de teclado: azul sobre fondos claros (el dorado no llega a 3:1 sobre blanco), dorado sobre los oscuros */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible, .slot :focus-visible, .footer :focus-visible, .chat__head :focus-visible, .post-cta :focus-visible { outline-color: var(--gold); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section-y) 0; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--white); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------- Logo ---------- */
/* El SVG se usa como máscara para poder pintarlo en azul o en blanco con `color` */
.logo {
  display: inline-block; flex: none; width: 124px; aspect-ratio: 606 / 242;
  color: var(--blue); background-color: currentColor;
  -webkit-mask: url("../assets/brand/logo-horizontal.svg") center / contain no-repeat;
          mask: url("../assets/brand/logo-horizontal.svg") center / contain no-repeat;
}
.logo--light { color: var(--white); }
.logo--footer { width: 150px; }

/* ---------- Botones (manual p. 17) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 60px; padding: 0 28px; border-radius: var(--radius-btn);
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .16s var(--ease-out), box-shadow .2s ease;
}
/* Todo lo que se pulsa responde al instante encogiéndose un poco */
.btn:active, .chip:active, .demo__ideas button:active, .chat__send:active, .chat__reset:active, .hero__pause:active, .wa:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-hover); }
.btn--inverse { background: var(--white); color: var(--navy); }
.btn--inverse:hover { background: var(--gray); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 0.9375rem; }
.btn--block { width: 100%; }

/* Acción principal "Reservar diagnóstico": dorada para que sea lo primero que se ve
   (decisión de Josué, se aparta a propósito del manual, que se actualizará) */
.btn--cta {
  min-height: 64px; padding: 0 36px; font-size: 1.0625rem;
  background: var(--gold); color: var(--navy);
  box-shadow: 0 10px 24px -12px rgba(11,31,58,.55); /* sombra neutra: el botón destaca por su color, no por un brillo */
}
.btn--cta:hover { background: #F5C518; }
/* El "levantarse" solo con ratón: en táctil el hover se queda pegado tras tocar */
@media (hover: hover) and (pointer: fine) {
  .btn--cta:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -14px rgba(11,31,58,.6); }
  .btn--cta:hover:active { transform: translateY(0) scale(.97); }
}

.link-quiet { color: rgba(255,255,255,.72); font-weight: 500; font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.3); }
.link-quiet:hover { color: var(--white); text-decoration-color: var(--white); }

/* ---------- Navegación (siempre sólida) ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  background: var(--white); box-shadow: 0 1px 0 var(--gray);
}
.nav__inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__menu { display: flex; align-items: center; gap: 32px; }
.nav__menu a:not(.btn) { color: var(--text-body); text-decoration: none; font-size: 0.9375rem; font-weight: 500; }
.nav__menu a:not(.btn):hover { color: var(--navy); }
/* "Blog" solo dentro del menú del móvil (en ordenador el menú tiene 3 enlaces y el blog está al final de la página) */
@media (min-width: 901px) { .nav__menu .nav__mobile-only { display: none; } }

.nav__toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; padding: 0; color: var(--navy); }
.nav__toggle-bars, .nav__toggle-bars::before, .nav__toggle-bars::after {
  display: block; width: 24px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: transform .2s var(--ease-out), background-color .2s ease;
}
.nav__toggle-bars::before, .nav__toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav__toggle-bars::before { top: -7px; }
.nav__toggle-bars::after { top: 7px; }
.nav.is-open .nav__toggle-bars { background: transparent; }
.nav.is-open .nav__toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); padding: 8px var(--gutter) 24px;
    box-shadow: 0 12px 24px rgba(11,31,58,.12);
    /* Aparece con un fundido corto desde arriba; al cerrarse, más rápido que al abrirse */
    opacity: 0; transform: translateY(-8px); visibility: hidden; pointer-events: none;
    transition: opacity .15s ease, transform .15s var(--ease-out), visibility 0s .15s;
  }
  .nav.is-open .nav__menu {
    opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: opacity .2s ease, transform .2s var(--ease-out), visibility 0s;
  }
  .nav__menu a:not(.btn) { color: var(--navy); padding: 14px 0; border-bottom: 1px solid var(--gray); font-size: 1.0625rem; }
  .nav__menu .btn { margin-top: 16px; min-height: 52px; }
}

/* ---------- Portada con vídeo ---------- */
.hero {
  position: relative; margin-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h));
  display: flex; align-items: center; overflow: hidden;
  background: var(--navy) url("../assets/img/hero-poster.jpg") center / cover no-repeat;
  color: var(--white);
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(11,31,58,.94) 0%, rgba(11,31,58,.82) 42%, rgba(11,31,58,.45) 100%),
    linear-gradient(0deg, rgba(11,31,58,.55) 0%, rgba(11,31,58,0) 35%);
}
.hero__content { position: relative; padding-top: 64px; padding-bottom: 96px; }
/* Antetítulo en blanco atenuado: el dorado queda solo para el botón */
.eyebrow { color: rgba(255,255,255,.72); font-weight: 700; font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { color: var(--white); max-width: 11ch; font-size: clamp(2.5rem, 5.6vw, 4.25rem); }
.hero__lead { margin-top: 28px; font-size: clamp(1.125rem, 1.7vw, 1.375rem); line-height: 1.55; color: rgba(255,255,255,.86); max-width: 32em; }
.hero__actions { margin-top: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 32px; }
.hero__pause {
  position: absolute; left: var(--gutter); bottom: 28px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(11,31,58,.35); color: var(--white);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .16s var(--ease-out);
}
.hero__pause:hover { background: rgba(11,31,58,.6); border-color: rgba(255,255,255,.7); }
.hero__pause[hidden] { display: none; }

/* Z decorativa gigante, recortada por la derecha: entre la capa azul y el texto. Solo escritorio y sin animación */
.hero__watermark { display: none; }
@media (min-width: 901px) {
  .hero__watermark {
    display: block; position: absolute; top: 50%; right: -9%;
    height: 120%; aspect-ratio: 692 / 804; transform: translateY(-50%);
    background: var(--white); opacity: .05; pointer-events: none;
    -webkit-mask: url("../assets/brand/isotipo-z.svg") center / contain no-repeat;
            mask: url("../assets/brand/isotipo-z.svg") center / contain no-repeat;
  }
}
.hero__pause svg path { fill: currentColor; }
.hero__pause .i-play { display: none; }
.hero__pause[aria-pressed="true"] .i-play { display: block; }
.hero__pause[aria-pressed="true"] .i-pause { display: none; }

/* ---------- Hueco recuperado ---------- */
.slot { background: var(--navy); color: rgba(255,255,255,.8); }
.slot h2 { color: var(--white); }
.slot .lead { color: rgba(255,255,255,.8); margin-top: 24px; }
.slot__intro .btn { margin-top: 40px; }
.slot__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.slot__demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.agenda { background: var(--white); border-radius: var(--radius-panel); overflow: hidden; color: var(--text); }
.agenda__head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px; border-bottom: 1px solid var(--gray); }
.agenda__title { font-weight: 700; }
.agenda__date { font-size: 0.875rem; color: var(--text-muted); }
.agenda__rows { list-style: none; margin: 0; padding: 8px; }
.row {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 12px;
  padding: 12px; border-radius: 10px; font-size: 0.9375rem;
  transition: background-color .35s, color .35s;
}
.row time { font-weight: 700; font-variant-numeric: tabular-nums; }
.row__who { font-weight: 500; }
.row__tag { font-size: 0.75rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--gray); padding: 2px 8px; border-radius: 99px; }
.row.is-cancelled .row__who { text-decoration: line-through; color: var(--text-muted); }
.row.is-cancelled { background: #FEF2F2; }
.row.is-cancelled .row__tag { color: var(--cancel); border-color: #FECACA; background: var(--white); }
.row.is-offering { background: var(--warn-bg); }
.row.is-offering .row__tag { color: #92400E; border-color: #FDE68A; background: var(--white); }
.row.is-free .row__who { color: var(--text-muted); font-style: italic; }
.row.is-filled { background: var(--ok-bg); }
.row.is-filled .row__tag { color: var(--ok); border-color: #BBF7D0; background: var(--white); }
.row.is-new { animation: pop .45s var(--ease-out); }
@keyframes pop { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: scale(1); } }

.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-height: 360px; }
.log li { animation: rise .35s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Las burbujas crecen desde su esquina, como en una app de mensajería */
@keyframes bubble { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
.log__event { font-size: 0.8125rem; color: rgba(255,255,255,.6); padding-left: 2px; }
.log__event strong { color: var(--white); font-weight: 600; }
.log__msg { background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-size: 0.875rem; line-height: 1.5; color: rgba(255,255,255,.9); }
.log__reply { align-self: flex-end; background: var(--blue); color: var(--white); border-radius: 14px 14px 4px 14px; padding: 8px 14px; font-size: 0.875rem; }
.log__done { background: var(--gold); color: var(--navy); border-radius: 12px; padding: 12px 16px; font-weight: 700; font-size: 0.9375rem; }

/* ---------- Demo del asistente (manual p. 18) ---------- */
.demo { background: var(--surface); }
.demo__grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.demo__intro .lead { margin-top: 24px; }
.demo__ideas { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.demo__ideas button { font: inherit; font-size: 0.9375rem; color: var(--navy); background: var(--white); border: 1px solid var(--gray); border-radius: 99px; padding: 6px 14px; min-height: 38px; cursor: pointer; transition: border-color .2s ease, color .2s ease, transform .16s var(--ease-out); }
.demo__ideas button:hover { border-color: var(--blue); color: var(--blue); }
.demo__disclaimer { margin-top: 28px; font-size: 0.9375rem; color: var(--text-muted); max-width: 32em; }

.chat {
  background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius-panel);
  box-shadow: 0 24px 48px -24px rgba(11,31,58,.28);
  display: flex; flex-direction: column; height: 600px; max-height: 80vh; overflow: hidden;
}
.chat__head { background: var(--navy); color: var(--white); display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.chat__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--white); display: grid; place-items: center; flex: none; }
.chat__avatar::before {
  content: ""; width: 20px; height: 23.2px; background: var(--blue); /* proporción de la Z: 692 × 804 */
  -webkit-mask: url("../assets/brand/isotipo-z.svg") center / contain no-repeat;
          mask: url("../assets/brand/isotipo-z.svg") center / contain no-repeat;
}
.chat__name { font-weight: 700; font-size: 1rem; line-height: 1.3; }
.chat__status { font-size: 0.8125rem; color: rgba(255,255,255,.7); }
.chat__status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; margin-right: 6px; vertical-align: 1px; }
.chat__reset { margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.3); color: var(--white); border-radius: 8px; padding: 6px 12px; min-height: 36px; font: inherit; font-size: 0.8125rem; cursor: pointer; transition: border-color .2s ease, background-color .2s ease, transform .16s var(--ease-out); }
.chat__reset:hover { border-color: var(--white); background: rgba(255,255,255,.08); }
.chat__body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; overscroll-behavior: contain; }
.msg { max-width: 82%; padding: 11px 15px; font-size: 0.9375rem; line-height: 1.5; animation: bubble .3s var(--ease-out) both; white-space: pre-line; }
.msg--bot { align-self: flex-start; background: #F1F5F9; color: var(--navy); border-radius: 14px 14px 14px 4px; transform-origin: 0 100%; }
.msg--user { align-self: flex-end; background: var(--blue); color: var(--white); border-radius: 14px 14px 4px 14px; transform-origin: 100% 100%; }
.msg__meta { align-self: flex-end; font-size: 0.75rem; color: var(--blue); margin-top: -4px; }
.msg--note { align-self: stretch; max-width: none; background: var(--warn-bg); border: 1px solid #FDE68A; color: var(--navy); border-radius: 10px; font-size: 0.875rem; animation-name: rise; }
.msg--note strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: #92400E; margin-bottom: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; animation: rise .3s var(--ease-out) both; }
.chip {
  background: var(--white); color: var(--blue); border: 1.5px solid var(--blue); border-radius: 99px;
  padding: 7px 16px; min-height: 38px; font: inherit; font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .16s var(--ease-out);
}
/* En pantallas táctiles, zonas de pulsación de 44 px como mínimo */
@media (pointer: coarse) {
  .chip, .demo__ideas button, .chat__reset { min-height: 44px; }
}
.chip:hover { background: var(--blue); color: var(--white); }
.chip:disabled { opacity: .45; cursor: default; background: var(--white); color: var(--blue); }
.typing { align-self: flex-start; background: #F1F5F9; border-radius: 14px; padding: 14px 16px; display: flex; gap: 5px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat__form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--gray); }
.chat__input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--gray); border-radius: 99px; padding: 0 18px; font: inherit; font-size: 0.9375rem; color: var(--navy); background: var(--surface); }
.chat__input::placeholder { color: var(--placeholder); }
.chat__input:focus { outline: none; border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 3px rgba(2,62,138,.14); }
.chat__send { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--blue); color: var(--white); display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color .2s ease, transform .16s var(--ease-out); }
.chat__send:hover { background: var(--blue-hover); }

/* ---------- Calculadora ---------- */
.calc__grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.calc__intro .lead { margin-top: 24px; }
.calc__panel { background: var(--surface); border: 1px solid var(--gray); border-radius: var(--radius-panel); padding: clamp(24px, 4vw, 40px); }
/* Cada dato se ajusta con la barra o se escribe el número exacto */
.calc-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px; margin-bottom: 24px; }
.calc-field label { font-weight: 700; color: var(--navy); font-size: 1rem; line-height: 1.4; }
.calc-field__box { position: relative; }
.calc-field__box input {
  width: 96px; height: 48px; padding: 0 12px; text-align: right;
  border: 1px solid var(--gray); border-radius: var(--radius-field); background: var(--white);
  font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; color: var(--blue);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.calc-field__box--euro input { padding-right: 32px; }
.calc-field__box--euro::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--blue); pointer-events: none; }
.calc-field__box input::-webkit-outer-spin-button,
.calc-field__box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-field__box input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,62,138,.12); }
.calc-field input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 4px 0 0; accent-color: var(--blue); height: 28px; cursor: pointer; }
.calc-field__hint { grid-column: 1 / -1; font-size: 0.875rem; color: var(--text-muted); }

/* Resultado explicado: semana → mes → año */
.calc__out { padding-top: 24px; border-top: 1px solid var(--gray); }
.calc__out-title { font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.chain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chain__item { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 12px; background: var(--white); border: 1px solid var(--gray); border-radius: 12px; }
/* Flecha dibujada (no un carácter de texto) entre semana → mes → año */
.chain__item + .chain__item::before {
  content: ""; position: absolute; left: -5px; top: 50%; width: 6px; height: 6px;
  border-top: 1.5px solid #94A3B8; border-right: 1.5px solid #94A3B8;
  transform: translate(-50%, -50%) rotate(45deg);
}
.chain__item--main { border: 2px solid var(--blue); padding: 13px 13px 11px; box-shadow: 0 8px 20px -12px rgba(2,62,138,.35); }
.chain__label { font-size: 0.8125rem; color: var(--text-muted); }
.chain__num { font-family: var(--font-title); font-weight: 700; font-size: clamp(1.25rem, 2.2vw, 1.625rem); line-height: 1.2; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chain__how { font-size: 0.75rem; color: var(--text-muted); }
.chain__item--main .chain__label { color: var(--blue); font-weight: 600; }
.chain__item--main .chain__num { color: var(--blue); }

/* Lo que se podría recuperar con el asistente */
.gain { margin-top: 24px; padding: 20px; background: #EEF4FC; border: 1px solid #C9DAF0; border-radius: 14px; }
.gain__field { margin-bottom: 8px; }
.gain__rate { font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.gain__result { padding-top: 12px; border-top: 1px solid #C9DAF0; }
.gain__label { font-size: 0.9375rem; font-weight: 600; color: var(--navy); }
.gain__num { font-size: 1rem; color: var(--text-body); }
.gain__num strong { font-family: var(--font-title); font-weight: 700; font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15; color: var(--blue); font-variant-numeric: tabular-nums; margin-right: 4px; }
.gain__sub { font-size: 0.9375rem; color: var(--text-body); }
.gain__sub span { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.calc__fine { margin-top: 16px; font-size: 0.8125rem; line-height: 1.5; color: var(--text-muted); }

.calc__aside { margin-top: 20px; font-size: 1rem; color: var(--text-muted); max-width: 30em; }

/* ---------- Trato humano (junto a la demo) ---------- */
.human { margin-top: 32px; padding: 20px 24px; background: var(--white); border-left: 4px solid var(--blue); border-radius: 0 12px 12px 0; }
.human__title { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.human p:not(.human__title) { font-size: 1rem; }

/* ---------- Cómo trabajamos ---------- */
.steps h2 { margin-bottom: 48px; }
.steps__list { list-style: none; margin: 0 0 48px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 48px); counter-reset: none; }
.steps__list li { position: relative; padding-top: 28px; border-top: 2px solid var(--gray); }
.steps__list li:first-child { border-top-color: var(--blue); }
.steps__num {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: var(--white); font-family: var(--font-title); font-weight: 700; font-size: 1.25rem; margin-bottom: 20px;
}
.steps__list h3 { font-size: 1.375rem; margin-bottom: 8px; }

/* ---------- Preguntas ---------- */
.faq { background: var(--surface); }
.faq__grid { display: grid; grid-template-columns: 4fr 7fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq__list { border-top: 1px solid var(--gray); }
.faq details { border-bottom: 1px solid var(--gray); }
.faq summary {
  list-style: none; cursor: pointer; padding: 24px 40px 24px 0; position: relative;
  font-weight: 600; font-size: 1.1875rem; color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
  border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  /* Solo transform (antes animaba margin, que obliga a recalcular la página) */
  transform: translateY(-9px) rotate(45deg); transition: transform .25s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(-3px) rotate(-135deg); }
.faq summary { transition: color .2s ease; }
.faq summary:hover { color: var(--blue); }
.faq details p { padding: 0 40px 24px 0; max-width: 40em; }
.faq details[open] p { animation: rise .3s var(--ease-out) both; }

/* ---------- Contacto ---------- */
.contact__grid { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(40px, 6vw, 96px); align-items: start; }
.contact__intro .lead { margin-top: 24px; }
.contact__points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.contact__points li { position: relative; padding-left: 32px; color: var(--navy); font-weight: 500; }
.contact__points li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 13px;
  border-right: 2.5px solid var(--blue); border-bottom: 2.5px solid var(--blue); transform: rotate(45deg);
}
.form { background: var(--surface); border: 1px solid var(--gray); border-radius: var(--radius-panel); padding: clamp(24px, 4vw, 40px); display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field label, .slots legend { font-weight: 600; font-size: 0.9375rem; color: var(--navy); }
.field input {
  height: 56px; border: 1px solid var(--gray); border-radius: var(--radius-field); padding: 0 16px;
  font: inherit; font-size: 1rem; color: var(--navy); background: var(--white);
}
.field input::placeholder { color: var(--placeholder); }
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,62,138,.12); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field textarea {
  min-height: 96px; resize: vertical; border: 1px solid var(--gray); border-radius: var(--radius-field); padding: 12px 16px;
  font: inherit; font-size: 1rem; line-height: 1.5; color: var(--navy); background: var(--white);
}
.field textarea::placeholder { color: var(--placeholder); }
.field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2,62,138,.12); }
.field__optional { font-weight: 400; color: var(--text-muted); }

/* Objetivos: casillas con forma de botón */
.goals { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goals legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 0.9375rem; color: var(--navy); }
.goals legend span { font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.goals label { position: relative; }
.goals input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.goals label span {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; line-height: 1.3;
  border: 1px solid var(--gray); border-radius: var(--radius-field); background: var(--white);
  color: var(--navy); font-size: 0.9375rem; font-weight: 500; transition: background-color .2s, border-color .2s, color .2s;
}
.goals label span::before {
  content: ""; flex: none; width: 18px; height: 18px; border: 1.5px solid #94A3B8; border-radius: 5px; background: var(--white) no-repeat center / 12px;
}
.goals input:checked + span { border-color: var(--blue); background: #EEF4FC; }
.goals input:checked + span::before {
  border-color: var(--blue); background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5 5 9l5-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.goals input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.slots { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slots legend { margin-bottom: 8px; padding: 0; }
.slots label { position: relative; }
.slots input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slots span {
  display: grid; place-items: center; height: 48px; border: 1px solid var(--gray); border-radius: var(--radius-field);
  background: var(--white); color: var(--navy); font-weight: 500; font-size: 0.9375rem; transition: background-color .2s, color .2s;
}
.slots input:checked + span { background: var(--blue); border-color: var(--blue); color: var(--white); font-weight: 700; }
.slots input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9375rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.form__status { font-size: 0.9375rem; font-weight: 500; min-height: 1.5em; }
.form__status.is-ok { color: var(--ok); }
.form__status.is-error { color: var(--cancel); }

/* ---------- Pie ---------- */
.footer { background: var(--navy); color: rgba(255,255,255,.7); padding: 72px 0 32px; font-size: 0.9375rem; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer__promise { margin-top: 20px; color: rgba(255,255,255,.7); }
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.footer__head { color: var(--white); font-weight: 600; margin-bottom: 4px; }
.footer a:not(.logo) { color: rgba(255,255,255,.7); text-decoration: none; }
.footer a:not(.logo):hover { color: var(--white); text-decoration: underline; }
.footer__base { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--navy-3); font-size: 0.8125rem; color: rgba(255,255,255,.5); }

/* ---------- Movimiento ---------- */
/* Entrada de la portada al cargar */
/* Es el momento "de autor" de la página: titular, texto y botón entran escalonados (70 ms entre cada uno) */
.js .hero__content > * { animation: hero-in .7s var(--ease-out) backwards; }
.js .hero__content > :nth-child(2) { animation-delay: .07s; }
.js .hero__content > :nth-child(3) { animation-delay: .14s; }
.js .hero__content > :nth-child(4) { animation-delay: .21s; }
@keyframes hero-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Zoom muy lento del vídeo para que la portada no se sienta estática */
.hero__video { animation: slow-zoom 22s ease-in-out infinite alternate; }
@keyframes slow-zoom { from { transform: scale(1); } to { transform: scale(1.08); } }

/* Aparición de cada bloque al llegar a él (main.js añade .is-visible) */
/* 0,6 s y 16 px: se nota, pero no hace esperar. Sin will-change permanente (gasta memoria en toda la página) */
.js [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* Bloques de texto: en vez de entrar todo de golpe, entran sus piezas una tras otra (70 ms entre cada una) */
.js [data-reveal="stagger"] { opacity: 1; transform: none; transition: none; }
.js [data-reveal="stagger"] > * {
  opacity: 0; transform: translateY(14px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal="stagger"] > :nth-child(2) { --i: 1; }
.js [data-reveal="stagger"] > :nth-child(3) { --i: 2; }
.js [data-reveal="stagger"] > :nth-child(4) { --i: 3; }
.js [data-reveal="stagger"] > :nth-child(5) { --i: 4; }
.js [data-reveal="stagger"] > :nth-child(6) { --i: 5; }
.js [data-reveal="stagger"] > :nth-child(n+7) { --i: 6; }
.js [data-reveal="stagger"].is-visible > * { opacity: 1; transform: none; }

/* En ordenador, los paneles grandes además "enfocan" al entrar (de un leve desenfoque a nítido).
   En móvil no: el desenfoque de bloques grandes cuesta rendimiento y ahí prima la fluidez. */
@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .js [data-reveal]:not([data-reveal="stagger"]) {
    filter: blur(6px);
    transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), filter .6s var(--ease-out);
    transition-delay: var(--d, 0s);
  }
  .js [data-reveal]:not([data-reveal="stagger"]).is-visible { filter: none; }
}
/* En móvil, recorrido más corto: en pantallas pequeñas 16 px de desplazamiento se ve exagerado */
@media (max-width: 640px) {
  .js [data-reveal]:not(.is-visible):not([data-reveal="stagger"]) { transform: translateY(10px); }
  .js [data-reveal="stagger"]:not(.is-visible) > * { transform: translateY(10px); }
}

/* El vídeo de la portada aparece con un fundido sobre la imagen fija, en vez de saltar */
.js .hero__video { opacity: 0; transition: opacity 1.2s ease; }
.js .hero__video.is-playing { opacity: 1; }

/* El menú gana una sombra suave en cuanto empiezas a bajar */
.nav { transition: box-shadow .3s ease; }
.nav.is-scrolled { box-shadow: 0 1px 0 var(--gray), 0 10px 28px -18px rgba(11,31,58,.35); }

/* Preguntas frecuentes: la respuesta se despliega y se recoge con suavidad (navegadores que lo permiten) */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
  .faq details::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .32s var(--ease-out), content-visibility .32s allow-discrete;
  }
  .faq details[open]::details-content { block-size: auto; }
}

/* Paso entre páginas (inicio ↔ blog ↔ artículos): fundido corto en vez de un corte brusco */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: ease; }
.nav .logo, .blog-top .logo, .legal-top .logo { view-transition-name: site-logo; }

/* El botón de la agenda cambia de texto (Ver cómo funciona / Reproduciendo… / Repetir) sin cambiar de ancho */
#slot-play { min-width: 214px; }
/* Los campos de formulario cambian de borde con suavidad al enfocarlos */
.field input, .field textarea, .calc-field__box input, .chat__input { transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }

/* Barra de progreso de lectura bajo el menú */
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%; background: var(--gold); transform-origin: 0 50%; transform: scaleX(0); }

/* Cómo trabajamos: botón final */
.steps__cta { margin-top: 8px; }

/* Botón flotante de WhatsApp (verde oficial de WhatsApp para que se reconozca al instante) */
.wa {
  position: fixed; right: 24px; bottom: 24px; z-index: 45;
  display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px;
  background: #25D366; color: var(--white); border-radius: 99px; text-decoration: none;
  box-shadow: 0 10px 28px -8px rgba(11,31,58,.45);
  transition: transform .25s var(--ease-out), box-shadow .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .wa:hover { transform: translateY(-3px); box-shadow: 0 14px 32px -8px rgba(11,31,58,.5); }
  .wa:hover:active { transform: translateY(0) scale(.97); }
}
.wa__label { font-weight: 700; font-size: 0.9375rem; white-space: nowrap; }
/* Al bajar, el botón se queda solo con el icono para no tapar contenido */
.wa.is-compact { width: 60px; padding: 0; justify-content: center; }
.wa.is-compact .wa__label { display: none; }
/* `backwards`: al terminar, la animación suelta el control y el hover y la pulsación vuelven a funcionar */
.js .wa { animation: wa-in .5s 1s var(--ease-out) backwards; }
@keyframes wa-in { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }

/* Botón fijo en móvil, visible cuando el de la portada ya no se ve */
.mobile-cta { display: none; }
@media (max-width: 900px) {
  .mobile-cta {
    display: flex; position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40; min-height: 56px;
    /* Sale más rápido de lo que entra */
    transform: translateY(140%); transition: transform .22s var(--ease-out), background-color .2s ease;
  }
  .mobile-cta.is-shown { transform: none; transition-duration: .35s, .2s; }
  .mobile-cta.is-shown:active { transform: scale(.97); }
  /* En móvil, WhatsApp solo con icono y por encima del botón fijo */
  .wa { width: 56px; height: 56px; padding: 0; justify-content: center; right: 16px; bottom: 16px; transition: transform .35s var(--ease-out); }
  /* Sube cuando aparece el botón fijo "Reservar diagnóstico" (con transform, que no recalcula la página) */
  .cta-shown .wa { transform: translateY(-68px); }
  .cta-shown .wa:active { transform: translateY(-68px) scale(.97); }
  /* Se aparta mientras se usa el chat o el formulario, para no tapar sus botones */
  .wa { transition: transform .35s var(--ease-out), opacity .2s ease, visibility 0s; }
  .wa.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: transform .35s var(--ease-out), opacity .15s ease, visibility 0s .15s; }
  .wa__label { display: none; }
  .footer { padding-bottom: 96px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .slot__grid { grid-template-columns: 1fr; }
  .slot__intro h2, .slot__intro .lead { max-width: 20em; }
}
@media (max-width: 900px) {
  .demo__grid, .calc__grid, .faq__grid, .contact__grid { grid-template-columns: 1fr; }
  .steps__list { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .hero { align-items: flex-end; }
  .hero__shade { background: linear-gradient(0deg, rgba(11,31,58,.96) 0%, rgba(11,31,58,.85) 55%, rgba(11,31,58,.6) 100%); }
  .hero__content { padding-bottom: 72px; }
  .hero__actions .btn { width: 100%; }
  .slot__demo { grid-template-columns: 1fr; }
  .log { min-height: 0; }
  .chat { height: 560px; }
  .msg { max-width: 90%; }
  .field-pair, .goals { grid-template-columns: 1fr; }
  .chain { grid-template-columns: 1fr; gap: 14px; }
  .chain__item { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .chain__label { flex-basis: 100%; }
  .chain__item + .chain__item::before { left: 50%; top: -7px; transform: translate(-50%, -50%) rotate(135deg); }
  .footer__grid { grid-template-columns: 1fr; }
}

/* "Reducir movimiento": se quitan los desplazamientos y los zooms, pero se conservan los fundidos y cambios de color */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .hero__video { animation: none; }
  .js [data-reveal], .js [data-reveal="stagger"] > * { transform: none; filter: none; transition: opacity .3s ease; transition-delay: 0s; }
  @view-transition { navigation: none; }
  .faq details::details-content { transition: none; }
  .btn, .chip, .wa, .mobile-cta, .post-card, .nav__menu, .faq summary::after { transition-property: background-color, color, border-color, opacity, visibility, box-shadow; }
  .btn:active, .chip:active, .wa:active, .btn--cta:hover, .wa:hover { transform: none; }
}
