/*
 * ZarelaFact — sistema visual de las páginas públicas (landing, registro,
 * acceso y legal). Los dashboards siguen en styles.css.
 *
 * Reglas: fondo blanco, Manrope para todo el texto y JetBrains Mono para
 * código y datos. Colores de la marca (logo "Factura Encaje"): tinta para
 * títulos, controles y fondos oscuros; verde e-CF como único acento (botón
 * principal, lo "aceptado"). El verde #16C47F nunca va como texto sobre
 * fondo claro: para texto verde se usa --zf-verde-700. Radios de 8–14 px.
 */

:root {
  color-scheme: light;

  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Primitivos de marca (guía de rediseño v1.0) */
  --zf-tinta-950: #0b1220; /* noche */
  --zf-tinta-900: #0e1a2b; /* tinta */
  --zf-tinta-800: #172539;
  --zf-tinta-700: #23344d;
  --zf-tinta-600: #33415a; /* párrafos */
  --zf-tinta-500: #5b6b80; /* pizarra */
  --zf-tinta-400: #8c9ab0;
  --zf-tinta-300: #b8c3d3;
  --zf-tinta-200: #d5dde7;
  --zf-tinta-100: #e3e8ef;
  --zf-tinta-50: #f4f6f9;
  --zf-papel: #e6edf7; /* texto sobre fondo oscuro */
  --zf-verde-700: #0b7a4e; /* enlaces y texto verde */
  --zf-verde-600: #0e9f68; /* texto verde de 24 px o más */
  --zf-verde-500: #16c47f; /* verde e-CF */
  --zf-verde-400: #2bd993; /* verde sobre fondo oscuro */
  --zf-verde-100: #ddf6ea;
  --zf-verde-50: #effbf5;
  --zf-borde-oscuro: #1c2638;

  /* Marca y texto */
  --navy-950: var(--zf-tinta-950);
  --navy-900: var(--zf-tinta-900);
  --navy-800: var(--zf-tinta-800);
  --ink: var(--zf-tinta-900);
  --text: var(--zf-tinta-600);
  --muted: var(--zf-tinta-500);
  --subtle: var(--zf-tinta-500);

  /* Controles: tinta. Botón principal: verde e-CF con texto en tinta. */
  --accent: var(--zf-tinta-900);
  --accent-hover: var(--zf-tinta-800);
  --accent-soft: var(--zf-tinta-50);
  --accent-soft-2: var(--zf-tinta-100);
  --primary: var(--zf-verde-500);
  --primary-hover: #12b172;
  --on-primary: var(--zf-tinta-900);
  --link: var(--zf-verde-700);
  --focus: var(--zf-verde-700);

  /* Acento verde: aceptado, confirmaciones */
  --green: var(--zf-verde-700);
  --green-soft: var(--zf-verde-100);
  --green-border: rgb(22 196 127 / 0.35);

  /* Superficies y bordes */
  --surface: #ffffff;
  --surface-subtle: var(--zf-tinta-50);
  --surface-sunken: #eef2f6;
  --border: var(--zf-tinta-100);
  --border-strong: var(--zf-tinta-200);
  --input-border: var(--zf-tinta-400);

  /* Código */
  --code-bg: var(--zf-tinta-950);
  --code-text: var(--zf-papel);
  --code-muted: var(--zf-tinta-400);
  --code-border: var(--zf-borde-oscuro);

  /* Estados (DGII y validación) */
  --ok: var(--zf-verde-700);
  --ok-soft: var(--zf-verde-100);
  --ok-border: rgb(22 196 127 / 0.35);
  --warn: #8a5c00;
  --warn-soft: #fff4d6;
  --danger: #b42318;
  --danger-soft: #fdecec;
  --danger-border: rgb(180 35 24 / 0.25);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgb(14 26 43 / 0.06);
  --shadow-float: 0 1px 2px rgb(14 26 43 / 0.06), 0 16px 40px -12px rgb(14 26 43 / 0.18);

  /* Fondo tinta del hero (brillo tinta arriba, verde abajo) y su textura;
     lo comparten la landing y el panel del login. */
  --navy-surface:
    radial-gradient(900px 420px at 85% 10%, rgb(35 52 77 / 0.9), transparent 65%),
    radial-gradient(700px 380px at 5% 100%, rgb(22 196 127 / 0.16), transparent 70%),
    var(--zf-tinta-900);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --dot-grid: radial-gradient(rgb(255 255 255 / 0.13) 1px, transparent 1.2px);

  --container: 1200px;
  --gutter: 24px;
  --section-y: clamp(64px, 8vw, 112px);
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
}

/* ---------- Base ---------- */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

:where(body.site) {
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:where(.site) :where(h1, h2, h3) {
  color: var(--ink);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
}

:where(.site) h1 {
  font-size: clamp(2.25rem, 1.35rem + 3.4vw, 3.5rem);
  letter-spacing: -0.034em;
  line-height: 1.06;
}

:where(.site) h2 {
  font-size: clamp(1.75rem, 1.3rem + 1.7vw, 2.5rem);
  letter-spacing: -0.028em;
  line-height: 1.12;
}

:where(.site) h3 {
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

:where(.site) p {
  margin: 0;
  text-wrap: pretty;
}

.nowrap {
  white-space: nowrap;
}

.site img {
  display: block;
  max-width: 100%;
}

.site code,
.site pre {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

.site :where(p, li) code {
  background: var(--surface-sunken);
  border-radius: 4px;
  color: var(--ink);
  font-size: 0.875em;
  padding: 1px 5px;
}

.site a {
  color: inherit;
}

.site :focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.container {
  margin: 0 auto;
  max-width: calc(var(--container) + var(--gutter) * 2);
  padding: 0 var(--gutter);
}

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link {
  background: var(--ink);
  border-radius: var(--radius-md);
  color: #fff;
  left: 16px;
  padding: 8px 14px;
  position: absolute;
  top: -48px;
  z-index: 100;
}

.skip-link:focus {
  top: 12px;
}

.link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgb(11 122 78 / 0.3);
  text-underline-offset: 3px;
}

.link:hover {
  color: var(--link);
  text-decoration-color: currentColor;
}

.link.muted {
  color: var(--muted);
  text-decoration: none;
}

.link.muted:hover {
  color: var(--ink);
}

.link.small {
  font-size: 14px;
}

.eyebrow {
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.lead {
  color: var(--muted);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  line-height: 1.6;
}

/* ---------- Botones ---------- */

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  gap: 8px;
  justify-content: center;
  line-height: 1.2;
  min-height: 40px;
  padding: 0 16px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.button.large {
  font-size: 16px;
  min-height: 48px;
  padding: 0 22px;
}

.button.full {
  width: 100%;
}

.button.primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button.primary:hover {
  background: var(--primary-hover);
}

.button.dark {
  background: var(--accent);
  color: #fff;
}

.button.dark:hover {
  background: var(--accent-hover);
}

.button.secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--surface-subtle);
}

.button.ghost {
  background: transparent;
  color: var(--ink);
}

.button.ghost:hover {
  background: var(--surface-sunken);
}

.button.inverse {
  background: #fff;
  color: var(--navy-900);
}

.button.inverse:hover {
  background: var(--accent-soft);
}

.button.ghost-inverse {
  background: transparent;
  border-color: var(--zf-tinta-600);
  color: var(--zf-papel);
}

.button.ghost-inverse:hover {
  background: var(--zf-tinta-800);
}

.button:disabled,
.button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.65;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions.center {
  justify-content: center;
}

/* ---------- Marca y encabezado ---------- */

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  font-size: 17px;
  font-weight: 700;
  gap: 10px;
  letter-spacing: -0.015em;
  text-decoration: none;
}

/* Logo horizontal (símbolo + nombre en un solo SVG): 28 px de alto, 24 px
   en móvil. No se recolorea ni se le pone sombra. */
.brand-logo {
  height: 28px;
  width: auto;
}

@media (max-width: 900px) {
  .brand-logo {
    height: 24px;
  }
}

.brand-inverse {
  color: #fff;
}

.site-header {
  background: rgb(255 255 255 / 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  position: sticky;
  top: 0;
  transition: border-color 0.2s ease;
  z-index: 50;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.site-header-inner {
  align-items: center;
  display: flex;
  gap: 32px;
  height: 64px;
}

.site-nav {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 4px;
}

.site-nav > a {
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 8px 12px;
  text-decoration: none;
}

.site-nav > a:hover {
  color: var(--ink);
}

.site-nav-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.nav-toggle {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  display: none;
  height: 40px;
  margin-left: auto;
  padding: 0;
  width: 40px;
}

.nav-toggle svg {
  fill: none;
  height: 20px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.75;
  width: 20px;
}

@media (max-width: 900px) {
  .nav-toggle {
    align-items: center;
    display: inline-flex;
    justify-content: center;
  }

  .site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-float);
    display: none;
    flex-direction: column;
    gap: 0;
    left: 0;
    padding: 8px var(--gutter) 20px;
    position: absolute;
    right: 0;
    top: 64px;
  }

  .site-header.is-open .site-nav {
    display: flex;
  }

  .site-header.is-open {
    background: var(--surface);
  }

  .site-nav > a {
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    color: var(--ink);
    font-size: 16px;
    padding: 14px 0;
    width: 100%;
  }

  .site-nav-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
    margin: 16px 0 0;
    width: 100%;
  }

  .site-nav-actions .button {
    min-height: 48px;
  }

  .site-nav-actions .button.ghost {
    border-color: var(--border-strong);
  }
}

/* ---------- Landing ---------- */

/*
 * Patrón de la landing: dos fondos (tinta de la marca y gris claro), tarjetas
 * siempre blancas con el mismo borde, radio y sombra, e íconos en tinta con
 * trazo verde, como el logo. El código va en tarjetas grafito.
 */
.landing {
  --tint: var(--zf-tinta-50);
  --card-border: var(--zf-tinta-100);
  --card-radius: 16px;
  --elev-1: 0 1px 2px rgb(14 26 43 / 0.06), 0 10px 28px -14px rgb(14 26 43 / 0.18);
  --elev-2: 0 2px 4px rgb(14 26 43 / 0.06), 0 24px 48px -20px rgb(14 26 43 / 0.28);
  --elev-on-dark: 0 30px 70px -28px rgb(0 0 0 / 0.6), 0 10px 24px -14px rgb(0 0 0 / 0.35);
  --elev-code: 0 0 0 1px rgb(255 255 255 / 0.06) inset, 0 30px 60px -30px rgb(11 18 32 / 0.55);
  background: #fff;
}

.landing .site-header {
  background: #fff;
  border-bottom-color: var(--card-border);
}

.landing .site-header.is-scrolled {
  box-shadow: 0 8px 24px -18px rgb(14 26 43 / 0.35);
}

.hero-points li::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Áreas de borde a borde: tinta (hero, contingencia y cierre) y gris claro
   (secciones alternas); solo cambia el fondo. */
.hero,
.band-dark {
  overflow: hidden;
}

.section.tint {
  background: var(--tint);
}

.hero,
.band-dark {
  background: var(--navy-surface);
  color: var(--zf-tinta-300);
  isolation: isolate;
  position: relative;
}

.hero::after,
.band-dark::after {
  background-image: var(--grain);
  content: "";
  inset: 0;
  mix-blend-mode: overlay;
  opacity: 0.18;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.hero h1,
.band-dark h2 {
  color: var(--zf-papel);
}

/* Hero */
.hero {
  padding: clamp(44px, 5vw, 76px) 0;
}

.hero::before {
  background-image: var(--dot-grid);
  background-size: 22px 22px;
  content: "";
  inset: 0;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 72% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 72% 40%, #000 20%, transparent 75%);
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.hero-grid {
  align-items: center;
  display: grid;
  gap: clamp(40px, 5vw, 72px);
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
}

.hero-copy {
  display: grid;
  gap: 22px;
  justify-items: start;
}

.hero h1 {
  font-size: clamp(2.5rem, 1.45rem + 3.1vw, 3.875rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-mark {
  animation: mark-in 0.9s cubic-bezier(0.6, 0, 0.2, 1) 0.35s both;
  background: linear-gradient(rgb(22 196 127 / 0.5), rgb(22 196 127 / 0.5)) no-repeat 0 88% / 0% 30%;
  padding: 0 0.04em;
}

@keyframes mark-in {
  to { background-size: 100% 30%; }
}

.hero .lead {
  color: var(--zf-tinta-300);
  font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem);
  max-width: 30em;
}

.hero-points {
  color: var(--zf-tinta-300);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  gap: 8px 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-points li {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.hero-points li::before {
  background: var(--zf-verde-400);
  content: "";
  flex: none;
  height: 14px;
  width: 14px;
}

/* Hero: el JSON real arriba y, debajo, la mascota que lo firma y lo envía a
   la DGII (escena "hero" de assets/mascota/), con el recorrido en etiquetas. */
.hero-flow {
  display: grid;
  position: relative;
}

.hero-code {
  position: relative;
  z-index: 1;
}

.hero-code .code-card-body {
  padding: 16px 18px 18px;
}

/* Código, escena y etiquetas comparten los mismos bordes. La escena va sin
   superponerse al código (arriba aparecen "Firmado" y "Aceptado"). */
.hero-scene {
  margin-top: 4px;
  min-width: 0;
}

/* El JSON baja desde la tarjeta de código a la boca de la mascota (en la
   escena original entra de lado, desde una tarjeta dibujada), y ella mira
   hacia arriba mientras lo espera. */
.hero-scene .zfh-bubble {
  animation-name: hero-json-drop;
}

.hero-scene .zfh-m .zfm-pupil {
  animation-name: hero-look-up;
}

@keyframes hero-json-drop {
  0%, 3% { opacity: 0; transform: translate(266px, 90px) scale(0.3); }
  6% { opacity: 1; transform: translate(262px, 110px) scale(1); }
  12% { opacity: 1; transform: translate(272px, 148px) scale(0.85); }
  16.5% { opacity: 1; transform: translate(300px, 168px) scale(0.55); }
  18%, 100% { opacity: 0; transform: translate(308px, 174px) scale(0.2); }
}

@keyframes hero-look-up {
  0% { transform: none; }
  4%, 16% { transform: translate(-1.8px, -1.8px); }
  24%, 44% { transform: none; }
  50% { transform: translate(2.2px, -0.8px); }
  70%, 86% { transform: translate(2.4px, 0.4px); }
  94%, 100% { transform: none; }
}

.hero-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.hero-chips li {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.hero-chips li + li::before {
  color: var(--zf-tinta-400);
  content: "→";
  font-size: 13px;
}

.hero-chips span {
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 999px;
  color: var(--zf-tinta-300);
  font: 500 12px/1 var(--font-mono);
  padding: 6px 11px;
}

.hero-chips .is-ok span {
  background: var(--zf-verde-500);
  border-color: var(--zf-verde-500);
  color: var(--zf-tinta-900);
}

/* Cada etiqueta se enciende en su momento de la escena (6 s): el JSON entra,
   se firma, viaja a la DGII y queda aceptado. Se pausan con la escena. */
.hero-chips span {
  animation: 6s linear infinite both;
}

.hero-chips li:nth-child(1) span { animation-name: chip-json; }
.hero-chips li:nth-child(2) span { animation-name: chip-firmado; }
.hero-chips li:nth-child(3) span { animation-name: chip-dgii; }
.hero-chips li:nth-child(4) span { animation-name: chip-aceptado; }

.hero-flow:has(.zf-scene.is-paused) .hero-chips span {
  animation-play-state: paused;
}

@keyframes chip-json {
  0%, 18% { background: rgb(43 217 147 / 0.12); border-color: var(--zf-verde-400); color: var(--zf-papel); }
  21%, 100% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
}

@keyframes chip-firmado {
  0%, 26% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
  28%, 44% { background: rgb(43 217 147 / 0.12); border-color: var(--zf-verde-400); color: var(--zf-papel); }
  47%, 100% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
}

@keyframes chip-dgii {
  0%, 47% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
  49%, 68% { background: rgb(43 217 147 / 0.12); border-color: var(--zf-verde-400); color: var(--zf-papel); }
  71%, 100% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
}

@keyframes chip-aceptado {
  0%, 69% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
  71%, 95% { background: var(--zf-verde-500); border-color: var(--zf-verde-500); color: var(--zf-tinta-900); }
  98%, 100% { background: transparent; border-color: rgb(255 255 255 / 0.14); color: var(--zf-tinta-300); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-chips span {
    animation: none;
  }
}

/* Tarjetas blancas: un solo estilo para toda la landing. */
.includes li,
.fact,
.plan,
.partner-extras,
.plan-includes,
.path {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-1);
}

.path {
  box-shadow: var(--elev-on-dark);
}

/* Código: siempre en tarjetas grafito, para que se distingan del fondo
   tinta. Los colores del texto son los de la guía de marca. */
.code-card,
.code-panel,
.retry-card {
  background: #2b2f36;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-code);
  color: var(--zf-papel);
  min-width: 0;
  overflow: hidden;
}

.hero-code,
.retry-card {
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.6);
}

.code-card-bar,
.code-panel-bar,
.retry-card-bar {
  align-items: center;
  background: rgb(0 0 0 / 0.16);
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  color: var(--zf-tinta-300);
  display: flex;
  font-family: var(--font-mono);
  font-size: 13px;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 18px;
}

.env-pill {
  background: rgb(43 217 147 / 0.12);
  border: 1px solid rgb(43 217 147 / 0.3);
  border-radius: 999px;
  color: var(--zf-verde-400);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 9px;
}

.code-card pre,
.code-panel pre {
  margin: 0;
  overflow-x: auto;
}

.code-card-body {
  font-size: 12.5px;
  line-height: 1.7;
  padding: 16px 18px 70px;
}

.http-ok,
.http-err {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-right: 4px;
}

.http-ok { color: var(--zf-verde-400); }
.http-err { color: #ff8a80; }

/* t-k: claves JSON · t-s: strings · t-n: números · t-c: comentarios ·
   t-p: puntuación · t-m: palabras clave */
.t-k { color: var(--zf-tinta-300); }
.t-s { color: var(--zf-verde-400); }
.t-n { color: #f5c26b; }
.t-c { color: #7e8da3; }
.t-p { color: var(--zf-tinta-400); }
.t-m { color: #7aa2f7; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .hero-mark {
    animation: none !important;
  }

  .hero-mark {
    background-size: 100% 30%;
  }
}

/* Secciones: mismo encabezado en todas. */
.section {
  padding: var(--section-y) 0;
  position: relative;
}

.section-head {
  display: grid;
  gap: 14px;
  margin-bottom: clamp(36px, 4vw, 56px);
  max-width: 760px;
}

.section-head h2,
.band-dark h2 {
  font-size: clamp(2rem, 1.3rem + 2.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.section-head > p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.band-dark .section-head > p {
  color: var(--zf-tinta-300);
}

.section-head.center {
  justify-items: center;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.footnote {
  color: var(--subtle);
  font-size: 14px;
  margin-top: 20px !important;
}

/* Qué incluye */
.includes {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.includes li {
  align-content: start;
  display: grid;
  gap: 6px;
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.includes li:hover {
  box-shadow: var(--elev-2);
  transform: translateY(-2px);
}

.include-icon {
  align-items: center;
  background: var(--zf-tinta-900);
  border-radius: 12px;
  color: var(--zf-verde-400);
  display: flex;
  height: 44px;
  justify-content: center;
  margin-bottom: 10px;
  width: 44px;
}

.include-icon svg {
  fill: none;
  height: 22px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 22px;
}

.includes strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.includes li > span:not(.include-icon) {
  color: var(--muted);
  font-size: 15px;
}

.facts {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.fact {
  align-content: start;
  display: grid;
  gap: 16px;
  padding: 24px;
}

.fact h3 {
  font-size: 17px;
  font-weight: 800;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.type-chips li,
.env-line code {
  background: var(--zf-tinta-50);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  padding: 5px 10px;
}

.env-line {
  align-items: center;
  color: var(--subtle);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.env-line code:last-of-type {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green);
}

.fact-note {
  color: var(--muted);
  font-size: 15px;
}

/* Integración: pasos a la izquierda, código a la derecha. */
.api-demo {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.55fr);
}

.api-steps {
  display: grid;
  gap: 10px;
}

.api-steps [role="tab"] {
  align-items: start;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--card-radius);
  color: var(--text);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 14px;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 18px;
  text-align: left;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

.api-steps [role="tab"]:hover {
  background: rgb(255 255 255 / 0.6);
}

/* Avance automático: el paso activo muestra cuánto falta para el siguiente. */
.api-steps [role="tab"] {
  overflow: hidden;
  position: relative;
}

.api-step-progress {
  background: var(--surface-sunken);
  bottom: 0;
  display: none;
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.api-step-progress::after {
  background: var(--zf-verde-500);
  content: "";
  inset: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
}

.api-demo.is-autoplay [aria-selected="true"] .api-step-progress {
  display: block;
}

.api-demo.is-autoplay.is-playing [aria-selected="true"] .api-step-progress::after {
  animation: step-progress 2s linear both;
}

.api-demo.is-paused [aria-selected="true"] .api-step-progress::after {
  animation-play-state: paused;
}

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

.code-response:not([hidden]) {
  animation: response-in 0.35s ease-out both;
}

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

.api-steps [role="tab"][aria-selected="true"] {
  background: #fff;
  border-color: var(--card-border);
  box-shadow: var(--elev-1);
}

.api-step-num {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

[aria-selected="true"] > .api-step-num {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}

.api-step-body {
  display: grid;
  gap: 4px;
}

.api-step-body strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.api-step-body small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.api-step-body > code {
  color: var(--link);
  font-size: 13px;
  margin-top: 4px;
}

.code-panel-bar {
  padding: 0 10px;
}

.lang-tabs {
  display: flex;
  gap: 2px;
}

.lang-tabs button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--zf-tinta-400);
  cursor: pointer;
  font: 600 13px var(--font-sans);
  padding: 6px 11px;
}

.lang-tabs button:hover {
  color: var(--zf-papel);
}

.lang-tabs button[aria-pressed="true"] {
  background: rgb(255 255 255 / 0.1);
  color: var(--zf-papel);
}

.code-panel pre {
  font-size: 13px;
  line-height: 1.65;
  padding: 18px 20px;
}

.code-step {
  transition: opacity 0.2s ease;
}

.code-panel[data-active-step="1"] .code-step:not([data-code-step="1"]),
.code-panel[data-active-step="2"] .code-step:not([data-code-step="2"]),
.code-panel[data-active-step="3"] .code-step:not([data-code-step="3"]) {
  opacity: 0.32;
}

.code-response {
  background: rgb(0 0 0 / 0.16);
  border-top: 1px solid rgb(255 255 255 / 0.1);
}

.code-response-head {
  color: var(--zf-tinta-300);
  font-size: 13px;
  padding: 14px 20px 0;
}

.code-response pre {
  font-size: 12.5px;
  padding-top: 10px;
}

.api-note {
  color: var(--muted);
  margin-top: 28px !important;
}

/* Contingencia */
.band-dark {
  padding: var(--section-y) 0;
}

.band-grid {
  align-items: center;
  display: grid;
  gap: clamp(40px, 6vw, 80px);
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.band-copy p {
  font-size: 18px;
  line-height: 1.6;
  margin-top: 18px !important;
  max-width: 30em;
}

.retry-light {
  background: var(--zf-verde-500);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgb(22 196 127 / 0.18);
  height: 9px;
  width: 9px;
}

.retry-log {
  display: grid;
  font-family: var(--font-mono);
  font-size: 13px;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 20px 18px 22px;
}

.retry-log li {
  display: grid;
  gap: 14px;
  grid-template-columns: 64px 110px minmax(0, 1fr);
}

.retry-log time { color: #7e8da3; }
.retry-log b { color: var(--zf-papel); font-weight: 500; }
.retry-log span { color: var(--zf-tinta-300); }
.retry-log .is-warn b { color: #f5c26b; }
.retry-log .is-ok b,
.retry-log .is-ok span { color: var(--zf-verde-400); }

.retry-card.is-playing .retry-log li {
  animation: log-in 0.35s ease-out both;
}

.retry-card.is-playing .retry-log li:nth-child(2) { animation-delay: 0.7s; }
.retry-card.is-playing .retry-log li:nth-child(3) { animation-delay: 1.2s; }
.retry-card.is-playing .retry-log li:nth-child(4) { animation-delay: 2.4s; }
.retry-card.is-playing .retry-log li:nth-child(5) { animation-delay: 3s; }

.retry-card.is-playing .retry-light {
  animation: retry-light 3s steps(1, end) both;
}

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

@keyframes retry-light {
  0% { background: #16c47f; box-shadow: 0 0 0 4px rgb(22 196 127 / 0.18); }
  23% { background: #f5c26b; box-shadow: 0 0 0 4px rgb(245 194 107 / 0.2); }
  80% { background: #f5c26b; box-shadow: 0 0 0 4px rgb(245 194 107 / 0.2); }
  100% { background: #16c47f; box-shadow: 0 0 0 4px rgb(22 196 127 / 0.18); }
}

@media (prefers-reduced-motion: reduce) {
  .code-response:not([hidden]),
  .retry-card.is-playing .retry-log li,
  .retry-card.is-playing .retry-light {
    animation: none !important;
  }
}

/* Precios: pestañas Mi empresa / Partners y planes de precio fijo. */
.price-badge {
  background: var(--green-soft);
  border-radius: 999px;
  color: var(--green);
  display: inline-block;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.4;
  margin-left: 4px;
  padding: 1px 7px;
}

.pricing-tabs {
  background: var(--surface-sunken);
  border-radius: 12px;
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
}

.pricing-tabs [role="tab"] {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: 700 15px var(--font-sans);
  gap: 6px;
  padding: 9px 18px;
}

.pricing-tabs [role="tab"]:hover {
  color: var(--ink);
}

.pricing-tabs [role="tab"][aria-selected="true"] {
  background: #fff;
  box-shadow: var(--shadow-xs), 0 0 0 1px var(--border);
  color: var(--ink);
}

.pricing-intro {
  color: var(--muted);
  margin-bottom: 20px !important;
  max-width: 62em;
}

.plan-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
}

.plan h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.plan-for {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.plan-price {
  align-items: baseline;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  font-size: 36px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  gap: 2px;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-top: 6px !important;
}

.plan-price span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  margin-right: 2px;
}

.plan-price small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: 2px;
}

.plan-price s {
  color: var(--subtle);
  flex-basis: 100%;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.plan-tag {
  color: var(--green);
  flex-basis: 100%;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: inherit;
  margin-bottom: 6px;
}

.plan-price-custom {
  font-size: 30px;
}

.plan-volume {
  background: var(--tint);
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
}

.plan-volume strong {
  color: var(--ink);
  font-weight: 800;
}

.plan-perks,
.partner-extras ul,
.plan-includes ul {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.plan-perks {
  margin: 4px 0 10px;
}

.plan-perks li,
.partner-extras li,
.plan-includes li {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  padding-left: 24px;
  position: relative;
}

.plan-perks li::before,
.partner-extras li::before,
.plan-includes li::before {
  background: var(--zf-verde-500);
  content: "";
  height: 14px;
  left: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  position: absolute;
  top: 3px;
  width: 14px;
}

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

.plan.is-free {
  border-color: var(--green-border);
}

.plan.is-free .plan-price {
  color: var(--green);
}

.partner-extras,
.plan-includes {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 24px;
}

.partner-extras h3,
.plan-includes h3 {
  font-size: 17px;
  font-weight: 800;
}

.partner-extras ul,
.plan-includes ul {
  column-gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.partner-extras code {
  font-size: 0.85em;
}

/* Cliente */
.quote {
  display: grid;
  gap: 22px;
  justify-items: center;
  max-width: 900px;
  text-align: center;
}

.quote img {
  filter: grayscale(1);
  mix-blend-mode: multiply;
  opacity: 0.85;
}

.quote blockquote {
  margin: 0;
}

.quote blockquote p {
  color: var(--ink);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.3;
}

.quote-by {
  color: var(--muted);
  font-size: 15px;
}

.quote-by strong {
  color: var(--ink);
  font-weight: 800;
}

/* Mascota (el logo con cara; escenas de assets/mascota/). En "Tres
   llamadas" ilustra el paso activo; en contingencia, la tormenta; en el
   cierre, saluda y sigue el cursor. */
.api-side {
  align-content: start;
  display: grid;
  gap: 16px;
}

.api-scenes {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-1);
  padding: 8px 16px 0;
}

.api-scene svg {
  margin: 0 auto;
  max-width: 280px;
}

/* Cada paso dura 2 s (avance automático): las escenas de 4 s van al doble,
   sin acelerar el parpadeo ni el balanceo. */
.api-scene .zf-scene * {
  animation-duration: 2s;
}

.api-scene .zfm-eye {
  animation-duration: 4.2s;
}

.api-scene .zfm-bob {
  animation-duration: 2.4s;
}

.band-copy .retry-card {
  margin-top: 28px;
}

.band-scene {
  min-width: 0;
}

/* Cierre: la mascota saluda sobre el título; los mismos dos caminos del
   registro debajo. */
.cta-mascot {
  margin: 0 auto -6px;
  width: 176px;
}

.paths {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 auto;
  max-width: 960px;
}

.path {
  align-content: start;
  display: grid;
  gap: 10px;
  padding: clamp(24px, 3vw, 34px);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.path:hover {
  transform: translateY(-3px);
}

.path h3 {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.path p {
  color: var(--muted);
}

.path-cta {
  color: var(--link);
  font-weight: 800;
  margin-top: 14px;
}

.path-cta span {
  display: inline-block;
  transition: transform 0.15s ease;
}

.path:hover .path-cta span {
  transform: translateX(4px);
}

/* Footer */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  padding: 56px 0 32px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
}

.footer-brand p {
  margin-top: 12px;
  max-width: 26em;
}

.footer-col {
  align-content: start;
  display: grid;
  gap: 10px;
}

.footer-col h2 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 4px;
}

.footer-col a {
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--ink);
}

.footer-bottom {
  color: var(--subtle);
  font-size: 13px;
  margin-top: 40px;
}

.footer-bottom p {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

/* Responsive landing */
@media (max-width: 1024px) {
  .includes,
  .plan-grid,
  .partner-extras ul,
  .plan-includes ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-grid,
  .api-demo,
  .band-grid,
  .facts,
  .paths {
    grid-template-columns: minmax(0, 1fr);
  }


  .api-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .api-steps [role="tab"] {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .api-step-body small,
  .api-step-body > code {
    display: none;
  }

  .api-scenes {
    display: none;
  }

  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .actions .button.large {
    width: 100%;
  }

  .hero-points {
    display: grid;
  }

  .includes,
  .plan-grid,
  .partner-extras ul,
  .plan-includes ul {
    grid-template-columns: minmax(0, 1fr);
  }

  .retry-log {
    font-size: 12px;
  }

  .retry-log li {
    gap: 4px 10px;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .retry-log span {
    grid-column: 2;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Formularios ---------- */

.form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.field-label-row {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}

:where(.site) :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], select) {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  min-height: 48px;
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

:where(.site) select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B6B80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 40px;
}

.site input::placeholder {
  color: var(--zf-tinta-400);
}

.site input:hover,
.site select:hover {
  border-color: var(--muted);
}

.site input:focus,
.site select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(11 122 78 / 0.2);
  outline: none;
}

.site input:disabled,
.site select:disabled {
  background: var(--surface-sunken);
  border-color: var(--border-strong);
  color: var(--subtle);
  cursor: not-allowed;
}

.site input.input-invalid,
.site select.input-invalid {
  border-color: var(--danger);
}

.site input.input-invalid:focus,
.site select.input-invalid:focus {
  box-shadow: 0 0 0 3px rgb(180 35 24 / 0.15);
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 88px;
}

.password-toggle {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  height: 36px;
  padding: 0 12px;
  position: absolute;
  right: 6px;
  top: 6px;
}

.password-toggle:hover {
  background: var(--accent-soft);
}

.password-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: -8px 0 0;
  padding: 0;
}

.password-rules li {
  align-items: center;
  background: var(--surface-sunken);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 500;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.password-rules li::before {
  border: 1.5px solid var(--input-border);
  border-radius: 50%;
  content: "";
  height: 9px;
  width: 9px;
}

.password-rules li.is-met {
  background: var(--ok-soft);
  color: var(--ok);
}

.password-rules li.is-met::before {
  background: var(--ok);
  border-color: var(--ok);
}

.check {
  align-items: flex-start;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  gap: 10px;
  line-height: 1.45;
}

.check input {
  accent-color: var(--accent);
  flex: none;
  height: 18px;
  margin: 2px 0 0;
  width: 18px;
}

.alert {
  border: 1px solid;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
}

.alert-error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.alert-success {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
}

.alert-info {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
  color: var(--navy-800);
}

/* ---------- Piezas compartidas ---------- */

.auth-aside-points li {
  padding-left: 26px;
  position: relative;
}

.auth-aside-points li::before {
  background: currentColor;
  content: "";
  height: 16px;
  left: 0;
  position: absolute;
  top: 0.2em;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  width: 16px;
}

.presets button,
.doc-preset {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-height: 32px;
  padding: 0 12px;
}

.presets button:hover,
.doc-preset:hover {
  border-color: var(--input-border);
}

.presets button[aria-pressed="true"],
.doc-preset.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Acceso (login, invitación, recuperación) ---------- */

.auth-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
  min-height: 100vh;
}

/* Mismo fondo que el hero de la landing: brillos, puntos y textura. */
.auth-aside {
  background: var(--navy-surface);
  color: var(--zf-tinta-300);
  display: flex;
  flex-direction: column;
  gap: 48px;
  isolation: isolate;
  overflow: hidden;
  padding: 40px clamp(32px, 4vw, 56px);
  position: relative;
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.auth-aside::before {
  background-image: var(--dot-grid);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 70% 35%, #000 20%, transparent 75%);
}

.auth-aside::after {
  background-image: var(--grain);
  mix-blend-mode: overlay;
  opacity: 0.18;
}

/* La mascota da la bienvenida a la derecha del título, a su altura, mirando
   hacia el formulario. Va fuera del flujo (absoluta sobre el bloque del
   título) para no mover el texto. Solo en escritorio: en móvil el panel no se
   muestra. Aquí no sigue el cursor ni salta. */
.auth-aside-copy {
  position: relative;
}

.auth-mascot {
  pointer-events: none;
  position: absolute;
  right: -24px;
  top: -214px;
  width: 210px;
}

/* Con el panel ancho cabe al lado del título; si no, va justo encima, a la
   derecha, en el espacio libre bajo el logo. */
@media (min-width: 1380px) {
  .auth-mascot {
    right: -32px;
    top: -140px;
    width: 230px;
  }
}

@media (max-width: 1100px) {
  .auth-mascot {
    right: -20px;
    top: -160px;
    width: 160px;
  }
}

.auth-mascot .zf-saludo {
  cursor: default;
}

.auth-aside-copy {
  display: grid;
  gap: 16px;
  margin-top: auto;
}

.auth-aside-copy h1 {
  color: #fff;
  font-size: clamp(1.875rem, 1.4rem + 1.4vw, 2.5rem);
  letter-spacing: -0.022em;
  line-height: 1.12;
  max-width: 14em;
}

.auth-aside-copy p {
  font-size: 17px;
  max-width: 30em;
}

.auth-aside-points {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
}

.auth-aside-points li {
  font-size: 15px;
}

.auth-aside-points li::before {
  color: var(--zf-verde-400);
}

.auth-main {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px var(--gutter);
}

.auth-card {
  display: grid;
  gap: 24px;
  max-width: 420px;
  width: 100%;
}

.auth-card-head {
  display: grid;
  gap: 8px;
}

.auth-card-head h1,
.auth-card-head h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-card-head p {
  color: var(--muted);
}

.auth-done {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 8px;
  padding: 20px;
}

.auth-done h2 {
  font-size: 18px;
}

.auth-done p {
  color: var(--text);
  font-size: 15px;
}

.auth-foot {
  font-size: 14px;
  margin-top: 32px !important;
  max-width: 420px;
  width: 100%;
}

.auth-mobile-brand {
  display: none;
}

.auth-simple {
  background: var(--surface-subtle);
}

.auth-simple .auth-main {
  min-height: 100vh;
}

.auth-simple-brand {
  margin-bottom: 32px;
}

.auth-simple .auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 36px);
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }

  .auth-main {
    justify-content: flex-start;
    padding-top: 32px;
  }

  .auth-mobile-brand {
    align-self: flex-start;
    display: inline-flex;
    margin: 0 auto 40px;
    max-width: 420px;
    width: 100%;
  }
}

/* ---------- Registro ---------- */

.signup-page {
  background: var(--surface-subtle);
  min-height: 100vh;
}

.signup-topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: calc(var(--container) + var(--gutter) * 2);
  padding: 20px var(--gutter);
}

.signup-top-actions {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 8px;
}

.signup-top-note {
  color: var(--muted);
}

.signup-chooser {
  margin: 0 auto;
  max-width: 1000px;
  padding: 24px var(--gutter) 80px;
  text-align: center;
}

.signup-chooser h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  margin: 12px 0 14px;
}

.signup-chooser-lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  margin: 0 auto 40px !important;
  max-width: 600px;
}

.path-cards {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: left;
}

.path-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
}

.path-card.is-partner {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: var(--zf-tinta-300);
}

.path-card-kicker {
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.path-card.is-partner .path-card-kicker {
  color: var(--zf-verde-400);
}

.path-card h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
}

.path-card.is-partner h2 {
  color: #fff;
}

.path-card > p {
  color: var(--muted);
  font-size: 15px;
}

.path-card.is-partner > p {
  color: var(--zf-tinta-300);
}

.path-card-facts {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 14px;
  margin: 8px 0 12px;
  padding-top: 18px;
}

.path-card.is-partner .path-card-facts {
  border-top-color: rgb(255 255 255 / 0.12);
}

.path-card-facts div,
.billing-summary dl div {
  display: grid;
  gap: 2px;
}

.path-card-facts dt,
.billing-summary dt {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.path-card.is-partner .path-card-facts dt {
  color: var(--zf-tinta-400);
}

.path-card-facts dd {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

.path-card.is-partner .path-card-facts dd {
  color: #fff;
}

.path-card .button {
  margin-top: auto;
  min-height: 48px;
  width: 100%;
}

.path-card.is-partner .button.primary {
  background: #fff;
  color: var(--navy-900);
}

.path-card.is-partner .button.primary:hover {
  background: var(--accent-soft);
}

.signup-chooser-note {
  color: var(--muted);
  font-size: 15px;
  margin: 32px auto 0 !important;
  max-width: 600px;
}

.signup-chooser-note strong {
  color: var(--ink);
  font-weight: 600;
}

.signup-shell {
  align-items: start;
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  margin: 0 auto;
  max-width: calc(var(--container) + var(--gutter) * 2);
  padding: 16px var(--gutter) 80px;
}

.signup-stepper {
  position: sticky;
  top: 24px;
}

.signup-stepper h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  letter-spacing: -0.022em;
  line-height: 1.15;
  margin: 10px 0 28px;
}

.signup-steps {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.signup-steps li {
  align-items: center;
  border-radius: var(--radius-md);
  display: flex;
  gap: 12px;
  padding: 10px 12px;
}

.signup-steps li.is-active {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
}

.signup-steps .step-index {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  display: inline-flex;
  flex: none;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.signup-steps li.is-active .step-index {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.signup-steps li.is-done .step-index {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
}

.signup-steps strong {
  color: var(--ink);
  display: block;
  font-size: 15px;
  font-weight: 500;
}

.signup-steps li:not(.is-active):not(.is-done) strong {
  color: var(--muted);
}

.signup-steps small {
  color: var(--subtle);
  display: block;
  font-size: 13px;
}

.billing-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 28px;
  padding: 18px 20px;
}

.billing-summary h2 {
  font-size: 15px;
  letter-spacing: 0;
  margin: 0 0 14px;
}

.billing-summary dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.billing-summary dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.billing-summary-change {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  margin-top: 16px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signup-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 3.5vw, 40px);
}

.signup-step-header {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.section-label {
  color: var(--subtle);
  font-size: 14px;
  font-weight: 500;
}

.signup-step-header h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.signup-step-header p {
  color: var(--muted);
}

.signup-grid {
  display: grid;
  gap: 20px;
}

.signup-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signup-grid label,
.signup-subsection label,
.password-block label,
.volume-input,
.partner-plan-select label {
  color: var(--ink);
  display: grid;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
}

.signup-grid label.full,
.signup-subsection label.full {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 400;
}

.field-optional {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 400;
}

.field-error {
  align-items: flex-start;
  color: var(--danger);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 6px;
  line-height: 1.4;
}

.field-error::before {
  content: "!";
  align-items: center;
  background: var(--danger);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  height: 16px;
  justify-content: center;
  margin-top: 1px;
  width: 16px;
}

/* Resultado de la consulta del RNC en el padrón DGII. */
.rnc-lookup {
  align-items: flex-start;
  border-radius: var(--radius-md);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  gap: 8px;
  line-height: 1.4;
  padding: 10px 12px;
}

.rnc-lookup[data-state="searching"] {
  background: var(--surface-subtle);
  color: var(--muted);
}

.rnc-lookup[data-state="found"] {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  color: var(--ok);
}

.rnc-lookup[data-state="found"] strong {
  color: var(--ink);
  font-weight: 700;
}

.rnc-lookup[data-state="not-found"] {
  background: var(--warn-soft);
  border: 1px solid rgb(138 92 0 / 0.25);
  color: var(--warn);
}

.rnc-lookup::before {
  flex: none;
  margin-top: 2px;
}

.rnc-lookup[data-state="searching"]::before {
  animation: rnc-lookup-spin 0.8s linear infinite;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  border-top-color: var(--ink);
  content: "";
  height: 14px;
  width: 14px;
}

.rnc-lookup[data-state="found"]::before {
  content: "✓";
  font-weight: 700;
  margin-top: 0;
}

.rnc-lookup[data-state="not-found"]::before {
  align-items: center;
  background: var(--warn);
  border-radius: 50%;
  color: #fff;
  content: "!";
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 16px;
  justify-content: center;
  margin-top: 1px;
  width: 16px;
}

@keyframes rnc-lookup-spin {
  to { transform: rotate(360deg); }
}

.step-summary-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 14px;
  margin-top: 20px !important;
  padding: 12px 14px;
}

.password-block {
  border-top: 1px solid var(--border);
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding-top: 24px;
}

.password-block .password-rules {
  margin-top: -10px;
}

.phone-input {
  display: grid;
  grid-template-columns: auto 1fr;
}

.phone-prefix {
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: 0;
  color: var(--muted);
  display: flex;
  font-size: 14px;
  font-weight: 500;
  padding: 0 12px;
}

.phone-input input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
}

.signup-notice {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--radius-md);
  display: grid;
  gap: 2px;
  margin-bottom: 24px;
  padding: 12px 14px;
}

.signup-notice strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.signup-notice span {
  color: var(--muted);
  font-size: 14px;
}

.signup-optional {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 18px;
}

.signup-optional summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.signup-optional .signup-grid {
  margin-top: 18px;
}

.plan-picker {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.plan-picker.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-tile {
  cursor: pointer;
  display: block;
  position: relative;
}

.plan-tile input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.plan-tile-inner {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: block;
  height: 100%;
  padding: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.plan-tile:hover .plan-tile-inner {
  border-color: var(--input-border);
}

.plan-tile input:checked + .plan-tile-inner {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-tile input:focus-visible + .plan-tile-inner {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.plan-tile-head {
  display: grid;
  gap: 2px;
}

.plan-tile-head strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.plan-tile-head em {
  color: var(--ink);
  font-size: 15px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.plan-tile-head em span {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 400;
}

.plan-tile-meta {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.45;
  margin-top: 8px;
}

.volume-estimator {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
}

.volume-input input {
  max-width: 220px;
}

.doc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.estimate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 2px;
  padding: 14px 16px;
}

.estimate-card span {
  color: var(--subtle);
  font-size: 13px;
}

.estimate-card strong {
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.estimate-card small {
  color: var(--muted);
  font-size: 13px;
}

.type-hint {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.estimate-plan-hint {
  color: var(--accent);
  font-weight: 500;
}

.partner-plan-select {
  margin-top: 16px;
}

.charge-notice {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg);
  margin-top: 20px;
  padding: 16px 18px;
}

.charge-notice strong {
  color: var(--ok);
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.charge-notice ul {
  color: var(--text);
  display: grid;
  font-size: 14px;
  gap: 6px;
  line-height: 1.5;
  margin: 0;
  padding-left: 18px;
}

.signup-subsection {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding-top: 20px;
}

.terms-inline {
  align-items: flex-start;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  gap: 10px;
  line-height: 1.45;
  margin-top: 20px;
}

.terms-inline input {
  accent-color: var(--accent);
  flex: none;
  height: 18px;
  margin: 2px 0 0;
  width: 18px;
}

.terms-error {
  margin-top: 8px;
}

.signup-step-actions {
  align-items: center;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 24px;
}

.signup-step-actions .button.primary {
  min-height: 48px;
  min-width: 160px;
  padding: 0 24px;
}

.signup-step-actions .button.secondary {
  min-height: 48px;
}

.signup-next-note {
  color: var(--subtle);
  font-size: 14px;
  margin-top: 12px !important;
  text-align: right;
}

@media (max-width: 980px) {
  .signup-shell {
    gap: 24px;
    grid-template-columns: 1fr;
  }

  .signup-stepper {
    position: static;
  }

  .signup-stepper h1 {
    margin-bottom: 20px;
  }

  .signup-steps {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }

  .signup-steps small {
    display: none;
  }

  .billing-summary {
    display: none;
  }

  .path-cards,
  .plan-picker,
  .plan-picker.two {
    grid-template-columns: 1fr;
  }
}

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

  .signup-top-note {
    display: none;
  }

  .signup-steps li {
    flex-direction: column;
    gap: 6px;
    padding: 8px 4px;
    text-align: center;
  }

  .signup-steps strong {
    font-size: 13px;
  }

  .path-card {
    padding: 22px;
  }

  .signup-step-actions {
    flex-direction: column-reverse;
  }

  .signup-step-actions .button {
    width: 100%;
  }

  .signup-next-note {
    text-align: center;
  }
}

/* ---------- Legal ---------- */

.legal-page {
  background: var(--surface-subtle);
}

.legal-shell {
  display: grid;
  gap: 48px;
  grid-template-columns: 220px minmax(0, 1fr);
  margin: 0 auto;
  max-width: calc(980px + var(--gutter) * 2);
  padding: 16px var(--gutter) 96px;
}

.legal-toc {
  align-self: start;
  display: grid;
  gap: 4px;
  font-size: 14px;
  position: sticky;
  top: 24px;
}

.legal-toc p {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 8px !important;
  text-transform: uppercase;
}

.legal-toc a {
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 4px 0;
  text-decoration: none;
}

.legal-toc a:hover {
  color: var(--ink);
}

.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 48px);
}

.legal-header {
  border-bottom: 1px solid var(--border);
  display: grid;
  gap: 10px;
  padding-bottom: 28px;
}

.legal-header p {
  color: var(--muted);
}

.legal-section {
  counter-increment: legal;
  padding-top: 32px;
}

.legal-section h2 {
  font-size: 20px;
  letter-spacing: -0.012em;
  margin-bottom: 12px;
}

.legal-section h2::before {
  color: var(--subtle);
  content: counter(legal) ". ";
  font-variant-numeric: tabular-nums;
}

.legal-card article,
.legal-body {
  counter-reset: legal;
}

.legal-section p,
.legal-section li {
  color: var(--text);
  line-height: 1.7;
  max-width: 70ch;
}

.legal-section p + p {
  margin-top: 12px;
}

.legal-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
}

.legal-list strong {
  color: var(--ink);
  font-weight: 600;
}

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

  .legal-toc {
    display: none;
  }
}

.legal-closing {
  border-top: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.7;
  margin-top: 36px;
  padding-top: 24px;
}

.legal-footer {
  margin-top: 28px;
}

/* Registro: confirmación de correo antes de entrar. */
.signup-verify {
  display: grid;
  justify-items: center;
  padding: 40px var(--gutter) 96px;
}

.signup-verify-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  display: grid;
  gap: 14px;
  justify-items: center;
  max-width: 520px;
  padding: clamp(28px, 5vw, 44px);
  text-align: center;
}

.signup-verify-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  height: 56px;
  justify-content: center;
  width: 56px;
}

.signup-verify-icon svg {
  fill: none;
  height: 26px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
  width: 26px;
}

.signup-verify-card h1 {
  font-size: 28px;
}

.signup-verify-card h1:focus {
  outline: none;
}

.signup-verify-card p {
  color: var(--muted);
}

.signup-verify-note {
  font-size: 14px;
}

.signup-verify-card .actions {
  justify-content: center;
  margin-top: 8px;
}

.signup-verify-feedback:empty {
  display: none;
}

.signup-verify-feedback {
  color: var(--ok) !important;
  font-size: 14px;
}

.login-resend {
  background: none;
  border: 0;
  cursor: pointer;
  justify-self: start;
  margin-top: -12px;
  padding: 0;
}

/* ---------- Certificación y preguntas frecuentes (landing) ---------- */

/* Los cuatro tramos de la certificación DGII, en tarjetas numeradas. */
.cert-steps {
  counter-reset: cert-step;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.cert-steps li {
  align-content: start;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-1);
  counter-increment: cert-step;
  display: grid;
  gap: 8px;
  padding: 24px;
}

.cert-steps li::before {
  align-items: center;
  background: var(--zf-tinta-900);
  border-radius: 12px;
  color: var(--zf-verde-400);
  content: counter(cert-step);
  display: flex;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 500;
  height: 44px;
  justify-content: center;
  margin-bottom: 8px;
  width: 44px;
}

.cert-steps h3 {
  font-size: 18px;
  font-weight: 800;
}

.cert-steps p {
  color: var(--muted);
  font-size: 15px;
}

.cert-steps .cert-who {
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.cert-more {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 28px;
}

.cert-more p {
  color: var(--muted);
}

/* Preguntas frecuentes: cada pregunta es un <details> con su título. */
.faq {
  display: grid;
  gap: 12px;
  max-width: 880px;
}

.faq details {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-1);
}

.faq summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  padding: 20px 24px;
}

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

.faq summary::after {
  color: var(--green);
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "−";
}

.faq summary h3 {
  font-size: 17px;
  font-weight: 800;
}

.faq .faq-answer {
  color: var(--text);
  display: grid;
  gap: 10px;
  padding: 0 24px 22px;
}

.faq .faq-answer ul {
  margin: 0;
  padding-left: 20px;
}

/* ---------- Guías (certificación, facturación electrónica, API) ---------- */

.guide-hero {
  padding: clamp(40px, 5vw, 72px) 0 clamp(44px, 5vw, 64px);
}

.guide-hero-inner {
  display: grid;
  gap: 20px;
  justify-items: start;
  max-width: 860px;
}

.guide-hero h1 {
  color: var(--zf-papel);
  font-size: clamp(2.25rem, 1.4rem + 2.6vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.guide-hero .lead {
  color: var(--zf-tinta-300);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.2rem);
  max-width: 36em;
}

.crumbs ol {
  color: var(--zf-tinta-400);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
}

.crumbs a {
  color: var(--zf-tinta-300);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--zf-papel);
}

.guide-meta {
  color: var(--zf-tinta-400);
  font-size: 14px;
}

.guide-shell {
  align-items: start;
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  grid-template-columns: 240px minmax(0, 1fr);
  padding-bottom: var(--section-y);
  padding-top: clamp(40px, 5vw, 64px);
}

.guide-toc {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 96px;
}

.guide-toc p {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.guide-toc a {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.guide-toc a:hover {
  color: var(--ink);
}

.guide-article {
  display: grid;
  gap: 18px;
  max-width: 760px;
  min-width: 0;
}

.guide-article > section {
  display: grid;
  gap: 16px;
  scroll-margin-top: 88px;
}

.guide-article > section + section {
  border-top: 1px solid var(--border);
  margin-top: 22px;
  padding-top: 40px;
}

.guide-article h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.guide-article h3 {
  font-size: 19px;
  font-weight: 800;
  margin-top: 8px;
}

.guide-article p,
.guide-article li {
  font-size: 17px;
  line-height: 1.7;
}

.guide-article ul,
.guide-article ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.guide-article strong {
  color: var(--ink);
}

.guide-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-summary div {
  background: var(--zf-tinta-50);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: grid;
  gap: 4px;
  padding: 16px 18px;
}

.guide-summary dt {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.guide-summary dd {
  color: var(--text);
  font-size: 15px;
  margin: 0;
}

.guide-table {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow-x: auto;
}

.guide-table table {
  border-collapse: collapse;
  font-size: 15px;
  min-width: 560px;
  width: 100%;
}

.guide-table th,
.guide-table td {
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.guide-table th {
  background: var(--zf-tinta-50);
  color: var(--ink);
  font-weight: 800;
}

.guide-table tr:last-child td {
  border-bottom: 0;
}

.guide-table td:first-child {
  color: var(--ink);
  font-weight: 700;
}

.guide-callout {
  background: var(--zf-verde-50);
  border: 1px solid var(--green-border);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  padding: 18px 20px;
}

.guide-callout.is-warn {
  background: var(--warn-soft);
  border-color: rgb(138 92 0 / 0.25);
}

.guide-callout p {
  font-size: 16px;
}

.guide-steps {
  counter-reset: guide-step;
  list-style: none;
  padding-left: 0 !important;
}

/* Una lista que sigue la numeración de la anterior (<ol start="4">); la CSP
   no deja fijar el contador con style="". */
.guide-steps[start="4"] {
  counter-reset: guide-step 3;
}

.guide-steps[start="9"] {
  counter-reset: guide-step 8;
}

.guide-steps > li {
  counter-increment: guide-step;
  padding-left: 48px;
  position: relative;
}

.guide-steps > li::before {
  align-items: center;
  background: var(--zf-tinta-900);
  border-radius: 9px;
  color: var(--zf-verde-400);
  content: counter(guide-step);
  display: flex;
  font-family: var(--font-mono);
  font-size: 14px;
  height: 30px;
  justify-content: center;
  left: 0;
  position: absolute;
  top: 2px;
  width: 30px;
}

.guide-who {
  background: var(--zf-tinta-50);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--muted);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-left: 6px;
  padding: 1px 9px;
  vertical-align: 2px;
  white-space: nowrap;
}

.guide-who.is-zf {
  background: var(--green-soft);
  border-color: var(--green-border);
  color: var(--green);
}

.guide-article .code-card pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
}

.guide-article .code-card code {
  color: var(--zf-papel);
  font-size: 13.5px;
  line-height: 1.6;
}

.guide-cta {
  align-items: center;
  background: var(--navy-surface);
  border-radius: var(--card-radius);
  color: var(--zf-tinta-300);
  display: grid;
  gap: 16px;
  padding: clamp(24px, 3vw, 36px);
}

.guide-cta h2 {
  color: var(--zf-papel);
}

.guide-cta p {
  color: var(--zf-tinta-300) !important;
}

.guide-related {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
  padding-left: 0 !important;
}

.guide-related a {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--elev-1);
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 20px 22px;
  text-decoration: none;
}

.guide-related strong {
  font-size: 17px;
}

.guide-related span {
  color: var(--muted);
  font-size: 15px;
}

.guide-article .faq {
  max-width: none;
}

@media (max-width: 1024px) {
  .cert-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .guide-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .cert-steps,
  .guide-summary,
  .guide-related {
    grid-template-columns: minmax(0, 1fr);
  }

  .faq summary {
    padding: 18px;
  }

  .faq .faq-answer {
    padding: 0 18px 18px;
  }

  .guide-article p,
  .guide-article li {
    font-size: 16px;
  }
}
