:root {
  --font-heading: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", -apple-system, Roboto, Helvetica, Arial, sans-serif;

  --bg: #f3f8fc;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.6);
  --border: #dbe8f2;
  --text: #16222c;
  --text-muted: #5a7182;
  --primary: #0d6bb4;
  --primary-hover: #0a5590;
  --primary-contrast: #ffffff;
  --primary-glow: rgba(13, 107, 180, 0.18);

  --radius: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 30, 44, .06), 0 1px 3px rgba(16, 30, 44, .08);
  --shadow-lg: 0 10px 30px rgba(16, 30, 44, .18);
  --shadow-xl: 0 24px 60px rgba(16, 30, 44, .16);
}

:root[data-theme="dark"] {
  --bg: #0e161f;
  --surface: #16202b;
  --surface-glass: rgba(22, 32, 43, 0.55);
  --border: #263544;
  --text: #e5edf4;
  --text-muted: #93a7b7;
  --primary: #3b9eea;
  --primary-hover: #63b6f0;
  --primary-contrast: #062031;
  --primary-glow: rgba(59, 158, 234, 0.22);

  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo {
  font-family: var(--font-heading);
}

/* Fraunces (serif) queda reservada a titulos editoriales; los elementos
   de UI (botones, numeros de KPI/precio, tags) se leen mejor en Inter. */
.btn, .mock-kpi-valor, .price-amount, .form-plan-tag {
  font-family: var(--font-body);
}

a { color: inherit; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 16px 24px 0;
}
.site-header-inner {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
}
.logo svg { display: block; }
.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease;
}
.site-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.theme-toggle:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 8px 24px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 80px;
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -220px;
  right: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  z-index: -1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--primary), #67c3f3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 0 34px;
}
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Mockup card in hero */
.hero-visual { position: relative; }
.hero-illustration {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 115%;
  max-width: 460px;
  height: auto;
  transform: translate(-50%, -50%);
  color: var(--primary);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
  will-change: transform, opacity;
}
.mock-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 22px;
}
.mock-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mock-dot-row { display: flex; gap: 6px; }
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.mock-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: #0d9c5c;
  background: rgba(13, 156, 92, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}
.mock-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.mock-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mock-kpi-valor { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.mock-kpi-label { font-size: 10px; color: var(--text-muted); }

.mock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px);
  animation: mockRowIn .5s ease forwards;
}
.mock-row:last-child { border-bottom: none; }
.mock-row-main { display: flex; flex-direction: column; gap: 3px; }
.mock-row-title { font-size: 13.5px; font-weight: 600; }
.mock-row-sub { font-size: 12px; color: var(--text-muted); }
.mock-status {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.mock-status.emitida { background: rgba(13, 107, 180, 0.12); color: var(--primary); }
.mock-status.procesando { background: rgba(180, 83, 9, 0.12); color: #b45309; }
@keyframes mockRowIn { to { opacity: 1; transform: translateY(0); } }

/* ---------- Section shell ---------- */
section { padding: 88px 0; position: relative; }
#antes-despues, #calculadora, #precios, #demo, #faq { overflow: hidden; }

/* ---------- Ilustraciones de fondo por sección ---------- */
.section-bg-art {
  position: absolute;
  pointer-events: none;
  color: var(--primary);
  opacity: 0.4;
  z-index: -1;
  will-change: transform, opacity;
}
.bg-art-flow { top: -30px; right: -50px; width: 320px; }
.bg-art-clock { bottom: -50px; left: -60px; width: 220px; }
.bg-art-stack { top: 6%; right: -70px; width: 220px; }
.bg-art-send { bottom: -40px; right: -50px; width: 240px; }
.bg-art-chat { top: -20px; left: -50px; width: 220px; }
.bg-art-cta {
  top: 50%;
  right: 6%;
  width: 180px;
  transform: translateY(-50%);
  color: #fff;
  opacity: 0.25;
}
@media (max-width: 900px) {
  .section-bg-art { display: none; }
}
.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(28px, 3.4vw, 38px);
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.section-head p { color: var(--text-muted); font-size: 16px; margin: 0; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Before / After ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.compare-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
}
.compare-card.before {
  background: var(--surface);
  opacity: 0.85;
}
.compare-card.after {
  background: linear-gradient(160deg, var(--surface), var(--primary-glow));
  box-shadow: var(--shadow-lg);
}
.compare-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 18px;
  color: var(--text-muted);
}
.compare-card.after .compare-label { color: var(--primary); }
.compare-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.compare-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
.compare-card.before .compare-list li { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(90,113,130,.4); }
.compare-icon { flex-shrink: 0; margin-top: 2px; }

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  will-change: transform, opacity;
}
.feature-icon svg { display: block; }
.feature-card h3 { font-size: 16.5px; margin: 0 0 8px; }
.feature-card p { font-size: 14px; color: var(--text-muted); margin: 0; line-height: 1.55; }

/* ---------- Pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 380px));
  justify-content: center;
  gap: 20px;
  align-items: stretch;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.price-card.featured {
  background: linear-gradient(165deg, var(--surface), var(--primary-glow));
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-xl);
  transform: translateY(-8px);
  position: relative;
}
.price-badge {
  position: absolute;
  top: -13px;
  left: 26px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.price-card h3 { font-size: 17px; margin: 0 0 6px; }
.price-card .price-sub { font-size: 13.5px; color: var(--text-muted); margin: 0 0 18px; }
.price-amount { font-size: 34px; font-weight: 800; font-family: var(--font-heading); margin-bottom: 22px; }
.price-amount span { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.price-list { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.price-list li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; }

/* ---------- Lead form ---------- */
.lead-section-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.lead-card {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
}
.contact-direct {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.contact-direct-label {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.contact-direct-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 6px;
}
.contact-direct a {
  display: block;
  font-size: 14.5px;
  color: var(--primary);
  text-decoration: none;
  margin-bottom: 4px;
}
.contact-direct a:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field input, .field textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.field textarea { resize: vertical; min-height: 84px; }
.form-plan-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 5px 12px;
  border-radius: 999px;
  width: fit-content;
}
.field textarea.flash-fill {
  animation: flashFill 1s ease;
}
@keyframes flashFill {
  0% { box-shadow: 0 0 0 4px var(--primary-glow); }
  100% { box-shadow: none; }
}
.form-msg { font-size: 13.5px; margin-top: 12px; min-height: 18px; }
.form-msg.ok { color: #0d9c5c; }
.form-msg.error { color: #c0392b; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.faq-question .chev { transition: transform .25s ease; color: var(--text-muted); flex-shrink: 0; }
.faq-item.open .faq-question .chev { transform: rotate(180deg); color: var(--primary); }
.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.faq-item.open .faq-answer-wrap { grid-template-rows: 1fr; }
.faq-answer-inner { overflow: hidden; }
.faq-answer {
  padding: 0 20px 18px;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ---------- Final CTA ---------- */
.cta-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), #063d63);
  border-radius: var(--radius-lg);
  padding: 56px 40px;
  text-align: center;
  color: #fff;
}
.cta-band h2, .cta-band p, .cta-band .btn-ghost { position: relative; z-index: 1; }
.cta-band h2 { margin: 0 0 12px; font-size: clamp(24px, 3vw, 32px); }
.cta-band p { margin: 0 0 26px; opacity: .85; }
.cta-band .btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.cta-band .btn-ghost:hover { border-color: #fff; }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 60px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13.5px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 13px; color: var(--text-muted); }

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.whatsapp-float:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 32px rgba(37, 211, 102, 0.55);
}

/* ---------- Panel en vivo (banner) ---------- */
.live-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
  padding: 12px 20px;
  margin: 0 auto 0;
  font-size: 13.5px;
  color: var(--text-muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.live-banner .live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0d9c5c;
  box-shadow: 0 0 0 0 rgba(13, 156, 92, 0.6);
  animation: liveDotPulse 2s infinite;
  flex-shrink: 0;
}
.live-banner a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.live-banner a:hover { text-decoration: underline; }
@keyframes liveDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 156, 92, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(13, 156, 92, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 156, 92, 0); }
}

/* ---------- Calculadora de ahorro ---------- */
.calc-card {
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}
.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.calc-row label { font-weight: 700; font-size: 14.5px; }
.calc-valor {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--primary);
}
.calc-slider {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  margin: 6px 0 26px;
}
.calc-resultado {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.calc-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.calc-stat-valor {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 26px;
}
.calc-stat-valor.ahorro { color: var(--primary); }
.calc-stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.calc-nota { font-size: 12px; color: var(--text-muted); margin-top: 18px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .compare-grid, .features-grid, .pricing-grid, .lead-section-inner { grid-template-columns: 1fr; }
  .price-card.featured { transform: none; }
  .site-nav { display: none; }
}
@media (max-width: 560px) {
  .hero { padding: 72px 0 56px; }
  section { padding: 64px 0; }
}
