/* styles.css — Mobile-first, minimalista, con animaciones suaves.
   Paleta basada exclusivamente en los colores del logo: Navy, Teal, Naranja. */

/* Fuente custom para la marca "TributaSoft" (sólo el wordmark del logo).
   Cargada vía @font-face con font-display:swap para que no bloquee el render. */
@font-face {
  font-family: 'Avenida';
  src: url('./Avenida.otf') format('opentype');
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}

:root {
  /* Paleta TributaSoft — sólo colores del logo */
  --color-primary: #00236f;            /* Deep Navy (texto, headers) */
  --color-primary-dark: #00164e;
  --color-primary-container: #1e3a8a;
  --color-on-primary-container: #b6c4ff;

  --color-brand-tributa: #87C7DC;      /* Celeste de "Tributa" en el logo */
  --color-brand-soft: #EF7306;         /* Naranja de "Soft" en el logo */

  --color-teal: #87C7DC;               /* Teal/celeste del logo (acentos suaves) */
  --color-teal-dark: #2E7A95;          /* Celeste oscuro (texto sobre teal-light) */
  --color-teal-light: #e3f2f8;         /* Celeste pálido (badges, fondos suaves) */

  --color-cta: #EF7306;                /* Naranja CTA (botones primarios) */
  --color-cta-dark: #c95e02;
  --color-cta-light: #fdecde;          /* Naranja pálido (hover suave) */

  --color-secondary: #EF7306;          /* Naranja vibrante (acentos) */
  --color-text: #1a1c1c;
  --color-muted: #444651;
  --color-bg: #f9f9f9;
  --color-card: #ffffff;
  --color-surface-low: #f3f3f3;
  --color-surface: #eeeeee;
  --color-border: #e2e2e2;
  --color-outline: #c5c5d3;

  /* Estados — siempre coherentes con la paleta del logo (sin verde) */
  --color-ok: #2E7A95;                 /* Éxito = celeste oscuro del logo */
  --color-ok-container: #e3f2f8;       /* Éxito suave = celeste pálido */
  --color-warn: #9d4300;               /* Advertencia = naranja oscuro */
  --color-warn-container: #fdecde;
  --color-error: #ba1a1a;
  --color-error-container: #ffdad6;
  --color-edit: #d92e2e;               /* Botón "Editar" en rojo (legacy) */
  --color-info: #00236f;

  --shadow-sm: 0 1px 2px rgba(0,35,111,.04), 0 1px 3px rgba(0,35,111,.06);
  --shadow-md: 0 4px 20px rgba(0,35,111,.08);
  --shadow-lg: 0 24px 64px rgba(0,35,111,.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;

  --transition: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Tipografía dual: DM Sans (headlines) + Inter (body) + Avenida (marca) */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'DM Sans', 'Inter', sans-serif;
  --font-brand: 'Avenida', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

/* ---------------- Header / Brand ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(249,249,249,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.brand {
  display: inline-flex; align-items: center; gap: .5rem;
  text-decoration: none;
  transition: opacity var(--transition), transform var(--transition);
}
.brand:hover { opacity: .85; }
.brand:active { transform: scale(.97); }
.brand-mark { height: 38px; width: auto; flex-shrink: 0; display: block; }
.brand-name {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: .005em;
  line-height: 1;
}
/* "Tributa" en celeste pálido (color del logo más actualizado). */
.brand-name .b-tributa { font-family: var(--font-brand); color: #c9dee9; }
/* "Soft" usa Lobster (no Avenida) — mantiene el guiño cursivo del logo histórico. */
.brand-name .b-soft { font-family: 'Lobster', cursive; color: var(--color-brand-soft); }
.site-header nav { display: flex; gap: .35rem; align-items: center; }

/* ---------------- Banner de red ---------------- */
.network-banner {
  position: fixed; top: 56px; left: 50%; transform: translateX(-50%);
  background: var(--color-error); color: white;
  padding: .65rem 1rem; border-radius: var(--radius-sm);
  z-index: 100; box-shadow: var(--shadow-md);
  max-width: calc(100% - 2rem);
  animation: slideDown var(--transition);
}
.network-banner[data-tipo="info"] { background: var(--color-info); }
.network-banner[data-tipo="warn"] { background: var(--color-warn); }

@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------------- Hero (3 líneas con colores específicos) ---------------- */
.hero {
  padding: 1.75rem 1rem 1rem;
  text-align: center;
  animation: fadeUp 600ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.02em;
}
.hero h1 .h-tiempo {
  display: block;
  color: #42A2BC;
  font-size: .78em;
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: .15em;
}
.hero h1 .h-docs {
  display: block;
  color: #c9dee9;
  font-size: 1em;
  /* Para legibilidad sobre fondos claros, le añadimos un sutil contorno
     en el color teal oscuro del logo. */
  text-shadow:
    0 1px 0 rgba(46,122,149,.15),
    0 0 1px rgba(46,122,149,.30);
}
.hero h1 .h-gratis {
  display: block;
  color: #ff931e;
  font-size: 1.4em;
  letter-spacing: .04em;
  margin-top: .15em;
  text-shadow: 0 2px 12px rgba(255,147,30,.15);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Tarjeta RUC ---------------- */
.ruc-card {
  margin: 1rem auto;
  padding: 1.1rem 1rem;
  max-width: 28rem;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  animation: fadeUp 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 100ms both;
  position: relative; /* para anclar el badge de ayuda contextual */
}
.ruc-card label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-muted);
  margin-bottom: .55rem;
}
.ruc-card input[type="tel"] {
  width: 100%;
  height: 2.9rem;
  padding: 0 .9rem;
  font-size: 1.02rem;
  letter-spacing: .12em;
  text-align: center;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-md);
  font-family: 'Inter', ui-monospace, monospace;
  background: white;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ruc-card input[type="tel"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, .15);
}
.ruc-card .help {
  color: var(--color-muted);
  font-size: .78rem;
  margin-top: .5rem;
  text-align: center;
  opacity: .8;
}
.ruc-card .btn--primary {
  height: 2.9rem;
  margin-top: .7rem;
  font-size: .9rem;
}
.feedback {
  margin-top: .65rem;
  font-size: .9rem;
  min-height: 1.2em;
  transition: color var(--transition);
}
.feedback--info  { color: var(--color-info); }
.feedback--ok    { color: var(--color-ok); }
.feedback--warn  { color: var(--color-warn); }
.feedback--error { color: var(--color-error); }

/* ---------------- Botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .9rem 1.4rem;
  font-size: 1rem; font-weight: 600;
  border: 0; border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Botón primario: armónico con los ghost (case normal, sin uppercase forzado).
   Mantenemos height y sombra. La diferencia con los ghost es color/peso visual. */
.btn--primary {
  background: var(--color-cta);
  color: white;
  width: 100%;
  height: 3rem;
  margin-top: 1rem;
  font-size: .95rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(239, 115, 6, .3);
}
.btn--primary:hover:not(:disabled) { background: var(--color-cta-dark); }
.btn--primary[aria-busy="true"]::after {
  content: ""; width: 1em; height: 1em;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-left: .5rem;
}
.btn--ghost {
  background: transparent; color: var(--color-primary);
  border: 1px solid var(--color-outline);
}
.btn--ghost:hover { background: var(--color-surface-low); }
.btn--text { background: none; color: var(--color-primary); padding: .5rem .8rem; font-weight: 600; font-size: .9rem; }
.btn--text:hover { color: var(--color-cta); }

/* Variante "inline" para botones secundarios dentro de un formulario.
   No ocupa ancho completo ni hereda el alto/tipografía del primario. */
.btn--inline {
  width: auto;
  height: auto;
  padding: .55rem 1rem;
  font-size: .85rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0;
  font-weight: 600;
}

/* Píldoras del header (Cotizar / Ayuda) — ícono minimalista + label.
   En pantallas de móvil mostramos sólo el ícono para no romper el layout. */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .85rem;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  background: white;
  color: var(--color-primary);
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn-pill:hover { background: var(--color-surface-low); border-color: var(--color-primary); }
.btn-pill:active { transform: scale(.97); }
.btn-pill:focus-visible { outline: 2px solid var(--color-cta); outline-offset: 2px; }
.btn-pill__icon { width: 16px; height: 16px; flex-shrink: 0; }
.btn-pill__label { line-height: 1; }

/* Mobile (todo lo que no sea tablet/pc): sólo ícono.
   Convertimos la píldora en un círculo táctil para mantener el área de toque. */
@media (max-width: 600px) {
  .btn-pill {
    padding: 0;
    width: 36px;
    height: 36px;
    gap: 0;
    justify-content: center;
  }
  .btn-pill__label { display: none; }
  .btn-pill__icon { width: 18px; height: 18px; }
}

/* Botones de icono pequeños (+/lapiz) — legacy, aún usado en variantes */
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 1px solid var(--color-outline);
  background: white;
  color: var(--color-primary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--color-teal-light); border-color: var(--color-teal); color: var(--color-teal-dark); }
.btn-icon:active { transform: scale(.92); }
.btn-icon svg { width: 1rem; height: 1rem; }

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

/* ---------------- Cómo funciona (4 pasos) ---------------- */
.section { padding: 1.5rem 1rem; }
.section h2 { font-size: 1.25rem; margin: 0 0 1rem; }
.como-funciona { display: grid; gap: 1.5rem; }
.como-funciona article {
  position: relative;
  padding: .25rem 0 .25rem 3rem;
  background: transparent;
  transition: transform var(--transition);
}
.como-funciona article::before {
  content: attr(data-step);
  position: absolute; left: 0; top: 0;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--color-primary-container);
  color: var(--color-on-primary-container);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
}
.como-funciona h3 {
  margin: 0 0 .25rem;
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text);
}
.como-funciona p { margin: 0; color: var(--color-muted); font-size: .88rem; }

/* ---------------- Link button (parece <a>, es <button>) ---------------- */
.link-button {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--color-primary);
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--color-cta); }

/* ---------------- Tooltip "i" + popover ---------------- */
.tooltip-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: .35rem;
  padding: 0;
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  background: white;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: .72rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.tooltip-i:hover {
  background: var(--color-primary);
  color: white;
}
.tooltip-i:active { transform: scale(.92); }
.tooltip-i:focus-visible { outline: 2px solid var(--color-cta); outline-offset: 2px; }

.tooltip-popover {
  position: fixed;
  z-index: 200;
  max-width: 18rem;
  width: calc(100% - 2rem);
  padding: .85rem 1rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: tooltipPop 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.tooltip-popover[hidden] { display: none; }
@keyframes tooltipPop {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.tooltip-popover__close {
  position: absolute;
  top: .3rem; right: .4rem;
  width: 22px; height: 22px;
  border: 0; background: transparent;
  color: var(--color-muted);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.tooltip-popover__close:hover { background: var(--color-surface-low); color: var(--color-primary); }
.tooltip-popover__title {
  margin: 0 0 .35rem;
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-primary);
  padding-right: 1.5rem;
}
.tooltip-popover__body {
  margin: 0;
  font-size: .82rem;
  color: var(--color-text);
  line-height: 1.5;
  white-space: pre-line;
}

/* ---------------- Formulario expandido ---------------- */
.registration-form {
  margin: 1.5rem 1rem;
  padding: 1.5rem 1.25rem;
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: slideUp 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.registration-form[hidden] { display: none; }
.form-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .9rem; margin-bottom: 1rem;
}
.form-header-row {
  display: flex; align-items: center; gap: .65rem;
  margin-bottom: .25rem;
}
.form-header-row h2 { margin: 0; }
.form-header .small { color: var(--color-muted); font-size: .85rem; }

/* Back button — flecha redonda con borde, usada en form-header y en modales. */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 2.25rem; height: 2.25rem;
  padding: 0;
  border: 1px solid var(--color-outline);
  border-radius: 50%;
  background: white;
  color: var(--color-primary);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform .1s ease;
}
.back-btn:hover {
  background: var(--color-surface-low);
  border-color: var(--color-primary);
}
.back-btn:active { transform: scale(.92); }
.back-btn:focus-visible { outline: 2px solid var(--color-cta); outline-offset: 2px; }
.back-btn svg { width: 1rem; height: 1rem; pointer-events: none; }

/* Versión que va dentro de un modal (anclada arriba-izquierda) */
.modal-content { position: relative; }
.modal-content .back-btn {
  position: absolute;
  top: .85rem;
  left: .85rem;
  width: 2rem;
  height: 2rem;
}
.modal-content .back-btn + h2 { padding-left: 2.5rem; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: .8rem .9rem;
  font-size: 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  background: white;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
/* Dejar espacio para la flecha nativa del <select> en móvil. Sin esto, en
   pantallas pequeñas la flecha del menú puede pisar el texto y la opción
   queda recortada (ej. "Depósito" o "Transferencia"). */
.field select {
  padding-right: 2.4rem;
  background-position: right .75rem center;
  text-overflow: ellipsis;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, .15);
}
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--color-error);
  box-shadow: 0 0 0 2px rgba(186, 26, 26, .12);
}
.field input:disabled, .field select:disabled, .field input[readonly] {
  background: var(--color-surface-low);
  color: var(--color-muted);
  cursor: not-allowed;
}
.field .error { color: var(--color-error); font-size: .85rem; min-height: 1.1em; margin-top: .25rem; }
.field .hint { color: var(--color-muted); font-size: .8rem; margin-top: .25rem; }

/* Campo con checkbox "No Aplica" */
.field-with-na {
  position: relative;
}
.field-with-na .na-toggle {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-top: .4rem;
  font-size: .82rem; color: var(--color-muted);
  cursor: pointer;
  user-select: none;
}
.field-with-na .na-toggle input[type="checkbox"] {
  width: 1rem; height: 1rem; margin: 0;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Grid de dos columnas para Provincia + Ciudad */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

.field-phone { display: flex; align-items: stretch; gap: .5rem; }
.field-phone input[type="tel"] { flex: 1; min-width: 0; }
.field-phone .celular-pais {
  flex: 0 0 auto;
  max-width: 11rem;
  padding: .8rem .55rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f7f8fb;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  appearance: auto;
  transition: border-color var(--transition);
}
.field-phone .celular-pais:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, .15);
}
@media (max-width: 480px) {
  .field-phone .celular-pais {
    max-width: 7.5rem;
    font-size: .9rem;
    padding: .8rem .4rem;
  }
}

/* Canal de verificación — íconos sobrios, sin fondo. 2 columnas (Email + WhatsApp). */
.canal-options {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin-top: .35rem;
}
.canal-options label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem;
  padding: .75rem .5rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-muted);
  background: white;
  transition: all var(--transition);
}
.canal-options input[type="radio"] { display: none; }
.canal-options label svg {
  width: 1.5rem; height: 1.5rem;
  stroke: var(--color-primary);
  fill: none;
  stroke-width: 1.7;
  transition: stroke var(--transition);
}
.canal-options label:hover:not(.canal-disabled) {
  border-color: var(--color-teal);
  color: var(--color-primary);
}
.canal-options label:has(input:checked) {
  background: white;
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(0,35,111,.12);
}
.canal-options label:has(input:checked) svg {
  stroke: var(--color-cta);
}
.canal-options label.canal-disabled {
  opacity: .4;
  cursor: not-allowed;
  background: var(--color-surface-low);
}
.canal-warn {
  display: block; color: var(--color-warn);
  font-size: .82rem; margin-top: .35rem; min-height: 1.1em;
}

details.config-avanzada {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem; margin-top: .5rem;
}
details.config-avanzada summary {
  cursor: pointer; font-weight: 600; color: var(--color-primary);
  list-style: none;
  padding: .25rem 0;
}
details.config-avanzada summary::after { content: " ▾"; transition: transform var(--transition); display: inline-block; }
details[open] summary::after { transform: rotate(180deg); }

/* Modos de facturación (cards con icono minimalista) */

/* Bloque único de establecimiento + punto de emisión (siempre editable cuando aparece) */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

.bloque-actions {
  display: flex; align-items: center; gap: .75rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}
.btn--guardar {
  width: auto;
  height: auto;
  padding: .55rem 1rem;
  font-size: .85rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 0;
}
.bloque-guardado {
  color: var(--color-teal-dark);
  font-weight: 600;
  font-size: .85rem;
}


/* Secuencias por tipo de documento (con tooltip por label) */
.secuencias {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px dashed var(--color-border);
}
.secuencias-titulo {
  font-size: .82rem; font-weight: 600; color: var(--color-muted);
  margin: 0 0 .5rem;
}
.secuencias-grid {
  display: grid; gap: .5rem;
}
.secuencia-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; align-items: center;
}
.secuencia-row .secuencia-label {
  font-size: .82rem; color: var(--color-text);
  display: inline-flex; align-items: center;
}
.secuencia-row input {
  padding: .5rem .6rem;
  font-size: .88rem;
  font-family: ui-monospace, monospace;
  text-align: right;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
}

/* Botones legacy del bloque establecimiento (mantenidos para compatibilidad) */
.btn-editar {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .35rem .7rem;
  background: transparent;
  border: 1.5px solid var(--color-edit);
  color: var(--color-edit);
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: .78rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all var(--transition);
}
.btn-editar:hover { background: var(--color-edit); color: white; }
.btn-editar.is-active { background: var(--color-edit); color: white; }

.banner-warn {
  background: var(--color-warn-container); border: 1px solid #fbd2a8;
  color: var(--color-warn); padding: .7rem 1rem; border-radius: var(--radius-md);
  font-size: .9rem; margin-bottom: 1rem;
}

/* Bloque de Términos y Condiciones */
.terminos {
  margin: 1.25rem 0 .5rem;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-low);
}
.terminos-label {
  display: flex; align-items: flex-start; gap: .65rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--color-text);
  line-height: 1.5;
}
.terminos-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 1.1rem; height: 1.1rem;
  margin: 0;
  margin-top: 2px;
  accent-color: var(--color-cta);
  cursor: pointer;
}
.terminos-label .link-button {
  font-weight: 600;
}

/* ---------------- Modales ---------------- */
dialog {
  border: 0; padding: 0; background: transparent;
  max-width: 28rem; width: calc(100% - 2rem);
  border-radius: var(--radius-lg);
}
dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
dialog.is-open .modal-content {
  animation: modalPop 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.modal-content {
  background: white;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
}
.modal-content--wide { max-width: 34rem; }
.modal-content h2 { margin: 0 0 .5rem; font-size: 1.3rem; color: var(--color-primary); }
.modal-content p { color: var(--color-muted); margin: 0 0 1rem; }

dialog#modal-cotizar,
dialog#modal-pago,
dialog#modal-terms {
  max-width: 34rem;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.codigo-input { display: flex; gap: .5rem; justify-content: center; margin: 1rem 0; }
.codigo-input input {
  width: 2.6rem; height: 3.2rem;
  text-align: center; font-size: 1.4rem; font-weight: 700;
  border: 2px solid var(--color-border); border-radius: var(--radius-md);
  font-family: ui-monospace, monospace;
  transition: border-color var(--transition), transform var(--transition);
}
.codigo-input input:focus {
  outline: none; border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, .15);
}
.modal-actions { display: flex; gap: .5rem; flex-direction: column; margin-top: 1rem; }
.modal-actions[hidden] { display: none; } /* sobre-escribe display:flex cuando se oculta */
/* Dentro de un modal todos los botones tienen el MISMO alto y peso visual.
   Esto evita que el primary (3.25rem + uppercase) se vea más grande que el
   ghost (alto por padding). Misma regla para .firma-options (subir / saltar). */
.modal-actions .btn,
.firma-options .btn {
  width: 100%;
  height: 3rem;
  min-height: 3rem;
  margin-top: 0;
  font-size: .95rem;
  padding: 0 1rem;
}
.modal-actions.modal-actions--split { flex-direction: row; }
.modal-actions--split .btn { flex: 1; width: auto; }
.modal-hint { color: var(--color-info); font-size: .78rem; text-align: center; }

/* Fuerza de clave — 3 niveles (Baja / Media / Alta) con la paleta del logo */
.fuerza-clave {
  height: 8px; background: var(--color-border); border-radius: 999px;
  position: relative; overflow: hidden; margin: .5rem 0 .25rem;
}
.fuerza-clave::after {
  content: "";
  position: absolute; inset: 0; right: auto;
  width: 0%;
  background: #ff931e;
  border-radius: 999px;
  transition: width var(--transition), background var(--transition);
}
.fuerza-clave[data-nivel="0"]::after { width: 33%; background: #ff931e; }       /* Baja */
.fuerza-clave[data-nivel="1"]::after { width: 66%; background: #c9dee9; }       /* Media */
.fuerza-clave[data-nivel="2"]::after { width: 100%; background: #42A2BC; }      /* Alta */

.fuerza-clave-label {
  margin: 0 0 .85rem;
  font-size: .82rem;
  color: var(--color-muted);
}
.fuerza-clave-label strong { font-weight: 700; }
.fuerza-clave-label[data-nivel="0"] strong { color: #c95e02; }
.fuerza-clave-label[data-nivel="1"] strong { color: #2E7A95; }
.fuerza-clave-label[data-nivel="2"] strong { color: #1E5666; }

.requisitos-clave { list-style: none; padding: 0; margin: .5rem 0 1rem; font-size: .85rem; color: var(--color-muted); }
.requisitos-clave li { padding-left: 1.4rem; position: relative; line-height: 1.8; }
.requisitos-clave li::before {
  content: "○"; position: absolute; left: 0;
  transition: color var(--transition), content var(--transition);
}
.requisitos-clave li.cumplido { color: var(--color-teal-dark); }
.requisitos-clave li.cumplido::before { content: "✓"; color: var(--color-teal-dark); }

/* Firma uploader */
.firma-options { display: grid; gap: .65rem; margin-top: 1rem; }
.firma-uploader { display: none; }
.firma-clave-step[hidden] { display: none; }
.firma-clave-step { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
.firma-nombre { font-family: ui-monospace, monospace; font-size: .85rem; color: var(--color-muted); }

.firma-archivo-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem; margin-bottom: .5rem;
}
.firma-archivo-row p { margin: 0; }
.btn-link-firma {
  background: transparent;
  border: 0;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: .25rem .35rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--transition);
  font-family: inherit;
}
.btn-link-firma:hover { color: var(--color-cta); }
.btn-link-firma:active { transform: scale(.97); }
.firma-error { color: var(--color-error); font-size: .9rem; min-height: 1.1em; margin-top: .35rem; }

.firma-resumen-titulo {
  margin: 0 0 .5rem; font-weight: 600; color: var(--color-success, #1d7a3a);
  font-size: .9rem; display: flex; align-items: center; gap: .35rem;
}
.firma-resumen-titulo::before {
  content: ""; display: inline-block; width: 14px; height: 14px;
  background: var(--color-success, #1d7a3a);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center / contain no-repeat;
}
.firma-resumen {
  background: var(--color-teal-light);
  border: 1px solid #c9e7ee;
  border-radius: var(--radius-md);
  padding: .75rem .85rem;
  margin-top: .75rem;
  font-size: .88rem;
  animation: slideUp 350ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.firma-resumen-row {
  display: flex; justify-content: space-between; gap: .75rem;
  padding: .15rem 0;
}
.firma-resumen-label { color: var(--color-muted); font-weight: 500; }
.firma-resumen-value {
  color: var(--color-primary); font-weight: 600; text-align: right;
  font-family: ui-monospace, monospace; font-size: .82rem;
}

/* ---------------- Modal Contratar (validar RUC) ---------------- */
.contratar-ruc-ok {
  margin: .35rem 0 0;
  padding: .55rem .75rem;
  font-size: .85rem;
  color: var(--color-teal-dark);
  background: var(--color-teal-light);
  border: 1px solid #c9e7ee;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: .4rem;
  animation: slideUp 200ms ease both;
}
.contratar-ruc-ok::before {
  content: "✓"; font-weight: 700; color: var(--color-teal-dark);
}

/* ---------------- Modal Confirmación final ---------------- */
.confirm-credentials {
  margin-top: .85rem;
  padding: .85rem 1rem;
  background: var(--color-teal-light);
  border: 1px solid var(--color-teal);
  border-radius: var(--radius-md);
}
.confirm-credentials-line {
  margin: 0;
  font-size: .9rem;
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: baseline;
}
.confirm-credentials-line span { color: var(--color-muted); }
.confirm-credentials-line strong {
  font-family: ui-monospace, monospace;
  color: var(--color-primary);
  font-size: 1.05rem;
  letter-spacing: .04em;
}

/* ---------------- Modal Logo / Banner ---------------- */
.logo-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin: .75rem 0 .5rem;
}
@media (max-width: 480px) {
  .logo-options { grid-template-columns: 1fr; }
}
.logo-options .btn {
  width: 100%;
  height: 3rem;
  min-height: 3rem;
  padding: 0 1rem;
  font-size: .95rem;
  margin-top: 0;
  white-space: nowrap;
}
.logo-preview-wrap {
  margin-top: 1rem;
  animation: slideUp 280ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.logo-preview-wrap[hidden] { display: none; }
.logo-preview-label {
  margin: 0 0 .35rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-muted);
}
.logo-preview-frame {
  /* Aspect ratio del banner real: 2970:300 = 9.9 : 1.
     Forzamos esa proporción con padding-bottom para que el preview luzca
     exactamente como lo verá el cliente final. */
  position: relative;
  width: 100%;
  padding-bottom: calc(300 / 2970 * 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#f2f2f2 0% 25%, #ffffff 0% 50%) 0 0 / 16px 16px;
  overflow: hidden;
}
.logo-preview-frame canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.logo-preview-source {
  margin: .4rem 0 0;
  font-size: .75rem;
  color: var(--color-muted);
  text-align: right;
  font-style: italic;
}

#logo-error { min-height: 1.1em; }

/* ---------------- Modal Cotizar ---------------- */
.cotizar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 480px) {
  .cotizar-grid { grid-template-columns: 1fr; gap: 0; }
}
.cot-resumen {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--color-teal);
  border-radius: var(--radius-md);
  background: var(--color-teal-light);
  animation: slideUp 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cot-resumen[hidden] { display: none; }
.cot-resumen h3 {
  margin: 0 0 .65rem;
  font-size: 1rem;
  color: var(--color-primary);
}
.cot-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .35rem 0;
  border-bottom: 1px dashed rgba(0,35,111,.12);
  font-size: .92rem;
}
.cot-row:last-of-type { border-bottom: 0; }
.cot-row strong {
  font-family: ui-monospace, monospace;
  color: var(--color-primary);
}
.cot-row--total {
  margin-top: .35rem;
  padding-top: .65rem;
  border-top: 2px solid var(--color-primary);
  border-bottom: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.cot-row--total strong { color: var(--color-cta); font-size: 1.15rem; }
.cot-vigencia {
  margin: .65rem 0 .85rem;
  font-size: .85rem;
  color: var(--color-muted);
  text-align: center;
}
.cot-vigencia strong { color: var(--color-primary); }

/* ---------------- Modal Pago ---------------- */
.pago-importante {
  margin-top: 1rem;
  padding: .85rem 1rem;
  background: var(--color-warn-container);
  border: 1px solid #fbd2a8;
  border-radius: var(--radius-md);
}
.pago-importante h4 {
  margin: 0 0 .5rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--color-warn);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pago-importante ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-text);
  font-size: .82rem;
  line-height: 1.55;
}
.pago-importante li { margin-bottom: .25rem; }

.btn--soporte {
  background: #25D366;
  color: white;
  border: 0;
}
.btn--soporte:hover { background: #1ebd5a; color: white; }

/* Variante de soporte para el botón "No tengo firma" — verde WhatsApp tenue
   en el borde, distinto al primary/ghost normales para que sugiera que es
   una acción de "ayuda externa". */
.btn--soporte-firma {
  border: 1px solid #25D366;
  color: #128C3F;
  background: white;
}
.btn--soporte-firma:hover {
  background: rgba(37, 211, 102, .08);
  border-color: #1ebd5a;
  color: #128C3F;
}

/* ---------------- Modal Información Bancaria ---------------- */
.bank-titular { margin: 0 0 .15rem; font-size: .95rem; }
.bank-ruc { margin: 0 0 .85rem; color: var(--color-muted); font-size: .85rem; display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.bank-ruc .mono { font-family: ui-monospace, monospace; }
.bank-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.bank-list li {
  display: flex; justify-content: space-between; align-items: center;
  gap: .75rem;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--color-border);
  font-size: .9rem;
}
.bank-list li:last-child { border-bottom: 0; }
.bank-label { color: var(--color-text); font-weight: 500; }
.bank-num {
  font-family: ui-monospace, monospace;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .92rem;
}
.bank-email {
  margin: 0 0 .25rem;
  font-size: .85rem;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.bank-email a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Wrapper que agrupa valor + botón de copiar en la misma "celda" inline. */
.bank-value {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

/* Botón Copiar (clipboard) — pequeño, inline, con feedback al copiar.
   El SVG por defecto se reemplaza temporalmente por un checkmark cuando
   la operación tiene éxito (.is-copied). */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--color-outline);
  background: white;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform .1s ease;
  flex-shrink: 0;
}
.copy-btn:hover {
  background: var(--color-teal-light);
  border-color: var(--color-teal);
  color: var(--color-teal-dark);
}
.copy-btn:active { transform: scale(.92); }
.copy-btn:focus-visible { outline: 2px solid var(--color-cta); outline-offset: 2px; }
.copy-btn svg {
  width: .9rem;
  height: .9rem;
  pointer-events: none;
}
.copy-btn__icon--success { display: none; }
.copy-btn.is-copied {
  background: var(--color-ok-container);
  border-color: var(--color-ok);
  color: var(--color-ok);
}
.copy-btn.is-copied .copy-btn__icon--default { display: none; }
.copy-btn.is-copied .copy-btn__icon--success { display: block; }

/* ---------------- Modal Términos (scroll-to-bottom) ---------------- */
.modal-content--terms { max-width: 36rem; }
.terms-body {
  max-height: 50vh;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--color-text);
  scrollbar-gutter: stable;
}
.terms-body h3 {
  margin: 1.2rem 0 .35rem;
  font-size: .95rem;
  color: var(--color-primary);
}
.terms-body h3:first-child { margin-top: 0; }
.terms-body p { margin: 0 0 .55rem; color: var(--color-text); }
.terms-body ul, .terms-body ol { margin: 0 0 .65rem 1.2rem; padding: 0; }
.terms-body li { margin-bottom: .25rem; }
.terms-hint {
  margin: .65rem 0 0;
  font-size: .8rem;
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
}
.terms-hint.is-bottom { color: var(--color-teal-dark); font-style: normal; font-weight: 600; }

/* Animación de "highlight" para el campo razón social al hacer scroll */
@keyframes highlightField {
  0%   { box-shadow: 0 0 0 0 rgba(135, 199, 220, 0); border-color: var(--color-border); }
  30%  { box-shadow: 0 0 0 6px rgba(135, 199, 220, .35); border-color: var(--color-brand-tributa); }
  100% { box-shadow: 0 0 0 0 rgba(135, 199, 220, 0); border-color: var(--color-border); }
}
.field input.is-highlighted {
  animation: highlightField 1600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------------- Success — check con teal del logo ---------------- */
.success {
  padding: 3rem 1.25rem;
  text-align: center;
  animation: fadeUp 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.success[hidden] { display: none; }
.success h2 { font-size: 1.8rem; margin: 1rem 0 .5rem; color: var(--color-primary); }
.check-icon {
  width: 80px; height: 80px; margin: 0 auto;
  border-radius: 50%; background: var(--color-teal);
  position: relative;
  animation: bounceIn 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.check-icon::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 30px; height: 16px;
  border-left: 5px solid white; border-bottom: 5px solid white;
  transform: translate(-50%, -65%) rotate(-45deg);
  animation: checkDraw 400ms 250ms ease-out both;
}
@keyframes bounceIn {
  0% { transform: scale(.3); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes checkDraw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* ---------------- Footer ---------------- */
.site-footer {
  padding: 2rem 1rem; text-align: center;
  color: var(--color-muted); font-size: .85rem;
  border-top: 1px solid var(--color-border); margin-top: 2rem;
}

/* ---------------- Desktop ---------------- */
@media (min-width: 768px) {
  .hero, .ruc-card, .section, .registration-form {
    max-width: 720px; margin-left: auto; margin-right: auto;
  }
  .hero h1 .h-tiempo { font-size: .85em; }
  .hero h1 .h-gratis { font-size: 1.6em; }
  .como-funciona { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
  .como-funciona article { padding-left: 2.6rem; }
  .modal-actions { flex-direction: row-reverse; }
  .modal-actions .btn { width: auto; flex: 1; }
}

/* =========================================================================
   MANUAL INTERACTIVO — modal full-screen con sidebar + animation stage
   ========================================================================= */

dialog.manual-modal {
  max-width: min(1180px, 96vw);
  width: 96vw;
  max-height: 92vh;
  border-radius: var(--radius-lg);
  padding: 0;
}
.manual-modal::backdrop {
  background: rgba(15, 23, 42, .65);
  backdrop-filter: blur(4px);
}
.manual-shell {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 92vh;
}
.manual-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1.25rem;
  border-bottom: 2px solid var(--color-primary);
  background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
}
/* Header con la marca corporativa (logo PNG + Avenida + Lobster) — replica
   exactamente la papelería de TributaSoft. */
.manual-brand-block {
  flex: 1;
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none;
  min-width: 0;
}
.manual-brand-mark {
  height: 38px;
  width: auto;
  flex-shrink: 0;
}
.manual-brand-wordmark {
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: .005em;
  line-height: 1;
  flex-shrink: 0;
}
.manual-brand-tributa {
  font-family: 'Avenida', 'DM Sans', sans-serif;
  color: #c9dee9;
}
.manual-brand-soft {
  font-family: 'Lobster', cursive;
  color: var(--color-cta);
}
.manual-brand-tagline {
  font-family: 'Lobster', cursive;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1;
  margin-left: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .manual-brand-tagline { display: none; }
  .manual-brand-wordmark { font-size: 1.2rem; }
  .manual-brand-mark { height: 30px; }
}
.manual-header-actions {
  display: flex; gap: .5rem; align-items: center; flex-shrink: 0;
}
.manual-pdf-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  background: white;
  color: var(--color-primary);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.manual-pdf-btn:hover { background: var(--color-surface-low); border-color: var(--color-primary); }
.manual-pdf-btn:disabled { opacity: .5; cursor: not-allowed; }
.manual-close {
  width: 2.25rem; height: 2.25rem;
  border: 1px solid var(--color-outline);
  border-radius: 50%;
  background: white;
  color: var(--color-muted);
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.manual-close:hover { background: var(--color-surface-low); color: var(--color-primary); }

.manual-tabs {
  display: flex;
  gap: 2px;
  padding: 0 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}
.manual-tab {
  flex: 1;
  padding: .85rem 1rem;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  border-bottom: 3px solid transparent;
  transition: all .15s ease;
}
.manual-tab:hover { color: var(--color-primary); background: rgba(0, 35, 111, .03); }
.manual-tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-cta);
  background: white;
}
.manual-tab-label { font-weight: 700; font-size: .95rem; }
.manual-tab-count { font-size: .75rem; color: var(--color-muted); }
.manual-tab.is-active .manual-tab-count { color: var(--color-cta); }

.manual-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-height: 0;
}
@media (max-width: 768px) {
  .manual-body { grid-template-columns: 1fr; }
  .manual-sidebar { display: none; }
}

.manual-sidebar {
  border-right: 1px solid var(--color-border);
  background: #f8fafc;
  overflow-y: auto;
  padding: 1.1rem 1rem;
}
.manual-sidebar-intro h3 {
  margin: 0 0 .35rem;
  font-size: .92rem;
  color: var(--color-primary);
  font-family: var(--font-body);
}
.manual-sidebar-intro p {
  margin: 0 0 1rem;
  font-size: .8rem;
  color: var(--color-muted);
  line-height: 1.4;
}
.manual-step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column; gap: .15rem;
}
.manual-step-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .85rem;
  color: var(--color-text);
  transition: all .15s ease;
}
.manual-step-item:hover { background: rgba(0, 35, 111, .04); }
.manual-step-bullet {
  flex-shrink: 0;
  width: 1.45rem; height: 1.45rem;
  border-radius: 50%;
  background: var(--color-surface);
  color: var(--color-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  transition: all .15s ease;
}
.manual-step-item.is-active { background: rgba(239, 115, 6, .08); color: var(--color-primary); font-weight: 600; }
.manual-step-item.is-active .manual-step-bullet { background: var(--color-cta); color: white; }
.manual-step-item.is-completed .manual-step-bullet { background: var(--color-teal); color: white; }
.manual-step-name { line-height: 1.3; }

.manual-main {
  display: grid;
  grid-template-rows: minmax(280px, 50%) 1fr;
  overflow: hidden;
  min-height: 0;
}
@media (max-height: 720px) {
  .manual-main { grid-template-rows: minmax(220px, 45%) 1fr; }
}
.manual-stage-wrap {
  position: relative;
  background: linear-gradient(135deg, #f1f5f9 0%, #e3f2f8 100%);
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}
.manual-stage {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  overflow: auto;
  transition: max-width var(--transition);
}
/* Cuando el stage tiene data-device, limitamos el ancho del mock dentro
   para simular el viewport del dispositivo seleccionado. */
.manual-stage[data-device="pc"] .mock { max-width: 560px; width: 100%; }
.manual-stage[data-device="tablet"] .mock { max-width: 380px; width: 100%; }
.manual-stage[data-device="mobile"] .mock { max-width: 280px; width: 100%; }

/* Toggle PC/Tablet/Móvil (arriba del stage) */
.manual-device-toggle {
  position: absolute;
  top: .65rem; left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 0;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  padding: .15rem;
  z-index: 5;
  box-shadow: var(--shadow-sm);
}
.manual-device-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .65rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--color-muted);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.manual-device-btn:hover { color: var(--color-primary); }
.manual-device-btn.is-active {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
}
.manual-device-btn span { letter-spacing: .02em; }
@media (max-width: 640px) {
  .manual-device-toggle { padding: .1rem; }
  .manual-device-btn { padding: .2rem .5rem; font-size: .68rem; }
  .manual-device-btn span { display: none; }
}
.manual-replay {
  position: absolute;
  bottom: .85rem; right: .85rem;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .8rem;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--color-primary);
  font-size: .78rem; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s ease;
  backdrop-filter: blur(4px);
}
.manual-replay:hover { background: white; border-color: var(--color-primary); }

.manual-content {
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}
.manual-step-head { margin-bottom: .65rem; }
.manual-step-num {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--color-cta);
  text-transform: uppercase;
}
.manual-step-title {
  margin: .25rem 0 0;
  font-size: 1.4rem;
  color: var(--color-primary);
  font-family: var(--font-display);
}
.manual-step-intro {
  margin: 0 0 1.1rem;
  font-size: .92rem;
  color: var(--color-text);
  line-height: 1.55;
}
.manual-section { margin-bottom: 1rem; }
.manual-section h4 {
  margin: 0 0 .4rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.manual-rules, .manual-errors {
  list-style: none; padding: 0; margin: 0;
}
.manual-rules li {
  padding: .35rem 0 .35rem 1.1rem;
  position: relative;
  font-size: .85rem; color: var(--color-text);
  line-height: 1.45;
  border-bottom: 1px dashed var(--color-border);
}
.manual-rules li:last-child { border-bottom: 0; }
.manual-rules li::before {
  content: "✓"; position: absolute; left: 0; top: .35rem;
  color: var(--color-teal-dark); font-weight: 700;
  font-size: .85rem;
}
.manual-errors li {
  padding: .45rem .65rem;
  background: var(--color-warn-container);
  border: 1px solid #fbd2a8;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: var(--color-text);
  line-height: 1.45;
  margin-bottom: .35rem;
}
.manual-errors li code {
  display: inline-block;
  background: var(--color-warn);
  color: white;
  padding: .08rem .4rem;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  margin-right: .3rem;
}
.manual-no-errors {
  background: var(--color-teal-light) !important;
  border-color: #c9e7ee !important;
  color: var(--color-teal-dark) !important;
}
.manual-tip {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .75rem .85rem;
  background: rgba(135, 199, 220, .12);
  border-left: 3px solid var(--color-teal);
  border-radius: var(--radius-sm);
}
.manual-tip-icon { font-size: 1.1rem; line-height: 1.2; }
.manual-tip p { margin: 0; font-size: .85rem; color: var(--color-text); line-height: 1.55; }
.manual-tip[hidden] { display: none; }

.manual-footer {
  display: flex; flex-direction: column; gap: .5rem;
  padding: .65rem 1.25rem .85rem;
  border-top: 1px solid var(--color-border);
  background: #fbfbfd;
}
.manual-footer-row {
  display: flex; align-items: center; gap: 1rem;
}
/* Traza "Manual de Usuario · Registro | Cotización | Pago" — proceso
   activo resaltado en navy/bold; los demás clickables para cambiar de tab. */
.manual-trace {
  text-align: center;
  font-size: .78rem;
  color: var(--color-muted);
  padding: .35rem 0 .15rem;
  border-bottom: 1px dashed var(--color-border);
}
.manual-trace-prefix {
  font-weight: 700;
  color: var(--color-primary);
}
.manual-trace-procs {
  display: inline-flex; align-items: center; gap: .35rem; flex-wrap: wrap;
  justify-content: center;
}
.manual-trace-proc {
  cursor: pointer;
  padding: .1rem .35rem;
  border-radius: 4px;
  transition: all .15s ease;
}
.manual-trace-proc:hover { background: var(--color-surface-low); color: var(--color-primary); }
.manual-trace-proc.is-active {
  color: var(--color-primary);
  font-weight: 700;
  background: rgba(239, 115, 6, .08);
}
.manual-trace-sep { color: var(--color-outline); }
.manual-prev, .manual-next {
  padding: .55rem 1rem;
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-primary);
  font-family: inherit;
  font-size: .85rem; font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
}
.manual-prev:hover:not(:disabled), .manual-next:hover:not(:disabled) {
  background: var(--color-surface-low);
  border-color: var(--color-primary);
}
.manual-prev:disabled, .manual-next:disabled { opacity: .35; cursor: not-allowed; }
.manual-next {
  background: var(--color-cta);
  color: white;
  border-color: var(--color-cta);
}
.manual-next:hover:not(:disabled) {
  background: var(--color-cta-dark);
  border-color: var(--color-cta-dark);
  color: white;
}
.manual-progress {
  flex: 1;
  display: flex; align-items: center; gap: .65rem;
}
.manual-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.manual-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-cta) 0%, #ffaa50 100%);
  border-radius: 999px;
  transition: width .35s ease;
}
.manual-progress-text {
  font-size: .78rem; font-weight: 700;
  color: var(--color-muted);
  font-family: ui-monospace, monospace;
  min-width: 3rem; text-align: right;
}

/* =========================================================================
   MOCK UI — fragmentos que imitan los componentes reales del producto.
   Usados dentro del manual-stage para las animaciones de cada paso.
   ========================================================================= */
.mock {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 30px rgba(0, 35, 111, .12);
  padding: 1.1rem 1.25rem;
  width: min(420px, 100%);
  max-height: 100%;
  overflow: hidden;
}
.mock-rcard { width: min(380px, 100%); }
.mock-form { width: min(360px, 100%); }
.mock-cot { width: min(420px, 100%); }
.mock-token { width: min(360px, 100%); text-align: center; }
.mock-firma { width: min(380px, 100%); }
.mock-pill-target {
  background: white;
  display: inline-flex;
  padding: .65rem 1rem;
  border-radius: var(--radius-md);
}

.mock-label {
  text-align: center;
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--color-muted);
  text-transform: uppercase;
  margin-bottom: .55rem;
}
.mock-form-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: .55rem;
}
.mock-input {
  width: 100%;
  padding: .65rem .8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  font-family: ui-monospace, monospace;
  font-size: .9rem;
  text-align: center;
  letter-spacing: .12em;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.mock-input.mock-focused {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 35, 111, .15);
}
.mock-input.mock-success { border-color: var(--color-teal-dark); box-shadow: 0 0 0 3px rgba(46, 122, 149, .25); }
.mock-tiny { padding: .45rem .55rem; font-size: .8rem; text-align: left; letter-spacing: 0; font-family: var(--font-body); }
.mock-help {
  margin: .5rem 0 0;
  text-align: center;
  font-size: .72rem;
  color: var(--color-muted);
}
.mock-help--center { text-align: center; }
.mock-row {
  display: flex; align-items: center; gap: .55rem;
  margin-bottom: .55rem;
}
.mock-flabel {
  flex: 0 0 6.5rem;
  font-size: .75rem;
  color: var(--color-muted);
  font-weight: 600;
}
.mock-row .mock-input { flex: 1; }
.mock-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  margin-top: .65rem;
  padding: .65rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: .9rem; font-weight: 700;
  cursor: pointer;
  border: 0;
  transition: all .15s ease;
  position: relative;
}
.mock-btn--cta {
  background: var(--color-cta);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 115, 6, .3);
}
.mock-btn--ghost {
  background: white;
  color: var(--color-primary);
  border: 1px solid var(--color-outline);
}
.mock-btn--wa {
  background: white;
  color: #128C3F;
  border: 1px solid #25D366;
}
.mock-btn--small { padding: .55rem .85rem; font-size: .82rem; margin-top: .55rem; }
.mock-btn.mock-clicked { transform: scale(.94); box-shadow: 0 0 0 4px rgba(239, 115, 6, .35); }
.mock-btn.mock-clicked-after { box-shadow: 0 0 0 0 rgba(239, 115, 6, 0); transition: box-shadow .25s ease; }
.mock-btn.mock-success { box-shadow: 0 0 0 4px rgba(46, 122, 149, .4); }
.mock-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .45rem .9rem;
  border: 1px solid var(--color-outline);
  border-radius: 999px;
  font-size: .85rem;
  color: var(--color-primary);
  font-weight: 600;
  background: white;
  transition: all .15s ease;
}
.mock-pill.mock-clicked { background: var(--color-cta); color: white; border-color: var(--color-cta); transform: scale(.95); }

/* Token codigo */
.mock-token-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-primary);
}
.mock-token-sub {
  font-size: .82rem;
  color: var(--color-muted);
  margin: .35rem 0 .85rem;
}
.mock-codigo {
  display: flex; gap: .35rem; justify-content: center;
  margin-bottom: .75rem;
}
.mock-cdig {
  width: 2.2rem; height: 2.7rem;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 1.1rem; font-weight: 700;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--color-text);
  transition: all .15s ease;
}
.mock-cdig.mock-focused { border-color: var(--color-primary); transform: translateY(-2px); }
.mock-cdig-filled { border-color: var(--color-primary); background: white; }
.mock-cdig.mock-success { border-color: var(--color-teal-dark); background: var(--color-teal-light); }

/* Strength bar */
.mock-bar {
  height: 7px;
  background: var(--color-border);
  border-radius: 999px;
  margin: .25rem 0;
  overflow: hidden;
}
.mock-bar-fill {
  height: 100%; width: 0%;
  background: #ff931e;
  transition: width .25s ease, background .25s ease;
}
.mock-bar-label {
  font-size: .72rem;
  color: var(--color-muted);
  margin: 0 0 .35rem;
}

/* Firma result */
.mock-firma-options {
  display: flex; flex-direction: column; gap: .35rem;
}
.mock-firma-options .mock-btn { margin-top: 0; }
.mock-firma-result {
  margin-top: .7rem;
  padding: .65rem .75rem;
  background: var(--color-teal-light);
  border: 1px solid #c9e7ee;
  border-radius: var(--radius-md);
  font-size: .8rem;
}
.mock-firma-result[hidden] { display: none; }
.mock-firma-result.mock-success { animation: mockFlash 700ms ease; }
.mock-firma-row {
  display: flex; justify-content: space-between;
  font-family: ui-monospace, monospace;
  padding: .15rem 0;
}
.mock-firma-row span { color: var(--color-muted); }
.mock-firma-row strong { color: var(--color-primary); }

/* Logo banner */
.mock-logo-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem;
}
.mock-logo-options .mock-btn { margin-top: 0; }
.mock-banner-wrap { margin-top: .85rem; }
.mock-banner-wrap[hidden] { display: none; }
.mock-banner {
  width: 100%;
  height: 30px;
  background: linear-gradient(180deg, #87C7DC 0 4px, #fff 4px calc(100% - 4px), #EF7306 calc(100% - 4px) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  animation: mockFadeIn 380ms ease;
}

/* Cotizador resumen */
.mock-cot-resumen {
  margin-top: .75rem;
  padding: .65rem .85rem;
  background: var(--color-teal-light);
  border: 1px solid var(--color-teal);
  border-radius: var(--radius-md);
  font-size: .82rem;
  animation: mockFadeIn 350ms ease;
}
.mock-cot-resumen[hidden] { display: none; }
.mock-cot-resumen.mock-success { animation: mockFlash 700ms ease; }
.mock-cot-row {
  display: flex; justify-content: space-between;
  padding: .25rem 0;
  border-bottom: 1px dashed rgba(0,35,111,.12);
}
.mock-cot-row:last-of-type { border-bottom: 0; }
.mock-cot-row strong { font-family: ui-monospace, monospace; color: var(--color-primary); }
.mock-cot-row--total {
  margin-top: .15rem;
  padding-top: .55rem;
  border-top: 2px solid var(--color-primary);
  font-weight: 700;
  font-size: .92rem;
}
.mock-cot-row--total strong { color: var(--color-cta); }

/* Pago */
.mock-file {
  flex: 1;
  padding: .45rem .55rem;
  border: 1px dashed var(--color-outline);
  border-radius: var(--radius-md);
  font-size: .78rem;
  color: var(--color-muted);
  text-align: center;
  background: white;
  transition: all .15s ease;
}
.mock-file.mock-clicked { border-style: solid; border-color: var(--color-primary); background: var(--color-teal-light); }
.mock-file.mock-file--ok { border-color: var(--color-teal-dark); color: var(--color-teal-dark); border-style: solid; font-family: ui-monospace, monospace; }
.mock-confirm-user {
  margin: .65rem 0;
  padding: .55rem .75rem;
  background: var(--color-teal-light);
  border-radius: var(--radius-md);
  font-size: .82rem;
}
.mock-confirm-user strong { font-family: ui-monospace, monospace; color: var(--color-primary); }
.mock-cont-result[hidden] { display: none; }

/* ---------------- Mocks nuevos para el manual (wizard 8 pasos) ---------------- */

/* Campo bloqueado en mock (gris, no editable visualmente) */
.mock-input.mock-locked {
  background: var(--color-surface-low);
  color: var(--color-muted);
  font-weight: 600;
}

/* Fila con dos campos (Establecimiento + Punto) */
.mock-row--split {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  align-items: center;
}
.mock-row--split .mock-flabel { min-width: 0; flex: 0 0 auto; }
.mock-row--split .mock-input { flex: 1; min-width: 60px; }

/* Radio del modo (mock visual) */
.mock-radio-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: .35rem 0 .65rem;
}
.mock-radio {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .78rem;
  color: var(--color-muted);
  transition: all .15s ease;
}
.mock-radio-dot {
  display: inline-block;
  width: 14px; height: 14px;
  border: 1.5px solid var(--color-outline);
  border-radius: 50%;
  flex-shrink: 0;
}
.mock-radio.mock-radio-active {
  border-color: var(--color-cta);
  background: var(--color-cta-light);
  color: var(--color-primary);
}
.mock-radio.mock-radio-active .mock-radio-dot {
  border-color: var(--color-cta);
  background: radial-gradient(circle, var(--color-cta) 0 5px, transparent 5px);
}

/* Resumen (pantalla 8) — tarjetas con Editar */
.mock-resumen {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-width: 320px;
}
.mock-resumen-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: .6rem .75rem;
  font-size: .78rem;
}
.mock-resumen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: .4rem;
}
.mock-resumen-head strong { color: var(--color-primary); font-size: .82rem; }
.mock-resumen-row {
  display: flex;
  justify-content: space-between;
  padding: .15rem 0;
  font-size: .72rem;
  border-top: 1px dashed var(--color-border);
}
.mock-resumen-row span:first-child { color: var(--color-muted); }
.mock-resumen-row span:last-child { color: var(--color-text); font-weight: 600; }

/* Pill de prefijo de país en el celular del mock */
.mock-row--phone { gap: .35rem; flex-wrap: nowrap; }
.mock-pais-pill {
  display: inline-flex; align-items: center;
  padding: .25rem .5rem;
  font-size: .68rem;
  font-weight: 600;
  background: var(--color-teal-light);
  color: var(--color-teal-dark);
  border-radius: 6px;
  border: 1px solid var(--color-outline);
  flex-shrink: 0;
}
.mock-input--phone { flex: 1; min-width: 0; }

/* Resumen estático del paso 8 — un poco más espacioso */
.mock-resumen-static .mock-resumen { max-width: 100%; }
.mock-resumen-static { padding-bottom: .65rem; }
.mock-btn--full { width: 100%; margin-top: .35rem; }
.mock-help--tiny { font-size: .68rem; margin-top: .35rem; opacity: .85; }
.mock-resumen-card--creds { background: rgba(135, 199, 220, .14); }
.mock-mono { font-family: 'Courier New', monospace; letter-spacing: .03em; }

/* Token dual: dos bloques (email + SMS) en el mock paso 3 */
.mock-token--dual {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: .85rem 1rem;
}
.mock-token--dual .mock-token-title {
  text-align: center;
  margin-bottom: .25rem;
}
.mock-token-block {
  background: var(--color-surface-low);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: .55rem .7rem;
}
.mock-token-chan {
  font-size: .68rem;
  color: var(--color-muted);
  margin-bottom: .35rem;
  text-align: center;
}
.mock-token-chan strong { color: var(--color-primary); }
.mock-token-ico { margin-right: .15rem; }
.mock-token--dual .mock-codigo {
  display: flex; justify-content: center; gap: .3rem;
}
.mock-token--dual .mock-cdig {
  width: 28px; height: 32px;
}

/* Botón Ayuda dentro de modales (Cotizar / Pago) */
.modal-help-btn {
  position: absolute;
  top: 1rem;
  right: 3.5rem;
  background: var(--color-teal-light);
  border: 1px solid var(--color-teal-dark);
  color: var(--color-teal-dark);
  border-radius: 999px;
  padding: .35rem .7rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: all var(--transition);
}
.modal-help-btn:hover {
  background: var(--color-teal-dark);
  color: white;
}

/* Botón Volver en el header del manual (solo cuando _returnTo está activo) */
.manual-volver {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .75rem;
  border: 1px solid var(--color-outline);
  background: white;
  color: var(--color-primary);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.manual-volver:hover {
  background: var(--color-teal-light);
  border-color: var(--color-teal-dark);
}
.manual-volver[hidden] { display: none; }

/* Cursor virtual */
.mock-cursor {
  position: absolute;
  top: 0; left: 0;
  width: 22px; height: 22px;
  pointer-events: none;
  z-index: 10;
  background:
    radial-gradient(circle at 30% 30%, white 0 2px, transparent 2px),
    linear-gradient(135deg, var(--color-primary) 0%, #1e3a8a 100%);
  border-radius: 0 50% 50% 50%;
  transform: translate(40%, 40%) rotate(-45deg);
  transform-origin: top left;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
}
.mock-cursor::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 0 50% 50% 50%;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.2) 100%);
}

@keyframes mockFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mockFlash {
  0% { box-shadow: 0 0 0 0 rgba(46,122,149,0); }
  40% { box-shadow: 0 0 0 6px rgba(46,122,149,.25); }
  100% { box-shadow: 0 0 0 0 rgba(46,122,149,0); }
}

/* =========================================================================
   POPUP DE AYUDA EN ERRORES + BADGE "?" inline
   ========================================================================= */

.help-badge {
  position: absolute;
  right: -.55rem; top: -.55rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.1rem; height: 1.1rem;
  border-radius: 50%;
  background: var(--color-cta);
  color: white;
  border: 2px solid white;
  cursor: pointer;
  padding: 0;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(239, 115, 6, .35);
  animation: mockFadeIn .25s ease;
  transition: transform .15s ease;
}
.help-badge:hover { transform: scale(1.1); }
.help-badge[hidden] { display: none; }
.field { position: relative; } /* asegura que el badge se posicione sobre el input */

.help-popover {
  position: fixed;
  z-index: 1000;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  padding: .35rem;
  animation: mockFadeIn .2s ease;
}
.help-popover[hidden] { display: none; }
.help-popover-trigger {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a8a 100%);
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s ease;
}
.help-popover-trigger:hover { background: linear-gradient(135deg, #00164e 0%, #1e3a8a 100%); }

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
