/* ============================================================
   Forge — landing
   Sistema Pulse. Los valores vienen de gym-app-mobile:
   lib/core/theme/{app_colors,pulse_palette}.dart
   ============================================================ */

:root {
  /* Neutros Pulse — claro */
  --bg:        #FAFAF7;
  --surface:   #FFFFFF;
  --soft:      #EEEEE8;
  --softer:    #F4F2EC;
  --text:      #0E1115;
  --text-dim:  #3A3F47;
  --mute:      #8B8F95;
  --line:      rgba(14,17,21,.07);
  --line-soft: rgba(14,17,21,.04);

  /* Acento */
  --accent:      #1F4FFF;
  --accent-soft: #E8EEFF;
  --accent-2:    #7E9AFF;
  --on-accent:   #FFFFFF;

  /* Semánticos */
  --danger: #D14545;
  --good:   #2E8B5C;

  /* Mapa muscular */
  --muscle:       #DCDDD8;
  --muscle-hover: #C8CACF;
  --body-outline: #F1EFE9;

  /* El bisel del mockup es oscuro en ambos temas: un teléfono real lo es, y
     heredar --text lo volvía crema en modo oscuro. */
  --phone-frame: #0E1115;

  --radius:    14px;
  --radius-lg: 22px;
  --wrap:      1120px;
  --shadow:    0 1px 2px rgba(14,17,21,.04), 0 8px 28px rgba(14,17,21,.06);
  --shadow-lg: 0 2px 4px rgba(14,17,21,.05), 0 24px 60px rgba(14,17,21,.10);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #121211;
    --surface:   #1B1B19;
    --soft:      #262622;
    --softer:    #201F1C;
    --text:      #F4F2EC;
    --text-dim:  #C8C6BE;
    --mute:      #8F8D86;
    --line:      rgba(244,242,236,.10);
    --line-soft: rgba(244,242,236,.06);

    --accent:      #5B82FF;
    --accent-soft: #1C2440;
    --accent-2:    #7E9AFF;

    --danger: #E86A6A;
    --good:   #4CAF7D;

    --muscle:       #2E2E29;
    --muscle-hover: #3A3A34;
    --body-outline: #232320;
    --phone-frame:  #34342E;

    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.32);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.45), 0 24px 60px rgba(0,0,0,.45);
  }
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  font-weight: 600; text-decoration: none; z-index: 100;
  transition: top .18s ease;
}
.skip:focus { top: 0; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .84em; }

/* ── Layout ────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap.narrow { max-width: 760px; }

.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-alt { background: var(--softer); border-block: 1px solid var(--line-soft); }

/* ── Tipografía ────────────────────────────────────────── */
h1 {
  /* Tope en 3.3rem: por encima, «Entrena con datos,» ya no cabe en la columna
     del hero y el salto de línea cae en la coma, partiendo la frase en mal sitio. */
  font-size: clamp(2.4rem, 4.6vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -.033em;
  font-weight: 800;
  text-wrap: balance;
}

.section-title {
  font-size: clamp(1.75rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -.028em;
  font-weight: 800;
  margin-bottom: 18px;
}

.lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--text-dim);
  max-width: 56ch;
  line-height: 1.62;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 18px;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent);
}
.center { text-align: center; }
.eyebrow.center { display: flex; justify-content: center; }
.lede.center { margin-inline: auto; }

.fineprint { font-size: .875rem; color: var(--mute); margin-top: 14px; }

/* ── Botones ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-weight: 700; font-size: .97rem;
  padding: 13px 24px; border-radius: 11px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .14s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn svg { width: 19px; height: 19px; flex-shrink: 0; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 9px 17px; font-size: .9rem; border-radius: 9px; }
.btn-lg { padding: 16px 30px; font-size: 1.02rem; border-radius: 13px; }

.btn-primary {
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 1px 2px rgba(31,79,255,.2), 0 8px 22px rgba(31,79,255,.24);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(31,79,255,.24), 0 14px 34px rgba(31,79,255,.32); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--soft); border-color: transparent; }

.btn-dark {
  background: var(--text); color: var(--bg);
  box-shadow: var(--shadow);
}
.btn-dark:hover { box-shadow: var(--shadow-lg); }

/* ── Nav ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.brand-name { font-weight: 800; font-size: 1.16rem; letter-spacing: -.02em; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: .94rem; font-weight: 600; }
.nav-links a:hover { color: var(--text); }
/* Solo el primario. Sin acotar, el .btn-ghost de las páginas legales heredaba
   texto blanco sobre fondo claro y quedaba ilegible. */
.nav-links a.btn-primary { color: var(--on-accent); }
.nav-links a.btn-ghost { color: var(--text); }

@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
}

/* ── Hero ──────────────────────────────────────────────── */
.hero { position: relative; padding: clamp(44px, 6vw, 76px) 0 clamp(48px, 6vw, 80px); overflow: hidden; }
.hero::before {
  content: ''; position: absolute; z-index: 0;
  top: -320px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 700px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 15%, transparent), transparent 72%);
  filter: blur(20px);
}

.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero h1 { margin-bottom: 22px; }
.hero .lede { margin-bottom: 34px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 13px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { justify-self: center; }
}

/* ── Mockup del teléfono ───────────────────────────────── */
.hero-visual { display: flex; justify-content: center; }

.phone {
  width: min(318px, 80vw);
  aspect-ratio: 9 / 17.4;
  background: var(--phone-frame);
  border-radius: 40px;
  padding: 9px;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.6deg);
}
.phone-screen {
  height: 100%; background: var(--bg);
  border-radius: 32px; padding: 22px 17px;
  display: flex; flex-direction: column; gap: 13px;
  overflow: hidden;
}

.scr-top { display: flex; align-items: center; justify-content: space-between; }
.scr-eyebrow { font-size: .6rem; font-weight: 800; letter-spacing: .13em; color: var(--mute); }
.scr-timer { font-family: 'JetBrains Mono', monospace; font-size: .8rem; font-weight: 500; color: var(--accent); }
.scr-title { font-size: 1.06rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }

.scr-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px; padding: 13px;
}
.scr-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.scr-ex { font-weight: 700; font-size: .89rem; }
.scr-badge {
  font-family: 'JetBrains Mono', monospace; font-size: .68rem; font-weight: 500;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 8px; border-radius: 6px;
}

.sets { display: flex; flex-direction: column; gap: 5px; }
.set {
  display: grid; grid-template-columns: 16px 1fr 26px;
  align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 9px;
  background: var(--softer);
  font-size: .76rem;
}
.set span { color: var(--mute); font-family: 'JetBrains Mono', monospace; font-size: .68rem; }
.set b { font-weight: 700; }
.set i { font-style: normal; color: var(--text-dim); text-align: right; font-family: 'JetBrains Mono', monospace; }
.set.done { background: color-mix(in srgb, var(--good) 11%, var(--softer)); }
.set.live { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }

.pr {
  margin-top: 10px; font-size: .7rem; font-weight: 700;
  color: var(--good);
}

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 9px; }
.bar span { font-size: .68rem; color: var(--text-dim); font-weight: 600; }
.bar .track { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar .track i {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.scr-next {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 13px;
  border-radius: 13px;
  border: 1.5px dashed var(--line);
}
.nx-label { font-size: .58rem; font-weight: 800; letter-spacing: .14em; color: var(--mute); }
.nx-ex { font-size: .78rem; font-weight: 600; color: var(--text-dim); line-height: 1.35; }

/* ── Grid de features ──────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 18px; margin-top: 52px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: transform .2s ease, box-shadow .24s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}
.card h3 { font-size: 1.12rem; font-weight: 800; letter-spacing: -.018em; margin-bottom: 9px; }
.card p { color: var(--text-dim); font-size: .95rem; }

.ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 18px;
}
.ico svg { width: 22px; height: 22px; }

/* ── Sección partida (fatiga) ──────────────────────────── */
.split {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(36px, 6vw, 80px); align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

.checks { list-style: none; padding: 0; margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }
.checks li {
  position: relative; padding-left: 32px;
  color: var(--text-dim); font-size: .98rem;
}
.checks li::before {
  content: ''; position: absolute; left: 0; top: .34em;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4FFF' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}

.fatigue-map {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.fm-label {
  font-size: .68rem; font-weight: 800; letter-spacing: .14em;
  color: var(--mute); align-self: flex-start;
}
.body { width: min(210px, 60vw); height: auto; }
.body .m { transition: fill .3s ease; }
.body .low  { fill: var(--muscle); }
.body .mid  { fill: color-mix(in srgb, #E0A63C 62%, var(--muscle)); }
.body .high { fill: color-mix(in srgb, var(--danger) 78%, var(--muscle)); }

.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: .78rem; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sw.low  { background: var(--muscle); }
.sw.mid  { background: color-mix(in srgb, #E0A63C 62%, var(--muscle)); }
.sw.high { background: color-mix(in srgb, var(--danger) 78%, var(--muscle)); }

/* ── Beta ──────────────────────────────────────────────── */
.beta-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(34px, 5.5vw, 62px);
  box-shadow: var(--shadow);
  max-width: 720px; margin-inline: auto;
}
.beta-lede { margin-bottom: 32px; }

.beta-form { display: flex; gap: 11px; flex-wrap: wrap; }
.beta-form input {
  flex: 1 1 260px;
  font-family: inherit; font-size: 1rem;
  padding: 16px 19px;
  border-radius: 13px;
  border: 1.5px solid var(--line);
  background: var(--bg); color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.beta-form input::placeholder { color: var(--mute); }
.beta-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}
.beta-form input[aria-invalid="true"] { border-color: var(--danger); }

.form-msg { font-size: .92rem; margin-top: 13px; min-height: 1.4em; font-weight: 600; }
.form-msg.ok  { color: var(--good); }
.form-msg.err { color: var(--danger); }

.sep { border: 0; border-top: 1px solid var(--line); margin: 40px 0 32px; }

.direct { text-align: center; }
.direct h3 { font-size: 1.14rem; font-weight: 800; letter-spacing: -.018em; margin-bottom: 7px; }
.direct p { color: var(--text-dim); font-size: .95rem; margin-bottom: 20px; }
.direct .fineprint { margin-top: 15px; }

/* ── FAQ ───────────────────────────────────────────────── */
details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 11px;
  overflow: hidden;
}
details:first-of-type { margin-top: 44px; }

summary {
  cursor: pointer; list-style: none;
  padding: 19px 52px 19px 22px;
  font-weight: 700; font-size: 1rem;
  position: relative;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ''; position: absolute; right: 22px; top: 50%;
  width: 10px; height: 10px; margin-top: -5px;
  border-right: 2.2px solid var(--mute);
  border-bottom: 2.2px solid var(--mute);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .22s ease;
}
details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
summary:hover { background: var(--softer); }

.det-body {
  padding: 0 22px 21px;
  color: var(--text-dim); font-size: .95rem;
}
.det-body p + p, .det-body ol { margin-top: 11px; }
.det-body ol { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
.det-body b { color: var(--text); }

/* ── Páginas legales ───────────────────────────────────── */
.legal { padding: clamp(48px, 7vw, 84px) 0 clamp(64px, 9vw, 104px); }
.legal h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-bottom: 12px; }
.legal .updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: .82rem; color: var(--mute);
  margin-bottom: 40px;
}
.legal h2 {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em;
  margin: 44px 0 14px; padding-top: 20px;
  border-top: 1px solid var(--line);
}
.legal h3 { font-size: 1.02rem; font-weight: 700; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--text-dim); }
.legal p { margin-bottom: 13px; }
.legal ul, .legal ol { padding-left: 22px; margin-bottom: 15px; display: flex; flex-direction: column; gap: 8px; }
.legal b, .legal strong { color: var(--text); font-weight: 700; }

.legal table {
  width: 100%; border-collapse: collapse;
  margin: 8px 0 20px; font-size: .93rem;
}
.legal th, .legal td {
  text-align: left; padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal th { font-weight: 700; color: var(--text); background: var(--softer); }
.legal td { color: var(--text-dim); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.note {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px; margin: 22px 0;
  font-size: .93rem;
}
.note p { margin-bottom: 0; color: var(--text-dim); }
.note p + p { margin-top: 10px; }

.back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .92rem; font-weight: 600; text-decoration: none;
  color: var(--text-dim); margin-bottom: 28px;
}
.back:hover { color: var(--accent); }
.back svg { width: 15px; height: 15px; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 52px 0 34px;
  background: var(--bg);
}
.footer-inner {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 30px; flex-wrap: wrap;
}
.footer-tag { color: var(--mute); font-size: .92rem; margin-top: 11px; }
.footer-links { display: flex; gap: 26px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); text-decoration: none; font-size: .93rem; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

.footer-legal {
  margin-top: 34px; padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--mute); font-size: .86rem;
}
