/* ==========================================================
   Flowy — Presentación de producto
   Identidad visual del sistema real (tema oscuro por defecto):
   bg #101828 · surface #1C2434 · border #2D3B4E
   primario #465FFF → #3641F5 (135°) · texto #E4E1EB
   Tipografía: Outfit (la misma que usa apps/web/index.html)
   ========================================================== */

:root {
  --bg: #101828;
  --surface-low: #161b22;
  --surface: #1c2434;
  --surface-high: #2d3b4e;
  --border: #2d3b4e;
  --text: #e4e1eb;
  --muted: #8a99af;
  --disabled: #4a5a72;
  --brand: #465fff;
  --brand-deep: #3641f5;
  --brand-soft: rgba(70, 95, 255, 0.12);
  --success: #12b76a;
  --error: #f04438;
  --amber: #f79009;
  --gradient: linear-gradient(135deg, #465fff 0%, #3641f5 100%);
  --radius-card: 14px;
  --radius-btn: 8px;
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.4);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Fondo editorial: resplandor de marca muy sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(70, 95, 255, 0.14), transparent 60%),
    radial-gradient(760px 420px at 95% 110%, rgba(54, 65, 245, 0.1), transparent 60%);
}

/* ---------- Barra de progreso ---------- */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 60;
}
.progress__fill {
  height: 100%;
  width: 0;
  background: var(--gradient);
  transition: width 0.4s var(--ease);
}

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  top: 3px; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.25rem);
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand__name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.brand__tag {
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.topbar__actions { display: flex; align-items: center; gap: 0.6rem; }
.counter {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-right: 0.4rem;
  white-space: nowrap;
}
.counter strong { color: var(--text); }

.icon-btn {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  border-radius: var(--radius-btn);
  border: 1px solid var(--border);
  background: rgba(28, 36, 52, 0.7);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.icon-btn:hover { transform: scale(1.03); border-color: var(--brand); background: var(--surface); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Deck / slides: una sola activa por viewport ---------- */
.deck { position: fixed; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4.5rem, 9vh, 6rem) clamp(1rem, 4vw, 3rem) clamp(5rem, 10vh, 6rem);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(48px) scale(0.99);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), visibility 0s linear 0.45s;
  overflow: hidden auto;
}
.slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.slide.is-before { transform: translateX(-48px) scale(0.99); }

.slide__inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

/* Aparición progresiva de elementos */
.slide.is-active .rise { animation: rise 0.5s var(--ease) both; }
.slide.is-active .rise[data-d="1"] { animation-delay: 0.08s; }
.slide.is-active .rise[data-d="2"] { animation-delay: 0.16s; }
.slide.is-active .rise[data-d="3"] { animation-delay: 0.24s; }
.slide.is-active .rise[data-d="4"] { animation-delay: 0.32s; }
.slide.is-active .rise[data-d="5"] { animation-delay: 0.4s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .slide, .slide.is-active .rise { animation: none; transition: none; }
}

/* ---------- Tipografía de slides ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand-light, #9cb9ff);
  color: #9cb9ff;
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--gradient); border-radius: 2px; }

h1, h2 { letter-spacing: -0.02em; line-height: 1.05; }
.display {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  font-weight: 800;
}
.display em { font-style: normal; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 700; margin-bottom: 0.7rem; }
.lead { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.6; max-width: 56ch; }
.center { text-align: center; }
.center .lead { margin: 0 auto; }

/* ---------- Botones (CTA luminoso del sistema) ---------- */
.btn {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-btn);
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.btn--primary { background: var(--gradient); color: #fff; box-shadow: 0 8px 28px rgba(70, 95, 255, 0.35); }
.btn--primary:hover { transform: scale(1.02); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { transform: scale(1.02); border-color: var(--brand); }
.btn:focus-visible { outline: 2px solid #9cb9ff; outline-offset: 2px; }

/* ---------- Navegación inferior ---------- */
.deck-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.25rem) 1.25rem;
  z-index: 50;
  pointer-events: none;
}
.deck-nav > * { pointer-events: auto; }
.nav-hint { color: var(--disabled); font-size: 0.75rem; letter-spacing: 0.04em; }
@media (max-width: 700px) { .nav-hint { display: none; } }

/* ---------- Browser frame profesional ---------- */
.browser {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.65rem 1rem;
  background: var(--surface-low);
  border-bottom: 1px solid var(--border);
}
.dots { display: flex; gap: 0.4rem; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--disabled); }
.dots span:nth-child(1) { background: #f04438; }
.dots span:nth-child(2) { background: #f79009; }
.dots span:nth-child(3) { background: #12b76a; }
.browser__url {
  flex: 1;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0.3rem 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser__body { padding: clamp(0.9rem, 2vw, 1.4rem); }
.shot-note { margin-top: 0.7rem; font-size: 0.75rem; color: var(--disabled); text-align: center; }

/* ---------- Screenshots reales del sistema ---------- */
.shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-low);
  cursor: zoom-in;
}
.shot:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shot--crop {
  max-height: 270px;
  object-fit: cover;
  object-position: top center;
}

/* Pantallas de poca altura (1366x768, 1280x720): compactar slide 4 */
@media (max-height: 800px) {
  .shot--crop { max-height: 165px; }
  .browser__body { padding: 0.8rem; }
  .card { padding: 0.85rem 1rem; }
  .card p, .card li { font-size: 0.82rem; }
  .title { margin-bottom: 0.4rem; }
  .shot-note { margin-top: 0.4rem; }
}

/* ---------- Layouts de slides ---------- */
.hero { display: grid; grid-template-columns: 0.9fr 1.3fr; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
.hero__ctas { display: flex; gap: 0.8rem; margin: 1.4rem 0 1rem; flex-wrap: wrap; }
.hero__ticks { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.hero__badges { display: flex; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.pill { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--border); background: var(--surface); padding: 0.35rem 0.75rem; border-radius: 999px; }
.pill strong { color: var(--text); }

.split { display: grid; grid-template-columns: 0.8fr 1.25fr; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 1.6rem; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.2rem 1.15rem;
  text-align: left;
}
.card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--brand-soft);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; margin-bottom: 0.8rem;
}
.card h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.card p, .card li { font-size: 0.87rem; color: var(--muted); line-height: 1.55; }
.card ul { list-style: none; display: grid; gap: 0.3rem; margin-top: 0.5rem; }
.card li::before { content: "→ "; color: var(--brand-light, #9cb9ff); color: #9cb9ff; }
.card--problem { border-top: 3px solid var(--error); }
.card--solve { border-top: 3px solid var(--success); }
.card__num { font-size: 0.75rem; color: var(--disabled); letter-spacing: 0.12em; }

.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; margin-top: 1.8rem; align-items: stretch; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.2rem 1rem; text-align: center; position: relative; }
.step__n {
  width: 34px; height: 34px; margin: 0 auto 0.7rem;
  border-radius: 50%; background: var(--gradient); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 0.98rem; margin-bottom: 0.35rem; }
.step p { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 1.6rem; }

.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.9rem; margin-top: 1.4rem; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 1.1rem 1rem; }
.plan--hot { border-color: var(--brand); box-shadow: 0 8px 28px rgba(70, 95, 255, 0.25); }
.plan__name { font-weight: 700; }
.plan__price { font-size: 1.6rem; font-weight: 800; margin: 0.3rem 0; font-variant-numeric: tabular-nums; }
.plan__price--custom { font-size: 1.25rem; }
.plan__price small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; font-size: 0.82rem; color: var(--muted); display: grid; gap: 0.3rem; margin-top: 0.6rem; }
.plan li::before { content: "✓ "; color: var(--success); }
.flag { display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; background: var(--gradient); color: #fff; border-radius: 999px; padding: 0.2rem 0.6rem; margin-bottom: 0.5rem; }

.onetime {
  margin-top: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--brand);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 28px rgba(70, 95, 255, 0.18);
  padding: 0.8rem 1.2rem;
}
.onetime__badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gradient);
  color: #fff;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  white-space: nowrap;
}
.onetime strong { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.onetime__old {
  font-size: 1rem;
  font-weight: 600;
  color: var(--disabled);
  text-decoration: line-through;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.onetime span:last-child { color: var(--muted); font-size: 0.9rem; }

.stack { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.2rem; justify-content: center; }

.closing { text-align: center; max-width: 760px; margin: 0 auto; }
.closing .btn { margin-top: 1.4rem; }
.sign { margin-top: 1.6rem; color: var(--disabled); font-size: 0.82rem; }

/* ---------- Visor ampliado (clic en una captura) ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 11, 20, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease); }
.lightbox__panel {
  width: min(1400px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.lightbox__img {
  max-width: 100%;
  max-height: 76vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-float);
}
.lightbox__cap { color: var(--muted); font-size: 0.85rem; text-align: center; }

/* ---------- Índice ---------- */
.index {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(10, 14, 24, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s linear 0.3s;
}
.index.is-open { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease); }
.index__panel {
  width: min(560px, 100%);
  max-height: 84vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: 1.4rem;
}
.index__panel h2 { font-size: 1.1rem; margin-bottom: 1rem; }
.index__list { list-style: none; display: grid; gap: 0.3rem; }
.index__list button {
  font-family: var(--font);
  width: 100%;
  display: flex; align-items: center; gap: 0.9rem;
  background: transparent; border: 1px solid transparent;
  color: var(--text); border-radius: 10px;
  padding: 0.65rem 0.8rem; font-size: 0.95rem; cursor: pointer; text-align: left;
}
.index__list button:hover { background: var(--surface-low); border-color: var(--border); }
.index__list button:focus-visible { outline: 2px solid var(--brand); }
.index__list button.is-current { background: var(--brand-soft); border-color: var(--brand); }
.index__num { font-size: 0.75rem; color: var(--muted); min-width: 2ch; font-variant-numeric: tabular-nums; }

/* ---------- Responsive (prioridad 16:9, de 1920 a 1280) ---------- */
@media (max-width: 1024px) {
  .hero, .split { grid-template-columns: 1fr; }
  .cards, .feat-grid { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .slide { align-items: flex-start; }
  .cards, .cards--2, .feat-grid, .plans { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .topbar__actions .icon-btn span { display: none; }
  .brand__tag { display: none; }
}
