/* Kit de autenticación de Qlaios (Sinapta y OfficeOne). Plano, sin sombras pesadas.
   AuthUiAssets sustituye los marcadores de doble llave por la URL con huella. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("plus-jakarta-sans.153fc85b70.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ Tokens */
:root {
  color-scheme: light dark;
  --accent: #ff2d55;
  --accent-end: #ff5c7c;
  --accent-glow: #ff9aa9;
  --accent-strong: #d4103a;        /* texto blanco encima: contraste AA */
  --accent-strong-hover: #bd0d33;
  --stage: #0b0b0e;
  --light-bg: #f5f7fa;
  --dark-bg: #0b0b0e;
  --light-ink: #0b0b0e;
  --strings-light: url("strings-light.843c079d3f.svg");
  --strings-dark: url("strings-dark.f96c7d5a35.svg");
  --radius: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}
:root[data-brand="officeone"] {
  --stage: #1a1a1a;
  --light-bg: #f7f7f7;
  --dark-bg: #1a1a1a;
  --light-ink: #1a1a1a;
}

/* Claro (por defecto) */
:root {
  --bg: var(--light-bg);
  --surface: #ffffff;
  --ink: var(--light-ink);
  --muted: #565b65;
  --line: #dde1e7;
  --line-strong: #b9c0ca;
  --field: #ffffff;
  --link: #c20e36;
  --danger: #bf1030;
  --accent-soft: rgba(255, 45, 85, .12);
  --vignette: radial-gradient(120% 80% at 50% 50%, transparent 45%, rgba(26, 26, 26, .05) 80%, rgba(26, 26, 26, .10) 100%);
  --strings: var(--strings-light);
}
/* Oscuro: sistema (si el host no fuerza claro) o forzado por el host */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--dark-bg);
    --surface: #15151b;
    --ink: #f5f7fa;
    --muted: #a7acb6;
    --line: #2b2d35;
    --line-strong: #474a55;
    --field: #101015;
    --link: #ff7b93;
    --danger: #ff8196;
    --accent-soft: rgba(255, 45, 85, .18);
    --vignette: radial-gradient(120% 80% at 50% 50%, transparent 30%, rgba(0, 0, 0, .28) 75%, rgba(0, 0, 0, .5) 100%);
    --strings: var(--strings-dark);
  }
}
:root[data-theme="dark"] {
  --bg: var(--dark-bg);
  --surface: #15151b;
  --ink: #f5f7fa;
  --muted: #a7acb6;
  --line: #2b2d35;
  --line-strong: #474a55;
  --field: #101015;
  --link: #ff7b93;
  --danger: #ff8196;
  --accent-soft: rgba(255, 45, 85, .18);
  --vignette: radial-gradient(120% 80% at 50% 50%, transparent 30%, rgba(0, 0, 0, .28) 75%, rgba(0, 0, 0, .5) 100%);
  --strings: var(--strings-dark);
}

/* ------------------------------------------------------------------ Base */
*, *::before, *::after { box-sizing: border-box; }
body.auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
html:not(.js) .js-only { display: none !important; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20; padding: 10px 14px;
  background: var(--ink); color: var(--bg); border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ico { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------------ Estructura */
.backdrop { display: none; }
.shell { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
.panel {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 24px 20px 40px; outline: none;
}
.brandbar { width: min(100%, 420px); margin: 0 0 24px; }
.auth-card { width: min(100%, 420px); }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 20px; letter-spacing: -.01em; }
.logo-mark { height: 30px; width: auto; flex: none; }
.logo-name { line-height: 1; }

/* Sinapta: escena dividida con el escudo. En móvil, banda compacta arriba. */
.stage {
  display: flex; align-items: center; justify-content: center;
  height: 128px; background: var(--stage); color: #f5f7fa; overflow: hidden;
}
.stage-brand, .stage-tag { display: none; }
.stage .shield { height: 112px; width: auto; flex: none; }
.bk-shield .stage { grid-row: 1; }
.bk-shield .panel { grid-row: 2; }

@media (min-width: 900px) {
  .bk-shield .shell { grid-template-columns: minmax(380px, 5fr) minmax(0, 6fr); grid-template-rows: 1fr; }
  .bk-shield .stage {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 44px 48px;
    background: radial-gradient(90% 60% at 50% 42%, rgba(255, 45, 85, .10), transparent 70%), var(--stage);
  }
  .bk-shield .stage { border-right: 1px solid rgba(255, 255, 255, .06); }
  .bk-shield .stage-brand { display: block; }
  .bk-shield .stage-brand .logo { color: #f5f7fa; }
  .bk-shield .stage .shield { height: auto; width: min(100%, 380px); max-height: 62vh; align-self: center; }
  .bk-shield .stage-tag { display: block; margin: 0; max-width: 24ch; font-size: 20px; line-height: 1.35; font-weight: 600; letter-spacing: -.01em; color: rgba(245, 247, 250, .86); }
  .bk-shield .brandbar { display: none; }
  .bk-shield .panel { grid-row: 1; justify-content: center; padding: 48px; }
}

/* OfficeOne: cuerdas a pantalla completa y tarjeta centrada. */
.bk-strings .backdrop, .bk-plain .backdrop { display: block; position: fixed; inset: 0; z-index: 0; }
.bk-strings .backdrop { background: var(--strings) center / cover no-repeat, var(--bg); }
.strings-live .bk-strings .backdrop { background: var(--bg); }
.bk-strings .backdrop::after { content: ""; position: absolute; inset: 0; background: var(--vignette); pointer-events: none; }
.strings-canvas { position: absolute; inset: 0; display: block; pointer-events: none; }
.bk-strings .shell, .bk-plain .shell { grid-template-rows: 1fr; }
.bk-strings .panel, .bk-plain .panel { justify-content: center; padding: 32px 16px; }
.bk-strings .brandbar, .bk-plain .brandbar { text-align: center; }
.bk-strings .auth-card, .bk-plain .auth-card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong); border-radius: 20px; padding: 28px 24px;
}
@media (min-width: 480px) { .bk-strings .auth-card, .bk-plain .auth-card { padding: 36px; } }

/* ------------------------------------------------------------------ Progreso */
.stepper { display: flex; list-style: none; margin: 0 0 28px; padding: 0; gap: 0; }
.step { flex: 1; display: flex; align-items: center; gap: 8px; position: relative; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.step:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 8px; border-radius: 2px; background: var(--line); min-width: 8px; }
.step-done:not(:last-child)::after { background: var(--accent); }
.step:last-child { flex: none; }
.step-label { white-space: nowrap; }
.dot {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; border: 1.5px solid var(--line-strong); color: var(--muted); background: transparent;
}
.dot .ico { width: 14px; height: 14px; }
.step-current { color: var(--ink); }
.step-current .dot { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.step-done { color: var(--ink); }
.step-done .dot { background: var(--accent-soft); border-color: var(--accent); color: var(--link); }
@media (max-width: 380px) { .step-todo .step-label { display: none; } }

/* ------------------------------------------------------------------ Texto */
.title { margin: 0 0 8px; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; }
.lead { margin: 0 0 24px; color: var(--muted); max-width: 40ch; text-wrap: pretty; }
.why {
  display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 24px; padding: 14px 16px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); font-size: 15px;
}
.why .ico { color: var(--link); margin-top: 2px; width: 22px; height: 22px; }
.hint { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; font-size: 14px; }
.links-end { margin-top: 24px; }
.links span { color: var(--muted); }

/* ------------------------------------------------------------------ Campos */
.form { display: block; }
.field { margin: 0 0 18px; }
.field label, .choices legend { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.input-wrap { position: relative; }
.input, .otp-input {
  width: 100%; height: 52px; padding: 0 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius);
  background: var(--field); color: var(--ink); font: 500 16px var(--font); transition: border-color .15s, background-color .15s;
}
.input::placeholder { color: var(--muted); }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.input-wrap .input { padding-right: 52px; }
.input-mono { font-family: var(--mono); letter-spacing: .06em; }
.input[aria-invalid="true"], .otp-input[aria-invalid="true"] { border-color: var(--danger); }
.reveal {
  position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); border-radius: 10px; cursor: pointer;
}
.reveal:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: var(--radius); font: 700 16px var(--font); cursor: pointer;
  text-decoration: none; transition: background-color .15s, border-color .15s, transform .12s var(--spring);
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { width: 100%; background: var(--accent-strong); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong-hover); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.btn-text { background: transparent; color: var(--link); min-height: 44px; padding: 0 4px; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:disabled { color: var(--muted); text-decoration: none; opacity: 1; }
.is-busy .btn-primary { opacity: .7; cursor: progress; }

.alert {
  display: flex; gap: 10px; align-items: flex-start; margin: 0 0 20px; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface)); font-size: 14px;
}
.alert .ico { color: var(--danger); margin-top: 1px; }
.alert p { margin: 0; }

/* ------------------------------------------------------------------ Código de 6 dígitos */
.otp { position: relative; }
.otp-cells { display: none; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-input { height: 60px; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .5em; padding-left: .5em; font-variant-numeric: tabular-nums; }
.otp-input:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.js .otp-cells { display: grid; }
.js .otp-input {
  position: absolute; inset: 0; z-index: 1; opacity: 0; font-size: 16px; padding: 0; letter-spacing: 0; height: 100%;
}
.otp-cell {
  position: relative; height: 60px; display: grid; place-items: center; border: 1.5px solid var(--line-strong);
  border-radius: var(--radius); background: var(--field); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell.is-filled { border-color: var(--ink); }
.otp-cell.is-active { border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
.otp-cell.is-active:empty::after { content: ""; width: 2px; height: 28px; background: var(--accent-strong); animation: blink 1.05s steps(1) infinite; }
.otp-cell.pop { animation: pop .38s var(--spring); }
.is-complete .otp-cell { border-color: var(--accent-strong); }
.otp-input[aria-invalid="true"] ~ .otp-cells .otp-cell, .shake .otp-cell { border-color: var(--danger); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { 0% { transform: scale(.72); } 100% { transform: scale(1); } }
.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 15% { transform: translateX(-7px); } 35% { transform: translateX(6px); } 55% { transform: translateX(-4px); } 75% { transform: translateX(3px); } 100% { transform: none; } }

/* Anillo de 30 s */
.ring { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.ring-svg { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring-bg, .ring-fg { fill: none; stroke-width: 3; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 97.39; stroke-dashoffset: 0; }
.ring-n { position: absolute; left: 0; top: 50%; width: 44px; transform: translateY(-50%); text-align: center; font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ring.is-low .ring-fg { stroke: var(--accent-strong); }
.ring.is-low .ring-n { animation: tickpulse 1s ease-in-out infinite; }
@keyframes tickpulse { 50% { transform: translateY(-50%) scale(1.18); } }
.resend { margin: 8px 0 0; display: flex; }

/* Cambiar de método */
.switch { margin: 28px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.switch-title { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.switch-link {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; margin: 0 0 8px;
  border: 1.5px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px;
  transition: border-color .15s;
}
.switch-link:hover { border-color: var(--ink); }
.switch-link .ico { color: var(--link); }

/* ------------------------------------------------------------------ Alta */
.choices { border: 0; margin: 0 0 20px; padding: 0; min-width: 0; }
.choices legend { padding: 0; margin-bottom: 10px; }
.choice { display: block; position: relative; margin: 0 0 10px; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--line-strong);
  border-radius: 16px; background: var(--surface); transition: border-color .15s, background-color .15s;
}
.choice:hover .choice-card { border-color: var(--muted); }
.choice input:checked + .choice-card { border-color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.choice input:focus-visible + .choice-card { outline: 3px solid var(--accent); outline-offset: 2px; }
.choice-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--link); }
.choice-icon .ico { width: 22px; height: 22px; }
.choice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-weight: 700; }
.choice-desc { color: var(--muted); font-size: 14px; line-height: 1.4; }
.badge { padding: 1px 8px; border-radius: 99px; background: var(--accent-strong); color: #fff; font-size: 12px; font-weight: 700; }
.choice-radio { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.choice input:checked + .choice-card .choice-radio { border-color: var(--accent-strong); }
.choice input:checked + .choice-card .choice-radio::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-strong); animation: pop .3s var(--spring); }

.steps { list-style: none; margin: 0 0 24px; padding: 0; counter-reset: s; }
.steps > li { position: relative; padding: 0 0 22px 40px; counter-increment: s; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700;
}
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 32px; bottom: 6px; width: 2px; background: var(--line); }
.step-text { margin: 2px 0 12px; font-weight: 600; }
.step-sub { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.steps .field-otp { margin: 0; }

.qr { position: relative; width: 208px; height: 208px; margin: 0 0 16px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line-strong); }
.qr-svg { display: block; width: 100%; height: 100%; animation: reveal 1.15s cubic-bezier(.5, 0, .2, 1) both; }
.qr-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent-end) 70%, transparent);
  box-shadow: 0 0 16px 2px rgba(255, 45, 85, .55); animation: scan 1.15s cubic-bezier(.5, 0, .2, 1) both;
}
@keyframes reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes scan { 0% { top: 0; opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% - 3px); opacity: 0; } }
.keybox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--field); font: 600 15px/1.4 var(--mono); letter-spacing: .08em; overflow-wrap: anywhere; user-select: all;
}
[data-copy].is-done { border-color: var(--accent-strong); color: var(--link); }

/* ------------------------------------------------------------------ Códigos de recuperación */
.codes-card { margin: 0 0 20px; padding: 18px; border: 1.5px solid var(--line-strong); border-radius: 16px; background: var(--surface); }
.codes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.codes li { padding: 8px 4px; border-bottom: 1px dashed var(--line); }
.codes code { font: 600 15px/1.3 var(--mono); letter-spacing: .06em; overflow-wrap: anywhere; user-select: all; }
.codes-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.codes-actions .btn { flex: 1 1 auto; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0 0 16px; cursor: pointer; font-weight: 600; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line-strong); border-radius: 8px; color: transparent; background: var(--field); transition: background-color .15s, border-color .15s; }
.check-box .ico { width: 16px; height: 16px; }
.check input:checked + .check-box { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; animation: pop .3s var(--spring); }
.check input:focus-visible + .check-box { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ Éxito */
.progress { height: 4px; margin: 8px 0 24px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-end)); transform-origin: left; animation: fill 1.9s linear both; }
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.done-badge { width: 60px; height: 60px; margin: 0 0 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-strong); color: #fff; animation: pop .5s var(--spring) both; }
.done-badge .ico { width: 30px; height: 30px; }
.bk-shield .done-badge { display: none; }

/* ------------------------------------------------------------------ Escudo de nodos */
.shield .spark-a { stop-color: #ff2d55; }
.shield .spark-b { stop-color: #ff5c7c; }
.shield .spark-c { stop-color: #ff9aa9; }
.shield circle { transform-box: fill-box; transform-origin: center; }
.shield line { fill: none; stroke-width: 1.3; stroke: rgba(245, 247, 250, .13); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.shield circle.n-out, .shield circle.n-in { fill: #23242b; stroke: rgba(245, 247, 250, .16); stroke-width: 1; }
.shield .halo { fill: #8a8f98; opacity: .35; animation: twinkle 4.5s ease-in-out infinite; }
.shield .s-fill { fill: url(#spark); opacity: 0; }
.shield .lock-shackle { fill: none; stroke: #5b5f69; stroke-width: 9; stroke-linecap: round; transform-box: fill-box; transform-origin: center bottom; transform: translateY(-11px); }
.shield .lock-body { fill: #2b2d35; stroke: #5b5f69; stroke-width: 2; }
.shield .lock-hole { fill: #8a8f98; }
.shield .burst { fill: none; stroke: #ff5c7c; stroke-width: 2; opacity: 0; }

/* Etapa 1: se enciende el contorno, nodo a nodo. */
[data-stage="1"] .e-out { stroke: url(#spark); stroke-dashoffset: 1; animation: draw .5s ease-out both; }
[data-stage="1"] .n-out { animation: nodeOn .5s var(--spring) both; }
/* Etapa 2: contorno encendido; se teje la malla interior y el candado espera. */
[data-stage="2"] .e-out, [data-stage="3"] .e-out { stroke: url(#spark); }
[data-stage="2"] .shield circle.n-out, [data-stage="3"] .shield circle.n-out { fill: url(#spark); stroke: none; }
[data-stage="2"] .e-sp, [data-stage="3"] .e-sp { stroke: rgba(255, 92, 124, .42); }
[data-stage="2"] .e-in { stroke: url(#spark); stroke-dashoffset: 1; animation: draw .5s ease-out both; }
[data-stage="2"] .n-in { animation: nodeOn .5s var(--spring) both; }
[data-stage="2"] .lock-body { stroke: #ff5c7c; animation: lockWait 2.4s ease-in-out 1.6s infinite; }
[data-stage="2"] .lock-shackle { stroke: #ff5c7c; }
[data-stage="2"] .lock-hole { fill: #ff2d55; }
/* Etapa 3: todo encendido, el candado se cierra y el escudo late. */
[data-stage="3"] .e-in { stroke: url(#spark); }
[data-stage="3"] .shield circle.n-in { fill: url(#spark); stroke: none; }
[data-stage="3"] .s-fill { animation: fillIn .9s ease-out .5s both; }
[data-stage="3"] .lock-shackle { stroke: #ff5c7c; animation: lockClose .7s var(--spring) .2s both; }
[data-stage="3"] .lock-body { fill: #ff2d55; stroke: #ff5c7c; }
[data-stage="3"] .lock-hole { fill: #0b0b0e; }
[data-stage="3"] .burst { animation: burst 1.3s ease-out .75s both; }
[data-stage="3"] .burst.b2 { animation-delay: 1s; }
.shield .h1 { animation-delay: .7s; } .shield .h2 { animation-delay: 1.4s; } .shield .h3 { animation-delay: 2.1s; }
.shield .h4 { animation-delay: 2.8s; } .shield .h5 { animation-delay: 3.5s; }

@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes nodeOn { from { fill: #23242b; transform: scale(.4); } to { fill: url(#spark); transform: scale(1); } }
@keyframes lockWait { 50% { stroke: #ff9aa9; } }
@keyframes lockClose { from { transform: translateY(-11px); } to { transform: translateY(0); } }
@keyframes fillIn { from { opacity: 0; } to { opacity: .16; } }
@keyframes burst { 0% { opacity: .85; transform: scale(.6); } 100% { opacity: 0; transform: scale(5.5); } }
@keyframes twinkle { 50% { opacity: .9; } }

/* Retardos por nodo (contorno en la etapa 1, malla en la etapa 2) */
[data-stage="1"] .g-out .d0 { animation-delay: 250ms; } [data-stage="2"] .g-in .d0 { animation-delay: 300ms; }
[data-stage="1"] .g-out .d1 { animation-delay: 335ms; } [data-stage="2"] .g-in .d1 { animation-delay: 390ms; }
[data-stage="1"] .g-out .d2 { animation-delay: 420ms; } [data-stage="2"] .g-in .d2 { animation-delay: 480ms; }
[data-stage="1"] .g-out .d3 { animation-delay: 505ms; } [data-stage="2"] .g-in .d3 { animation-delay: 570ms; }
[data-stage="1"] .g-out .d4 { animation-delay: 590ms; } [data-stage="2"] .g-in .d4 { animation-delay: 660ms; }
[data-stage="1"] .g-out .d5 { animation-delay: 675ms; } [data-stage="2"] .g-in .d5 { animation-delay: 750ms; }
[data-stage="1"] .g-out .d6 { animation-delay: 760ms; } [data-stage="2"] .g-in .d6 { animation-delay: 840ms; }
[data-stage="1"] .g-out .d7 { animation-delay: 845ms; } [data-stage="2"] .g-in .d7 { animation-delay: 930ms; }
[data-stage="1"] .g-out .d8 { animation-delay: 930ms; } [data-stage="2"] .g-in .d8 { animation-delay: 1020ms; }
[data-stage="1"] .g-out .d9 { animation-delay: 1015ms; } [data-stage="2"] .g-in .d9 { animation-delay: 1110ms; }
[data-stage="1"] .g-out .d10 { animation-delay: 1100ms; } [data-stage="2"] .g-in .d10 { animation-delay: 1200ms; }
[data-stage="1"] .g-out .d11 { animation-delay: 1185ms; } [data-stage="2"] .g-in .d11 { animation-delay: 1290ms; }
[data-stage="1"] .g-out .d12 { animation-delay: 1270ms; } [data-stage="2"] .g-in .d12 { animation-delay: 1380ms; }
[data-stage="1"] .g-out .d13 { animation-delay: 1355ms; } [data-stage="2"] .g-in .d13 { animation-delay: 1470ms; }

/* ------------------------------------------------------------------ Movimiento reducido: estados finales, sin animar */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .otp-cell.is-active:empty::after { animation: none; }
}
@media (forced-colors: active) {
  .btn-primary, .badge, .step-current .dot { forced-color-adjust: none; }
}

/* ------------------------------------------------------------------ Impresión: solo los códigos */
@media print {
  .stage, .backdrop, .brandbar, .stepper, .codes-actions, .check, .btn, .hint, .skip, .lead, .alert { display: none !important; }
  body.auth { background: #fff; color: #000; }
  .shell, .panel { display: block; padding: 0; }
  .auth-card, .codes-card { border: 0; background: none; padding: 0; width: 100%; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .codes { border: 1px solid #000; padding: 16px; }
  .codes code { color: #000; }
}

/* ---------------------------------------------------------------- Passkeys */
[data-passkey][hidden], [data-passkey-status][hidden], [data-passkey-unsupported][hidden], [data-passkey-add][hidden] { display: none !important; }
.passkey-login { margin-top: 20px; display: grid; gap: 12px; }
.passkey-or { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); font-size: 13px; }
.passkey-or::before, .passkey-or::after { content: ""; flex: 1; border-top: 1px solid var(--line-strong); }
.passkey-login .btn, .passkey-login .cbtn, .passkey-add .btn, .passkey-add .cbtn, .passkey-panel > .btn, .passkey-panel > .cbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.cbtn-ghost { background: transparent !important; border: 1px solid currentColor; color: inherit !important; }
.passkey-status { margin: 0; font-size: 14px; color: var(--muted); }
.passkey-status.is-error { color: var(--danger, #ff2d55); }
.passkey-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.passkey-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; }
.passkey-item { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; }
.passkey-meta { margin: 0; color: var(--muted); font-size: 13px; }
.passkey-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.passkey-add { display: grid; gap: 8px; margin-top: 16px; }
.passkey-empty { color: var(--muted); }
