/* =========================================================
   MarketsPlus — página principal (index.html)
   ========================================================= */

/* ---------- Variables ---------- */
:root {
  --bg: #070c16;
  --surface: #0d1525;
  --card: #111c30;
  --primary: #0ea5e9;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --green: #22c55e;
  --glow: rgba(14, 165, 233, .3);
  --glow-strong: rgba(6, 182, 212, .5);
  --text: #f0f6fc;
  --text-muted: #7a90a8;
  --text-dim: #4a607a;
  --link: #93c5fd;
  --border: rgba(14, 165, 233, .12);
  --border-bright: rgba(14, 165, 233, .35);
  --grad: linear-gradient(135deg, #0ea5e9, #06b6d4);
  --grad-soft: linear-gradient(135deg, rgba(14, 165, 233, .15), rgba(6, 182, 212, .08));
  --radius: 16px;
  --radius-sm: 10px;
  --font-title: 'Space Grotesk', sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-title); line-height: 1.2; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.texto-grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- Navegación ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 20px 40px;
  display: flex; align-items: center; justify-content: space-between;
  transition: all .4s ease;
}
.nav.scrolled {
  background: rgba(7, 12, 22, .85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
  box-shadow: 0 4px 40px rgba(0, 0, 0, .4);
}
.nav-logo img { height: 58px; width: auto; display: block; filter: drop-shadow(0 0 8px rgba(14, 165, 233, .3)); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-size: .875rem; color: var(--text-muted); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.nav-cta {
  background: var(--grad);
  color: #fff;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 600;
  box-shadow: 0 0 20px var(--glow);
  transition: opacity .2s, transform .2s;
}
.nav-links a.nav-cta:hover { opacity: .9; transform: translateY(-1px); }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 6px; cursor: pointer;
}
.nav-hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Hero ---------- */
#hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 100px 20px 20px;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(14, 165, 233, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, .04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 80%);
}
.hero-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none;
  animation: flotar 8s ease-in-out infinite;
}
.hero-orb-1 { width: 500px; height: 500px; background: rgba(14, 165, 233, .08); top: -100px; left: -100px; }
.hero-orb-2 { width: 400px; height: 400px; background: rgba(6, 182, 212, .07); bottom: -80px; right: -80px; animation-delay: -4s; }
.hero-inner { position: relative; z-index: 1; max-width: 980px; }
.hero-logo {
  height: clamp(90px, 14vw, 160px); width: auto;
  margin-bottom: 28px;
  filter: drop-shadow(0 0 30px rgba(14, 165, 233, .35)) drop-shadow(0 4px 20px rgba(0, 0, 0, .6));
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(14, 165, 233, .1);
  border: 1px solid var(--border-bright);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--cyan-light);
  margin-bottom: 28px;
}
.hero-badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 8px var(--cyan);
  animation: latir 2s ease-in-out infinite;
}
#hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  font-weight: 700; letter-spacing: -1.5px; line-height: 1.1;
  margin-bottom: 22px;
}
#hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 560px; margin: 0 auto 40px;
  line-height: 1.7;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 30px 0 64px; }
.btn-hero-main, .btn-hero-sec {
  display: inline-block; padding: 16px 28px; border-radius: 14px;
  font-weight: 700; font-size: 1.05rem;
}
.btn-hero-main { background: linear-gradient(135deg, var(--primary), var(--green)); color: #04121f; box-shadow: 0 10px 30px rgba(14, 165, 233, .35); }
.btn-hero-sec { border: 1px solid rgba(255, 255, 255, .25); color: #e6f0ff; }
.btn-hero-main:focus-visible, .btn-hero-sec:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 3px; }
#hero .hero-mini { opacity: .75; }

/* Lista de funciones del inicio (con íconos de colores) */
.hero-lista {
  list-style: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  max-width: 980px; margin: 0 auto 26px;
}
.hero-lista li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 18px 7px 7px;
  background: rgba(17, 28, 48, .8);
  border: 1px solid var(--border-bright);
  border-radius: 50px;
  font-weight: 600; font-size: .98rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  transition: transform .2s, border-color .2s;
}
.hero-lista li:hover { transform: translateY(-3px); border-color: var(--cyan-light); }
.hero-ico {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
.hero-ico svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-ico--ventas { background: linear-gradient(135deg, #0ea5e9, #06b6d4); }
.hero-ico--stock { background: linear-gradient(135deg, #f97316, #f59e0b); }
.hero-ico--empleados { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.hero-ico--fiado { background: linear-gradient(135deg, #10b981, #14b8a6); }
.hero-ico--caja { background: linear-gradient(135deg, #22c55e, #84cc16); }

/* Etiqueta "PRO" junto a una función */
.tag-pro {
  display: inline-block; vertical-align: middle;
  font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  padding: 2px 7px; border-radius: 50px;
  background: linear-gradient(135deg, #f59e0b, #f97316); color: #1a0f02;
}

/* ---------- Secciones (base) ---------- */
section { padding: 100px 20px; }
.container { max-width: 1200px; margin: 0 auto; }
.centrado { text-align: center; }
.section-label {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary);
  margin-bottom: 12px;
}
.section-title { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; letter-spacing: -1px; margin-bottom: 16px; }
.section-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; line-height: 1.7; }
.centrado .section-sub { margin: 0 auto 60px; }
.divider { width: 48px; height: 3px; background: var(--grad); border-radius: 2px; margin: 0 auto 20px; }

/* ---------- Funciones ---------- */
#features .container { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.features-text .section-sub { margin-bottom: 36px; }
.features-highlight {
  background: var(--grad-soft);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 16px 20px; margin-top: 28px;
  display: flex; align-items: center; gap: 12px;
  font-size: .875rem; color: var(--text-muted);
}
.features-highlight svg { flex: none; }
.features-highlight strong { color: var(--cyan-light); }
.features-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.feat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: transform .25s, border-color .25s;
}
.feat-card:hover { transform: translateY(-3px); border-color: var(--border-bright); }
.feat-icon { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.feat-card h4 { font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.feat-card p { font-size: .78rem; color: var(--text-muted); line-height: 1.5; }

/* ---------- Números ---------- */
#stats { background: var(--surface); text-align: center; padding: 80px 20px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px; max-width: 900px; margin: 0 auto;
}
.stat-number {
  font-family: var(--font-title);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1;
  margin-bottom: 8px;
}
.stat-label { font-size: .875rem; color: var(--text-muted); }

/* ---------- Precios ---------- */
.pricing-toggle {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 50px; padding: 6px;
  margin-bottom: 48px;
}
.toggle-btn {
  padding: 8px 20px; border-radius: 50px;
  font-size: .85rem; font-weight: 600; font-family: inherit;
  cursor: pointer; border: none; background: transparent; color: var(--text-muted);
  transition: all .2s;
}
.toggle-btn.active { background: var(--grad); color: #fff; box-shadow: 0 0 15px var(--glow); }
.toggle-save { font-size: .7rem; color: #4ade80; margin-left: 4px; }
.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 760px; margin: 0 auto; }
.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  text-align: left;
  position: relative; overflow: hidden;
}
.plan-card.featured {
  border-color: var(--border-bright);
  background: linear-gradient(160deg, rgba(14, 165, 233, .1) 0%, var(--card) 60%);
  box-shadow: 0 0 40px var(--glow), 0 20px 60px rgba(0, 0, 0, .4);
}
.plan-card.featured::before {
  content: '⭐ Más popular';
  position: absolute; top: 16px; right: 16px;
  background: var(--grad); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 50px;
}
.plan-name { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.plan-price-wrap { margin-bottom: 6px; }
.plan-price { font-family: var(--font-title); font-size: 2.4rem; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.plan-period { font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.plan-save {
  font-size: .78rem; color: #4ade80; font-weight: 600;
  background: rgba(74, 222, 128, .1); border: 1px solid rgba(74, 222, 128, .25);
  border-radius: 50px; padding: 2px 10px; margin-bottom: 20px;
}
.plan-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 24px; line-height: 1.6; }
.plan-features { list-style: none; margin-bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.plan-features li { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; }
.plan-features .check { color: var(--primary); font-size: .9rem; flex-shrink: 0; margin-top: 2px; }
.btn-plan-free, .btn-plan-pro {
  display: block; text-align: center;
  padding: 13px; border-radius: 10px; font-weight: 600; font-size: .9rem;
}
.btn-plan-free { border: 1px solid var(--border-bright); color: var(--text); transition: background .2s; }
.btn-plan-free:hover { background: rgba(14, 165, 233, .1); }
.btn-plan-pro { background: var(--grad); color: #fff; box-shadow: 0 0 20px var(--glow); transition: opacity .2s, transform .2s; }
.btn-plan-pro:hover { opacity: .9; transform: translateY(-1px); }
.pricing-note { margin-top: 24px; font-size: .82rem; color: var(--text-dim); }
.pricing-note span { color: var(--primary); }
.pricing-note a { color: var(--link); text-decoration: underline; }

/* Mensual / anual: lo cambia el JS con la clase .is-annual en #pricing */
.annual { display: none; }
.is-annual .monthly { display: none; }
.is-annual .plan-price.annual,
.is-annual .plan-period.annual { display: block; }
.is-annual .plan-save.annual { display: inline-block; }

/* ---------- Cómo empezar ---------- */
#steps { background: var(--surface); }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.step-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 28px;
  transition: transform .3s;
}
.step-card:hover { transform: translateY(-5px); }
.step-num { font-family: var(--font-title); font-size: 3rem; font-weight: 700; line-height: 1; margin-bottom: 16px; }
.step-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; }
.step-card p { font-size: .875rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- Descarga ---------- */
#download {
  text-align: center;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(14, 165, 233, .12) 0%, transparent 70%), var(--bg);
  padding: 120px 20px;
}
#download .section-title { font-size: clamp(2rem, 5vw, 3rem); }
#download .section-sub { margin: 0 auto 48px; }
.download-btns { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.btn-apk, .btn-web {
  padding: 16px 36px; border-radius: 50px;
  font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; gap: 10px;
}
.btn-apk {
  background: var(--grad); color: #fff;
  box-shadow: 0 0 35px var(--glow-strong);
  transition: transform .2s, box-shadow .2s;
}
.btn-apk:hover { transform: translateY(-3px); box-shadow: 0 10px 50px var(--glow-strong); }
.btn-web {
  background: rgba(255, 255, 255, .05); border: 1px solid var(--border-bright);
  color: var(--text);
  transition: background .2s, transform .2s;
}
.btn-web:hover { background: rgba(14, 165, 233, .12); transform: translateY(-3px); }
.download-note { margin-top: 24px; font-size: .82rem; color: var(--text-dim); }
.oculto { display: none !important; }

/* ---------- Pie de página ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 56px 20px 28px; position: relative; overflow: hidden; }
.site-footer::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--green), transparent);
  opacity: .6;
}
.site-footer a:focus-visible { outline: 2px solid var(--cyan-light); outline-offset: 3px; border-radius: 6px; }
.sf-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1.3fr; gap: 36px; }
.sf-brand p { color: var(--text-muted); font-size: .92rem; line-height: 1.65; margin: 14px 0 18px; max-width: 320px; }
.sf-logo img { height: 64px; width: auto; display: block; }
.sf-cta { display: inline-block; padding: 10px 18px; border-radius: 12px; background: var(--grad); color: #04121f; font-weight: 700; font-size: .9rem; }
.sf-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sf-col h4 { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 4px; }
.sf-col a { color: var(--text-muted); font-size: .92rem; transition: color .2s; width: fit-content; }
.sf-col a:hover, .sf-col a:focus-visible { color: var(--cyan-light); }
.sf-col a.sf-pill { border: 1px solid var(--border-bright); border-radius: 8px; padding: 3px 10px; }
.sf-small { color: var(--text-dim); font-size: .82rem; line-height: 1.55; }
.sf-col a.sf-defensa { color: var(--text-muted); font-size: .82rem; text-decoration: underline; }
.sf-mail { color: var(--text); font-size: .88rem; font-weight: 600; user-select: all; overflow-wrap: anywhere; }

.sf-credit {
  max-width: 1100px; margin: 44px auto 0; padding: 18px 20px;
  border: 1px solid var(--border); border-radius: 18px;
  background: linear-gradient(135deg, rgba(14, 165, 233, .07), rgba(34, 197, 94, .05));
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.sf-dev { display: flex; align-items: center; gap: 14px; color: var(--text); min-width: 0; }
.sf-avatar {
  flex: none; position: relative;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  font-weight: 800; letter-spacing: .04em; font-size: .9rem; color: #04121f;
  background: linear-gradient(135deg, #38bdf8, var(--green) 60%, #f59e0b);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(56, 189, 248, .55), 0 6px 20px rgba(14, 165, 233, .25);
  transition: transform .25s;
}
/* La foto tapa las iniciales; si el archivo no está, se ven las iniciales */
.sf-avatar-foto { position: absolute; inset: 0; background: url(../assets/img/avatar-mfg.webp) center / cover no-repeat; }
.sf-dev:hover .sf-avatar, .sf-dev:focus-visible .sf-avatar { transform: scale(1.06); }
.sf-dev-line { font-size: .98rem; }
.sf-dev-line strong { background: linear-gradient(90deg, #7dd3fc, #86efac); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sf-heart { color: #f43f5e; display: inline-block; animation: latido 1.6s ease-in-out infinite; }
.sf-web {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--text-muted); border: 1px solid var(--border);
  transition: color .2s, border-color .2s, transform .2s;
}
.sf-web:hover, .sf-web:focus-visible { color: var(--cyan-light); border-color: var(--border-bright); transform: translateY(-2px); }
.sf-hecho { display: inline-flex; align-items: center; gap: 6px; }
.sf-flag { border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.sf-bottom { max-width: 1100px; margin: 22px auto 0; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-dim); font-size: .8rem; }

/* ---------- Animaciones al hacer scroll ----------
   Solo si hay JS (clase .js en <html>): sin JS el contenido se ve igual. */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible, .js .reveal-left.visible, .js .reveal-right.visible { opacity: 1; transform: none; }

/* Demora escalonada */
.d1 { transition-delay: 60ms; }
.d2 { transition-delay: 120ms; }
.d3 { transition-delay: 180ms; }
.d4 { transition-delay: 240ms; }
.d5 { transition-delay: 320ms; }
.d6 { transition-delay: 400ms; }
.d7 { transition-delay: 480ms; }
.d8 { transition-delay: 560ms; }

@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-30px); } }
@keyframes latir { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes latido { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  #features .container { grid-template-columns: 1fr; gap: 50px; }
  .js .reveal-left, .js .reveal-right { transform: translateY(30px); }
  .sf-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .hero-lista li { font-size: .9rem; padding-right: 14px; }
  .nav { padding: 18px 20px; }
  .nav.scrolled { padding: 12px 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .plans-grid, .features-grid { grid-template-columns: 1fr; }

  /* Menú abierto en el celular */
  .nav-abierto .nav-links {
    display: flex; flex-direction: column;
    position: fixed; inset: 60px 0 0 0;
    background: rgba(7, 12, 22, .98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    align-items: center; justify-content: center; gap: 32px;
    z-index: 99;
  }
  .nav-abierto .nav-links a { font-size: 1.2rem; }
}
@media (max-width: 560px) {
  .sf-grid { grid-template-columns: 1fr; gap: 28px; }
  .sf-bottom { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-left, .js .reveal-right { opacity: 1; transform: none; transition: none; }
  .hero-orb, .hero-badge-dot, .sf-heart { animation: none; }
}
