/* ==========================================================================
   base.css — Ridgeline Clinical Access
   Fuente de verdad de tokens y componentes. Sin frameworks, sin build.

   Registro: institución médica, no landing de captación. Titular serif grande
   sobre foto a sangre, botones de contorno, filetes de un pixel, mucho aire.
   Cero tarjetas con sombra, cero píldoras de color, cero CTA relleno gritando.
   ========================================================================== */

/* --- Fuentes -------------------------------------------------------------
   Newsreader para titulares, Public Sans para texto y UI. Self-hosted; los
   woff2 van en assets/fonts/. Hasta entonces caen a Georgia y al sans del
   sistema, que es una caída decente.
   ------------------------------------------------------------------------ */

@font-face { font-family:"Newsreader"; src:url("/assets/fonts/newsreader-400.woff2") format("woff2"); font-weight:400; font-display:swap; }
@font-face { font-family:"Newsreader"; src:url("/assets/fonts/newsreader-500.woff2") format("woff2"); font-weight:500; font-display:swap; }
@font-face { font-family:"Public Sans"; src:url("/assets/fonts/public-sans-400.woff2") format("woff2"); font-weight:400; font-display:swap; }
@font-face { font-family:"Public Sans"; src:url("/assets/fonts/public-sans-600.woff2") format("woff2"); font-weight:600; font-display:swap; }
@font-face { font-family:"Public Sans"; src:url("/assets/fonts/public-sans-700.woff2") format("woff2"); font-weight:700; font-display:swap; }

/* --- Tokens -------------------------------------------------------------- */

:root {
  --paper:      #FFFFFF;
  --stone:      #F4F2EF;   /* banda alterna: gris cálido, no crema */
  --stone-deep: #EBE7E2;
  --ink:        #1B1714;
  --ink-soft:   #5F5751;
  --rule:       #DFDAD3;
  --rule-soft:  #EDE9E4;

  /* Granate: registro de facultad de medicina. Ni el azul de Mayo ni el verde
     de cualquier clínica. Se usa poco y siempre para lo mismo. */
  --garnet:      #6E1F2E;
  --garnet-deep: #4C1420;
  --garnet-tint: #F7EAEC;

  /* Obligatorio y precaución. Separado del granate para que el color de marca
     no compita con el de aviso. */
  --ochre:      #8A5B00;
  --ochre-tint: #FBF3E2;
  --ok:         #24523A;
  --ok-tint:    #D7E9DC;

  --serif: "Newsreader", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans:  "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --s1: .25rem; --s2: .5rem;  --s3: 1rem;  --s4: 1.5rem;
  --s5: 2.5rem; --s6: 4rem;   --s7: 6.5rem;

  --page:   78rem;
  --text:   40rem;
  --header: 4.75rem;
}

/* --- Reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
svg { max-width: 100%; }
figure { margin: 0; }

/* --- Tipografía ----------------------------------------------------------
   Los titulares van en serif y con peso normal, no en negrita: a tamaño
   grande el peso lo da el cuerpo de la letra, no el trazo.
   ------------------------------------------------------------------------ */

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 0 0 var(--s3);
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.875rem, 1.3rem + 2.1vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); }

h4, .label {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 var(--s1);
  letter-spacing: -0.005em;
}

p { margin: 0 0 var(--s3); max-width: var(--text); }
p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(1.125rem, 1rem + .5vw, 1.3125rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 34rem;
}

.small { font-size: .875rem; line-height: 1.6; color: var(--ink-soft); }
.fine  { font-size: .8125rem; line-height: 1.6; color: var(--ink-soft); }

/* Etiqueta de sección. Es la única versalita del sitio y marca a qué parte del
   documento perteneces, no decora. */
.kicker {
  display: block;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--garnet);
  margin-bottom: var(--s3);
}

a { color: var(--garnet); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--garnet-deep); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--garnet); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: var(--s3); top: var(--s3); z-index: 100;
  background: var(--paper); padding: var(--s2) var(--s3);
  border: 1px solid var(--ink);
}

/* --- Estructura ---------------------------------------------------------- */

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s4); }
.wrap--text { max-width: 52rem; }

.section { padding: var(--s7) 0; }
/* Aire por encima del destino cuando se llega por un ancla. */
section[id] { scroll-margin-top: var(--s4); }
.section--stone { background: var(--stone); }
.section--rule  { border-top: 1px solid var(--rule-soft); }

.section__head { max-width: 44rem; margin-bottom: var(--s6); }
.section__head p { font-size: 1.125rem; color: var(--ink-soft); max-width: 38rem; }

/* --- Cabecera ------------------------------------------------------------
   Barra de servicio, no barra de conversión: el CTA es un enlace de texto,
   como en cualquier institución sanitaria. Nada de botón fijo persiguiéndote.
   ------------------------------------------------------------------------ */

.masthead { position: relative; background: var(--paper); border-bottom: 1px solid var(--rule); }
.masthead__inner {
  min-height: var(--header);
  display: flex; align-items: center; gap: var(--s5);
  padding-block: var(--s3);
}

.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.logo svg { flex: none; }
.logo b {
  font-family: var(--serif);
  font-size: 1.25rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1;
}
.logo span {
  display: block;
  font-size: .625rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: .2rem;
}

/* Sin JS el menú se ve entero y el botón no existe: la navegación nunca
   depende de que el script cargue. El script marca <html class="js"> y a
   partir de ahí manda el botón. */
.menu__btn { display: none; }
.menu__panel { margin-left: auto; }

.masthead ul {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--s5); margin: 0; padding: 0; list-style: none;
}
.masthead a {
  color: var(--ink); text-decoration: none;
  font-size: .9375rem; font-weight: 600;
  padding-bottom: 2px; border-bottom: 2px solid transparent;
}
.masthead a:hover { color: var(--garnet); border-bottom-color: var(--garnet); }
.masthead .is-cta { color: var(--garnet); }

/* --- Acciones ------------------------------------------------------------
   Contorno, no relleno. Un botón relleno de color en cada sección es lo que
   hace que una página de salud parezca un embudo.
   ------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: .8125rem 1.75rem;
  border: 1.5px solid currentColor;
  border-radius: 2rem;
  color: var(--garnet);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}
.btn:hover { background: var(--garnet); color: var(--paper); border-color: var(--garnet); }

.btn--light { color: var(--paper); }
.btn--light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

.btn--solid { background: var(--garnet); color: var(--paper); border-color: var(--garnet); }
.btn--solid:hover { background: var(--garnet-deep); border-color: var(--garnet-deep); color: var(--paper); }

/* Enlace con cheurón. El cheurón es un glifo aparte, no una flecha pegada al
   texto: se mueve al pasar el cursor y no viaja con el subrayado. */
.chev {
  display: inline-flex; align-items: baseline; gap: .45rem;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.chev::after { content: "›"; font-size: 1.2em; line-height: 1; transition: transform 180ms ease; }
.chev:hover::after { transform: translateX(3px); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s5); }

/* --- Portada -------------------------------------------------------------
   Foto a sangre, titular serif encima. Sin formulario: esta página informa,
   la captación empieza cuando el visitante decide entrar al intake.
   ------------------------------------------------------------------------ */

.hero { position: relative; background: #2A1418; isolation: isolate; }
.hero__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: center 35%;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, rgba(20,8,11,.90) 0%, rgba(20,8,11,.72) 42%, rgba(20,8,11,.25) 100%);
}
.hero__inner { padding-block: clamp(var(--s6), 12vh, 10rem) clamp(var(--s6), 11vh, 8.5rem); }
.hero__body { max-width: 40rem; color: var(--paper); }
.hero__body h1 { color: var(--paper); }
.hero__body .kicker { color: #E7BFC6; }
.hero__body .lede { color: rgba(255,255,255,.88); max-width: 33rem; }
.hero__body .chev { color: var(--paper); }

/* --- Bloque de texto e imagen -------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: var(--s7);
  align-items: center;
}
.split > * { min-width: 0; }

/* Columna de apoyo más estrecha: para un retrato de plantilla, no para una
   imagen de portada. A media página una cara ocupa como un cartel. */
.split--aside { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.headshot { max-width: 15rem; }
.headshot img { width: 100%; }
.split--flip > figure { order: -1; }
.split--top { align-items: start; }
.split__body h2 { margin-bottom: var(--s4); }

/* Par etiqueta + párrafo. Sustituye a la fila de tarjetas idénticas. */
.pairs { margin: 0; }
.pairs dt { font-family: var(--sans); font-weight: 700; margin-top: var(--s4); }
.pairs dt:first-of-type { margin-top: 0; }
.pairs dd { margin: .25rem 0 0; color: var(--ink-soft); max-width: 34rem; }

figcaption { margin-top: var(--s3); font-size: .8125rem; color: var(--ink-soft); }

/* --- Índice de áreas -----------------------------------------------------
   Filas con filete, no tarjetas. Es un índice que se recorre, y se comporta
   como tal: el área entera es el enlace.
   ------------------------------------------------------------------------ */

.areas { border-top: 1px solid var(--rule); }
.area {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 1.5fr) auto;
  gap: var(--s4) var(--s5);
  align-items: baseline;
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color 160ms ease;
}
.area:hover, .area:focus-within { background: var(--stone); }
.section--stone .area:hover, .section--stone .area:focus-within { background: var(--paper); }

.area__no {
  font-family: var(--sans); font-size: .8125rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink-soft); letter-spacing: .06em;
}
.area h3 { margin: 0; }
.area p { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
.area__meta {
  font-family: var(--sans); font-size: .8125rem; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.area__meta b { display: block; font-size: 1.25rem; font-weight: 400; color: var(--ink); font-family: var(--serif); }

/* --- Mapa de cobertura --------------------------------------------------- */

.geo__map { display: block; width: 100%; max-width: 30rem; height: auto; }
.geo__tile rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
.geo__tile text { font-family: var(--sans); font-size: 10px; font-weight: 600; fill: #B6ADA6; }
.geo__tile[data-site="1"] rect { fill: var(--garnet-tint); stroke: #E0BFC5; }
.geo__tile[data-site="1"] text { fill: var(--garnet); }
.geo__tile[data-match="1"] rect { fill: var(--garnet); stroke: var(--garnet); }
.geo__tile[data-match="1"] text { fill: var(--paper); }
.geo__tile rect, .geo__tile text { transition: fill 160ms ease, stroke 160ms ease; }

/* --- Diagrama de traspaso ------------------------------------------------ */

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll-x:focus-visible { outline: 2px solid var(--garnet); outline-offset: 3px; }

.flow { display: block; width: 100%; max-width: 35rem; height: auto; }
.flow__lane { font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .14em; fill: var(--ink-soft); }
.flow__divider { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.flow__node rect { fill: var(--paper); stroke: var(--rule); stroke-width: 1; }
.flow__num { font-family: var(--sans); font-size: 11px; font-weight: 700; fill: var(--garnet); }
.flow__label { font-family: var(--sans); font-size: 13px; fill: var(--ink); }
.flow__cross { font-family: var(--sans); font-size: 9px; font-weight: 700; letter-spacing: .14em; fill: var(--garnet); }
.flow__aside { font-family: var(--sans); font-size: 11.5px; fill: var(--ink-soft); }
.flow__link { stroke: #C4BBB4; stroke-width: 1.5; }
.flow__link--cross { stroke: var(--garnet); }
#tip path { fill: #C4BBB4; }
#tip-brand path { fill: var(--garnet); }
.flow__node[data-on] rect { fill: var(--garnet); stroke: var(--garnet); }
.flow__node[data-on] .flow__num { fill: rgba(255,255,255,.7); }
.flow__node[data-on] .flow__label { fill: var(--paper); }
.flow__node rect, .flow__node text { transition: fill 160ms ease, stroke 160ms ease; }

/* --- Pasos numerados ----------------------------------------------------- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--s4);
  padding: var(--s4) 0;
  border-top: 1px solid var(--rule-soft);
  transition: background-color 160ms ease;
}
.steps li:first-child { border-top: 0; }
.steps li[data-on] { background: var(--garnet-tint); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--serif); font-size: 1.375rem; color: var(--garnet);
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.steps p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .9375rem; }

/* --- Testimonios --------------------------------------------------------- */

.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6) var(--s5); }
.quote blockquote {
  margin: 0 0 var(--s4);
  font-family: var(--serif);
  font-size: 1.25rem; line-height: 1.45;
}
.quote blockquote::before {
  content: ""; display: block; width: 2rem; height: 2px;
  background: var(--garnet); margin-bottom: var(--s4);
}
.quote figcaption { margin: 0; }
.quote__name { display: block; font-weight: 700; font-size: .9375rem; color: var(--ink); }

/* --- Preguntas ----------------------------------------------------------- */

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding: var(--s4) 0; cursor: pointer; list-style: none;
  font-family: var(--serif); font-size: 1.25rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  font-family: var(--sans); font-size: 1.5rem; font-weight: 400;
  color: var(--garnet); line-height: 1; transition: transform 200ms ease;
}
.faq details[open] summary::after { content: "–"; }
.faq__body { padding: 0 0 var(--s5); max-width: 42rem; color: var(--ink-soft); }

/* --- Avisos -------------------------------------------------------------- */

.notice { border-left: 2px solid var(--ochre); background: var(--ochre-tint); padding: var(--s4) var(--s5); }
.notice .label { color: var(--ochre); }
.req { color: var(--ochre); }

/* --- Consentimiento SMS -------------------------------------------------- */

.consent { border: 1px solid var(--rule); background: var(--paper); padding: var(--s6); }
.field { margin-bottom: var(--s4); max-width: 24rem; }
.field label { display: block; font-weight: 700; font-size: .9375rem; margin-bottom: var(--s2); }
.input {
  width: 100%; font: inherit; color: var(--ink);
  padding: .8125rem 1rem;
  background: var(--paper);
  border: 1px solid var(--ink-soft);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input:focus { outline: none; border-color: var(--garnet); box-shadow: 0 0 0 3px var(--garnet-tint); }
.input:user-invalid { border-color: var(--ochre); }
.check { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: .75rem; align-items: start; margin: var(--s4) 0; }
.check input { width: 1.25rem; height: 1.25rem; margin: .15rem 0 0; accent-color: var(--garnet); }
.check label { font-size: .875rem; line-height: 1.65; color: var(--ink-soft); max-width: 46rem; }

/* --- Portada de página interior -----------------------------------------
   Compacta y sin foto: en una institución sanitaria las páginas de servicio no
   abren con imagen, abren con su nombre y una migaja de ruta.
   ------------------------------------------------------------------------ */

.page-head { background: var(--stone); border-bottom: 1px solid var(--rule); padding: var(--s6) 0 var(--s5); }
.page-head h1 { font-size: clamp(2.125rem, 1.5rem + 2.4vw, 3.25rem); margin-bottom: var(--s3); }
.page-head p { font-size: 1.125rem; color: var(--ink-soft); max-width: 42rem; }

.crumbs { font-size: .8125rem; margin-bottom: var(--s4); color: var(--ink-soft); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: .4rem; color: var(--rule); }
.crumbs a { color: var(--ink-soft); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

/* --- Documento legal -----------------------------------------------------
   Columna estrecha, numeración real y encabezados enlazables. Se lee y se
   cita: un revisor necesita poder apuntar a "sección 7".
   ------------------------------------------------------------------------ */

.doc { max-width: 44rem; }
.doc > section { padding-top: var(--s5); }
.doc > section:first-of-type { padding-top: var(--s4); }
.doc h2 {
  font-size: 1.375rem;
  display: flex; gap: .75rem;
  padding-bottom: var(--s2); margin-bottom: var(--s3);
  border-bottom: 1px solid var(--rule-soft);
}
.doc h2 span { color: var(--garnet); font-variant-numeric: tabular-nums; flex: none; }
.doc h3 { font-family: var(--sans); font-size: 1rem; font-weight: 700; margin: var(--s4) 0 var(--s1); }
.doc p, .doc li { max-width: 42rem; }
.doc ul { padding-left: 1.15rem; margin: 0 0 var(--s3); }
.doc li { margin-bottom: .4rem; }
.doc dl { margin: 0 0 var(--s3); }
.doc dt { font-weight: 700; margin-top: var(--s3); }
.doc dd { margin: .2rem 0 0; color: var(--ink-soft); }

.doc__meta {
  font-size: .8125rem; color: var(--ink-soft);
  padding-bottom: var(--s4); border-bottom: 2px solid var(--ink);
}

.toc { background: var(--stone); padding: var(--s4) var(--s5); margin-bottom: var(--s5); }
.toc ol { columns: 2; column-gap: var(--s5); margin: 0; padding-left: 1.1rem; font-size: .9375rem; }
.toc li { margin-bottom: .35rem; break-inside: avoid; }

/* --- Panel de suscripción SMS -------------------------------------------
   Bloque sólido de marca. Es el único lugar del sitio donde el granate ocupa
   una superficie grande, y por eso funciona como llamada.
   ------------------------------------------------------------------------ */

.subscribe {
  background: var(--garnet);
  color: var(--paper);
  padding: clamp(var(--s5), 5vw, var(--s6));
  max-width: 46rem;
}
.subscribe h2 {
  font-family: var(--sans);
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.625rem);
  font-weight: 700; line-height: 1.3; letter-spacing: -0.015em;
  color: var(--paper);
  margin-bottom: var(--s4);
  max-width: 32ch;
}
.subscribe .input {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.45);
  color: var(--paper);
  font-size: 1.0625rem;
}
.subscribe .input::placeholder { color: rgba(255,255,255,.62); }
.subscribe .input:focus { border-color: var(--paper); box-shadow: 0 0 0 3px rgba(255,255,255,.22); }
.subscribe .field { max-width: none; margin-bottom: var(--s4); }
.subscribe .field label { color: var(--paper); }
.subscribe .check { margin: 0 0 var(--s4); }
.subscribe .check label { color: rgba(255,255,255,.92); font-size: .875rem; }
.subscribe .check input { accent-color: var(--paper); }
.subscribe a { color: var(--paper); text-decoration-thickness: 1px; }
.subscribe a:hover { color: var(--paper); text-decoration-thickness: 2px; }
.subscribe .req { color: #F0C7A0; }
.subscribe .btn--go {
  background: var(--paper); color: var(--garnet);
  border-color: var(--paper); font-weight: 700;
}
.subscribe .btn--go:hover { background: var(--stone); color: var(--garnet-deep); border-color: var(--stone); }
.subscribe .fine { color: rgba(255,255,255,.7); }

/* Confirmación de envío. Bloque claro sobre el granate: a esta distancia el
   contraste lo da el valor, no el tono. */
.subscribe__done {
  display: flex; align-items: flex-start; gap: .875rem;
  background: var(--ok-tint); color: var(--ok);
  padding: var(--s4) var(--s5);
}
.subscribe__done svg { flex: none; margin-top: .15rem; }
.subscribe__done b { display: block; font-size: 1.0625rem; line-height: 1.35; }
.subscribe__done span { display: block; margin-top: .35rem; font-size: .875rem; line-height: 1.55; }

/* --- Llamada intercalada -------------------------------------------------
   Va donde el visitante acaba de entender algo, no cada dos secciones.
   ------------------------------------------------------------------------ */

.cta-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s4) var(--s5);
  margin-top: var(--s6);
  padding-top: var(--s5);
  border-top: 1px solid var(--rule);
}
.cta-row p { margin: 0; font-family: var(--serif); font-size: 1.375rem; line-height: 1.3; max-width: 32ch; }
.cta-row .btn { flex: none; }

/* --- Intake --------------------------------------------------------------
   Formulario por pasos. Es el único movimiento orquestado del sitio junto al
   diagrama: el paso que entra se desliza, y sólo responde a una acción.
   ------------------------------------------------------------------------ */

.intake { max-width: 34rem; }

.progress { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.progress__track { flex: 1; height: 3px; background: var(--rule); overflow: hidden; }
.progress__bar { display: block; height: 100%; background: var(--garnet); transition: width 320ms cubic-bezier(.2,.7,.3,1); }
.progress__label { font-size: .8125rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

.step { border: 0; padding: 0; margin: 0; min-width: 0; }
.step[hidden] { display: none !important; }
.step legend { padding: 0; margin-bottom: var(--s2); }
.step legend h2 { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); }
.step > p { color: var(--ink-soft); margin-bottom: var(--s5); }
.step.is-entering { animation: step-in 320ms cubic-bezier(.2,.7,.3,1) both; }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

.choices { display: grid; gap: .5rem; margin: 0 0 var(--s4); }
.choice {
  display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: .75rem;
  align-items: start;
  padding: var(--s3) var(--s4);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.choice:hover { border-color: var(--ink-soft); }
.choice input { margin: .15rem 0 0; accent-color: var(--garnet); }
.choice:has(input:checked) { border-color: var(--garnet); background: var(--garnet-tint); }
.choice b { display: block; font-weight: 700; font-size: .9375rem; }
.choice span { display: block; font-size: .8125rem; color: var(--ink-soft); margin-top: .15rem; }

.step-nav { display: flex; align-items: center; gap: var(--s4); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--rule-soft); }
.step-nav .btn { flex: none; }
.btn--back { border-color: transparent; color: var(--ink-soft); padding-left: 0; padding-right: 0; }
.btn--back:hover { background: transparent; color: var(--garnet); border-color: transparent; }

.step__note { margin-top: var(--s4); font-size: .8125rem; color: var(--ink-soft); }

.confirm { border-left: 2px solid var(--garnet); background: var(--garnet-tint); padding: var(--s5); }
.confirm h2 { margin-bottom: var(--s3); }

.aside-card { border: 1px solid var(--rule); padding: var(--s5); background: var(--paper); }
.aside-card h2 { font-size: 1.25rem; }
.aside-card dl { margin: 0; }
.aside-card dt { font-family: var(--sans); font-weight: 700; font-size: .875rem; margin-top: var(--s3); }
.aside-card dt:first-of-type { margin-top: 0; }
.aside-card dd { margin: .15rem 0 0; font-size: .875rem; color: var(--ink-soft); }

@media (max-width: 46rem) {
  .cta-row { flex-direction: column; align-items: flex-start; }
  .cta-row .btn { width: 100%; }
  .step-nav { flex-wrap: wrap; }
  .step-nav .btn { width: 100%; }
  .btn--back { order: 2; }
}

/* --- Pie ----------------------------------------------------------------- */

.colophon { background: #1B1714; color: rgba(255,255,255,.66); padding: var(--s6) 0 var(--s5); }
.colophon a { color: var(--paper); }
.colophon strong, .colophon .label { color: var(--paper); }
.colophon__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s5); }
.colophon ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .9375rem; }
.colophon__legal {
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: .8125rem; line-height: 1.7;
}
.colophon__legal p { max-width: 62rem; }
address { font-style: normal; }

/* --- Placeholder --------------------------------------------------------- */

.todo { background: #FFF3B0; color: #5B4A00; box-shadow: 0 0 0 1px #E6CF63; padding: 0 .2em; font-weight: 600; }

/* --- Movimiento ----------------------------------------------------------
   Un solo gesto: el contenido entra una vez al aparecer. Nada de hover que
   levanta tarjetas ni de elementos que se mueven solos.
   ------------------------------------------------------------------------ */

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 700ms ease, transform 700ms cubic-bezier(.2,.7,.3,1); }
.reveal.is-in[data-delay="1"] { transition-delay: 100ms; }
.reveal.is-in[data-delay="2"] { transition-delay: 200ms; }

.flow--draw .flow__node { opacity: 0; animation: fade 380ms ease forwards; }
.flow--draw .flow__node[data-step="1"] { animation-delay:  60ms; }
.flow--draw .flow__node[data-step="2"] { animation-delay: 280ms; }
.flow--draw .flow__node[data-step="3"] { animation-delay: 500ms; }
.flow--draw .flow__node[data-step="4"] { animation-delay: 900ms; }
.flow--draw .flow__link { stroke-dasharray: 240; stroke-dashoffset: 240; animation: draw 340ms ease forwards; }
.flow--draw .flow__link:nth-of-type(1) { animation-delay: 220ms; }
.flow--draw .flow__link:nth-of-type(2) { animation-delay: 440ms; }
.flow--draw .flow__link--cross { animation-delay: 660ms; animation-duration: 460ms; }
.flow--draw .flow__cross, .flow--draw .flow__aside { opacity: 0; animation: fade 320ms ease 740ms forwards; }

@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 64rem) {
  .split { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .split--flip > figure { order: 0; }
  .quotes { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .colophon__grid { grid-template-columns: 1fr 1fr; }
  .area { grid-template-columns: 3rem minmax(0, 1fr); }
  .area__meta { grid-column: 2; text-align: left; }
  .area__meta b { display: inline; font-size: 1rem; }
  .area p { grid-column: 2; }
}

@media (max-width: 46rem) {
  :root { --s7: 4rem; --s6: 2.75rem; }
  /* Botón de menú. Siete enlaces sueltos envolvían en tres filas y el
     encabezado medía 185px: parecía texto derramado, no un menú. */
  /* El logo y el botón tienen que caber en una fila: envolviendo, la cabecera
     medía 185px y el menú parecía texto derramado. */
  /* Con JS, logo y botón en una fila. Sin JS el nav ocupa el ancho completo y
     tiene que poder bajar a su propia línea, o se monta encima del logo. */
  .masthead__inner { flex-wrap: wrap; gap: var(--s3); min-height: 0; }
  .js .masthead__inner { flex-wrap: nowrap; }
  html:not(.js) .menu__panel { width: 100%; border-top: 1px solid var(--rule-soft); }
  .logo { gap: .5rem; min-width: 0; }
  .logo svg { width: 30px; height: 30px; }
  .logo b { font-size: 1.0625rem; }
  .logo span { font-size: .5625rem; letter-spacing: .1em; }

  .js .menu__btn {
    display: flex; align-items: center; gap: .55rem;
    margin-left: auto; flex: none;
    padding: .5rem .875rem .5rem .75rem;
    border: 1px solid var(--rule);
    background: var(--paper); color: var(--ink);
    font-family: var(--sans); font-size: .875rem; font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu__bars, .menu__bars::before, .menu__bars::after {
    display: block; width: 17px; height: 1.5px; background: var(--ink);
    transition: transform 180ms ease, opacity 120ms ease;
  }
  .menu__bars { position: relative; }
  .menu__bars::before, .menu__bars::after { content: ""; position: absolute; left: 0; }
  .menu__bars::before { top: -5px; }
  .menu__bars::after  { top:  5px; }
  .menu__btn[aria-expanded="true"] { border-color: var(--ink); }
  .menu__btn[aria-expanded="true"] .menu__bars { background: transparent; }
  .menu__btn[aria-expanded="true"] .menu__bars::before { transform: translateY(5px) rotate(45deg); }
  .menu__btn[aria-expanded="true"] .menu__bars::after  { transform: translateY(-5px) rotate(-45deg); }

  /* Con JS el panel arranca oculto y solo lo abre data-open. Sin JS se queda
     visible, apilado bajo el logo, y el sitio sigue siendo navegable. */
  .js .menu__panel { display: none; }
  .js .menu__panel[data-open] {
    display: block;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px rgba(27,23,20,.07);
    padding: 0 var(--s4) var(--s3);
    z-index: 40;
  }
  .menu__panel { width: 100%; }
  .menu__panel ul {
    flex-direction: column; align-items: stretch;
    gap: 0; width: 100%;
  }
  .menu__panel li { border-bottom: 1px solid var(--rule-soft); }
  .menu__panel li:last-child { border-bottom: 0; }
  .menu__panel a {
    display: block; padding: var(--s3) 0;
    font-size: 1.0625rem; border-bottom: 0;
  }
  .menu__panel a:hover { border-bottom: 0; }

  .colophon__grid { grid-template-columns: 1fr; gap: var(--s4); }
  .consent { padding: var(--s4); }
  .actions { gap: var(--s3); }
  .actions .btn { width: 100%; }
}

@media (max-width: 40rem) { .flow { min-width: 33rem; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-delay: 0ms !important;
    transition-duration: .01ms !important; transition-delay: 0ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .flow--draw .flow__node, .flow--draw .flow__cross, .flow--draw .flow__aside { opacity: 1; }
  .flow--draw .flow__link { stroke-dashoffset: 0; }
}

/* --- Validación del panel de suscripción ---------------------------------
   El ocre ya es el color de "campo obligatorio" (.req), así que un requisito
   sin cumplir habla el mismo idioma. */
.check.is-invalid label,
.field.is-invalid label { color: #F0C7A0; }
.check.is-invalid input[type="checkbox"] {
  outline: 2px solid #F0C7A0;
  outline-offset: 2px;
}
.subscribe .form-error {
  margin: .9rem 0 0;
  padding: .6rem .8rem;
  font-size: .82rem;
  line-height: 1.5;
  color: #fff;
  background: rgba(240, 199, 160, .18);
  border-left: 3px solid #F0C7A0;
}


/* Campo trampa del formulario: alcanzable por un robot que lee el HTML e
   invisible para todo lo demás, lectores de pantalla incluidos (de ahí el
   aria-hidden y el tabindex negativo en el marcado). `display:none` sería una
   pista: muchos robots lo saltan. */
.hp{
  position: absolute !important;
  left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}
