/* ==========================================================================
   ContaBot — landing page
   Tokens de marca (ver README). Secciones .dark / .light alternadas.
   ========================================================================== */

/* Fuentes propias, sin Google Fonts (la CSP solo permite 'self'):
   - Inter y JetBrains Mono: los mismos archivos que sirve la app (ui/web/fonts/).
   - Bricolage Grotesque (OFL): solo para títulos; variable en peso y ancho. */
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url(../fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  src: url(../fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --accent: #E63946;
  --accent-hover: #EC5762;
  --accent-soft: rgba(230, 57, 70, .12);
  /* Rojo un poco más oscuro para el fondo de botones: texto blanco con contraste AA (≈5:1).
     #E63946 con texto blanco da ≈4.2:1 y no cumple AA en texto normal. */
  --accent-btn: #D62839;
  --accent-btn-hover: #BF1F30;
  /* Verde de WhatsApp oscurecido: texto blanco ≈5.2:1 (#25D366 da ≈2:1). */
  --wa: #0E7A6E;
  --wa-hover: #0B6A5F;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Curvas (Emil Kowalski): las de CSS se quedan cortas.
     ease-out fuerte para entradas e interacción; ease-in-out para lo que se mueve
     en pantalla; la de cajón (iOS) para la barra fija del teléfono. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --container: 1160px;
  --gutter: 16px;
  --header-h: 64px;
}

.dark {
  --bg: #0C1524; --card: #111D31; --surface: #16263F; --elevated: #1D3557;
  --border: #24395C; --border-strong: #33507C;
  --text: #E8EDF5; --text-2: #A4B3CA; --text-3: #7189A8;
  --link: #EC5762;            /* ≈5:1 sobre #0B0C10 */
  --icon: #D5D8DE;
  --focus: #F58A92;
  --warn: #FBBF24;
  --positive: #34D399;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
  color: var(--text);
}

/* Neutros teñidos del azul marino de la marca (no grises puros). Contraste sobre
   blanco / sobre .soft: --text 17:1 / 15.7:1, --text-2 7.2:1 / 6.6:1, --text-3 5.3:1 / 4.8:1. */
.light {
  --bg: #FFFFFF; --card: #FFFFFF; --surface: #F2F5F8; --elevated: #E9EEF3;
  --border: #E2E8EE; --border-strong: #CDD6DF;
  --text: #0F1B2D; --text-2: #4A586B; --text-3: #5F6D80;
  --link: #0F1B2D;
  --icon: #0F1B2D;
  --focus: #1D3557;
  --warn: #B45309;
  --positive: #0A8C5B;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 16px rgba(15, 27, 45, .05);
  color-scheme: light;
  color: var(--text);
}
/* Sección clara alterna: tinte suave de la marca (aguamarina y azul acero) */
.soft { --bg: #EEF5F7; }
.section.soft {
  background:
    radial-gradient(720px 420px at 100% 0%, rgba(168, 218, 220, .38), transparent 70%),
    radial-gradient(620px 420px at 0% 100%, rgba(69, 123, 157, .10), transparent 70%),
    var(--bg);
}

/* Banda oscura (azul marino de la app) que corta el blanco a media página */
.section.band {
  background:
    radial-gradient(640px 420px at 0% 0%, rgba(69, 123, 157, .38), transparent 70%),
    radial-gradient(560px 380px at 100% 100%, rgba(230, 57, 70, .16), transparent 70%),
    linear-gradient(160deg, #142640, #0C1524);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;  /* sin el destello gris al tocar; cada control tiene su :active */
  scrollbar-color: #B9C4D0 transparent;
  interpolate-size: allow-keywords;          /* permite animar la altura de las preguntas */
}
::selection { background: rgba(168, 218, 220, .75); color: #0C1524; }
.dark ::selection { background: rgba(230, 57, 70, .5); color: #fff; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0 0 .5em;
  font-family: var(--font-display);
  font-stretch: 96%;
  line-height: 1.15;
  letter-spacing: -.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.02; }
h2 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.04; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: var(--link); text-underline-offset: .2em; text-decoration-thickness: 1px; }
@media (hover: hover) and (pointer: fine) { a:hover { text-decoration-thickness: 2px; } }

/* Segunda parte de un título: tono, no degradado (el énfasis va en el color plano) */
.tone { color: #3A6A88; }
.dark .tone { color: #A8DADC; }

/* Táctil: respuesta inmediata y sin selección accidental en los controles */
a, button, summary, input, select, textarea, label { touch-action: manipulation; }
.btn, summary, .stage-dot, .stage-pause, .nav-toggle { -webkit-user-select: none; user-select: none; }
input, textarea, select { caret-color: var(--accent-btn); }
code, .mono { font-family: var(--font-mono); }
strong { font-weight: 600; color: var(--text); }
img, svg { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter); top: -100px;
  z-index: 100;
  padding: .6rem 1rem;
  background: var(--accent-btn);
  color: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 8px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  /* Con viewport-fit=cover, en horizontal el contenido no se mete bajo el notch */
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
.container.narrow { max-width: 820px; }
.center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }

.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.c-red   { --icon: #C8202F; }
.c-steel { --icon: #3A6A88; }
.c-teal  { --icon: #23787B; }
.c-green { --icon: #0A8C5B; }
.c-amber { --icon: #B45309; }
.c-navy  { --icon: #1D3557; }
.icon-lg {
  width: 48px; height: 48px;
  padding: 11px;
  color: var(--icon);
  stroke-width: 1.6;
  background: color-mix(in srgb, var(--icon) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--icon) 22%, transparent);
  border-radius: var(--r-lg);
}

/* ---------- Marca ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  text-decoration: none;
}
.brand .brand-mark { width: 34px; height: 34px; }
.wordmark {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: .04em;
}
.wordmark-bot { color: var(--accent); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-lg { min-height: 48px; padding: .75rem 1.4rem; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(180deg, #E0303F, var(--accent-btn));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 2px rgba(16, 24, 40, .12);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.btn-ghost { background: transparent; color: var(--text); }

.btn-wa {
  background: var(--wa);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 2px rgba(16, 24, 40, .12);
}
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: linear-gradient(180deg, #D62839, var(--accent-btn-hover)); }
  .btn-secondary:hover { background: var(--surface); border-color: var(--border-strong); }
  .btn-ghost:hover { background: var(--surface); }
  .btn-wa:hover { background: var(--wa-hover); }
  .btn-primary:hover .icon { transform: translateX(3px); }
  .nav-links a:hover { color: var(--text); background: var(--surface); }
}

/* ---------- Barra superior ---------- */
.site-header {
  --bg: #FFFFFF; --surface: #F2F5F8; --border: #E2E8EE; --border-strong: #CDD6DF;
  --text: #0F1B2D; --text-2: #4A586B; --focus: #1D3557;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  color: var(--text);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--border);
}
.site-header .btn { min-height: 40px; padding: .5rem .95rem; font-size: .9rem; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 1rem;
}
.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-links {
  display: flex;
  gap: .25rem;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-links a {
  display: block;
  padding: .5rem .7rem;
  white-space: nowrap;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: .95rem;
  text-decoration: none;
}
.nav-actions { display: flex; gap: .5rem; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.nav-toggle:active { transform: scale(.94); }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem var(--gutter) 1.25rem;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid var(--border);
  }
  .site-nav.is-open { display: flex; }
  .site-header:has(.site-nav.is-open) { background: rgba(255, 255, 255, .98); }
  /* Sin JS, el menú queda visible para no perder la navegación */
  .no-js .site-nav { display: flex; position: static; padding: 0 0 1rem; border: 0; }
  .no-js .header-inner { flex-wrap: wrap; }
  .no-js .nav-toggle { display: none; }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: .75rem .5rem; }
  .nav-actions { flex-direction: column; }
  .nav-actions .btn { width: 100%; min-height: 44px; }
}

/* ---------- Secciones ---------- */
.section {
  background: var(--bg);
  color: var(--text);
  padding: clamp(4rem, 9vw, 6.5rem) 0;
}
.section-head { max-width: 720px; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section-lead { color: var(--text-2); font-size: 1.075rem; max-width: 62ch; }
.center-head .section-lead { margin-left: auto; margin-right: auto; }
.center-head { margin-left: auto; margin-right: auto; text-align: center; }

.grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card .icon-lg { margin-bottom: 1rem; }
.tile, .persona, .step { transition: border-color 200ms ease, box-shadow 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover, .persona:hover, .step:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 4px rgba(15, 27, 45, .04), 0 18px 40px -16px rgba(15, 27, 45, .16);
  }
}
.card p { color: var(--text-2); }

/* Tarjetas con su color (.c-* en la tarjeta): tinte arriba y línea de acento */
.tile[class*="c-"], .card.persona, .spot.step {
  background: linear-gradient(180deg, color-mix(in srgb, var(--icon) 7%, #fff), #fff 60%);
}
.tile[class*="c-"]::before, .persona::before, .step::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--icon);
}

.checklist {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: .55rem;
  color: var(--text-2);
  font-size: .95rem;
}
.checklist li {
  position: relative;
  padding-left: 1.5rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: .5em;
  width: .7rem; height: .4rem;
  border-left: 2px solid var(--positive);
  border-bottom: 2px solid var(--positive);
  transform: rotate(-45deg);
}
.card p + .checklist { margin-top: .25rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(4rem, 8vw, 5.5rem);
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(640px 420px at 82% 22%, rgba(168, 218, 220, .45), transparent 70%),
    radial-gradient(520px 380px at 96% 78%, rgba(230, 57, 70, .10), transparent 70%),
    radial-gradient(560px 380px at 0% 0%, rgba(69, 123, 157, .10), transparent 70%),
    linear-gradient(180deg, #F7FAFB, #FFFFFF 80%);
}
.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(17, 19, 24, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 19, 24, .05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 35%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 60% 35%, #000 30%, transparent 75%);
}
.hero-grid > * { min-width: 0; }
.hero-grid {
  display: grid;
  gap: 3.5rem;
  align-items: center;
}
/* Dos columnas solo desde 1100 px: más angosto, la app no cabe junto al texto */
@media (min-width: 1100px) {
  .hero-grid { grid-template-columns: .95fr 1.2fr; gap: 3.5rem; }
}
/* Más estrecho (eje de ancho de la fuente) para que cada frase quepa en su línea */
.hero h1 { margin-bottom: 1.5rem; font-size: clamp(2.3rem, 3.8vw, 3rem); font-stretch: 86%; }
.hero h1 .tone { color: var(--accent-btn); }
.hero .lead {
  color: var(--text-2);
  font-size: clamp(1.05rem, 1.7vw, 1.2rem);
  max-width: 34rem;
  margin-bottom: 2rem;
}

.cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.cta-note { margin-top: .9rem; color: var(--text-2); font-size: .9rem; }
.btn-primary .icon { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
@media (max-width: 420px) {
  .cta-row .btn { flex: 1 1 100%; }
}

/* Visual del hero: escenario 3D con pantallas que rotan */
.hero-visual { position: relative; padding-top: 2.5rem; }
.stage { position: relative; perspective: 1600px; }
.scene {
  --rx: 6deg;
  --ry: -14deg;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));  /* con mouse, la inclinación la mueve un resorte en JS */
}
@media (max-width: 1099px) { .scene { --rx: 4deg; --ry: -6deg; } }

.ghost {
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #24395C, #111D31);
  border: 1px solid #33507C;
}
.ghost-1 { transform: translate3d(26px, -22px, -60px); opacity: .55; }
.ghost-2 { transform: translate3d(52px, -44px, -120px); opacity: .28; }

.app-window {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 50px 90px -30px rgba(17, 29, 49, .55), 0 18px 40px -20px rgba(17, 29, 49, .35);
}
.app-body { display: grid; grid-template-columns: 52px 1fr; }
.app-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .8rem 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.side-logo { width: 26px; height: 26px; margin-bottom: .5rem; color: var(--text); }
.side-logo svg { width: 100%; height: 100%; }
.side-item {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  color: var(--text-3);
  transition: background-color 300ms ease, color 300ms ease;
}
.side-item .icon { width: 17px; height: 17px; }
.side-item.is-active { background: rgba(230, 57, 70, .16); color: #F58A92; }
@media (max-width: 559px) { .app-body { grid-template-columns: 1fr; } .app-side { display: none; } }

/* Pantallas apiladas: todas ocupan la misma celda; la altura es la de la más alta */
.screens { display: grid; min-width: 0; }
/* Cambio de pantalla (Emil Kowalski): la salida es más rápida que la entrada y un
   desenfoque leve funde los dos estados para que no se vean dos cosas encimadas. */
.screen {
  grid-area: 1 / 1;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(24px);
  filter: blur(3px);
  transition: opacity 200ms ease, transform 200ms var(--ease-out), filter 200ms ease, visibility 0s linear 200ms;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  filter: none;
  transition: opacity 400ms var(--ease-out) 80ms, transform 500ms var(--ease-out) 80ms, filter 400ms ease 80ms, visibility 0s;
}
.screen.is-leaving { transform: translateX(-24px); }
.screen-pad { padding: 1rem; }
.screen-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .85rem; }
.screen-head .panel-title { margin: 0; }

.flow-body { display: grid; gap: 1px; background: var(--border); height: 100%; }
@media (min-width: 560px) { .flow-body { grid-template-columns: 1.15fr 1fr; } }
.flow-panel { background: var(--card); padding: 1rem; min-width: 0; }
.panel-title {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .85rem;
  color: var(--text-2);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.panel-title .icon { width: 15px; height: 15px; color: #A8DADC; }

.dte-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.dte-rows li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "code info amt" "code info status";
  align-items: center;
  column-gap: .65rem;
  row-gap: .2rem;
  padding: .55rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.dte-code {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(168, 218, 220, .14);
  color: #A8DADC;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 500;
}
.dte-rows .dte-code { grid-area: code; }
.dte-info { grid-area: info; display: grid; min-width: 0; line-height: 1.3; }
.dte-info b { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dte-info code { color: var(--text-3); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dte-amt { grid-area: amt; justify-self: end; font-family: var(--font-mono); font-size: .8rem; }
.status {
  grid-area: status;
  justify-self: end;
  padding: .05rem .45rem;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 600;
  white-space: nowrap;
}
.status.ok { background: color-mix(in srgb, var(--positive) 14%, transparent); color: var(--positive); }
.status.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
@media (max-width: 559px) {
  .dte-info code { display: none; }
  /* En el teléfono cada pantalla muestra solo su panel principal */
  .screen .flow-body > .flow-panel + .flow-panel { display: none; }
  .stage-controls { flex-wrap: wrap; gap: .6rem; }
  .stage-label { flex-basis: 100%; min-width: 0; text-align: center; }
}

.mini-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.mini-table th {
  padding: 0 0 .45rem;
  color: var(--text-3);
  font-size: .66rem;
  font-weight: 600;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table td {
  padding: .5rem 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}
.mini-table td:first-child { color: var(--text-2); }
.mini-table td + td { padding-left: .6rem; }
.screen-compras .mini-table td:first-child { font-family: var(--font-sans); white-space: normal; }
.mini-table th:nth-child(2) { text-align: left; }
.screen-compras .mini-table th:nth-child(2) { text-align: right; }
.mini-table tbody td:nth-child(2) { font-family: var(--font-sans); color: var(--text-2); text-align: left; }
.screen-compras .mini-table tbody td:nth-child(2) { font-family: var(--font-mono); color: var(--text); text-align: right; }
.mini-table tfoot td { border-bottom: 0; border-top: 1px solid var(--border-strong); font-weight: 600; color: var(--text); }
.balanced, .pill-ok {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .6rem;
  border-radius: var(--r-md);
  background: rgba(52, 211, 153, .1);
  color: #34D399;
  font-size: .76rem;
  font-weight: 600;
}
.balanced { margin-top: .85rem; }
.pill-ok { padding: .25rem .55rem; border-radius: 999px; white-space: nowrap; }
.balanced .icon, .pill-ok .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.tag-soft {
  padding: .2rem .55rem;
  border-radius: 999px;
  background: rgba(168, 218, 220, .12);
  color: #A8DADC;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Liquidación / estados */
.liq { display: grid; gap: .35rem; }
.liq-row, .liq-total {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: .8rem;
  color: var(--text-2);
}
.liq-row code, .liq-total code { color: var(--text); font-size: .78rem; }
.liq-row.strong { color: var(--text); font-weight: 600; padding-top: .35rem; border-top: 1px dashed var(--border); }
.liq-total {
  margin-top: .5rem;
  padding: .65rem .75rem;
  border-radius: var(--r-md);
  background: rgba(230, 57, 70, .12);
  color: var(--text);
  font-weight: 600;
}
.liq-total code { color: #F58A92; font-size: .9rem; font-weight: 600; }
.liq-bar { height: 8px; margin-bottom: .45rem; border-radius: 4px; background: var(--surface); overflow: hidden; }
.liq-bar i { display: block; height: 100%; border-radius: 4px; transform-origin: left; }
.b-red { background: linear-gradient(90deg, #E63946, #EC5762); }
.b-cyan { background: #A8DADC; }
.b-steel { background: #457B9D; }
.w100 { width: 100%; } .w10 { width: 10%; } .w2 { width: 3%; }

/* Facturación */
.invoice { display: grid; gap: .5rem; }
.inv-client { display: grid; margin: 0 0 .35rem; padding: .6rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); line-height: 1.35; }
.inv-client span { color: var(--text-3); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.inv-client b { font-size: .8rem; font-weight: 600; }
.emit-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.emit-steps li { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--text); }
.emit-steps .icon {
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--positive) 14%, transparent);
  color: var(--positive);
  stroke-width: 3;
}
.qr {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 74px;
  margin-top: 1rem;
  padding: 7px;
  background: #fff;
  border-radius: 8px;
}
.qr i { aspect-ratio: 1; background: #0C1524; border-radius: 1px; }
.qr i:nth-child(2), .qr i:nth-child(4), .qr i:nth-child(7), .qr i:nth-child(9), .qr i:nth-child(12),
.qr i:nth-child(14), .qr i:nth-child(16), .qr i:nth-child(18), .qr i:nth-child(20), .qr i:nth-child(23) { background: transparent; }

/* Barras de ventas */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: .5rem; }
.bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #457B9D, #24395C); transform-origin: bottom; }
.bars i.hot { background: linear-gradient(180deg, #EC5762, #A92B37); }
.h45 { height: 45%; } .h52 { height: 52%; } .h60 { height: 60%; } .h70 { height: 70%; } .h78 { height: 78%; } .h92 { height: 92%; }
.bars-x { display: flex; gap: 8px; margin-top: .4rem; }
.bars-x span { flex: 1; text-align: center; color: var(--text-3); font-size: .62rem; }

/* Conciliación */
.recon { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .5rem; }
.recon li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: .7rem;
  padding: .6rem .7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: .8rem;
}
.recon code { font-size: .74rem; }
.recon code:first-child { color: var(--text-3); }
.recon .pos { color: #34D399; }
.recon .status { grid-area: auto; }
.progress span { display: block; margin-bottom: .4rem; color: var(--text-2); font-size: .74rem; }
.track { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.track i { display: block; width: 66%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #457B9D, #A8DADC); transform-origin: left; }
@media (max-width: 559px) { .recon li { grid-template-columns: 1fr auto; } .recon code:first-child { display: none; } .recon .status { display: none; } }

/* Panel */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .6rem; }
.kpi { padding: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); display: grid; gap: .2rem; min-width: 0; }
.kpi span { color: var(--text-3); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b { font-family: var(--font-mono); font-size: .98rem; font-weight: 600; }
.kpi:nth-child(1) b { color: #A8DADC; }
.kpi:nth-child(3) b { color: #F58A92; }
.chart-card { padding: .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.chart-card .panel-title { margin-bottom: .4rem; }
.proj { display: block; width: 100%; height: 110px; }

/* Robot y tarjeta flotantes, por delante de la ventana */
.hero-robot {
  position: absolute;
  top: -2.75rem; right: -1rem;
  z-index: 3;
  width: clamp(92px, 11vw, 120px);
  padding: .7rem;
  background: linear-gradient(160deg, #24395C, #111D31);
  border: 1px solid #33507C;
  border-radius: 26px;
  box-shadow: 0 30px 50px -18px rgba(17, 29, 49, .6), 0 0 0 6px rgba(255, 255, 255, .6);
  color: var(--text);
  transform: translateZ(120px);
}
.hero-robot .brand-mark { display: block; width: 100%; height: auto; }
.float-card {
  position: absolute;
  left: -2.5rem; bottom: -1.6rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .65rem .9rem .65rem .65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 40px -18px rgba(17, 29, 49, .45);
  color: #0F1B2D;
  transform: translateZ(80px);
  line-height: 1.3;
}
.float-card b { display: block; font-size: .8rem; }
.float-card small { color: #4A586B; font-size: .7rem; }
.float-icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(230, 57, 70, .1);
  color: #C8202F;
}
.float-icon .icon { width: 17px; height: 17px; }
@media (max-width: 1100px) { .float-card { left: -.5rem; } .hero-robot { right: -.25rem; } }
@media (max-width: 559px) { .float-card { display: none; } .hero-robot { width: 76px; top: -2.25rem; border-radius: 20px; } }

/* Controles del recorrido */
.stage-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  margin-top: 2rem;
}
.stage-pause {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.stage-pause:active { transform: scale(.92); }
.stage-pause .icon { width: 14px; height: 14px; fill: currentColor; }
.stage-pause .icon-play, .stage-pause[aria-pressed="true"] .icon-pause { display: none; }
.stage-pause[aria-pressed="true"] .icon-play { display: block; }
.stage-dots { display: flex; gap: .35rem; }
.stage-dot {
  position: relative;
  width: 26px; height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.stage-dot::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--border-strong);
}
.stage-dot::after {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 4px;
  margin-top: -2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}
.stage-dot[aria-current="true"]::after { transform: scaleX(1); }
.motion .stage.is-playing .stage-dot.tick[aria-current="true"]::after { animation: dot-fill var(--dur, 5s) linear both; }
@keyframes dot-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.stage-label { min-width: 9.5rem; color: var(--text-2); font-size: .85rem; font-weight: 500; }

/* El momento animado de la página: lo que pasa dentro de cada pantalla del recorrido.
   Escalonado corto (70 ms entre elementos) para que todo termine antes del cambio. */
.motion .screen.is-active .a { animation: rise 380ms var(--ease-out) both; }
.motion .screen.is-active .a1 { animation-delay: 80ms; }
.motion .screen.is-active .a2 { animation-delay: 150ms; }
.motion .screen.is-active .a3 { animation-delay: 220ms; }
.motion .screen.is-active .a4 { animation-delay: 290ms; }
.motion .screen.is-active .a5 { animation-delay: 360ms; }
.motion .screen.is-active .a6 { animation-delay: 430ms; }
.motion .screen.is-active .a7 { animation-delay: 500ms; }
.motion .screen.is-active .a8 { animation-delay: 570ms; }
.motion .screen.is-active .status.a, .motion .screen.is-active .balanced.a, .motion .screen.is-active .pill-ok.a { animation-name: pop; }
.motion .screen.is-active .liq-bar i { animation: grow-x 600ms var(--ease-out) 300ms both; }
.motion .screen.is-active .track i { animation: grow-x 600ms var(--ease-out) 600ms both; }
.motion .screen.is-active .bars i.a { animation-name: grow-y; animation-duration: 500ms; }
.motion .screen.is-active .draw { stroke-dasharray: 260; animation: draw 900ms var(--ease-in-out) 250ms both; }
.motion .screen.is-active .draw-2 { animation: fade-in 300ms ease 1s both; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* Nunca desde scale(0): nada aparece de la nada */
@keyframes pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }

/* Marcos (navegador / teléfono) */
.browser-frame, .phone-frame {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: .6rem .8rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.browser-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.browser-bar .dot:nth-child(1) { background: #E63946; opacity: .8; }
.browser-bar .dot:nth-child(2) { background: #FBBF24; opacity: .7; }
.browser-bar .dot:nth-child(3) { background: #34D399; opacity: .7; }
.browser-url {
  margin-left: .75rem;
  padding: .15rem .6rem;
  background: var(--bg);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: .72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(127, 140, 160, .06) 14px 28px),
    var(--surface);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: .9rem;
  text-align: center;
  padding: 1rem;
}

/* ---------- Tarjetas ---------- */
.spot {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ---------- Para quién ---------- */
.persona { padding: 1.75rem; border-radius: 16px; }
.persona h3 { font-size: 1.2rem; }
.persona-tag {
  position: absolute;
  top: 1.5rem; right: 1.5rem;
  padding: .2rem .6rem;
  border: 1px solid color-mix(in srgb, var(--icon) 25%, transparent);
  background: color-mix(in srgb, var(--icon) 7%, transparent);
  border-radius: 999px;
  color: var(--icon);
  font-size: .72rem;
  font-weight: 600;
}
.persona { position: relative; overflow: hidden; }

/* ---------- Pasos ---------- */
.steps {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.step {
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem 1.5rem;
}
.step p { color: var(--text-2); }
.step-num {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--step, #C8202F) 12%, transparent);
  color: var(--step, #C8202F);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}
.step:nth-child(2) { --step: #3A6A88; }
.step:nth-child(3) { --step: #0A8C5B; }
.step { --icon: var(--step, #C8202F); }
.mini {
  margin-top: auto;
  padding-top: 1.5rem;
}
.mini-sources { display: flex; flex-wrap: wrap; gap: .5rem; }
.src {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 500;
}
.src .icon { width: 15px; height: 15px; color: var(--icon); }
.mini-entry .ln {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem 0;
  border-bottom: 1px dashed var(--border);
}
.mini-entry code { font-size: .78rem; color: var(--text); }
.bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--border-strong), var(--surface)); }
.w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.ok-line, .mini-ready li {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--positive);
  font-size: .8rem;
  font-weight: 600;
}
.mini-entry .ok-line { margin-top: .75rem; }
.ok-line .icon, .mini-ready .icon { width: 15px; height: 15px; stroke-width: 2.5; }
.mini-ready { list-style: none; margin-bottom: 0; display: grid; gap: .45rem; padding-left: 0; }
.mini-ready li {
  padding: .4rem .65rem;
  background: color-mix(in srgb, var(--positive) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--positive) 18%, transparent);
  border-radius: var(--r-md);
}

/* ---------- Funciones (bento) ---------- */
.bento { display: grid; gap: 1rem; }
@media (min-width: 680px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .bento { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
.tile { padding: 1.6rem; display: flex; flex-direction: column; }
.tile .icon-lg { margin-bottom: 1.1rem; }
.tile h3 { font-size: 1.2rem; margin-bottom: .6rem; }
.tile p { color: var(--text-2); }
.tile .checklist { font-size: .92rem; }
.tile p + .checklist { margin-top: .25rem; }
@media (min-width: 680px) {
  .tile-wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; align-items: center; }
  .tile-wide .mini { margin-top: 0; padding-top: 0; }
}
.tile-hero {
  background:
    linear-gradient(135deg, #FFFFFF, #F7F8FA);
}
.tile-hero h3 { font-size: 1.45rem; }

.mini-emit {
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 50px -24px rgba(16, 24, 40, .25);
}
.emit-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .7rem;
  padding-bottom: .9rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--border);
}
.emit-head .dte-code, .emit-head .dte-amt { grid-area: auto; }
/* En la tarjeta ancha .mini quita el padding superior; el recuadro lo necesita */
.tile-wide .mini-emit { padding-top: 1rem; }
.mini-emit .dte-code { background: rgba(69, 123, 157, .1); color: #3A6A88; }
.emit-info { display: grid; min-width: 0; line-height: 1.3; }
.emit-info b { font-size: .88rem; }
.emit-info code { color: var(--text-3); font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emit-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; position: relative; }
.emit-steps li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .85rem;
  color: var(--text);
}
.emit-steps .icon {
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--positive) 12%, transparent);
  color: var(--positive);
  stroke-width: 3;
}

.mini-chart { display: block; width: 100%; height: 90px; margin-top: auto; padding-top: 1rem; }
@media (min-width: 680px) {
  .tile-full { grid-column: 1 / -1; }
  .tile-full .mini-chart { height: 120px; padding-top: 0; }
}

.platform {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgba(69, 123, 157, .18);
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(69, 123, 157, .08), rgba(168, 218, 220, .24));
}
.platform-title {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-weight: 600;
}
.platform-title .icon { color: var(--icon); }
.pills { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.pills li {
  padding: .35rem .75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: .82rem;
}

/* ---------- Cumplimiento ---------- */
.compliance { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 960px) { .compliance { grid-template-columns: 1fr 1.1fr; gap: 4rem; } .compliance .section-head { margin-bottom: 0; } }
.compliance-extra {
  list-style: none;
  margin: 1.5rem 0 0; padding: 0;
  display: grid;
  gap: .6rem;
  color: var(--text);
  font-weight: 500;
}
.compliance-extra li { display: flex; align-items: center; gap: .6rem; }
.compliance-extra .icon {
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(10, 140, 91, .12);
  color: var(--positive);
  stroke-width: 3;
}
.dte-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.dte-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem .9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: .92rem;
  font-weight: 500;
}
.dark .dte-list li { background: rgba(255, 255, 255, .04); box-shadow: none; }
.dark .dte-list code { background: rgba(168, 218, 220, .1); border-color: rgba(168, 218, 220, .22); color: #A8DADC; }
.dark .compliance-extra .icon { background: rgba(52, 211, 153, .14); }
.dte-list code {
  min-width: 3.4rem;
  padding: .2rem .4rem;
  background: rgba(69, 123, 157, .1);
  border: 1px solid rgba(69, 123, 157, .2);
  border-radius: var(--r-sm);
  color: #1D3557;
  font-size: .8rem;
  text-align: center;
}

/* ---------- Teléfono ---------- */
.split { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1.1fr 1fr; gap: 4rem; } }
.split .checklist { margin-top: 1.5rem; }
.phone-wrap { position: relative; display: grid; place-items: center; }
.phone-wrap::before {
  content: "";
  position: absolute;
  top: 6%;
  width: 420px; height: 420px;
  max-width: 100%;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 35% 40%, rgba(168, 218, 220, .55), transparent),
    radial-gradient(closest-side at 70% 70%, rgba(230, 57, 70, .14), transparent);
  pointer-events: none;
}
.stage-phone { width: 100%; display: grid; justify-items: center; }
.scene-phone { --rx: 4deg; --ry: -18deg; width: min(290px, 82%); }
@media (max-width: 999px) { .scene-phone { --rx: 3deg; --ry: -10deg; } }

.phone-ghost {
  position: absolute;
  inset: 0;
  border-radius: 44px;
  background: linear-gradient(160deg, #24395C, #111D31);
  border: 1px solid #33507C;
  opacity: .35;
  transform: translate3d(38px, -26px, -90px);
}
.phone-frame {
  position: relative;
  padding: 12px;
  border-radius: 44px;
  background: linear-gradient(160deg, #24395C, #111D31 40%, #0C1524);
  border: 1px solid #33507C;
  box-shadow: 0 50px 80px -30px rgba(17, 29, 49, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.phone-notch {
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 78px; height: 20px;
  background: #050811;
  border-radius: 999px;
  z-index: 1;
}
.phone-screen {
  display: flex;
  flex-direction: column;
  height: 540px;
  padding: 3.25rem .85rem .7rem;
  border-radius: 34px;
  background: linear-gradient(180deg, #0C1524, #0E1A2C);
  overflow: hidden;
}
.phone-screen .screens { flex: 1; min-height: 0; }
.ps-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.ps-top .wordmark { font-size: 1rem; }
.ps-section { color: var(--text-2); font-size: .75rem; font-weight: 600; }
.ps-list, .ps-detail { display: flex; flex-direction: column; gap: .55rem; }
.ps-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "code info" "code status";
  column-gap: .6rem;
  row-gap: .3rem;
  align-items: center;
  padding: .65rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ps-card .dte-code { grid-area: code; }
.ps-card .status { grid-area: status; justify-self: start; }
.ps-info { grid-area: info; display: grid; line-height: 1.3; min-width: 0; }
.ps-info b { font-size: .8rem; }
.ps-info code { color: var(--text-3); font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-doc { display: flex; align-items: center; gap: .6rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border); }
.qr-sm { width: 64px; margin: .25rem auto 0; }
.ps-sheet {
  margin-top: .25rem;
  padding: .85rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
}
.ps-sheet p { margin-bottom: .6rem; font-size: .78rem; font-weight: 600; color: var(--text); }
.ps-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ps-actions span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .55rem;
  border-radius: 10px;
  background: var(--accent-btn);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
}
.ps-actions span + span { background: var(--elevated); color: var(--text); }
.ps-actions .icon { width: 14px; height: 14px; }
.ps-alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem;
  border-radius: 12px;
  background: rgba(251, 191, 36, .1);
  border: 1px solid rgba(251, 191, 36, .25);
  line-height: 1.3;
}
.ps-alert .icon { width: 20px; height: 20px; color: #FBBF24; }
.ps-alert b { display: block; font-size: .8rem; }
.ps-alert small { color: var(--text-2); font-size: .68rem; }
.ps-field { display: grid; gap: .2rem; padding: .6rem .7rem; border: 1px dashed var(--border-strong); border-radius: 10px; }
.ps-field span { color: var(--text-3); font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; }
.ps-field b { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.ps-btn { padding: .65rem; border-radius: 10px; background: var(--accent-btn); color: #fff; font-size: .8rem; font-weight: 600; text-align: center; }
.ps-hint { margin: .25rem 0 0; color: var(--text-2); font-size: .72rem; text-align: center; }
.ps-tile { display: grid; gap: .15rem; padding: .75rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.ps-tile span { color: var(--text-3); font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; }
.ps-tile > code { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.ps-tile small { color: var(--text-2); font-size: .7rem; }
.ps-tile small code { color: #A8DADC; }
.ps-detail .pill-ok { align-self: flex-start; }
.ps-detail .kpi b { font-size: 1.15rem; }
.kpi b.red { color: #F58A92; }
.ps-chart { padding: .75rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.bars-sm { height: 110px; gap: 6px; }

.ps-tabbar {
  display: flex;
  justify-content: space-around;
  margin: .6rem -.35rem 0;
  padding: .45rem .25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.ps-tabbar .side-item { width: 36px; height: 32px; }

/* Tarjetas flotantes del teléfono */
.float-card.fc-a { left: -7rem; right: auto; top: -.75rem; bottom: auto; transform: translateZ(90px); }
.float-card.fc-b { left: auto; right: -6rem; top: auto; bottom: -2.4rem; transform: translateZ(70px); }
.float-icon.green { background: rgba(10, 140, 91, .1); color: #0A8C5B; }
@media (max-width: 1100px) { .float-card.fc-a { left: -4rem; } .float-card.fc-b { right: -3.5rem; } }
@media (max-width: 559px) { .float-card.fc-a, .float-card.fc-b { display: none; } }
.stage-phone .stage-controls { margin-top: 4.25rem; }
@media (max-width: 559px) { .stage-phone .stage-controls { margin-top: 2.5rem; } }

/* ---------- FAQ ---------- */
.faq-layout { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) {
  .faq-layout { grid-template-columns: .8fr 1.2fr; gap: 4rem; }
  .faq-layout .section-head { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.faq { display: grid; gap: .75rem; }
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: border-color .2s ease;
}
.faq details[open] { border-color: var(--border-strong); }
/* Apertura animada donde el navegador lo permite (::details-content + interpolate-size) */
.faq details::details-content {
  height: 0;
  overflow: clip;
  transition: height 250ms var(--ease-out), content-visibility 250ms allow-discrete;
}
.faq details[open]::details-content { height: auto; }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: 14px;
  transition: background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .faq summary:hover { background: var(--surface); } }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon {
  width: 28px; height: 28px;
  padding: 6px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  transition: transform 200ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.faq details[open] summary .icon { transform: rotate(45deg); background: var(--text); color: var(--card); }
.faq details p { padding: 0 1.35rem 1.25rem; color: var(--text-2); }

/* ---------- Llamado final ---------- */
.cta-card {
  padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 4vw, 3rem);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(520px 300px at 0% 0%, rgba(168, 218, 220, .22), transparent 70%),
    radial-gradient(520px 300px at 100% 100%, rgba(230, 57, 70, .28), transparent 70%),
    linear-gradient(135deg, #1D3557, #0C1524);
  border: 1px solid #33507C;
  box-shadow: 0 40px 80px -40px rgba(17, 29, 49, .6);
}
.cta-robot {
  width: 84px;
  margin: 0 auto 1.75rem;
  padding: .6rem;
  border-radius: 22px;
  background: linear-gradient(160deg, #24395C, #111D31);
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .05), 0 20px 40px -14px rgba(0, 0, 0, .5);
  color: var(--text);
}
.cta-robot svg { display: block; width: 100%; height: auto; }
.cta-final h2 { font-size: clamp(1.9rem, 4.6vw, 3.2rem); max-width: 16ch; margin: 0 auto 2rem; }

/* ---------- Antes / Con ContaBot ---------- */
.versus { display: grid; gap: 1rem; }
@media (min-width: 760px) { .versus { grid-template-columns: 1fr 1fr; gap: 1.25rem; } }
.vs-card {
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.vs-after {
  border-color: color-mix(in srgb, var(--positive) 30%, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--positive) 6%, #fff), #fff 70%);
}
.vs-tag {
  display: inline-flex;
  margin-bottom: 1.25rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}
.vs-before .vs-tag { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.vs-after .vs-tag { background: color-mix(in srgb, var(--positive) 12%, transparent); color: var(--positive); }
.vs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.vs-list li { display: flex; align-items: flex-start; gap: .7rem; }
.vs-before li { color: var(--text-2); }
.vs-after li { color: var(--text); font-weight: 500; }
.vs-list .icon {
  width: 22px; height: 22px;
  padding: 4px;
  margin-top: .05rem;
  border-radius: 50%;
  stroke-width: 3;
}
.vs-before .icon { background: rgba(200, 32, 47, .08); color: #C8202F; }
.vs-after .icon { background: color-mix(in srgb, var(--positive) 12%, transparent); color: var(--positive); }

/* ---------- Solicitar demo ---------- */
.demo { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 960px) {
  .demo { grid-template-columns: .9fr 1.1fr; gap: 4rem; }
  .demo-copy { position: sticky; top: calc(var(--header-h) + 2rem); }
}
.contact-list { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .75rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .9rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, transform 160ms var(--ease-out);
}
.contact-item:active { transform: scale(.98); }
@media (hover: hover) and (pointer: fine) { .contact-item:hover { border-color: var(--border-strong); } }
.contact-item > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.contact-item small { color: var(--text-3); font-size: .8rem; }
.contact-item b { font-weight: 600; overflow-wrap: anywhere; }
.contact-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(230, 57, 70, .1);
  color: #C8202F;
}
.contact-icon.wa { background: color-mix(in srgb, var(--wa) 12%, transparent); color: var(--wa); }

.demo-form { display: grid; gap: 1.1rem; padding: clamp(1.25rem, 4vw, 2rem); }
.form-row { display: grid; gap: 1.1rem; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .4rem; min-width: 0; }
.field label { font-size: .92rem; font-weight: 500; }
.field label small { color: var(--text-3); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field select {
  appearance: none;
  padding-right: 2.4rem;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A586B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center / 18px;
}
.field select:invalid { color: var(--text-3); }
.field select option { color: var(--text); }
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none;
  border-color: #1D3557;
  box-shadow: 0 0 0 3px rgba(29, 53, 87, .15);
}
.field input:user-invalid, .field select:user-invalid { border-color: #C8202F; }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }
.form-actions .btn { flex: 1 1 210px; }
.form-note { margin: 0; color: var(--text-3); font-size: .85rem; }

/* ---------- WhatsApp flotante y barra fija del teléfono ---------- */
.wa-float {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .75rem 1.15rem .75rem .9rem;
  border-radius: 999px;
  background: var(--wa);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 30px -10px rgba(14, 122, 110, .6), 0 2px 6px rgba(15, 27, 45, .15);
  /* Entrada: 300 ms con ease-out */
  transition: transform 300ms var(--ease-out), opacity 300ms var(--ease-out), visibility 0s, background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) { .wa-float:hover { background: var(--wa-hover); } }
.wa-float:active { transform: scale(.96); }
/* Con JS aparece al pasar el hero (ver initMobileCta); sin JS queda siempre visible.
   Salida más rápida que la entrada (200 ms). */
html:not(.no-js) .wa-float:not(.is-visible) {
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.96);
  transition: transform 200ms ease, opacity 200ms ease, visibility 0s linear 200ms;
}
.wa-float .icon { width: 22px; height: 22px; }
.wa-float:focus-visible { outline: 2px solid #1D3557; outline-offset: 3px; }

.mobile-cta { display: none; }
@media (max-width: 900px) {
  .wa-float { display: none; }
  .mobile-cta {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: .5rem;
    padding: .6rem var(--gutter) calc(.6rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid #E2E8EE;
    visibility: hidden;
    transform: translateY(110%);
    /* Salida: 200 ms; entrada: 350 ms con la curva de cajón de iOS */
    transition: transform 200ms ease, visibility 0s linear 200ms;
  }
  .mobile-cta.is-visible { visibility: visible; transform: none; transition: transform 350ms var(--ease-drawer), visibility 0s; }
  .mobile-cta .btn { min-height: 44px; padding: .5rem .7rem; font-size: .9rem; }
  .mobile-cta .btn-wa { width: 44px; padding: 0; }
  .mobile-cta .btn-wa .icon { width: 22px; height: 22px; }
  .site-footer { padding-bottom: calc(2.5rem + 72px); }
}
@media (max-width: 359px) { .mobile-cta .btn { font-size: .8rem; padding: .5rem .45rem; } }

/* ---------- Pie ---------- */
.site-footer {
  --bg: #0C1524; --text: #E8EDF5; --text-2: #A4B3CA; --border: #24395C; --link: #E8EDF5;
  --focus: #F58A92;
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1.5rem;
  list-style: none;
  margin: 0; padding: 0;
  font-size: .95rem;
}
.footer-links a { color: var(--text-2); text-decoration: none; transition: color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .footer-links a:hover { color: var(--text); text-decoration: underline; } }
.copyright { margin: 0; color: var(--text-2); font-size: .9rem; width: 100%; }


/* ---------- Movimiento reducido ---------- */
/* Movimiento reducido: se quita el desplazamiento y se conservan los fundidos que
   explican un cambio (pantallas del recorrido, barra fija, botón de WhatsApp). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .screen, .screen.is-leaving { transform: none; filter: none; }
  .btn:active, .contact-item:active, .stage-pause:active, .nav-toggle:active, .wa-float:active { transform: none; }
  html:not(.no-js) .wa-float:not(.is-visible) { transform: none; }
  .faq details::details-content { transition: none; }
  .faq summary .icon { transition: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 900px) {
  .mobile-cta, .mobile-cta.is-visible { transform: none; opacity: 0; transition: opacity 200ms ease, visibility 0s linear 200ms; }
  .mobile-cta.is-visible { opacity: 1; transition: opacity 200ms ease, visibility 0s; }
}
