/* ============================================================
   Acceso de CheQR (login y registro) — dirección cinematográfica.
   Fuente única de las dos pantallas; su comportamiento vive en
   /auth.js. Tokens y primitivas vienen de /styles.css.
   Solo se animan transform y opacity; con movimiento reducido
   todo queda visible y quieto.
   ============================================================ */
.au { background: #04060d; }
.au-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(440px, .8fr); }

/* ---- Escena: el reloj checador, a tamaño de cartel ---- */
.au-escena { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: clamp(28px, 4vw, 60px); }
.au-luz { position: absolute; inset: -30% -20% auto -20%; height: 120vh; z-index: -2; pointer-events: none;
  background: radial-gradient(46% 50% at 78% 46%, rgba(34, 211, 238, .20), transparent 68%), radial-gradient(40% 42% at 6% 6%, rgba(109, 94, 252, .24), transparent 70%);
  animation: auRespira 11s ease-in-out infinite alternate; }
@keyframes auRespira { from { opacity: .65; transform: translate3d(-1.5%, 0, 0); } to { opacity: 1; transform: translate3d(1.5%, 1%, 0) scale(1.05); } }

/* Patrón de localización de un QR (el mismo cuadro del logotipo), gigante y a sangre. */
.au-visor { position: absolute; right: -150px; bottom: -170px; width: 560px; aspect-ratio: 1; z-index: -1; pointer-events: none;
  border: 54px solid rgba(255, 255, 255, .045); border-radius: 92px; display: grid; place-items: center;
  animation: auDeriva 16s ease-in-out infinite alternate; }
.au-visor::after { content: ''; width: 46%; aspect-ratio: 1; border-radius: 40px; background: rgba(34, 211, 238, .07); }
@keyframes auDeriva { from { transform: rotate(-9deg); } to { transform: rotate(-5deg) translate3d(-14px, -12px, 0); } }

.au-cab { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.au-volver { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: .9rem; font-weight: 600; color: var(--text-dim); transition: color .2s; }
.au-volver:hover { color: var(--text); }
.au-volver .ico-svg { width: 16px; height: 16px; transform: rotate(180deg); }

/* Reloj y titulares: corte ancho de Archivo. */
.au-lema, .au-titulo, .au-datos b, .au-ok b { font-stretch: var(--ancho-titulo); }
.au-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-2); }
.au-reloj { display: flex; align-items: flex-end; margin: 16px 0 28px; font-size: clamp(7rem, 17vw, 16.5rem); line-height: 1; }
.au-reloj > i { font-style: normal; line-height: 1; color: var(--brand-2); margin: 0 .04em; animation: auPulso 2s steps(1) infinite; }
.au-reloj small { font-size: .3em; color: var(--text-mut); margin: 0 0 .28em .3em; }
@keyframes auPulso { 50% { opacity: .35; } }
.au-lema { font-size: clamp(1.5rem, 2.7vw, 2.5rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.06; max-width: 18ch; }
.au-lema span { color: var(--text-mut); }

.au-datos { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border-strong); }
.au-datos li { padding: 20px 18px 0 0; }
.au-datos li + li { padding-left: 18px; border-left: 1px solid var(--border); }
.au-datos b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; color: var(--brand-2); font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.au-datos span { font-size: .88rem; color: var(--text-dim); }

/* Entrada escalonada de la escena */
.au-cab, .au-centro, .au-datos { animation: auEntra .9s var(--ease-out) both; }
.au-centro { animation-delay: .1s; }
.au-datos { animation-delay: .22s; }
@keyframes auEntra { from { opacity: 0; transform: translate3d(0, 22px, 0); } to { opacity: 1; transform: none; } }

/* Lo pone /auth.js al terminar la entrada: el contenido queda fijo aunque el navegador pause las animaciones. */
.au-ya .au-cab, .au-ya .au-centro, .au-ya .au-datos, .au-ya .au-cont, .au-ya .au-esq { animation: none; }

/* ---- Panel del formulario: superficie opaca ---- */
.au-panel { background: #080b16; border-left: 1px solid var(--border); display: grid; place-items: center; padding: clamp(44px, 5vh, 96px) clamp(28px, 4vw, 64px); }
.au-caja { position: relative; width: 100%; max-width: 400px; }
.au-cont { animation: auEntra .8s .18s var(--ease-out) both; transition: opacity .25s, transform .35s var(--ease-out); }

/* Esquinas de visor: el formulario queda «encuadrado», como al escanear. */
.au-esq { position: absolute; width: 22px; height: 22px; pointer-events: none; color: var(--brand-2); border: 0 solid currentColor;
  animation: auEnfoca .9s .3s var(--ease-out) both; transition: transform .45s var(--ease-out), color .25s; }
.au-esq.a { top: -30px; left: -30px; border-width: 2px 0 0 2px; border-top-left-radius: 7px; --dx: -16px; --dy: -16px; }
.au-esq.b { top: -30px; right: -30px; border-width: 2px 2px 0 0; border-top-right-radius: 7px; --dx: 16px; --dy: -16px; }
.au-esq.c { bottom: -30px; left: -30px; border-width: 0 0 2px 2px; border-bottom-left-radius: 7px; --dx: -16px; --dy: 16px; }
.au-esq.d { bottom: -30px; right: -30px; border-width: 0 2px 2px 0; border-bottom-right-radius: 7px; --dx: 16px; --dy: 16px; }
@keyframes auEnfoca { from { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0); } to { opacity: 1; transform: none; } }

.au-marca { display: none; margin-bottom: 26px; }
.au-titulo { font-size: clamp(1.9rem, 2.6vw, 2.4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; margin: 10px 0 8px; }
.au-sub { color: var(--text-dim); margin-bottom: 24px; }

/* Selector de tipo de cuenta: el indicador se desliza (solo transform). */
.au-seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: #0c111f; border: 1px solid var(--border); margin-bottom: 24px; }
.au-seg::before { content: ''; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: #1b2238; border: 1px solid var(--border-strong); transition: transform .35s var(--ease-out); }
.au-seg[data-on="emp"]::before { transform: translate3d(100%, 0, 0); }
.au-seg .tab { position: relative; min-height: 44px; padding: 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; font-weight: 650; color: var(--text-mut); transition: color .2s; }
.au-seg .tab:hover { color: var(--text-dim); }
.au-seg .tab.active { color: var(--text); }

/* Campos */
.au .field { margin-bottom: 16px; }
.au .field label { font-size: .8rem; letter-spacing: .01em; }
.au .input { min-height: 52px; padding: 14px 16px; border-radius: 14px; background: #0c111f; }
.au .input:focus { border-color: var(--brand-2); background: #0d1424; box-shadow: 0 0 0 4px rgba(34, 211, 238, .16); }
.au .input[aria-invalid="true"] { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(248, 113, 113, .16); }
.au-pass { position: relative; }
.au-pass .input { padding-right: 56px; }
.au-ojo { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 11px; background: none; color: var(--text-mut); cursor: pointer; transition: color .2s, background .2s; }
.au-ojo:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.au-ojo .ico-svg { width: 19px; height: 19px; }

/* Estado en vivo bajo un campo: requisito cumplido / pendiente / error */
.au-estado { display: flex; align-items: center; gap: 8px; min-height: 20px; font-size: .82rem; color: var(--text-mut); transition: color .2s; }
.au-estado::before { content: ''; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: currentColor; opacity: .55; }
.au-estado.ok { color: var(--good); }
.au-estado.mal { color: var(--bad-text); }
.au-estado.ok::before, .au-estado.mal::before { opacity: 1; }
.au-estado:empty { visibility: hidden; }

/* Sin halos de color: el botón principal es una pieza sólida y clara. */
.au .brand .mark { box-shadow: none; }
.au .btn-primary { background: var(--text); color: #04060d; box-shadow: none; transition: transform .12s var(--ease-out), background .2s; }
.au .btn-primary:hover { background: #fff; box-shadow: none; }
.au .btn.is-busy::after { border-color: rgba(4, 6, 13, .25); border-top-color: #04060d; }
.au-enviar { margin-top: 8px; }
.au-enviar .ico-svg { transition: transform .3s var(--ease-out); }
.au-enviar:hover .ico-svg { transform: translate3d(4px, 0, 0); }
.au-nota { margin-top: 14px; font-size: .82rem; color: var(--text-mut); text-align: center; }
.au-pie { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .92rem; color: var(--text-dim); }
.au-pie a { color: var(--brand-2); font-weight: 650; text-underline-offset: 4px; }
.au-pie a:hover { text-decoration: underline; }

/* Rechazo: sacudida corta del encuadre */
.au-caja.no .au-cont, .au-ya .au-caja.no .au-cont { animation: auNo .34s; }
.au-caja.no .au-esq { color: var(--bad); }
@keyframes auNo { 20% { transform: translate3d(-7px, 0, 0); } 50% { transform: translate3d(6px, 0, 0); } 80% { transform: translate3d(-3px, 0, 0); } }

/* Acceso concedido: el visor se cierra en verde y aparece la confirmación */
.au-ok { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; opacity: 0; transform: scale(.94); pointer-events: none; transition: opacity .3s .12s, transform .5s .12s var(--ease-out); }
.au-ok-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 211, 153, .12); border: 2px solid var(--good); color: var(--good); }
.au-ok-ico .ico-svg { width: 36px; height: 36px; stroke-width: 2.6; }
.au-ok b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.au-ok span { color: var(--text-dim); font-size: .95rem; }
.au-caja.ok .au-cont { opacity: 0; transform: scale(.97); pointer-events: none; animation: none; }
.au-caja.ok .au-ok { opacity: 1; transform: none; }
.au-caja.ok .au-esq { color: var(--good); }
.au-caja.ok .au-esq.a { transform: translate3d(14px, 14px, 0); }
.au-caja.ok .au-esq.b { transform: translate3d(-14px, 14px, 0); }
.au-caja.ok .au-esq.c { transform: translate3d(14px, -14px, 0); }
.au-caja.ok .au-esq.d { transform: translate3d(-14px, -14px, 0); }

/* ---- Pantallas angostas: la escena se pliega a una franja con el reloj ---- */
@media (max-width: 960px) {
  .au-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .au-escena { flex-direction: row; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .au-visor, .au-escena .au-kicker, .au-lema, .au-datos, .au-volver { display: none; }
  .au-luz { height: 60vh; }
  .au-reloj { margin: 0; font-size: 2rem; color: var(--text-dim); }
  .au-reloj small { font-size: .6em; margin-bottom: .1em; }
  .au-panel { border-left: 0; place-items: start center; padding: 56px 24px calc(48px + env(safe-area-inset-bottom)); }
  .au-esq { width: 18px; height: 18px; }
  .au-esq.a, .au-esq.b { top: -22px; }
  .au-esq.c, .au-esq.d { bottom: -22px; }
  .au-esq.a, .au-esq.c { left: -10px; }
  .au-esq.b, .au-esq.d { right: -10px; }
}

@media (prefers-reduced-motion: reduce) {
  .au-luz, .au-visor, .au-reloj > i, .au-cab, .au-centro, .au-datos, .au-cont, .au-esq, .au-caja.no .au-cont { animation: none !important; }
  .au-cont, .au-esq, .au-ok, .au-seg::before, .au-enviar .ico-svg { transition: none; }
}
.au-nota a { color: var(--brand-2); font-weight: 650; text-underline-offset: 4px; }
.au-nota a:hover { text-decoration: underline; }
