/* Caudal · landing — light, espejo de design-system/tokens.json (semantic.light).
   Animaciones (reveal/stagger/count-up) espejo del motion de la app, vía landing.js.
   Los paneles de features recrean la mini-UI de la app. */

body.landing {
  /* semantic.light */
  --bg: #F9F9F9;
  --surface: #FFFFFF;
  --surface-2: #F2F2F2;
  --surface-3: #E8E8E8;
  --border: #E8E8E8;
  --border-strong: #D2D2D2;
  --text: #0A0A0A;
  --text-2: #646464;
  --text-3: #767676;
  --brand: #E85002;
  --brand-soft: #C10801;       /* naranja como texto sobre superficie (light) */
  --on-brand: #0A0A0A;         /* texto sobre naranja = negro, siempre */
  --positive: #00875A;
  --positive-bg: rgba(0, 135, 90, 0.08);
  --negative: #D92D20;
  --negative-bg: rgba(217, 45, 32, 0.08);
  --chart-pos: #12B981;
  --chart-pos-fill: rgba(18, 185, 129, 0.12);
  --viz-1: #2563EB;
  --viz-2: #CA8A04;
  --viz-3: #C42E9B;
  --viz-4: #0D9488;
  /* global.radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  /* elevation 1 (light) = sombra sutil */
  --shadow-1: 0 1px 2px rgba(10, 10, 10, 0.04), 0 8px 24px rgba(10, 10, 10, 0.05);
  /* global.motion (duration base/slow + easing.standard) */
  --dur: 220ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  background: var(--bg);
  color: var(--text);
  overflow-x: clip;
}

body.landing .wrap { max-width: 1080px; }

/* texto negro sobre naranja también en el toggle (regla dura del DS) */
body.landing .lang-toggle button.active { color: var(--on-brand); }

/* ---------- Nav sticky glass (glass solo en header, como en la app) ---------- */
body.landing .brand { font-size: 35px; }
body.landing nav.top {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: 0 -24px 0;
  padding: 14px 24px;
  background: rgba(249, 249, 249, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* ---------- Reveal on scroll (FadeInUp de la app: fade + translateY) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
/* stagger de hijos (step 28ms, como tokens.motion.stagger) */
.stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.stagger.visible > * { opacity: 1; transform: none; }
.stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger.visible > *:nth-child(2) { transition-delay: 28ms; }
.stagger.visible > *:nth-child(3) { transition-delay: 56ms; }
.stagger.visible > *:nth-child(4) { transition-delay: 84ms; }
.stagger.visible > *:nth-child(5) { transition-delay: 112ms; }
.stagger.visible > *:nth-child(6) { transition-delay: 140ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero (centrado) ---------- */
body.landing .hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 560px;
  padding: 72px 0 96px;
}
.hero-copy { position: relative; z-index: 1; max-width: 720px; }
body.landing .hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 auto 16px;
}
body.landing .hero p.sub {
  font-size: 18px;
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-2);
}
.hero-ctas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; }
body.landing .badge {
  margin-top: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md); /* como los botones del DS, no pill */
  color: var(--text);
  font-weight: 600;
}
.btn-primary {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--r-md);
  background: var(--brand);
  color: var(--on-brand); /* texto negro sobre naranja, regla dura del DS */
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.btn-primary:hover { background: #C10801; } /* brand.pressed */
.btn-primary:active { transform: scale(0.96); } /* pressScale del DS */
.btn-ghost {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  transition: transform 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-3); }
.btn-ghost:active { transform: scale(0.96); }

/* mini-UI (mockup y paneles): números en Space Grotesk tabular */
.micro {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 4px;
}
.num, .display-num, .mcard-val, .chip b, .mrow-val, .stat .big {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
}
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.mrow:first-child { border-top: 0; }
.dcell { width: 30px; text-align: center; flex-shrink: 0; }
.dcell b { display: block; font-family: "Space Grotesk", sans-serif; font-size: 17px; font-weight: 700; line-height: 1; }
.dcell small { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); margin-top: 2px; }
.tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: 1px;
  margin-left: 4px;
}
.tag.declared { color: #2563EB; background: rgba(37, 99, 235, 0.08); }
.tag.estimated { color: var(--text-2); background: var(--surface-2); }
.month-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.month-row .micro { margin: 0; }
.checko {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  color: var(--text-3);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mrow-when { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.mrow-main { flex: 1; min-width: 0; }
.mrow-main b { display: block; font-size: 13.5px; color: var(--text); font-weight: 600; }
.mrow-main small { display: block; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow-end { text-align: right; }
.mrow-val { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.mrow-end .pct { font-size: 11.5px; font-weight: 600; }
.pct.pos { color: var(--positive); }
.pct.neg { color: var(--negative); }

/* ---------- Trust strip ---------- */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 0 24px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-1);
}
.stat .big {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stat .lbl { display: block; margin-top: 4px; font-size: 13px; color: var(--text-2); }

/* ---------- Secciones ---------- */
.section { padding: 56px 0 8px; }
.section-head { max-width: 620px; margin: 0 0 40px; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-soft);
  margin: 0 0 10px;
}
body.landing h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 10px; }
.section-head p { color: var(--text-2); margin: 0; }

/* filas alternadas texto + panel */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
  padding: 36px 0;
}
.feature:nth-of-type(even) .feature-copy { order: 2; }
.feature h3 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 24px;
  letter-spacing: -0.015em;
  line-height: 1.2;
  margin: 0 0 10px;
}
.feature p { color: var(--text-2); margin: 0 0 12px; }
.feature ul { margin: 0; padding-left: 18px; }
.feature li { color: var(--text-2); font-size: 15px; margin: 4px 0; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-1);
}

.mcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mcard {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
}
.mcard-val { display: block; font-size: 20px; font-weight: 700; margin-top: 2px; }
.mcard-val.pos { color: var(--positive); }
.mcard-val.neg { color: var(--negative); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.chip b { color: var(--text); font-weight: 600; }

/* tarjetas de métricas quant (como el panel Metrics de la app) */
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-1);
}
.qtop { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.qtop .micro { margin: 0; }
.info {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1.5px solid var(--text-3);
  color: var(--text-3);
  font-size: 10px;
  font-weight: 600;
  font-style: italic;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qval {
  display: block;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.qval.pos { color: var(--positive); }
.qval.neg { color: var(--negative); }

/* ---------- Grid de features secundarias ---------- */
.grid-more {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 8px 0 24px;
}
.gcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
}
.gcard .ico {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: rgba(232, 80, 2, 0.08);
  color: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  margin-bottom: 12px;
}
.gcard h3 { font-size: 16px; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
.gcard p { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.5; }

/* ---------- Seguridad ---------- */
.security {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-1);
}
.security ul { list-style: none; margin: 0; padding: 0; }
.security li {
  position: relative;
  padding: 8px 0 8px 28px;
  color: var(--text-2);
  font-size: 15px;
}
.security li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--positive);
  font-weight: 700;
}

/* ---------- FAQ ---------- */
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  color: var(--text-3);
  transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; font-size: 15px; }

/* ---------- CTA final ---------- */
.cta-final { text-align: center; padding: 72px 0 40px; }
.cta-final h2 { margin-bottom: 12px; }
.cta-final p { color: var(--text-2); max-width: 460px; margin: 0 auto; }
.cta-final .hero-ctas { justify-content: center; }

/* ---------- Footer (centrado) ---------- */
body.landing footer { text-align: center; }
body.landing footer .links { justify-content: center; }
body.landing footer a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  body.landing .hero { min-height: 460px; padding: 48px 0 72px; }
  body.landing .brand { font-size: 28px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; gap: 24px; padding: 28px 0; }
  .feature:nth-of-type(even) .feature-copy { order: 0; }
  .grid-more { grid-template-columns: 1fr 1fr; }
  .security { grid-template-columns: 1fr; padding: 28px; gap: 20px; }
}
@media (max-width: 520px) {
  .grid-more { grid-template-columns: 1fr; }
  .stat .big { font-size: 28px; }
}
