/* Demo interactiva — diseño Stitch de Roberto (sesión 12): tema claro, violeta
   eléctrico, Inter + JetBrains Mono + Caveat; escena cálida A SANGRE con los
   tres dispositivos reales flotando y rótulos numerados alrededor (como la
   maqueta). Es una página de marketing: NO hereda base.css. */

:root {
  --bg: #f6f5f8;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #7c3aed;
  --primary-deep: #6d28d9;
  --primary-soft: rgba(124, 58, 237, 0.10);
  --line: #e2e8f0;
  --ok: #22c55e;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}
#app { position: relative; z-index: 1; }

/* ── Barra superior ── */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 26px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.3rem; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand .planet { font-size: 1.5rem; }
.nav-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.nav-status { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.nav-status .dot { color: #cbd5e1; font-size: 0.7rem; }
.nav-status .dot.ok { color: var(--ok); }

.btn-primary {
  display: inline-block; text-align: center; text-decoration: none;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.02rem;
  padding: 13px 22px; border-radius: 13px;
  box-shadow: 0 12px 40px -8px rgba(124, 58, 237, 0.55);
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-primary:hover { background: var(--primary-deep); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-primary.slim { padding: 9px 16px; font-size: 0.92rem; border-radius: 11px; }
.btn-primary.ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn-primary.ghost:hover { background: var(--primary-soft); }

/* ── Hero ── */
.hero { text-align: center; max-width: 780px; margin: 0 auto; padding: 34px 24px 0; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 3.5rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; line-height: 1.08; }
.hero h1 .violet, .violet { color: var(--primary); }
.hero p { color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.15rem); line-height: 1.55; margin: 0; }
.hero-note {
  font-family: var(--hand); color: var(--primary) !important;
  font-size: 1.55rem !important; margin-top: 8px !important; font-weight: 600;
}

/* ── Escena a sangre completa ── */
#stage { margin-top: 14px; }
.scene {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(#faf7f2, #f2ede4); /* base neutra bajo los ambientes */
  border-top: 1px solid rgba(120, 90, 40, 0.10);
  border-bottom: 1px solid rgba(120, 90, 40, 0.10);
}

/* Capa ambiental: tres escenarios fundiéndose en bucle DETRÁS de la demo.
   Los dispositivos (en .scene-canvas, encima) permanecen inmóviles: solo
   cambia el fondo. Escenas pintadas en CSS, desenfocadas y luminosas; si se
   colocan fotos reales (public/demo/scene-pasteleria.jpg, scene-supermercado.jpg,
   scene-moda.jpg — mejor ya desenfocadas), cada capa las recoge sola. */
.scene-bgs { position: absolute; inset: 0; }
.scene-bg {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 3s ease-in-out; /* crossfade lento y elegante */
}
.scene-bg.on { opacity: 1; }
/* Velo claro: el fondo nunca compite con la interfaz. */
.scene-bg::after {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.60), rgba(255, 255, 255, 0.48));
}
.bg-pasteleria {
  background:
    url('/demo/scene-pasteleria.jpg') center / cover no-repeat,
    radial-gradient(55% 70% at 14% 10%, rgba(255, 205, 140, 0.65), transparent 62%),
    radial-gradient(45% 60% at 86% 88%, rgba(224, 168, 104, 0.55), transparent 62%),
    radial-gradient(38% 50% at 68% 14%, rgba(255, 231, 195, 0.7), transparent 60%),
    linear-gradient(165deg, #fbeeda 0%, #f5e2c4 50%, #eed7b4 100%);
}
.bg-supermercado {
  background:
    url('/demo/scene-supermercado.jpg') center / cover no-repeat,
    repeating-linear-gradient(90deg, rgba(120, 165, 150, 0.10) 0 70px, rgba(255, 255, 255, 0) 70px 150px),
    radial-gradient(50% 65% at 18% 12%, rgba(170, 220, 200, 0.55), transparent 62%),
    radial-gradient(45% 60% at 84% 86%, rgba(140, 200, 175, 0.45), transparent 62%),
    linear-gradient(165deg, #eef7f1 0%, #dfeee6 50%, #d4e6db 100%);
}
.bg-moda {
  background:
    url('/demo/scene-moda.jpg') center / cover no-repeat,
    radial-gradient(50% 65% at 16% 12%, rgba(235, 200, 205, 0.55), transparent 62%),
    radial-gradient(45% 60% at 85% 85%, rgba(205, 190, 210, 0.5), transparent 62%),
    linear-gradient(165deg, #f7f0f1 0%, #efe6e8 50%, #e6dcdf 100%);
}
/* Rótulo del comercio de ejemplo: viaja fundido con su ambiente. */
.bg-sign {
  position: absolute; right: 3%; bottom: 2.5%; z-index: 1;
  text-align: right; pointer-events: none;
}
.bg-sign-n { display: block; font-family: var(--hand); font-weight: 600; font-size: 2.1rem; color: rgba(88, 60, 28, 0.55); line-height: 1; }
.bg-sign-s { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(88, 60, 28, 0.42); margin-top: 5px; }
.bg-supermercado .bg-sign-n { color: rgba(35, 80, 62, 0.5); }
.bg-supermercado .bg-sign-s { color: rgba(35, 80, 62, 0.4); }
.bg-moda .bg-sign-n { color: rgba(95, 55, 70, 0.5); }
.bg-moda .bg-sign-s { color: rgba(95, 55, 70, 0.4); }

.scene-canvas {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 1280 / 900;
}

/* Sombra de apoyo en el "suelo": ancla los aparatos a la escena para que no
   parezcan capturas pegadas. */
.pos-tablet::after, .pos-tv::after, .pos-phone::after {
  content: '';
  position: absolute; left: 7%; right: 7%; bottom: -15px; height: 26px;
  background: radial-gradient(closest-side, rgba(70, 45, 15, 0.30), transparent 72%);
  filter: blur(6px);
  z-index: -1;
}
.sc-item { position: absolute; }

/* Posiciones (en % del lienzo), calcadas de la composición de la maqueta */
.pos-name   { left: 2.5%; top: 2.5%; width: 34%; z-index: 6; }
.pos-tablet { left: 2.5%; top: 20%;  width: 51%; z-index: 3; }
.pos-c2     { left: 0.8%; top: 76%;  width: 22%; z-index: 6; }
.pos-c3     { left: 43%;  top: 4%;   width: 21%; z-index: 6; }
.pos-tv     { right: 2%;  top: 12%;  width: 40%; z-index: 2; }
.pos-qr     { left: 35%;  top: 52%;  width: 15%; z-index: 6; }
.pos-phone  { left: 51%;  top: 42%;  width: 20%; z-index: 5; }
.pos-c5     { right: 2.5%; top: 58%; width: 22%; z-index: 6; }

/* Rótulos numerados */
.callout {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 14px 34px -12px rgba(15, 23, 42, 0.30);
  padding: 13px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.co-head { display: flex; align-items: center; gap: 9px; }
.co-n {
  flex: none; width: 25px; height: 25px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.co-t { font-weight: 800; font-size: 0.98rem; letter-spacing: -0.01em; }
.co-h { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.callout input {
  font: inherit; font-weight: 600; font-size: 0.98rem;
  border: none; border-bottom: 2px solid var(--line); border-radius: 0;
  padding: 6px 2px; background: transparent; color: var(--text); outline: none;
}
.callout input:focus { border-bottom-color: var(--primary); }
.co-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.name-status { color: var(--primary); font-size: 0.82rem; font-weight: 700; }
.co-qr { align-items: center; text-align: center; }
.co-qr img { width: 100%; max-width: 150px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 5px; }
.co-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.co-checks li { font-size: 0.9rem; font-weight: 600; padding-left: 24px; position: relative; }
.co-checks li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 900; }

/* Marcos de dispositivo */
.frame { position: relative; }
.frame-tablet {
  background: #232b3a;
  border: 1px solid #39435a;
  border-radius: 20px; padding: 12px;
  box-shadow: 0 30px 60px -18px rgba(40, 25, 5, 0.45);
}
.frame-tablet .cam {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 4px; border-radius: 99px; background: #46516b;
}
.tablet-stand {
  width: 34%; height: 30px; margin: -4px auto 0;
  background: linear-gradient(#eceff4, #c9cfda);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 14px 24px -10px rgba(40, 25, 5, 0.35);
}
.frame-tv {
  background: #0d1017; border-radius: 12px; padding: 8px;
  box-shadow: 0 30px 60px -18px rgba(40, 25, 5, 0.5);
}
.tv-stand { width: 34%; height: 12px; margin: -1px auto 0; background: #2c3342; border-radius: 0 0 10px 10px; }
.frame-phone {
  background: #10151f; border-radius: 38px; padding: 8px;
  border: 1px solid #3a4457;
  box-shadow: 0 30px 60px -16px rgba(15, 23, 42, 0.55);
  position: relative;
}
.frame-phone .notch {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 38%; height: 18px; background: #05070c;
  border-radius: 0 0 12px 12px; z-index: 5; pointer-events: none;
}

/* Pantallas escaladas: el iframe se renderiza al tamaño REAL del dispositivo
   (tablet APAISADA 1024×768, TV 1280×720, móvil 320×660) y se escala al marco. */
.screen { position: relative; overflow: hidden; border-radius: 10px; background: #0e1017; }
.screen.s-tablet { aspect-ratio: 4 / 3; }
.screen.s-tv { aspect-ratio: 16 / 9; }
.screen.s-phone { aspect-ratio: 320 / 660; border-radius: 30px; }
.screen > iframe {
  position: absolute; top: 0; left: 0; border: 0;
  transform: scale(var(--s, 0.5)); transform-origin: 0 0;
}

.open-full { color: var(--primary); font-weight: 700; font-size: 0.86rem; text-decoration: none; }
.open-full:hover { text-decoration: underline; }
.open-full.on-dark { display: block; text-align: center; margin-top: 8px; }
.ttl-note { text-align: center; color: var(--muted); font-size: 0.85rem; font-family: var(--mono); margin: 14px 16px 4px; }

/* ── Tarjetas-panel (secciones inferiores) ── */
.panel-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.10);
  border-radius: 24px;
  max-width: 1160px;
  margin: 26px auto;
  padding: 30px 34px;
}
@media (max-width: 1200px) { .panel-card { margin-left: 16px; margin-right: 16px; } }

.licon { display: inline-flex; color: var(--primary); }

/* ── Sección hardware ── */
.hw { display: grid; grid-template-columns: 3fr 2fr; gap: 30px; align-items: center; }
.hw h2 { margin: 0 0 8px; font-size: clamp(1.5rem, 3.4vw, 2rem); letter-spacing: -0.01em; }
.hw p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.hw-items { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.hw-item { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 86px; text-align: center; }
.hw-ico {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 1px solid rgba(124, 58, 237, 0.2);
}
.hw-lbl { font-weight: 700; font-size: 0.85rem; }
.hw-hint { color: var(--muted); font-size: 0.75rem; }
.hw-sep { width: 1px; background: var(--line); align-self: stretch; }

/* Bodegón de hardware (CSS): tablet en peana + monitor + altavoz */
.hw-visual { position: relative; display: flex; justify-content: center; padding: 20px 8px 8px; }
.hw-badge {
  position: absolute; top: -14px; right: -2px; z-index: 2;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 0.85rem;
  border-radius: 50%; transform: rotate(10deg);
  text-align: center; line-height: 1.15; width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center; padding: 10px;
  box-shadow: 0 12px 30px -8px rgba(124, 58, 237, 0.6);
}
.hw-set { display: flex; align-items: flex-end; gap: 14px; background: #f1f3f7; border-radius: 18px; padding: 26px 26px 20px; }
.hw-mini-tablet { width: 74px; height: 104px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; box-shadow: 0 10px 22px -10px rgba(15,23,42,.3); }
.hw-mini-screen { width: 100%; height: 100%; border-radius: 6px; background: linear-gradient(#fdf4e7, #f3e3c9); }
.hw-monitor {
  background: #10131c; border-radius: 14px; padding: 20px 34px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  box-shadow: 0 20px 45px -14px rgba(15, 23, 42, 0.5);
}
.hw-tv-sec { color: #9aa3b8; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hw-tv-num { color: #ffb200; font-weight: 900; font-size: 3rem; letter-spacing: -0.03em; line-height: 1; }
.hw-tv-name { color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: 0.02em; }
.hw-speaker { width: 58px; height: 84px; background: #1a1f2b; border-radius: 12px; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 22px -10px rgba(15,23,42,.4); }
.hw-grill { width: 30px; height: 48px; border-radius: 8px; background: repeating-linear-gradient(#2c3342 0 3px, #1a1f2b 3px 7px); }

/* ── Así de fácil ── */
.easy h2 { text-align: center; margin: 0 0 24px; font-size: clamp(1.4rem, 3vw, 1.8rem); }
.easy-row { display: flex; gap: 10px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.easy-step {
  flex: 1 1 170px; max-width: 220px; position: relative;
  background: #f8f7fc; border: 1px solid var(--line); border-radius: 18px;
  padding: 22px 16px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.easy-n {
  position: absolute; top: -11px; left: 14px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
}
.easy-ico {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); border: 1px solid rgba(124, 58, 237, 0.2);
}
.easy-t { font-weight: 800; }
.easy-h { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.easy-arrow { align-self: center; color: var(--primary); font-weight: 900; font-size: 1.3rem; }

/* ── Banda final ── */
.cta-band { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.cta-band h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.cta-band p { margin: 0 0 16px; color: var(--muted); }
.perks { display: flex; gap: 24px; flex-wrap: wrap; }
.perk { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.92rem; }
.perk-ico {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid rgba(124, 58, 237, 0.45);
}

/* ── Pie ── */
.footer {
  max-width: 1160px; margin: 10px auto 30px; padding: 14px 24px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

/* ── Mensajes de estado del escenario ── */
.stage-msg { text-align: center; max-width: 460px; }
.stage-msg .big { font-size: 3rem; margin-bottom: 6px; }
.stage-msg .btn-primary { margin-top: 8px; }
.expired-card { text-align: center; max-width: 520px; }
.expired-card .big { font-size: 3rem; margin-bottom: 6px; }
.expired-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Responsive: por debajo de 980px la escena pasa a columna ── */
@media (max-width: 980px) {
  .scene-canvas { aspect-ratio: auto; display: flex; flex-direction: column; gap: 16px; padding: 18px 14px; }
  .bg-sign { display: none; } /* en columna chocaría con los dispositivos */
  .pos-tablet::after, .pos-tv::after, .pos-phone::after { display: none; }
  .sc-item { position: static; width: 100% !important; max-width: 430px; margin: 0 auto; }
  .pos-name { order: 1; }
  .pos-tablet { order: 2; }
  .pos-c2 { order: 3; }
  .pos-c3 { order: 4; }
  .pos-tv { order: 5; }
  .pos-qr { order: 6; }
  .pos-phone { order: 7; max-width: 290px; }
  .pos-c5 { order: 8; }
  .hw { grid-template-columns: 1fr; }
  .cta-band { grid-template-columns: 1fr; }
  .easy-arrow { display: none; }
}
