/* ==========================================================================
   Sistema de diseño — claro por defecto, oscuro via prefers-color-scheme.
   Tipografía del sistema (cero dependencia de fuentes externas = cero
   peticiones de red, cero parpadeo de carga). Los precios usan una pila
   monoespaciada: se leen como datos, no como prosa.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f6f7fb;
  --surface-2: #eef0f7;
  --border: #e3e6ee;
  --text: #161923;
  --text-muted: #5b6172;
  --text-faint: #8b91a1;
  --accent: #5850ec;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --up: #d1382b;      /* precio sube = malo para el comprador */
  --down: #1a8f5e;    /* precio baja = bueno para el comprador */
  --shadow: 0 1px 2px rgba(20, 22, 35, 0.04), 0 8px 24px rgba(20, 22, 35, 0.05);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Roboto Mono", monospace;
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e15;
    --surface: #12141e;
    --surface-2: #191c29;
    --border: #262a3a;
    --text: #e9eaf2;
    --text-muted: #a2a8bd;
    --text-faint: #6d7286;
    --accent: #8b85ff;
    --accent-ink: #14152a;
    --accent-soft: #1c1c38;
    --up: #ff6b5e;
    --down: #3ddb96;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; }
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Tipografía ---------- */
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--text-muted); }
.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 62ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent);
  margin-bottom: 10px;
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 0.9rem; }

/* ---------- Navegación ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.1rem; text-decoration: none; color: var(--text); }
.brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav-links { display: flex; gap: 26px; align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-size: 0.94rem; font-weight: 600; }
.nav-links a:hover { color: var(--text); }
.nav-cta { background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 0.94rem;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.hero-stat strong { display: block; font-size: 1.5rem; font-family: var(--font-mono); }
.hero-stat span { font-size: 0.85rem; color: var(--text-faint); }

/* ---------- Tarjetas / grids ---------- */
.grid { display: grid; gap: 16px; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-plans { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2col { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .grid-2col { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-link { text-decoration: none; color: inherit; transition: transform .12s ease, border-color .12s ease; display: block; }
.card-link:hover { transform: translateY(-2px); border-color: var(--accent); }

.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); background: var(--surface-2);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 10px;
}

/* ---------- Insignias de cambio de precio ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; font-family: var(--font-mono); }
.badge-up { background: color-mix(in srgb, var(--up) 14%, transparent); color: var(--up); }
.badge-down { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }

/* ---------- Fila de cambio (feed) ---------- */
.change-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.change-row:last-child { border-bottom: none; }
.change-icon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-weight: 800; font-size: 0.95rem;
}
.change-body { flex: 1; min-width: 0; }
.change-body .summary { font-weight: 600; color: var(--text); }
.change-date { color: var(--text-faint); font-size: 0.85rem; white-space: nowrap; }

/* ---------- Planes de precio ---------- */
.plan {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px; text-align: center;
}
.plan-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.plan-price { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 800; }
.plan-price .unit { font-size: 0.85rem; font-weight: 500; color: var(--text-faint); }
.plan-note { font-size: 0.78rem; color: var(--text-faint); margin-top: 4px; }

/* ---------- Sparkline SVG ---------- */
.sparkline { width: 100%; height: 96px; display: block; }
.sparkline-area { fill: var(--accent); opacity: 0.10; stroke: none; }
.sparkline-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sparkline-dot { fill: var(--accent); }
.no-history {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 24px; text-align: center; color: var(--text-faint); font-size: 0.9rem;
}

/* ---------- Callout didáctico ---------- */
.callout {
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: 0.92rem; color: var(--text);
}
.callout strong { color: var(--accent); }

/* ---------- Pasos numerados (how it works) ---------- */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.step { position: relative; padding-left: 46px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: var(--font-mono);
}

/* ---------- Formulario de suscripción ---------- */
.subscribe-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center;
}
.subscribe-form { display: flex; gap: 10px; max-width: 420px; margin: 18px auto 0; }
.subscribe-form input[type="email"] {
  flex: 1; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.95rem; font-family: var(--font);
}
.subscribe-form input[type="email"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 480px) { .subscribe-form { flex-direction: column; } }
.form-msg { margin-top: 12px; font-size: 0.88rem; font-weight: 600; }
.form-msg[data-state="ok"] { color: var(--down); }
.form-msg[data-state="error"] { color: var(--up); }

/* ---------- Tabla comparativa ---------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.compare-table th, .compare-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.compare-table th { color: var(--text-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-table td.num { font-family: var(--font-mono); text-align: right; }

/* ---------- Utilidades de layout ---------- */
section { padding: 44px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.breadcrumb { font-size: 0.85rem; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumb a { text-decoration: none; color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; }
.footer-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.footer-links a { text-decoration: none; color: var(--text-muted); font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hero { padding: 48px 0 32px; }
}
