/*
 * Precision — sistema de diseño web de gamalserhan.com
 * Fuente canónica de los tokens: "Precision Performance" (pp-1) de GAMO
 *   gamo/coach-os/apps/athlete/src/tokens/precision.ts
 * CANON (no cambiar aquí sin cambiar allá): colores, radios, espaciado de 4, motion.
 * DERIVACIÓN WEB (propuesta, NO canon): la escala editorial con clamp(), los anchos de
 * rejilla y el tratamiento del héroe. PP es un sistema de app y no define titulares web.
 *
 * Reglas de uso:
 *  1. Un solo CTA rojo (.btn-red) por pantalla/sección visible. El resto: .btn-white o .btn-line.
 *  2. --red es SOLO relleno. Texto rojo = --red-text. --steel-dark nunca es texto.
 *  3. El rojo no significa error: error = --crit + icono + texto.
 *  4. Barlow Condensed solo para cifras y UN titular por vista. Mono solo para micro-datos.
 *  5. Elevación por capas (obsidian → graphite 1/2/3). Sin sombras.
 */

@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* Color — canon */
  --obsidian: #07080A;
  --graphite-1: #0F1114;
  --graphite-2: #171A1F;
  --graphite-3: #22262D;
  --hairline: #1F2329;
  --field-border: #6B7380;
  --steel-dark: #5E6670;
  --steel-mid: #8B939E;
  --steel-light: #B4BAC3;
  --white: #F4F5F7;
  --red: #E10600;
  --on-accent: #FFFFFF;
  --red-text: #FF4A3D;
  --red-press: #B80500;
  --ok: #36D399;
  --warn: #F5B83D;
  --crit: #FF6B8B;
  --info: #8FB4FF;

  /* Radios — canon */
  --r-control: 12px;
  --r-card: 16px;
  --r-sheet: 24px;
  --r-pill: 999px;

  /* Espaciado — canon (escala de 4) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  /* Derivación web */
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;
  --margin: 20px;
  --wrap: 1200px;
  --section: clamp(72px, 10vw, 144px);

  /* Tipografía */
  --f-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-figure: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* Escala editorial web — DERIVACIÓN, no canon */
  --fs-display: clamp(3.5rem, 11.5vw, 9rem);
  --fs-h2: clamp(1.75rem, 3.2vw, 2.75rem);
  --fs-h3: clamp(1.125rem, 1.4vw, 1.3125rem);
  --fs-lead: clamp(1.0625rem, 1.3vw, 1.25rem);
  --fs-figure-xl: clamp(4rem, 10vw, 7.5rem);
  --fs-figure-l: clamp(2.5rem, 5vw, 3.5rem);
  --fs-body: 1rem;        /* canon: 16/23 */
  --fs-secondary: .875rem; /* canon: 14/20 */
  --fs-label: .8125rem;    /* canon: 13/18, mínimo */
  --fs-micro: .75rem;      /* canon: 12/16 mono */

  /* Movimiento — canon */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-tap: 90ms;
  --t-appear: 220ms;
  --t-sheet: 320ms;
  --t-number: 450ms;
}
@media (min-width: 768px) { :root { --margin: 24px; } }
@media (min-width: 1100px) { :root { --margin: 40px; } }

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--obsidian); color: var(--white);
  font: 400 var(--fs-body)/1.45 var(--f-text);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--white); text-decoration-color: var(--steel-dark); text-underline-offset: 4px; transition: text-decoration-color var(--t-appear) var(--ease); }
a:hover { text-decoration-color: var(--white); }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--white); color: var(--obsidian); }
:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -80px; z-index: 100; background: var(--white); color: var(--obsidian); padding: 12px 16px; border-radius: var(--r-control); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--margin)); margin-inline: auto; padding-inline: var(--margin); }
.section { padding-block: var(--section); border-top: 1px solid var(--hairline); }
.section-head { display: grid; gap: var(--s-4); max-width: 720px; margin-bottom: clamp(32px, 5vw, 64px); }

/* ── Tipografía ── */
.micro { font: 500 var(--fs-micro)/1.35 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-mid); }
.micro b { font-weight: 500; color: var(--white); }
.display { font: 700 var(--fs-display)/.86 var(--f-figure); letter-spacing: -.012em; text-wrap: balance; padding-bottom: .07em; }
.hero .display { font-size: clamp(3.5rem, min(11.5vw, 15.5vh), 9rem); } /* el CTA del héroe debe caber en el primer pantallazo */
.h2 { font: 600 var(--fs-h2)/1.12 var(--f-text); letter-spacing: -.025em; text-wrap: balance; }
.h3 { font: 600 var(--fs-h3)/1.3 var(--f-text); letter-spacing: -.012em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--steel-light); text-wrap: pretty; max-width: 60ch; }
.muted { color: var(--steel-light); }
.small { font-size: var(--fs-secondary); line-height: 1.45; color: var(--steel-mid); }
.figure { font: 700 var(--fs-figure-l)/1 var(--f-figure); font-variant-numeric: tabular-nums; letter-spacing: -.005em; }
.figure-xl { font-size: var(--fs-figure-xl); line-height: .88; }
.unit { font: 500 var(--fs-micro)/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-mid); margin-left: 6px; }

/* ── Botones (alto 52 primario, 44 resto) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border: 1px solid transparent; border-radius: var(--r-control);
  font: 600 1rem/1 var(--f-text); letter-spacing: -.01em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-tap) var(--ease), background-color var(--t-appear) var(--ease), border-color var(--t-appear) var(--ease), color var(--t-appear) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-red { background: var(--red); color: var(--on-accent); }
.btn-red:hover { background: #F20A04; }
.btn-red:active { background: var(--red-press); }
.btn-white { background: var(--white); color: var(--obsidian); }
.btn-white:hover { background: #fff; }
.btn-line { border-color: var(--field-border); color: var(--white); background: transparent; }
.btn-line:hover { border-color: var(--white); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn .arr { transition: transform var(--t-appear) var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; color: var(--white); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--steel-dark); text-underline-offset: 5px; }
.link:hover { text-decoration-color: var(--white); }

/* ── Tarjetas ── */
.card { background: var(--graphite-1); border: 1px solid var(--hairline); border-radius: var(--r-card); padding: var(--s-6); }
.card-2 { background: var(--graphite-2); }
.card-hero { position: relative; overflow: hidden; }
.card-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--red); }

/* ── Marcadores "PENDIENTE GAMAL" (modo borrador) ──
   Se ocultan con <html data-borrador="0"> o con ?borrador=0 en la URL. */
.pend {
  flex-wrap: wrap;
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; padding: 12px 14px; border: 1px dashed var(--warn); border-radius: var(--r-control);
  background: rgba(245, 184, 61, .06); color: var(--warn); font: 500 var(--fs-micro)/1.5 var(--f-mono); letter-spacing: .02em;
}
.pend::before { content: "PENDIENTE GAMAL"; flex: none; padding: 1px 6px; border-radius: 4px; background: var(--warn); color: var(--obsidian); font-weight: 500; letter-spacing: .06em; }
.pend-inline { display: inline-flex; padding: 2px 8px; vertical-align: middle; }
.pend-inline::before { content: "PENDIENTE"; }
[data-borrador="0"] [data-pendiente] { display: none !important; }
.draft-bar { background: var(--graphite-2); border-bottom: 1px dashed var(--warn); color: var(--warn); font: 500 var(--fs-micro)/1.4 var(--f-mono); letter-spacing: .04em; padding: 8px var(--margin); text-align: center; }

/* ── Nav ── */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(7, 8, 10, .82); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); border-bottom: 1px solid var(--hairline); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font: 600 .9375rem/1 var(--f-text); letter-spacing: -.01em; text-decoration: none; }
.brand i { width: 3px; height: 18px; background: var(--red); border-radius: 1px; }
.nav-links { display: none; gap: var(--s-6); }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-secondary); color: var(--steel-light); text-decoration: none; transition: color var(--t-appear) var(--ease); }
.nav-links a:hover { color: var(--white); }
.nav-end { display: flex; align-items: center; gap: var(--s-2); }
.lang { display: inline-flex; border: 1px solid var(--hairline); border-radius: var(--r-control); padding: 2px; background: var(--graphite-1); }
.lang button { min-width: 44px; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--steel-mid); font: 500 var(--fs-micro)/1 var(--f-mono); letter-spacing: .08em; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--graphite-3); color: var(--white); }
@media (min-width: 900px) { .nav-links { display: flex; } }

/* ── Héroe ── */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before { /* luz cenital: gradiente, no sombra */
  content: ""; position: absolute; z-index: -1; inset: -20% -10% auto -10%; height: 110%;
  background: radial-gradient(60% 55% at 72% 18%, rgba(180, 186, 195, .13), transparent 70%), radial-gradient(40% 40% at 8% 0%, rgba(139, 147, 158, .07), transparent 70%);
}
.hero-in { display: grid; gap: clamp(40px, 6vw, 72px); padding-block: clamp(40px, 5vw, 72px) clamp(56px, 8vw, 112px); align-items: end; }
.hero-copy { display: grid; gap: var(--s-6); }
.hero-copy .lead { max-width: 44ch; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); margin-top: var(--s-2); }
.hero-note { font-size: var(--fs-label); color: var(--steel-mid); }
.plate { position: relative; border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; background: linear-gradient(180deg, var(--graphite-2) 0%, var(--graphite-1) 46%, var(--obsidian) 100%); aspect-ratio: 4 / 5; max-height: 640px; width: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: var(--s-5); }
.plate::before { /* retícula de medición */
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 39px, var(--hairline) 39px 40px), radial-gradient(70% 50% at 50% 0%, rgba(244, 245, 247, .10), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%); mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.plate > * { position: relative; }
.plate-top { display: flex; justify-content: space-between; gap: var(--s-3); }
.plate-year { font: 700 clamp(6rem, 22vw, 11rem)/.8 var(--f-figure); letter-spacing: -.02em; color: transparent; -webkit-text-stroke: 1px var(--steel-dark); align-self: flex-start; margin-block: auto; user-select: none; }
.plate-rows { display: grid; }
.plate-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 10px 0; border-top: 1px solid var(--hairline); }
.plate-rows dt { font: 500 var(--fs-micro)/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-mid); }
.plate-rows dd { font-size: var(--fs-secondary); font-weight: 500; text-align: right; }
.plate .pend { margin-top: var(--s-3); }
@media (min-width: 900px) {
  .hero-in { grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); }
  .plate { justify-self: end; max-width: 420px; }
}

/* ── Embeds oficiales de Instagram ──
   Solo se estiliza el contenedor; el interior del embed (iframe de Instagram) no se toca.
   El embed pide ~326 px de ancho mínimo: el recuadro va sin relleno lateral para que quepa en móvil. */
.plate-ig { aspect-ratio: auto; max-height: none; justify-content: flex-start; gap: var(--s-4); padding: var(--s-5) 0 0; }
.plate-ig > .plate-top, .plate-ig > .ig-cap { padding-inline: var(--s-5); }
.plate-ig > .ig-cap { padding-bottom: var(--s-4); }
@media (min-width: 900px) { .hero-in:has(.plate-ig) { align-items: start; } }
.ig { display: flex; justify-content: center; overflow-x: auto;background: var(--obsidian); border-block: 1px solid var(--hairline); }
.ig blockquote.instagram-media { width: 100%; margin: 0; padding: var(--s-6); min-height: 120px; display: grid; place-items: center; } /* respaldo antes de que cargue embed.js */
.ig blockquote.instagram-media a { color: var(--white); font-weight: 500; text-underline-offset: 5px; text-decoration-color: var(--steel-dark); }
.ig-cap { display: grid; gap: var(--s-3); }
.ig-item { display: grid; gap: var(--s-4); align-content: start; background: var(--graphite-1); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; }
.ig-item > .ig-cap { padding: 0 var(--s-5) var(--s-5); }
.ig-item > .ig { border-top: 0; }
.ig-gallery { align-items: start; }

/* ── Cifras ── */
.stats { display: grid; border-top: 1px solid var(--hairline); }
.stat { padding: var(--s-6) 0; border-bottom: 1px solid var(--hairline); display: grid; gap: 6px; }
.stat .small { max-width: 34ch; }
@media (min-width: 768px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: var(--s-8) var(--s-6) var(--s-8) 0; border-bottom: 0; }
  .stat + .stat { padding-left: var(--s-6); border-left: 1px solid var(--hairline); }
}

/* ── Rejillas de contenido ── */
.grid-3 { display: grid; gap: var(--s-3); }
.grid-2 { display: grid; gap: var(--s-3); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.split { display: grid; gap: clamp(32px, 5vw, 80px); }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; } .split > .sticky { position: sticky; top: 96px; } }
.stack { display: grid; gap: var(--s-4); align-content: start; }
.stack-sm { display: grid; gap: var(--s-2); align-content: start; }
.role { display: grid; gap: var(--s-3); align-content: start; }
.role .micro { color: var(--steel-mid); }
.role p:not(.pend) { color: var(--steel-light); font-size: .9375rem; line-height: 1.55; }
.testimonio-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-card); }

/* Pasos del método */
.steps-list { display: grid; counter-reset: paso; border-top: 1px solid var(--hairline); }
.steps-list li { counter-increment: paso; display: grid; grid-template-columns: 56px 1fr; gap: var(--s-4); padding: var(--s-6) 0; border-bottom: 1px solid var(--hairline); }
.steps-list li::before { content: "0" counter(paso); font: 600 1.75rem/1 var(--f-figure); color: var(--steel-mid); font-variant-numeric: tabular-nums; }
.steps-list p { color: var(--steel-light); margin-top: 6px; font-size: .9375rem; line-height: 1.55; max-width: 56ch; }

/* ── Servicios ── */
.offer { display: grid; gap: var(--s-3); }
@media (min-width: 900px) { .offer { grid-template-columns: 1.15fr .85fr; } }
.offer-main { padding: clamp(24px, 3.5vw, 40px); display: grid; gap: var(--s-6); align-content: start; }
.offer-side { display: grid; gap: var(--s-3); align-content: start; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.price .figure { font-size: clamp(3rem, 6vw, 4.5rem); }
.ticks { display: grid; gap: 10px; }
.ticks li { display: grid; grid-template-columns: 16px 1fr; gap: 12px; color: var(--steel-light); font-size: .9375rem; line-height: 1.5; }
.ticks li::before { content: ""; width: 8px; height: 1px; background: var(--steel-mid); margin-top: .75em; }
.row-card { display: grid; gap: var(--s-3); }
.row-card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-4); }
.row-card-head .figure { font-size: 2rem; white-space: nowrap; }
.row-card p:not(.pend) { color: var(--steel-light); font-size: .9375rem; line-height: 1.5; }
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: var(--s-8); }
.ladder li { display: grid; gap: 8px; font: 500 var(--fs-micro)/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--steel-mid); }
.ladder li::before { content: ""; height: 2px; background: var(--graphite-3); }
.ladder li[aria-current="true"] { color: var(--white); }
.ladder li[aria-current="true"]::before { background: var(--red); }
@media (max-width: 599px) { .ladder li span { display: none; } }

/* ── Destacado ── */
.rows { border-top: 1px solid var(--hairline); }
.rows a, .rows .row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px var(--s-4); min-height: 72px; padding: var(--s-4) 0; border-bottom: 1px solid var(--hairline); text-decoration: none; }
.rows a .t { font-weight: 500; }
.rows a .small { grid-column: 1; }
.rows a .n { grid-row: 1 / span 2; grid-column: 2; display: inline-flex; align-items: baseline; gap: 12px; font: 600 1.75rem/1 var(--f-figure); font-variant-numeric: tabular-nums; }
.rows a .n::after { content: "↗"; font: 400 1rem/1 var(--f-text); color: var(--steel-mid); transition: transform var(--t-appear) var(--ease), color var(--t-appear) var(--ease); }
.rows a:hover .n::after { color: var(--white); transform: translate(2px, -2px); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--field-border); border-radius: var(--r-pill); font: 500 .6875rem/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--steel-light); vertical-align: middle; margin-left: 8px; }
.names { display: flex; flex-wrap: wrap; gap: 8px 28px; font: 600 1.25rem/1.2 var(--f-text); letter-spacing: -.015em; color: var(--steel-light); }

/* ── FAQ ── */
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: 64px; padding: var(--s-4) 0; cursor: pointer; list-style: none; font-weight: 500; font-size: 1.0625rem; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font: 400 1.5rem/1 var(--f-text); color: var(--steel-mid); transition: transform var(--t-appear) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 var(--s-6); color: var(--steel-light); max-width: 68ch; line-height: 1.6; display: grid; gap: var(--s-3); }

/* ── Formularios ── */
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .legend { font: 500 var(--fs-label)/1.4 var(--f-text); color: var(--steel-light); }
.legend { display: block; margin-bottom: 8px; padding: 0; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.input-wrap { position: relative; }
.input {
  width: 100%; height: 52px; padding: 0 14px; border: 1px solid var(--field-border); border-radius: var(--r-control);
  background: var(--graphite-2); color: var(--white); font-size: 1rem; appearance: none; -moz-appearance: textfield;
  transition: border-color var(--t-appear) var(--ease), background-color var(--t-appear) var(--ease);
}
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input::placeholder { color: var(--steel-dark); }
.input:hover { border-color: var(--steel-light); }
.input:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; border-color: var(--white); border-radius: var(--r-control); }
.input[aria-invalid="true"] { border-color: var(--crit); }
.input-wrap .input { padding-right: 52px; }
.input-wrap .suffix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font: 500 var(--fs-micro)/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--steel-mid); pointer-events: none; }
.err { display: flex; gap: 6px; font-size: var(--fs-label); line-height: 1.4; color: var(--crit); }
.err::before { content: "!"; flex: none; width: 16px; height: 16px; border: 1px solid currentColor; border-radius: 50%; font: 600 .6875rem/14px var(--f-text); text-align: center; margin-top: 1px; }
.hint { font-size: var(--fs-label); line-height: 1.45; color: var(--steel-mid); }

/* Segmentado (radios reales) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--r-control); background: var(--graphite-2); border: 1px solid var(--hairline); }
.seg label { position: relative; display: block; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border-radius: 9px; font-weight: 500; font-size: .9375rem; color: var(--steel-light); text-align: center; transition: background-color var(--t-appear) var(--ease), color var(--t-appear) var(--ease); }
.seg input:checked + span { background: var(--white); color: var(--obsidian); }
.seg input:focus-visible + span { outline: 2px solid var(--white); outline-offset: 3px; }

/* Opciones en lista (radios) y casillas */
.opts { display: grid; gap: 8px; }
.opt, .check { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 14px; align-items: start; min-height: 56px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: var(--r-control); background: var(--graphite-2); cursor: pointer; transition: border-color var(--t-appear) var(--ease), background-color var(--t-appear) var(--ease); }
.opt:hover, .check:hover { border-color: var(--field-border); }
.opt input, .check input { appearance: none; width: 22px; height: 22px; margin: 1px 0 0; border: 1.5px solid var(--field-border); background: transparent; cursor: pointer; display: grid; place-content: center; transition: border-color var(--t-tap) var(--ease), background-color var(--t-tap) var(--ease); }
.opt input { border-radius: 50%; }
.check input { border-radius: 6px; }
.opt input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--obsidian); transform: scale(0); transition: transform var(--t-tap) var(--ease); }
.check input::after { content: ""; width: 11px; height: 6px; border: solid var(--obsidian); border-width: 0 0 2px 2px; transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform var(--t-tap) var(--ease); }
.opt input:checked, .check input:checked { background: var(--white); border-color: var(--white); }
.opt input:checked::after { transform: scale(1); }
.check input:checked::after { transform: rotate(-45deg) scale(1); }
.opt:has(input:checked), .check:has(input:checked) { border-color: var(--steel-light); background: var(--graphite-3); }
.opt b, .check b { display: block; font-weight: 500; }
.opt small, .check small { display: block; margin-top: 2px; font-size: var(--fs-label); line-height: 1.4; color: var(--steel-mid); }
.check-plain { border: 0; background: none; padding: 4px 0; min-height: 44px; font-size: var(--fs-secondary); line-height: 1.45; color: var(--steel-light); }
.check-plain:has(input:checked) { background: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Avisos de estado: siempre icono + texto */
.notice { display: grid; grid-template-columns: 20px 1fr; gap: 12px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: var(--r-control); background: var(--graphite-2); font-size: var(--fs-secondary); line-height: 1.5; color: var(--steel-light); }
.notice::before { content: "i"; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--info); color: var(--info); font: 600 .75rem/17px var(--f-text); text-align: center; }
.notice-warn::before { content: "!"; border-color: var(--warn); color: var(--warn); }
.notice-crit { border-color: rgba(255, 107, 139, .45); color: var(--white); }
.notice-crit::before { content: "!"; border-color: var(--crit); color: var(--crit); }
.notice-ok::before { content: "✓"; border-color: var(--ok); color: var(--ok); }

/* ── Calculadora ── */
.calc { max-width: 880px; }
.calc-shell { background: var(--graphite-1); border: 1px solid var(--hairline); border-radius: var(--r-card); overflow: hidden; }
.calc-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: 0 var(--s-5); border-bottom: 1px solid var(--hairline); }
.calc-steps { display: flex; gap: var(--s-5); min-width: 0; }
.calc-steps li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 52px; font: 500 var(--fs-micro)/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel-mid); white-space: nowrap; }
.calc-steps li[aria-current="step"] { color: var(--white); }
.calc-steps li[aria-current="step"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); }
.calc-steps li.done { color: var(--steel-light); }
@media (max-width: 519px) { .calc-steps li:not([aria-current="step"]) span { display: none; } }
.calc-body { padding: clamp(20px, 4vw, 40px); display: grid; gap: var(--s-8); }
.calc-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-grid .full { grid-column: 1 / -1; }
@media (min-width: 640px) { .calc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.calc-actions { display: flex; flex-wrap: wrap-reverse; justify-content: space-between; align-items: center; gap: var(--s-3); }
.calc-actions .btn { flex: 1 1 200px; margin-left: auto; }
.calc-actions > span:empty { display: none; }
@media (min-width: 640px) { .calc-actions .btn { flex: 0 0 auto; min-width: 200px; } }
.calc details.more { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.calc details.more summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; cursor: pointer; list-style: none; font-weight: 500; font-size: .9375rem; color: var(--steel-light); }
.calc details.more summary::-webkit-details-marker { display: none; }
.calc details.more summary::after { content: "+"; font-size: 1.25rem; color: var(--steel-mid); transition: transform var(--t-appear) var(--ease); }
.calc details.more[open] summary::after { transform: rotate(45deg); }
.calc details.more > div { padding: var(--s-2) 0 var(--s-6); display: grid; gap: var(--s-4); }

/* Resultados */
.res-head { display: grid; gap: var(--s-2); }
.res-get { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.goals { display: grid; gap: 8px; }
@media (min-width: 640px) { .goals { grid-template-columns: repeat(3, 1fr); } }
.goal { position: relative; display: block; cursor: pointer; }
.goal input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.goal-in { position: relative; display: grid; gap: 6px; height: 100%; padding: 16px 16px 18px; border: 1px solid var(--hairline); border-radius: var(--r-control); background: var(--graphite-2); overflow: hidden; transition: border-color var(--t-appear) var(--ease), background-color var(--t-appear) var(--ease); }
.goal-in::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform var(--t-sheet) var(--ease); }
.goal:hover .goal-in { border-color: var(--field-border); }
.goal input:checked + .goal-in { background: var(--graphite-3); border-color: var(--steel-light); }
.goal input:checked + .goal-in::after { transform: scaleX(1); }
.goal input:focus-visible + .goal-in { outline: 2px solid var(--white); outline-offset: 3px; }
.goal .figure { font-size: clamp(2.25rem, 5vw, 3rem); }
.goal .small { min-height: 2.9em; }
@media (max-width: 639px) {
  .goal-in { grid-template-columns: 1fr auto; align-items: center; }
  .goal .small { grid-column: 1; min-height: 0; }
  .goal .gfig { grid-column: 2; grid-row: 1 / span 2; text-align: right; }
}
.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.macro { display: grid; gap: 6px; padding: 16px; border-radius: var(--r-control); background: var(--graphite-2); border: 1px solid var(--hairline); min-width: 0; }
.macro .figure { font-size: clamp(2.5rem, 7vw, 4rem); }
.macro .bar { height: 2px; background: var(--graphite-3); border-radius: 1px; overflow: hidden; }
.macro .bar i { display: block; height: 100%; background: var(--steel-light); transform-origin: left; transition: transform 600ms var(--ease); }
.macros.locked .figure { color: var(--steel-dark); }
.pace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .pace { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pace > div { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: var(--r-control); }
.pace .figure { font-size: 2rem; }
.gate { display: grid; gap: var(--s-4); padding: clamp(20px, 3vw, 28px); border-radius: var(--r-control); background: var(--graphite-2); border: 1px solid var(--hairline); }
.gate-row { display: grid; gap: 8px; }
@media (min-width: 640px) { .gate-row { grid-template-columns: 1fr auto; } }
.next { display: grid; gap: var(--s-4); padding: clamp(20px, 3vw, 32px); }
.next-actions { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; }
.avisos { display: grid; gap: 8px; }
.sci { display: grid; }
.sci div { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--hairline); font-size: var(--fs-secondary); line-height: 1.5; }
.sci dt { color: var(--steel-mid); font-size: var(--fs-label); }
.sci dd { color: var(--steel-light); }
@media (min-width: 640px) { .sci div { grid-template-columns: 200px 1fr; gap: var(--s-4); } }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.share-preview { width: 100%; max-width: 280px; border-radius: var(--r-control); border: 1px solid var(--hairline); }

/* Calculadora: cabecera del paso, rejillas y tarjeta para compartir */
.calc-h { font-size: 1.375rem; letter-spacing: -.02em; }
.calc-h:focus-visible, .res-head [data-h]:focus-visible { outline-offset: 6px; }
.calc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); }
.calc-unit .legend { margin: 0; }
.calc-unit .seg { min-width: 200px; }
@media (min-width: 640px) { .calc-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) { .calc-grid-3 > :first-child { grid-column: 1 / -1; } }
.opt .tag { margin-left: 6px; }
.pace dd { display: flex; align-items: baseline; }
.pace .small, .macro .small { color: var(--steel-mid); }
@media (min-width: 640px) { .pace-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.macro dd { display: flex; align-items: baseline; min-width: 0; }
.gate .field { max-width: 480px; }
.share { display: grid; gap: var(--s-4); align-items: end; }
.share .btn { justify-self: start; }
@media (min-width: 640px) { .share { grid-template-columns: 1fr auto; } .share-preview { width: 220px; } }
.page-head { padding-block: clamp(40px, 7vw, 88px) clamp(28px, 4vw, 48px); display: grid; gap: var(--s-4); }
.page-head .display { font-size: clamp(3rem, 8vw, 6rem); }
.page-body { padding-bottom: var(--section); }

/* ── Newsletter y pie ── */
.news { display: grid; gap: var(--s-6); padding: clamp(24px, 4vw, 48px); }
@media (min-width: 900px) { .news { grid-template-columns: 1fr 1fr; align-items: start; gap: var(--s-12); } }
.footer { border-top: 1px solid var(--hairline); padding-block: var(--s-12) var(--s-10); color: var(--steel-mid); font-size: var(--fs-secondary); }
.footer-in { display: grid; gap: var(--s-8); }
.footer nav { display: flex; flex-wrap: wrap; gap: 4px var(--s-6); }
.footer nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--steel-light); text-decoration: none; }
.footer nav a:hover { color: var(--white); }
@media (min-width: 768px) { .footer-in { grid-template-columns: 1fr auto; align-items: end; } }
.prose { max-width: 68ch; display: grid; gap: var(--s-4); color: var(--steel-light); line-height: 1.65; }
.prose h2 { font: 600 1.25rem/1.3 var(--f-text); color: var(--white); margin-top: var(--s-6); letter-spacing: -.015em; }
.prose ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }

/* ── Movimiento: aparición (fade + 8 px, escalonado 30 ms, máx. 6) ── */
.js .rv { opacity: 0; transform: translateY(8px); transition: opacity var(--t-appear) var(--ease), transform var(--t-appear) var(--ease); transition-delay: calc(var(--i, 0) * 30ms); }
.js .rv.in { opacity: 1; transform: none; }
.appear { animation: aparecer var(--t-appear) var(--ease) both; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .js .rv { transform: none; transition: opacity var(--t-appear) linear !important; }
  .appear { animation: fundido var(--t-appear) linear both !important; }
  .spinner { animation: giro 1.2s linear infinite !important; }
  .btn:active { transform: none; }
}
@keyframes fundido { from { opacity: 0; } }

/* Ajustes de la calculadora */
.full-sm { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 640px) { .full-sm { grid-column: auto; } }
.page-head { padding-block: clamp(40px, 6vw, 80px) clamp(24px, 4vw, 40px); display: grid; gap: var(--s-4); max-width: 720px; }
.page-main { padding-bottom: var(--section); }

/* Funciones de GAMO todavía no activas: se muestran como "Próximamente" (decisión de Gamal, 15/11) */
.ticks li.soon { color: var(--steel-mid); }
.tag-soon { display: inline-block; margin-left: 6px; padding: 1px 8px; border: 1px solid var(--field-border); border-radius: var(--r-pill, 999px); font: 500 var(--fs-micro)/1.5 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--steel-light); white-space: nowrap; }
.ticks li.soon .tag-soon { grid-column: 2; justify-self: start; margin: 4px 0 0; }
