/* ==========================================================================
   Posfac — sistema de diseño compartido por las 13 páginas del sitio
   Páginas: <body class="page-home | page-product | page-legal">
   ========================================================================== */

:root {
  /* Color */
  --ink: #0b1f3a;
  --ink-2: #102748;
  --ink-3: #1a3762;
  --ink-deep: #071428;
  --brand: #2b64d1;
  --brand-600: #2456b8;
  --brand-50: #eef4ff;
  --brand-100: #dce7fd;
  --sky: #4fb3ea;
  --wa: #25d366;
  --wa-hover: #3ee07a;
  --on-wa: #052e16;
  --amber: #f5a524;
  --amber-50: #fff6e5;
  --red-50: #fff1f1;
  --green-50: #eafaf0;
  --green-700: #15803d;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --line: #e3e8f1;
  --line-strong: #cbd6e6;
  --text: #1c2b45;
  --muted: #51607a;
  --on-dark: #eef3fb;
  --on-dark-muted: #a9b8d0;

  /* Forma */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, 0.06), 0 1px 1px rgba(11, 31, 58, 0.04);
  --shadow: 0 1px 2px rgba(11, 31, 58, 0.05), 0 12px 32px -14px rgba(11, 31, 58, 0.22);
  --shadow-lg: 0 2px 6px rgba(11, 31, 58, 0.06), 0 30px 70px -24px rgba(11, 31, 58, 0.38);

  /* Movimiento (curvas de Emil Kowalski) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* Layout */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --container: 1180px;
  --gutter: 20px;
  --nav-h: 72px;
  --section-y: clamp(64px, 8vw, 104px);
}

/* ========== BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 700; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

::selection { background: var(--brand-100); color: var(--ink); }

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 2000;
  background: var(--wa);
  color: var(--on-wa);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 160ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

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

/* ========== BOTONES ========== */
.navbar-cta, .hero-cta, .hero-cta-secondary, .plan-cta, .nomina-cta, .migration-cta,
.cta-btn, .popup-btn, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 160ms var(--ease-out),
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    color 200ms ease;
}

.navbar-cta:active, .hero-cta:active, .hero-cta-secondary:active, .plan-cta:active,
.nomina-cta:active, .migration-cta:active, .cta-btn:active, .popup-btn:active, .btn:active {
  transform: scale(0.97);
}

.navbar-cta svg, .hero-cta svg, .cta-btn svg, .nomina-cta svg, .migration-cta svg, .plan-cta svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: currentColor;
}

/* WhatsApp: acción principal */
.navbar-cta, .hero-cta, .cta-btn, .nomina-cta, .migration-cta,
.plan-card.popular .plan-cta {
  background: var(--wa);
  color: var(--on-wa);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 22px -10px rgba(37, 211, 102, 0.75);
}

/* Secundario sobre fondo oscuro */
.hero-cta-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* Secundario sobre fondo claro */
.plan-cta {
  width: 100%;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}

.plan-cta.custom-cta { background: var(--ink); border-color: var(--ink); color: #fff; }

.popup-btn { width: 100%; background: var(--brand); color: #fff; }

@media (hover: hover) and (pointer: fine) {
  .navbar-cta:hover, .hero-cta:hover, .cta-btn:hover, .nomina-cta:hover, .migration-cta:hover,
  .plan-card.popular .plan-cta:hover { background: var(--wa-hover); }
  .hero-cta-secondary:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.4); }
  .plan-cta:hover { border-color: var(--ink); }
  .plan-cta.custom-cta:hover { background: var(--ink-3); border-color: var(--ink-3); }
  .popup-btn:hover { background: var(--brand-600); }
}

/* ========== NAVBAR ========== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 31, 58, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@supports (backdrop-filter: blur(1px)) {
  .navbar { background: rgba(11, 31, 58, 0.82); backdrop-filter: saturate(150%) blur(14px); -webkit-backdrop-filter: saturate(150%) blur(14px); }
}

.navbar-inner {
  max-width: calc(var(--container) + 2 * var(--gutter));
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-logo { flex: none; border-radius: 8px; }
.navbar-logo img { height: 36px; width: auto; }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  list-style: none;
}

.navbar-links > li { position: relative; }

.navbar-links > li > a, .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #c9d5e8;
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}

.navbar-links > li > a[aria-current="page"], .nav-trigger.is-current { color: #fff; }

.nav-trigger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; transition: transform 200ms var(--ease-out); }
.has-dropdown.open .nav-trigger svg { transform: rotate(180deg); }

@media (hover: hover) and (pointer: fine) {
  .navbar-links > li > a:hover, .nav-trigger:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
  .has-dropdown:hover .nav-trigger svg { transform: rotate(180deg); }
}

.navbar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 250px;
  padding: 8px;
  background: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s linear 180ms;
}

/* Puente invisible para no perder el hover entre el botón y el panel */
.has-dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 12px; }

.has-dropdown.open .navbar-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s;
}

@media (hover: hover) and (pointer: fine) and (min-width: 961px) {
  .has-dropdown:hover .navbar-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out), visibility 0s;
  }
}

.navbar-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c9d5e8;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

.navbar-dropdown a[aria-current="page"] { color: #fff; background: rgba(79, 179, 234, 0.14); }

@media (hover: hover) and (pointer: fine) {
  .navbar-dropdown a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
}

/* Menú de interfaces en dos grupos */
.navbar-mega {
  left: 50%;
  width: min(760px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 4px 12px;
  padding: 14px;
  transform: translate(-50%, -6px) scale(0.98);
  transform-origin: top center;
}

.has-dropdown.open .navbar-mega { transform: translate(-50%, 0); }

@media (hover: hover) and (pointer: fine) and (min-width: 961px) {
  .has-dropdown:hover .navbar-mega { transform: translate(-50%, 0); }
}

.mega-title {
  padding: 6px 12px 8px;
  color: var(--on-dark-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mega-links { display: grid; gap: 2px; }
.mega-group-verticals .mega-links { grid-template-columns: 1fr 1fr; }
.mega-group-modules { border-left: 1px solid rgba(255, 255, 255, 0.08); padding-left: 12px; }

.navbar-mega a strong { display: block; color: #fff; font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.navbar-mega a span { display: block; color: var(--on-dark-muted); font-size: 0.78rem; line-height: 1.35; margin-top: 2px; }

.navbar-mega .mega-all {
  margin-top: 8px;
  color: var(--sky);
  font-size: 0.85rem;
  font-weight: 600;
}

.navbar-cta { min-height: 42px; padding: 0 16px; font-size: 0.9rem; flex: none; }
.navbar-cta svg { width: 18px; height: 18px; }

.navbar-hamburger {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.navbar-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  border-radius: 2px;
  background: #e2e9f5;
  transition: transform 220ms var(--ease-out), opacity 160ms ease;
}

.navbar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.open span:nth-child(2) { opacity: 0; }
.navbar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .navbar-inner { gap: 10px; }
  /* En el DOM la hamburguesa va antes del menú (orden de foco); visualmente queda al final */
  .navbar-hamburger { display: block; order: 3; margin-left: 0; }
  .navbar-cta { order: 2; margin-left: auto; }

  .navbar-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--nav-h));
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 12px var(--gutter) 28px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--ink);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 40px -20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
  }

  .navbar-links.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
  }

  .navbar-links > li > a, .nav-trigger { width: 100%; justify-content: space-between; min-height: 50px; font-size: 1rem; }

  .has-dropdown::after { display: none; }

  .navbar-dropdown, .navbar-mega {
    position: static;
    width: auto;
    min-width: 0;
    display: none;
    margin: 2px 0 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .has-dropdown.open .navbar-dropdown { display: block; }
  .has-dropdown.open .navbar-mega { display: grid; grid-template-columns: 1fr; transform: none; }
  .mega-group-modules { border-left: 0; padding-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 6px; }
}

@media (max-width: 560px) {
  .mega-group-verticals .mega-links { grid-template-columns: 1fr; }
}

@media (max-width: 440px) {
  .navbar-logo img { height: 30px; }
  .navbar-cta { width: 44px; min-height: 44px; padding: 0; }
  .navbar-cta .navbar-cta-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ========== HERO (base oscura compartida) ========== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--on-dark);
  background:
    radial-gradient(60% 70% at 88% 0%, rgba(79, 179, 234, 0.24), transparent 62%),
    radial-gradient(55% 65% at 0% 100%, rgba(43, 100, 209, 0.32), transparent 60%),
    var(--ink);
}

/* Retícula sutil que se desvanece hacia los bordes */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.hero-inner {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(48px, 7vw, 88px) var(--gutter) clamp(64px, 8vw, 104px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px 14px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d6e2f3;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wa);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.18);
}

.hero-title {
  color: #fff;
  font-size: clamp(2.15rem, 4.6vw, 3.55rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.032em;
  margin-bottom: 20px;
}

.hero-subtitle {
  max-width: 34em;
  color: #c3d0e4;
  font-size: clamp(1.05rem, 1.5vw, 1.18rem);
  line-height: 1.65;
  margin-bottom: 32px;
}

.hero-cta-group { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.hero-cta, .hero-cta-secondary { min-height: 54px; padding: 0 26px; font-size: 1.02rem; }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--on-dark-muted);
  font-size: 0.9rem;
}

.hero-trust svg { width: 18px; height: 18px; flex: none; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--on-dark-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.breadcrumb a { color: #c9d5e8; text-decoration: none; }
.breadcrumb [aria-current] { color: #fff; font-weight: 600; }

@media (hover: hover) and (pointer: fine) {
  .breadcrumb a:hover { color: #fff; text-decoration: underline; }
}

/* Marco de imagen del hero */
.hero-visual { position: relative; }

.hero-frame {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
}

.hero-frame > img {
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  object-fit: cover;
  background: var(--ink-3);
}

.hero-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  font-size: 0.8rem;
  line-height: 1.3;
}

.hero-chip strong { display: block; font-size: 0.92rem; }
.hero-chip span { color: var(--muted); }
.hero-chip span strong { color: var(--ink); }

.hero-chip-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--green-50);
  color: var(--green-700);
}

.hero-chip-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-chip-icon.is-blue { background: var(--brand-50); color: var(--brand); }

.hero-chip-a { left: -22px; bottom: 48px; }
.hero-chip-b { right: -18px; top: 28px; }

/* Entrada al cargar (rara: primera impresión) */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero-visual { animation: hero-rise 560ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 50ms; }
  .hero-copy > :nth-child(3) { animation-delay: 100ms; }
  .hero-copy > :nth-child(4) { animation-delay: 150ms; }
  .hero-copy > :nth-child(5) { animation-delay: 200ms; }
  .hero-visual { animation-duration: 700ms; animation-delay: 120ms; }
  .hero-chip-a { animation: chip-in 520ms 520ms var(--ease-out) both; }
  .hero-chip-b { animation: chip-in 520ms 640ms var(--ease-out) both; }
}

@keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes chip-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 620px; margin-top: 12px; }
  .hero-chip-a { left: 12px; top: -18px; bottom: auto; }
  .hero-chip-b { right: 12px; top: -18px; }
}

@media (max-width: 520px) {
  .hero-cta-group { flex-direction: column; }
  .hero-cta, .hero-cta-secondary { width: 100%; }
  .hero-chip-b { display: none; }
  .hero-trust { align-items: flex-start; }
}

/* ========== HERO DEL HOME: slider de pantalla completa ==========
   Una diapositiva por interfaz: foto de fondo + textos propios. La barra de progreso de la
   pestaña activa (animación CSS) marca el tiempo; al terminar, posfac.js pasa a la siguiente. */
.hero-home {
  --hero-interval: 6500ms;
  min-height: max(640px, calc(100vh - var(--nav-h)));
  min-height: max(640px, calc(100svh - var(--nav-h)));
  display: flex;
  flex-direction: column;
  background: var(--ink);
}

.hero-home::before { display: none; }

.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--ink); }

.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1100ms ease, transform 7.5s linear;
}

.hero-bg-img.is-active { opacity: 1; transform: scale(1); }

/* Velo para que el texto se lea sobre cualquier foto */
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(8, 22, 44, 0.94) 0%, rgba(8, 22, 44, 0.84) 36%, rgba(8, 22, 44, 0.4) 70%, rgba(8, 22, 44, 0.18) 100%),
    linear-gradient(0deg, rgba(8, 22, 44, 0.9) 0%, rgba(8, 22, 44, 0) 38%);
}

.hero-home .hero-inner {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: clamp(48px, 9vh, 104px);
  padding-bottom: 28px;
}

.hero-slides { display: grid; max-width: 680px; }

.hero-slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 0s linear 240ms;
}

.hero-slide.is-active { opacity: 1; visibility: visible; transition: opacity 240ms ease, visibility 0s; }

.hero-home .hero-subtitle { color: #d6e1f0; }

.hero-arrow {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hero-cta-secondary:hover .hero-arrow { transform: translateX(3px); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-slide.is-active > * { animation: hero-rise 620ms var(--ease-out) both; }
  .hero-slide.is-active > :nth-child(1) { animation-delay: 150ms; }
  .hero-slide.is-active > :nth-child(2) { animation-delay: 200ms; }
  .hero-slide.is-active > :nth-child(3) { animation-delay: 250ms; }
  .hero-slide.is-active > :nth-child(4) { animation-delay: 300ms; }
}

/* Barra inferior: pausa, una pestaña por interfaz y contador.
   El relleno inferior deja espacio a la franja de beneficios, que se monta 44px sobre el hero. */
.hero-nav { position: relative; padding: 0 var(--gutter) 76px; }

.hero-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.hero-tabs::-webkit-scrollbar { display: none; }

.hero-tab {
  position: relative;
  flex: none;
  min-height: 44px;
  padding: 14px 12px 8px;
  border: 0;
  background: transparent;
  color: rgba(226, 234, 246, 0.6);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 160ms ease;
}

.hero-tab::before, .hero-tab::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  top: 4px;
  height: 2px;
  border-radius: 2px;
}

.hero-tab::before { background: rgba(255, 255, 255, 0.22); }
.hero-tab::after { background: var(--wa); transform: scaleX(0); transform-origin: left center; }
.hero-tab.is-active { color: #fff; }
.hero-tab.is-active::after { animation: hero-progress var(--hero-interval) linear forwards; }
.hero-home.is-holding .hero-tab.is-active::after { animation-play-state: paused; }
.hero-home.is-paused .hero-tab.is-active::after { animation: none; transform: scaleX(1); }

@keyframes hero-progress { to { transform: scaleX(1); } }

@media (hover: hover) and (pointer: fine) {
  .hero-tab:hover { color: #fff; }
}

.hero-count {
  flex: none;
  color: var(--on-dark-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hero-count-current { color: #fff; }

.slider-toggle {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}

.slider-toggle:active { transform: scale(0.94); }
.slider-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.slider-toggle .icon-play { display: none; }
.slider-toggle[aria-pressed="true"] .icon-play { display: block; }
.slider-toggle[aria-pressed="true"] .icon-pause { display: none; }

@media (hover: hover) and (pointer: fine) {
  .slider-toggle:hover { background: rgba(255, 255, 255, 0.12); }
}

@media (max-width: 760px) {
  /* En pantallas angostas el texto ocupa todo el ancho: velo más parejo */
  .hero-bg::after {
    background:
      linear-gradient(0deg, rgba(8, 22, 44, 0.95) 0%, rgba(8, 22, 44, 0.78) 45%, rgba(8, 22, 44, 0.62) 100%);
  }
  .hero-count { display: none; }
  .hero-tabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}

/* Página legal: hero compacto */
.page-legal .hero { text-align: center; }
.page-legal .hero-inner, .page-legal .hero > * { position: relative; }
.page-legal .hero {
  padding: clamp(56px, 8vw, 96px) var(--gutter) clamp(48px, 7vw, 80px);
}
.page-legal .hero-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.page-legal .hero-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--sky); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.page-legal .hero-title { max-width: 18em; margin: 0 auto 14px; font-size: clamp(2rem, 4vw, 3rem); }
.page-legal .hero-subtitle { margin: 0 auto 14px; max-width: 40em; }
.page-legal .hero-date { color: var(--on-dark-muted); font-size: 0.88rem; }
.page-legal .hero-law {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d6e2f3;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Página 404 */
.page-404 .hero-cta-group { justify-content: center; margin-top: 28px; }
.notfound { max-width: 860px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) var(--section-y); text-align: center; }
.notfound-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 20px; }
.notfound-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.notfound-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .notfound-links a:hover { border-color: var(--brand); color: var(--brand); }
}

/* ========== FRANJA DE BENEFICIOS (home) ========== */
.features-bar {
  position: relative;
  z-index: 2;
  margin-top: -44px;
  padding: 0 var(--gutter);
  /* La mitad superior deja ver el hero; la inferior continúa el fondo de "Nosotros" */
  background: linear-gradient(to bottom, transparent 44px, var(--surface) 44px);
}

.features-bar .features-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
}

.feature-item > span:first-child {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.8rem;
  font-weight: 800;
}

@media (max-width: 1020px) {
  .features-bar .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .features-bar { margin-top: -28px; background: linear-gradient(to bottom, transparent 28px, var(--surface) 28px); }
  .features-bar .features-grid { grid-template-columns: 1fr 1fr; padding: 10px; }
  .feature-item { padding: 8px; font-size: 0.85rem; }
}

/* ========== SECCIONES ========== */
.section, .nosotros-section, .modules-section, .pricing-section, .extras-section,
.faq-section, .ideal-for {
  padding: var(--section-y) var(--gutter);
}

.page-home .nosotros-section,
.page-home .pricing-section,
.page-home .faq-section,
.page-product .section,
.page-product .ideal-for,
.page-product .pricing-section { background: var(--surface); }

.page-home .section,
.page-home .extras-section,
.page-product .modules-section,
.page-product .faq-section { background: var(--bg); }

.page-product .ideal-for + .pricing-section { border-top: 1px solid var(--line); }

.section-header {
  max-width: 720px;
  margin: 0 auto clamp(36px, 5vw, 56px);
  text-align: center;
}

.section-badge, .nomina-badge, .migration-badge, .popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.section-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.028em;
  margin-bottom: 14px;
}

.section-subtitle { color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

/* Tarjeta base reutilizada */
.feature-card, .module-card, .interface-card, .extra-card, .nosotros-card, .ideal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease-out), box-shadow 220ms ease, border-color 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .feature-card:hover, .module-card:hover, .interface-card:hover, .extra-card:hover, .ideal-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
  }
}

/* Ícono en cuadro */
.feature-icon, .module-icon, .nosotros-card-icon, .extra-icon, .ideal-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--brand-50), #e4f3fc);
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(43, 100, 209, 0.1);
}

.feature-icon svg, .module-icon svg, .nosotros-card-icon svg, .extra-icon svg, .ideal-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ========== NOSOTROS (home) ========== */
.nosotros-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.nosotros-text h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; margin-bottom: 20px; }
.nosotros-text p { color: var(--muted); font-size: 1.04rem; margin-bottom: 16px; }
.nosotros-text p strong { color: var(--ink); }

.nosotros-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.nosotros-stat { padding: 18px 16px; text-align: left; }
.nosotros-stat + .nosotros-stat { border-left: 1px solid var(--line); }

.nosotros-stat-number {
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.nosotros-stat-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-top: 4px; }

.nosotros-cards { display: grid; gap: 14px; }
.nosotros-card { display: flex; align-items: flex-start; gap: 16px; padding: 22px; }
.nosotros-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.nosotros-card p { color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

@media (max-width: 860px) {
  .nosotros-inner { grid-template-columns: 1fr; }
}

/* ========== INTERFACES (home) ========== */
.interfaces-group-title {
  max-width: var(--container);
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interfaces-group-title::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }

.interfaces-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

/* Una tarjeta sola en la última fila se vuelve horizontal y ocupa todo el ancho.
   El selector cambia con el número de columnas: 3n+1 en escritorio, 2n+1 en tablet. */
@media (min-width: 1021px) {
  .interfaces-grid > .interface-card:last-child:nth-child(3n + 1) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
  }
  .interfaces-grid > .interface-card:last-child:nth-child(3n + 1) > .interface-thumbnail { grid-row: 1 / -1; aspect-ratio: auto; min-height: 300px; }
  .interfaces-grid > .interface-card:last-child:nth-child(3n + 1) > :not(.interface-thumbnail) { grid-column: 2; }
  .interfaces-grid > .interface-card:last-child:nth-child(3n + 1) > .interface-header { padding-top: 32px; }
  .interfaces-grid > .interface-card:last-child:nth-child(3n + 1) > .interface-link { align-self: end; }
}

@media (min-width: 641px) and (max-width: 1020px) {
  .interfaces-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interfaces-grid > .interface-card:last-child:nth-child(2n + 1) {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
  }
  .interfaces-grid > .interface-card:last-child:nth-child(2n + 1) > .interface-thumbnail { grid-row: 1 / -1; aspect-ratio: auto; min-height: 280px; }
  .interfaces-grid > .interface-card:last-child:nth-child(2n + 1) > :not(.interface-thumbnail) { grid-column: 2; }
  .interfaces-grid > .interface-card:last-child:nth-child(2n + 1) > .interface-header { padding-top: 28px; }
  .interfaces-grid > .interface-card:last-child:nth-child(2n + 1) > .interface-link { align-self: end; }
}

@media (max-width: 640px) {
  .interfaces-grid { grid-template-columns: 1fr; }
}

.interfaces-grid + .interfaces-group-title { margin-top: 48px; }

.interface-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.interface-thumbnail { aspect-ratio: 16 / 10; overflow: hidden; background: var(--brand-50); }

.interface-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .interface-card:hover .interface-thumbnail img { transform: scale(1.04); }
  .interface-card:hover .interface-link { gap: 10px; }
}

.interface-header { padding: 22px 24px 0; }
.interface-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.015em; }
.interface-desc { padding: 8px 24px 0; color: var(--muted); font-size: 0.95rem; line-height: 1.6; }

.interface-features { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 24px 0; }

.interface-feature-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: #3a4a66;
  font-size: 0.78rem;
  font-weight: 600;
}

.interface-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding: 20px 24px 22px;
  color: var(--brand);
  font-size: 0.93rem;
  font-weight: 700;
  transition: gap 200ms var(--ease-out);
}

/* ========== MICROSITIO: CARACTERÍSTICAS Y MÓDULOS ========== */
.page-product .features-grid, .modules-grid, .ideal-grid, .extras-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.page-product .features-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

.feature-card { padding: 28px; }
.feature-card .feature-icon { margin-bottom: 20px; }
.feature-title { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.feature-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.6; }

.modules-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

/* Con 4 módulos, una cuadrícula 2×2 evita una tarjeta huérfana */
@media (min-width: 761px) {
  .modules-grid:has(> .module-card:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.module-card { padding: 28px; }
.module-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.module-icon { background: var(--ink); color: #fff; box-shadow: none; }
.module-title { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.01em; }

.module-list { list-style: none; }

.module-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-top: 1px solid var(--line);
  color: #3a4a66;
  font-size: 0.94rem;
  line-height: 1.5;
}

.module-list li:first-child { border-top: 0; }

.module-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.ideal-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
.ideal-card { padding: 26px 20px; text-align: center; }
.ideal-card .ideal-icon { margin: 0 auto 14px; }
.ideal-title { font-size: 1rem; font-weight: 700; }

/* ========== PRECIOS ========== */
.planes-grid {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  padding: 30px 26px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 220ms var(--ease-out), box-shadow 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
}

.plan-card.custom { grid-column: 1 / -1; }

.plan-nombre { color: var(--ink); font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }

.plan-precio {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.plan-precio span, .plan-precio-custom span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
}

.plan-precio-custom {
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.plan-precio-custom span { display: block; margin-top: 4px; }

.plan-ahorro {
  align-self: flex-start;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.8rem;
  font-weight: 700;
}

.plan-descripcion { margin: 14px 0 20px; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

.plan-features {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.plan-feature { display: flex; align-items: flex-start; gap: 10px; color: #33415c; font-size: 0.92rem; line-height: 1.45; }

.plan-feature-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green-700);
  font-size: 0.7rem;
  font-weight: 800;
}

.plan-cta { margin-top: auto; }

.plan-badge {
  position: absolute;
  top: 22px;
  right: 22px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber);
  color: #3a2300;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Plan destacado */
.plan-card.popular {
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(79, 179, 234, 0.22), transparent 60%),
    var(--ink);
  border-color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.plan-card.popular .plan-nombre,
.plan-card.popular .plan-precio { color: #fff; }
.plan-card.popular .plan-precio span,
.plan-card.popular .plan-descripcion { color: var(--on-dark-muted); }
.plan-card.popular .plan-features { border-top-color: rgba(255, 255, 255, 0.12); }
.plan-card.popular .plan-feature { color: #dbe5f3; }
.plan-card.popular .plan-feature-icon { background: rgba(37, 211, 102, 0.16); color: var(--wa); }
.plan-card.popular .plan-ahorro { background: rgba(37, 211, 102, 0.16); color: #7ef0a8; }

/* Plan local personalizado (instalación en servidor propio, por cotización) */
.plan-card.custom { background: linear-gradient(180deg, var(--amber-50), #fff); border-color: #f4dfb5; }
.plan-card.custom .plan-badge {
  position: static;
  justify-self: start;
  align-self: flex-start;
  margin-bottom: 12px;
  background: var(--ink);
  color: #fff;
}

/* Escritorio: el plan personalizado ocupa toda la fila, en horizontal */
@media (min-width: 1021px) {
  .plan-card.custom {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    align-content: start;
    column-gap: 40px;
  }
  .plan-card.custom > * { grid-column: 1; }
  .plan-card.custom > .plan-features {
    grid-column: 2;
    grid-row: 1 / span 6;
    grid-template-columns: 1fr 1fr;
    align-self: center;
    gap: 14px 24px;
    margin: 0;
    padding: 0 0 0 40px;
    border-top: 0;
    border-left: 1px solid var(--line);
  }
  .plan-card.custom .plan-cta { margin-top: 8px; }
}

/* Tablet ancha: los tres planes en la nube en una fila más compacta */
@media (min-width: 821px) and (max-width: 1020px) {
  .planes-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .plan-card { grid-column: span 1; padding: 26px 20px 22px; }
  .plan-card.custom { grid-column: 1 / -1; }
  .plan-precio { font-size: 1.75rem; }
}

/* Celular y tablet angosta: una columna, con el plan destacado primero */
@media (max-width: 820px) {
  .planes-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .plan-card, .plan-card.custom { grid-column: 1 / -1; }
  .plan-card.popular { order: -1; }
}

.pricing-note {
  max-width: 860px;
  margin: 32px auto 0;
  padding: 18px 22px 18px 54px;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.pricing-note::before {
  content: 'i';
  position: absolute;
  left: 20px;
  top: 19px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  font-style: normal;
}

.pricing-note p + p { margin-top: 8px; }
.pricing-note strong { color: var(--ink); }

/* ========== COMPLEMENTO DE CONTABILIDAD (debajo de los planes) ========== */
.addon-card {
  max-width: var(--container);
  margin: 24px auto 0;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px 28px;
  background: linear-gradient(90deg, var(--brand-50), var(--surface) 65%);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
}

.addon-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}

.addon-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.addon-badge {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--brand-100);
  color: var(--brand-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.addon-title { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 4px; }
.addon-desc { color: var(--muted); font-size: 0.93rem; line-height: 1.55; }

.addon-prices { display: flex; gap: 22px; }
.addon-prices p { display: flex; flex-direction: column; line-height: 1.2; }

.addon-prices strong {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.addon-prices span { margin-top: 2px; color: var(--muted); font-size: 0.8rem; font-weight: 600; }

.addon-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--brand);
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .addon-link:hover .hero-arrow { transform: translateX(3px); }
}

@media (max-width: 960px) {
  .addon-card { grid-template-columns: auto minmax(0, 1fr); }
  .addon-prices, .addon-link { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .addon-card { padding: 20px 18px; }
  .addon-icon { width: 44px; height: 44px; }
  .addon-prices { gap: 16px; }
  .addon-prices strong { font-size: 1.35rem; }
}

/* ========== NÓMINA ELECTRÓNICA ========== */
.nomina-banner {
  max-width: var(--container);
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 56px);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.nomina-banner > * { grid-column: 1; }
.nomina-banner > .nomina-table-wrap { grid-column: 2; grid-row: 1 / span 8; }

.nomina-badge { justify-self: start; background: var(--green-50); color: var(--green-700); }
.nomina-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; margin-bottom: 14px; }
.nomina-desc { color: var(--muted); font-size: 1rem; margin-bottom: 18px; }
.nomina-desc strong, .nomina-combo strong, .nomina-contadores strong { color: var(--ink); }

.nomina-combo, .nomina-contadores {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  color: #3a4a66;
  font-size: 0.92rem;
  line-height: 1.6;
}

.nomina-cta { justify-self: start; margin: 10px 0 14px; }
.nomina-terms { color: var(--muted); font-size: 0.82rem; line-height: 1.55; }

.nomina-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.nomina-table, .terms-table, .data-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }

.nomina-table th {
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
}

.nomina-table th:last-child, .nomina-table td:last-child { text-align: right; }
.nomina-table td { padding: 12px 18px; border-top: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.nomina-table td:first-child { font-weight: 700; }
.nomina-table tbody tr:nth-child(even) td { background: #fafbfd; }

.nomina-table td:last-child { white-space: nowrap; }

@media (max-width: 900px) {
  .nomina-banner { grid-template-columns: 1fr; }
  .nomina-banner > .nomina-table-wrap { grid-column: 1; grid-row: auto; margin-bottom: 18px; }
}

@media (max-width: 520px) {
  .nomina-table th, .nomina-table td { padding-left: 14px; padding-right: 14px; }
  .nomina-cta, .migration-cta, .cta-btn { width: 100%; }
}

/* ========== PAQUETES DE DOCUMENTOS ========== */
.docs-banner {
  max-width: var(--container);
  margin: clamp(48px, 6vw, 72px) auto 0;
  padding: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  column-gap: clamp(28px, 4vw, 56px);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.docs-banner > * { grid-column: 1; }
.docs-banner > .docs-table-wrap { grid-column: 2; grid-row: 1 / span 8; }

.docs-badge {
  justify-self: start;
  display: inline-flex;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.docs-title { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; margin-bottom: 14px; }
.docs-desc { color: var(--muted); font-size: 1rem; margin-bottom: 18px; }
.docs-desc strong, .docs-tip strong { color: var(--ink); }

.docs-tip {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  color: #3a4a66;
  font-size: 0.92rem;
  line-height: 1.6;
}

.docs-includes { list-style: none; display: grid; gap: 8px; margin-bottom: 22px; }

.docs-includes li {
  position: relative;
  padding-left: 30px;
  color: #33415c;
  font-size: 0.93rem;
  line-height: 1.5;
}

.docs-includes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.docs-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-bottom: 14px;
  padding: 0 22px;
  border-radius: 12px;
  background: var(--wa);
  color: var(--on-wa);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 8px 22px -10px rgba(37, 211, 102, 0.75);
  transition: transform 160ms var(--ease-out), background-color 200ms ease;
}

.docs-cta svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.docs-cta:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .docs-cta:hover { background: var(--wa-hover); }
}

.docs-terms { color: var(--muted); font-size: 0.82rem; line-height: 1.55; }

.docs-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.docs-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }

.docs-table th {
  padding: 13px 14px;
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-align: right;
}

.docs-table td { padding: 10px 14px; border-top: 1px solid var(--line); color: #3a4a66; text-align: right; white-space: nowrap; }
.docs-table th:first-child, .docs-table td:first-child { text-align: left; }
.docs-table td:first-child { color: var(--ink); font-weight: 700; }
.docs-table td:nth-child(3) { color: var(--ink); font-weight: 700; }
.docs-table td:last-child { color: var(--green-700); font-weight: 600; }
.docs-table tbody tr:nth-child(even) td { background: #fafbfd; }

@media (max-width: 900px) {
  .docs-banner { grid-template-columns: 1fr; }
  .docs-banner > .docs-table-wrap { grid-column: 1; grid-row: auto; margin-bottom: 18px; }
}

@media (max-width: 600px) {
  .docs-banner { padding: 26px 18px; }
  .docs-col-base { display: none; }
  .docs-table-wrap { overflow-x: auto; }
  .docs-table { font-size: 0.86rem; }
  .docs-table th, .docs-table td { padding-left: 10px; padding-right: 10px; }
  .docs-cta { width: 100%; }
}

/* ========== MIGRACIÓN ========== */
.migration-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: var(--container);
  margin: 24px auto 0;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 56px);
  border-radius: 26px;
  text-align: center;
  color: var(--on-dark);
  background:
    radial-gradient(50% 80% at 0% 0%, rgba(43, 100, 209, 0.45), transparent 60%),
    radial-gradient(40% 70% at 100% 100%, rgba(37, 211, 102, 0.18), transparent 60%),
    var(--ink);
}

.migration-banner > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.migration-badge { background: rgba(37, 211, 102, 0.16); color: #7ef0a8; }
.migration-title { color: #fff; font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 800; margin-bottom: 18px; }

.migration-logos { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 20px; }

.migration-logo-name {
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
}

.migration-desc { color: #c9d5e8; font-size: 1.02rem; margin-bottom: 10px; }
.migration-desc strong { color: #fff; }
.migration-extra { color: var(--on-dark-muted); font-size: 0.92rem; margin-bottom: 26px; }
.migration-terms { margin-top: 16px; color: var(--on-dark-muted); font-size: 0.82rem; }
.migration-terms a { color: var(--sky); }

/* ========== SERVICIOS ADICIONALES (home) ========== */
.extras-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.extra-card { padding: 28px; }
.extra-card .extra-icon { margin-bottom: 18px; }
.extra-nombre { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.extra-precio { color: var(--ink); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.extra-desc { color: var(--muted); font-size: 0.93rem; }

/* ========== PREGUNTAS FRECUENTES ========== */
.faq-list {
  max-width: 860px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.faq-item + .faq-item { border-top: 1px solid var(--line); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 18px 24px;
  color: var(--ink);
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '';
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1f3a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform 220ms var(--ease-out), background-color 160ms ease;
}

.faq-item[open] summary::after { transform: rotate(180deg); background-color: var(--brand-50); }

@media (hover: hover) and (pointer: fine) {
  .faq-item summary:hover { color: var(--brand); }
}

.faq-answer { padding: 0 24px 22px; color: var(--muted); font-size: 0.98rem; line-height: 1.7; }
.faq-answer strong { color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .faq-item[open] .faq-answer { animation: faq-in 260ms var(--ease-out); }
}

@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } }

.faq-more { max-width: 860px; margin: 24px auto 0; text-align: center; font-weight: 700; }
.faq-more a { text-decoration: none; }

@media (hover: hover) and (pointer: fine) {
  .faq-more a:hover { text-decoration: underline; }
}

/* ========== CTA FINAL ========== */
.cta-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--section-y) var(--gutter);
  text-align: center;
  color: var(--on-dark);
  background:
    radial-gradient(45% 80% at 50% 120%, rgba(37, 211, 102, 0.22), transparent 70%),
    radial-gradient(40% 70% at 10% 0%, rgba(43, 100, 209, 0.4), transparent 65%),
    var(--ink);
}

.cta-section > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.cta-title { color: #fff; font-size: clamp(1.9rem, 4vw, 2.9rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 16px; }
.cta-subtitle { color: #c3d0e4; font-size: 1.12rem; margin-bottom: 32px; }
.cta-btn { min-height: 56px; padding: 0 30px; font-size: 1.05rem; }

/* ========== FOOTER ========== */
.footer { background: var(--ink-deep); color: var(--on-dark-muted); padding: 64px var(--gutter) 28px; }

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.footer-brand img { height: 38px; width: auto; margin-bottom: 18px; }
.footer-tagline { max-width: 30em; color: #c3d0e4; font-size: 0.95rem; margin-bottom: 14px; }
.footer-company { font-size: 0.88rem; }
.footer-contact { margin-top: 6px; font-size: 0.88rem; }
.footer-contact a { color: #fff; text-decoration: none; font-weight: 600; }

.footer-social { display: flex; gap: 10px; margin-top: 20px; }

.footer-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #dbe5f3;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.footer-social a:active { transform: scale(0.95); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }

.footer-title { margin-bottom: 14px; color: #fff; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.footer-col ul { list-style: none; display: grid; gap: 2px; }

.footer-col a {
  display: inline-block;
  padding: 5px 0;
  color: var(--on-dark-muted);
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .footer-col a:hover, .footer-contact a:hover { color: #fff; text-decoration: underline; }
  .footer-social a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
}

.footer-bottom {
  max-width: var(--container);
  margin: 48px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* ========== POPUP CAMBIO DE NOMBRE ========== */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 20, 40, 0.62);
  opacity: 0;
  transition: opacity 200ms ease;
}

@supports (backdrop-filter: blur(1px)) {
  .popup-overlay { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
}

.popup-overlay[hidden] { display: none; }
.popup-overlay.is-open { opacity: 1; }

.popup-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 36px 32px 30px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  opacity: 0;
  transform: scale(0.96) translateY(6px);
  transition: opacity 240ms var(--ease-out), transform 240ms var(--ease-out);
}

.popup-overlay.is-open .popup-card { opacity: 1; transform: none; }
.popup-overlay.is-closing { transition-duration: 160ms; }
.popup-overlay.is-closing .popup-card { transition-duration: 160ms; }

.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .popup-close:hover { background: var(--bg); color: var(--ink); }
}

.popup-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 18px; }

.popup-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 1.25rem;
  font-weight: 800;
}

.popup-old-name { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.popup-arrow { color: var(--brand); }
.popup-new-name { color: var(--brand); }
.popup-text { color: var(--muted); font-size: 0.95rem; line-height: 1.65; margin-bottom: 24px; }
.popup-text strong { color: var(--ink); }

/* ========== PÁGINAS LEGALES ========== */
.page-legal .content {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) var(--section-y);
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  column-gap: 56px;
  align-items: start;
}

.page-legal .toc {
  grid-column: 1;
  grid-row: 1 / span 99;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.page-legal .toc-title { margin-bottom: 12px; color: var(--ink); font-size: 0.95rem; font-weight: 700; letter-spacing: 0; }
.page-legal .toc-list { list-style: none; counter-reset: toc; display: grid; gap: 1px; }

.page-legal .toc-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .page-legal .toc-list a:hover { background: var(--bg); color: var(--ink); }
}

.page-legal .section {
  grid-column: 2;
  padding: 0 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
  background: none;
}

.page-legal .section:last-of-type { border-bottom: 0; }

.page-legal .section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  letter-spacing: -0.02em;
}

.page-legal .section-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}

.page-legal .section-content { color: #33415c; font-size: 1rem; line-height: 1.75; }
.page-legal .section-content > * + * { margin-top: 14px; }
.page-legal .section-content ul, .page-legal .section-content ol { padding-left: 22px; }
.page-legal .section-content li + li { margin-top: 6px; }
.page-legal .section-content li::marker { color: var(--brand); }
.page-legal .section-content h3 { margin-top: 26px; font-size: 1.08rem; }
.page-legal .section-content strong { color: var(--ink); }

.page-legal .highlight-box, .page-legal .warning-box, .page-legal .danger-box, .page-legal .info-box {
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
  border-left-width: 4px;
  font-size: 0.95rem;
}

.page-legal .highlight-box { background: var(--brand-50); border-color: var(--brand-100); border-left-color: var(--brand); }
.page-legal .info-box { background: #ecf7fd; border-color: #cdeaf9; border-left-color: var(--sky); }
.page-legal .warning-box { background: var(--amber-50); border-color: #f6e2bb; border-left-color: var(--amber); }
.page-legal .danger-box { background: var(--red-50); border-color: #f7d4d4; border-left-color: #dc2626; }

.page-legal .definitions-list, .page-legal .definitions-grid, .page-legal .rights-grid { display: grid; gap: 12px; }
.page-legal .definitions-grid, .page-legal .rights-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }

.page-legal .definition-item, .page-legal .right-card, .page-legal .contact-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page-legal .definition-term, .page-legal .right-title { color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.page-legal .definition-desc, .page-legal .right-desc { color: var(--muted); font-size: 0.93rem; line-height: 1.6; }
.page-legal .right-icon, .page-legal .contact-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-50);
  color: var(--brand);
}

.page-legal .right-icon { margin-bottom: 10px; }

.page-legal .right-icon svg, .page-legal .contact-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-legal .contact-card h3 { margin: 0 0 12px; }
.page-legal .contact-item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.page-legal .contact-item:first-of-type { border-top: 0; }
.page-legal .contact-text strong { display: block; }

.page-legal .table-container { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.page-legal .terms-table th, .page-legal .data-table th { padding: 12px 16px; background: var(--ink); color: #fff; font-size: 0.85rem; text-align: left; }
.page-legal .terms-table td, .page-legal .data-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
.page-legal .terms-table tbody tr:nth-child(even) td, .page-legal .data-table tbody tr:nth-child(even) td { background: #fafbfd; }

@media (max-width: 960px) {
  /* minmax(0, 1fr): las tablas anchas se desplazan dentro de su contenedor sin ensanchar la página */
  .page-legal .content { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .page-legal .toc { position: static; grid-row: auto; max-height: none; }
  .page-legal .section { grid-column: 1; }
}

/* ========== AVISO DE COOKIES ========== */
/* Debajo del popup de cambio de nombre (3000) y encima del navbar y de "volver arriba" */
.cookie-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 2500;
  width: min(440px, calc(100% - 40px));
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -24px rgba(11, 31, 58, 0.45);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 260ms var(--ease-out);
}

.cookie-banner.is-open { opacity: 1; transform: none; }
.cookie-title { margin-bottom: 6px; color: var(--ink); font-size: 1rem; font-weight: 800; }
.cookie-status { margin-top: 8px; color: var(--ink); font-weight: 600; }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

.cookie-btn {
  min-height: 44px;
  padding: 0 16px;
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
  font-size: 0.92rem;
}

.cookie-btn-accept { background: var(--ink); border-color: var(--ink); color: #fff; }

.footer-cookies {
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .cookie-btn:hover { border-color: var(--ink); }
  .cookie-btn-accept:hover { background: var(--ink-3); border-color: var(--ink-3); }
  .footer-cookies:hover { color: #fff; }
}

@media (max-width: 520px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transform: none; transition: opacity 180ms ease; }
}

/* ========== VOLVER ARRIBA ========== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s linear 200ms;
}

.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s; }
.back-to-top:active { transform: scale(0.95); }

/* ========== ANIMACIONES Y MICROINTERACCIONES ========== */

/* Navbar: más sólido y con sombra al hacer scroll */
.navbar { transition: background-color 200ms ease, box-shadow 200ms ease; }
.navbar.is-scrolled { box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.5); }

@supports (backdrop-filter: blur(1px)) {
  .navbar.is-scrolled { background: rgba(11, 31, 58, 0.92); }
}

/* Barra de progreso de lectura bajo el navbar (animación ligada al scroll, sin JavaScript) */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .navbar::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 2px;
      background: linear-gradient(90deg, var(--wa), var(--sky));
      transform: scaleX(0);
      transform-origin: 0 50%;
      animation: page-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@keyframes page-progress { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: no-preference) {
  /* Punto verde "en vivo" del hero */
  .hero-eyebrow-dot { position: relative; }
  .hero-eyebrow-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--wa);
    animation: ping 2.4s var(--ease-out) infinite;
  }

  /* Brillo ambiental que se desplaza lento detrás del CTA final */
  .cta-section::before {
    content: '';
    position: absolute;
    inset: -20%;
    z-index: -1;
    background:
      radial-gradient(32% 42% at 30% 40%, rgba(79, 179, 234, 0.2), transparent 70%),
      radial-gradient(28% 38% at 70% 72%, rgba(37, 211, 102, 0.14), transparent 70%);
    animation: drift 16s ease-in-out infinite alternate;
  }

  /* Micrositios: la insignia del hero flota suavemente después de entrar */
  .hero-product .hero-chip-a {
    animation: chip-in 520ms 520ms var(--ease-out) both, chip-float 4.8s 1.2s ease-in-out infinite alternate;
  }
}

@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes drift { to { transform: translate3d(6%, -4%, 0) rotate(6deg); } }
@keyframes chip-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }

/* Micrositios: perspectiva para la inclinación 3D de la foto (la mueve posfac.js con un resorte) */
.hero-product .hero-visual { perspective: 1200px; }
.hero-product .hero-frame { transform-style: preserve-3d; }

/* Destello que cruza los botones de WhatsApp al pasar el mouse */
.hero-cta, .cta-btn, .docs-cta, .nomina-cta, .migration-cta, .navbar-cta, .plan-card.popular .plan-cta {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-cta::after, .cta-btn::after, .docs-cta::after, .nomina-cta::after, .migration-cta::after,
.navbar-cta::after, .plan-card.popular .plan-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%);
  transform: translateX(-120%);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero-cta:hover::after, .cta-btn:hover::after, .docs-cta:hover::after, .nomina-cta:hover::after,
  .migration-cta:hover::after, .navbar-cta:hover::after, .plan-card.popular .plan-cta:hover::after {
    transform: translateX(120%);
    transition: transform 700ms var(--ease-out);
  }

  /* Íconos de tarjetas: pequeño giro al pasar el mouse */
  .feature-icon, .module-icon, .extra-icon, .ideal-icon { transition: transform 260ms var(--ease-out); }
  .feature-card:hover .feature-icon, .module-card:hover .module-icon,
  .extra-card:hover .extra-icon, .ideal-card:hover .ideal-icon {
    transform: translateY(-2px) rotate(-6deg) scale(1.06);
  }
}

/* Preguntas frecuentes: la respuesta se despliega con altura animada (navegadores compatibles) */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .faq-list { interpolate-size: allow-keywords; }
    .faq-item::details-content {
      height: 0;
      overflow: clip;
      transition: height 320ms var(--ease-out), content-visibility 320ms allow-discrete;
    }
    .faq-item[open]::details-content { height: auto; }
  }
}

/* Índice legal: marca la sección que se está leyendo */
.page-legal .toc-list a { position: relative; }
.page-legal .toc-list a[aria-current="true"] { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }

.page-legal .toc-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--brand);
  transform: scaleY(0);
  transition: transform 200ms var(--ease-out);
}

.page-legal .toc-list a[aria-current="true"]::before { transform: scaleY(1); }

/* ========== MOVIMIENTO REDUCIDO ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  /* Sin acercamiento de fondo ni reproducción automática (posfac.js arranca en pausa) */
  .hero-bg-img, .hero-bg-img.is-active { transform: none; transition: opacity 400ms ease; }
  .navbar-cta:active, .hero-cta:active, .hero-cta-secondary:active, .plan-cta:active,
  .nomina-cta:active, .migration-cta:active, .cta-btn:active, .popup-btn:active, .docs-cta:active,
  .slider-toggle:active { transform: none; }
}

/* ========== IMPRESIÓN ========== */
@media print {
  .navbar, .footer, .back-to-top, .popup-overlay, .page-legal .toc, .cta-section { display: none !important; }
  .hero { background: none !important; color: #000; }
  .hero-title, .hero-subtitle { color: #000 !important; }
  .page-legal .content { display: block; }
}
