/* ORBITALDATA · pantallas de autenticación (ingreso, recuperación, clave nueva, MFA) */
:root {
  --auth-bg: #020608;
  --auth-card: rgba(8, 18, 28, 0.9);
  --auth-ink: #eef6fb;
  --auth-muted: #7f97aa;
  --auth-line: #1e3344;
  --auth-cyan: #3ee7ff;
  --auth-cyan-dim: #1a9fb8;
  --auth-violet: #a78bfa;
  --auth-ok: #3dffa8;
  --auth-bad: #ff6b8a;
  --auth-warn: #ffc857;
  --auth-font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --auth-mono: ui-monospace, "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--auth-bg);
  color: var(--auth-ink);
  font-family: var(--auth-font);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { overflow-x: hidden; }

/* ---------- fondo ---------- */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.auth-bg-grid {
  background-image:
    linear-gradient(rgba(62, 231, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 231, 255, 0.045) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 25%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 25%, #000 15%, transparent 75%);
  opacity: 0.4;
}
.auth-bg-glow {
  background:
    radial-gradient(ellipse 85% 55% at 50% -15%, rgba(62, 231, 255, 0.22), transparent 55%),
    radial-gradient(ellipse 45% 40% at 100% 95%, rgba(167, 139, 250, 0.14), transparent 50%),
    radial-gradient(ellipse 40% 35% at 0% 75%, rgba(62, 231, 255, 0.1), transparent 45%);
}
.auth-bg-orbit {
  display: grid;
  place-items: center;
}
.auth-bg-orbit span {
  position: absolute;
  border: 1px solid rgba(62, 231, 255, 0.09);
  border-radius: 50%;
  animation: auth-spin 42s linear infinite;
}
.auth-bg-orbit span:nth-child(1) { width: 520px; height: 520px; }
.auth-bg-orbit span:nth-child(2) { width: 760px; height: 760px; animation-duration: 68s; animation-direction: reverse; }
.auth-bg-orbit span:nth-child(3) { width: 1040px; height: 1040px; animation-duration: 96s; }
.auth-bg-orbit span::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--auth-cyan);
  box-shadow: 0 0 12px rgba(62, 231, 255, 0.8);
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* ---------- estructura ---------- */
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom, 0px));
}
.auth-card {
  width: min(430px, 100%);
  padding: 26px 24px 22px;
  border: 1px solid var(--auth-line);
  border-radius: 20px;
  background: var(--auth-card);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  animation: auth-in 0.45s ease both;
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--auth-line);
}
.auth-brand img:first-child { width: 36px; height: 36px; }
.auth-brand img + img { height: 15px; width: auto; }
.auth-eyebrow {
  margin: 0 0 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--auth-cyan-dim);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.auth-note {
  margin: 0 0 14px;
  color: var(--auth-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.auth-note b { color: var(--auth-ink); }

/* ---------- pasos ---------- */
.auth-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  list-style: none;
  padding: 0;
}
.auth-steps li {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--auth-muted);
  text-align: center;
}
.auth-steps li[aria-current="step"] {
  border-color: rgba(62, 231, 255, 0.55);
  color: var(--auth-cyan);
  background: rgba(62, 231, 255, 0.08);
}

/* ---------- campos ---------- */
.auth-field { margin-bottom: 14px; }
.auth-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--auth-muted);
}
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-card input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #0a141d;
  color: var(--auth-ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-card input::placeholder { color: #4d657a; }
.auth-card input:focus-visible,
.auth-card input:focus {
  outline: none;
  border-color: var(--auth-cyan-dim);
  box-shadow: 0 0 0 3px rgba(62, 231, 255, 0.16);
}
.auth-input-wrap.has-toggle input { padding-right: 52px; }
.auth-code {
  font-family: var(--auth-mono);
  font-size: 1.35rem;
  letter-spacing: 0.34em;
  text-align: center;
}

/* ojo para mostrar/ocultar clave */
.auth-eye {
  position: absolute;
  right: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}
.auth-eye:hover { color: var(--auth-cyan); background: rgba(62, 231, 255, 0.08); }
.auth-eye svg { width: 20px; height: 20px; display: block; }
.auth-eye .eye-off { display: none; }
.auth-eye[aria-pressed="true"] { color: var(--auth-cyan); }
.auth-eye[aria-pressed="true"] .eye-on { display: none; }
.auth-eye[aria-pressed="true"] .eye-off { display: block; }

/* ---------- fuerza de clave ---------- */
.auth-meter {
  display: flex;
  gap: 5px;
  margin: 10px 0 8px;
}
.auth-meter span {
  height: 4px;
  flex: 1;
  border-radius: 99px;
  background: #16242f;
  transition: background 0.2s;
}
.auth-meter[data-score="1"] span:nth-child(-n+1) { background: var(--auth-bad); }
.auth-meter[data-score="2"] span:nth-child(-n+2) { background: var(--auth-warn); }
.auth-meter[data-score="3"] span:nth-child(-n+3) { background: #7ee0ff; }
.auth-meter[data-score="4"] span { background: var(--auth-ok); }
.auth-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  font-size: 0.74rem;
  color: var(--auth-muted);
}
.auth-rules li::before {
  content: "○ ";
  color: #46606f;
}
.auth-rules li[data-ok="1"] { color: var(--auth-ok); }
.auth-rules li[data-ok="1"]::before { content: "● "; color: var(--auth-ok); }

/* ---------- botones ---------- */
.auth-card button[type="submit"],
.auth-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-cyan-dim), var(--auth-cyan));
  color: #041018;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, opacity 0.15s;
}
.auth-card button[type="submit"]:hover,
.auth-btn:hover { box-shadow: 0 10px 28px rgba(62, 231, 255, 0.28); transform: translateY(-1px); }
.auth-card button[type="submit"]:disabled,
.auth-btn:disabled { opacity: 0.55; cursor: progress; transform: none; box-shadow: none; }
.auth-btn.ghost {
  background: transparent;
  border: 1px solid var(--auth-line);
  color: var(--auth-cyan);
  font-weight: 700;
  min-height: 46px;
}
.auth-btn.ghost:hover { border-color: var(--auth-cyan-dim); box-shadow: none; }
.auth-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--auth-cyan);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
}
.auth-link:hover { background: rgba(62, 231, 255, 0.08); }

/* ---------- mensajes ---------- */
.auth-msg {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.85rem;
  line-height: 1.45;
}
.auth-msg.err { background: rgba(255, 107, 138, 0.1); border-color: rgba(255, 107, 138, 0.4); color: #ffb3c1; }
.auth-msg.ok { background: rgba(61, 255, 168, 0.09); border-color: rgba(61, 255, 168, 0.35); color: #9dffd2; }
.auth-msg.warn { background: rgba(255, 200, 87, 0.1); border-color: rgba(255, 200, 87, 0.38); color: #ffdd9c; }

/* ---------- MFA ---------- */
.auth-qr {
  display: flex;
  justify-content: center;
  margin: 14px 0;
  padding: 14px;
  background: #fff;
  border-radius: 14px;
}
.auth-qr canvas, .auth-qr img, .auth-qr table { display: block; }
.auth-secret {
  margin: 8px 0 0;
  padding: 11px 13px;
  border: 1px dashed var(--auth-line);
  border-radius: 10px;
  font-family: var(--auth-mono);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  word-break: break-all;
  color: var(--auth-ink);
  background: #0a141d;
}
.auth-apps {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--auth-line);
}
.auth-apps-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--auth-muted);
}
.auth-apps-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.auth-app {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: rgba(62, 231, 255, 0.05);
  color: var(--auth-ink);
  text-decoration: none;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.auth-app:hover,
.auth-app:focus-visible {
  border-color: var(--auth-cyan-dim);
  background: rgba(62, 231, 255, 0.12);
}
.auth-app-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}
.auth-app-note {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--auth-muted);
}
@media (max-width: 420px) {
  .auth-apps-row { grid-template-columns: 1fr; }
}

.auth-foot {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--auth-line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--auth-muted);
}
.auth-foot a { color: var(--auth-cyan); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

@media (max-width: 420px) {
  .auth-card { padding: 22px 18px 18px; border-radius: 16px; }
  .auth-card h1 { font-size: 1.18rem; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg-orbit span { animation: none; }
  .auth-card { animation: none; }
  .auth-card button[type="submit"]:hover,
  .auth-btn:hover { transform: none; }
}
