/* ═══════════════════════════════════════════════
   Piofly — Auth pages (login + registro)
   Sistema unificado dark premium + naranja de marca.
   Compartido por login.php y registro.php (registro.css importa éste).
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

* { box-sizing: border-box; }

:root {
  --auth-bg: #0B1120;
  --auth-card-bg: #161E2E;
  --auth-card-bg-2: #1A2336;
  --auth-border: rgba(255,255,255,0.08);
  --auth-border-soft: rgba(255,255,255,0.05);
  --auth-text: #F1F5F9;
  --auth-text-muted: rgba(241,245,249,0.72);
  --auth-text-soft: rgba(241,245,249,0.55);
  --auth-text-faint: rgba(241,245,249,0.42);
  --auth-orange: #FF8A00;
  --auth-orange-hover: #FF9A1F;
  --auth-orange-press: #E67A00;
  --auth-orange-soft: rgba(255,138,0,0.10);
  --auth-orange-glow: rgba(255,138,0,0.32);
  --auth-danger: #EF4444;
  --auth-success: #10B981;
}

html, body { height: 100%; }

body {
  /* Background con dos radiales naranja sutiles + grano sutil de bg.
     Da sensación de profundidad sin ruido visual. */
  background:
    radial-gradient(ellipse 55% 45% at 88% 8%, rgba(255, 138, 0, 0.12), transparent 60%),
    radial-gradient(ellipse 65% 55% at 6% 96%, rgba(255, 138, 0, 0.07), transparent 60%),
    var(--auth-bg);
  min-height: 100vh;
  min-height: 100dvh; /* iOS safe — usa altura dinámica si está disponible */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: max(80px, env(safe-area-inset-bottom));
  font-family: 'Nunito', sans-serif;
  color: var(--auth-text);
  margin: 0;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Toast: "cerraste sesión correctamente" ─────────────────────
   Aparece arriba del card cuando se llega aquí vía logout.php?out=1. */
.auth-toast {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.40);
  border-radius: 999px;
  color: #6EE7B7;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: calc(100vw - 32px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: auth-toast-in 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
.auth-toast-icon { color: #34D399; display: inline-flex; flex-shrink: 0; }
.auth-toast--out { animation: auth-toast-out 0.6s ease forwards; }
@keyframes auth-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes auth-toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-14px); }
}
body.auth-just-out { padding-top: max(84px, calc(env(safe-area-inset-top) + 60px)); }

/* ── Link "← Volver al inicio" ─────────────────────────────────
   Fixed abajo, pero respeta safe-area iOS. */
.auth-exit {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  color: var(--auth-text-soft);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5;
}
.auth-exit:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--auth-text);
  transform: translateX(-50%) translateY(-2px);
}
.auth-exit svg { flex-shrink: 0; }

/* ── Card central ──────────────────────────────────────────────
   Linear gradient sutil + multi-layer shadow + inset highlight
   = profundidad sin ruido. */
.auth-card {
  background: linear-gradient(180deg, var(--auth-card-bg-2) 0%, var(--auth-card-bg) 100%);
  border: 1px solid var(--auth-border);
  border-radius: 20px;
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 12px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 32px;
  position: relative;
  animation: auth-card-in 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Logo: mascota + wordmark ─────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-bottom: 22px;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-logo:hover { transform: translateY(-2px); }
.auth-logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}
.auth-logo .logo-wordmark {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  display: inline-flex;
}
.auth-logo .logo-wordmark span:first-child { color: var(--auth-text); }
.auth-logo .logo-wordmark span:last-child  { color: var(--auth-orange); }

/* ── Title + sub ─────────────────────────────────────────────── */
.auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--auth-text);
  text-align: center;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin: 0 0 8px;
}
.auth-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--auth-text-muted);
  text-align: center;
  line-height: 1.5;
  margin: 0 0 24px;
}

/* ── Form fields ─────────────────────────────────────────────── */
.fg { margin-bottom: 16px; }
.fg label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--auth-text-soft);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 8px;
}
.fg input {
  width: 100%;
  padding: 13px 15px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--auth-border);
  border-radius: 11px;
  font-family: inherit;
  /* 15px desktop. Mobile usa 16px (regla iOS-zoom) en el breakpoint. */
  font-size: 15px;
  font-weight: 500;
  color: var(--auth-text);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.fg input::placeholder {
  color: var(--auth-text-faint);
  font-weight: 500;
}
.fg input:hover:not(:focus) {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
}
.fg input:focus {
  border-color: var(--auth-orange);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 0 0 3px rgba(255,138,0,0.18);
}
/* Autofill: el chrome amarillo viene de Chrome — lo neutralizamos */
.fg input:-webkit-autofill,
.fg input:-webkit-autofill:hover,
.fg input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-text);
  -webkit-box-shadow: 0 0 0 1000px var(--auth-card-bg-2) inset;
  caret-color: var(--auth-text);
  transition: background-color 5000s ease-in-out 0s;
}
.fg .hint {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--auth-text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

/* ── Botón CTA naranja ─────────────────────────────────────────
   Refinado: padding más generoso, micro-bounce hover, ripple sutil. */
.btn-auth {
  width: 100%;
  padding: 14px 18px;
  background: var(--auth-orange);
  color: #FFFFFF;
  border: none;
  border-radius: 11px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 6px 18px var(--auth-orange-glow),
    inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.18s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.btn-auth::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.btn-auth:hover:not(:disabled) {
  background: var(--auth-orange-hover);
  transform: translateY(-1.5px);
  box-shadow:
    0 12px 26px var(--auth-orange-glow),
    0 4px 12px rgba(255,138,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-auth:hover:not(:disabled)::after { opacity: 1; }
.btn-auth:active:not(:disabled) { transform: translateY(0); }
.btn-auth:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(255,138,0,0.18);
}

/* ── Error inline ─────────────────────────────────────────────── */
.auth-error {
  background: rgba(239, 68, 68, 0.10);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #FECACA;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 14px;
  display: none;
  animation: auth-error-shake 0.36s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes auth-error-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

/* ── Footer link ──────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-text-soft);
}
.auth-footer a {
  color: var(--auth-orange);
  font-weight: 800;
  text-decoration: none;
  transition: color 0.15s ease;
}
.auth-footer a:hover {
  color: var(--auth-orange-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Divisor "o con email" ────────────────────────────────────── */
.lm-divider,
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--auth-text-faint);
  text-transform: uppercase;
  letter-spacing: 1.4px;
}
.lm-divider::before, .lm-divider::after,
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.lm-divider--small { margin: 16px 0 14px; }

/* ── Botón Google: host con tamaño FIJO contenedor ──────────────
   El bug del "cuadro blanco" venía de que el iframe oficial de Google
   tiene ancho propio (renderButton width:360). En contenedores más
   chicos se desbordaba con un fondo blanco visible. Ahora:
   - El host es un wrapper con tamaño exacto.
   - El JS calcula el ancho dinámico (ver login.js initGoogleSignIn).
   - El > div del iframe NO se fuerza con !important. */
.lm-google-host {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  width: 100%;
  /* Importante: que el wrapper sea relative para que el iframe se ancle */
  position: relative;
}
/* Contenedor interno que GIS crea — lo dejamos ser, solo aseguramos
   que no se desborde del card en ningún tamaño */
.lm-google-host > div {
  max-width: 100%;
}
/* El iframe del botón oficial — radius para que combine con el card */
.lm-google-host iframe {
  border-radius: 11px !important;
  /* Sombra sutil para integrarlo con el resto */
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ── Welcome bonus (solo en registro) ──────────────────────────── */
.welcome-bonus {
  display: flex;
  align-items: center;
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(255,138,0,0.10), rgba(255,138,0,0.04));
  border: 1px solid rgba(255,138,0,0.24);
  border-radius: 13px;
  padding: 13px 15px;
  margin-bottom: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.welcome-bonus .bonus-emoji {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}
.welcome-bonus p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(241,245,249,0.88);
}
.welcome-bonus strong {
  color: #FFA333;
  font-weight: 800;
}

/* ── Terms (solo en registro) ─────────────────────────────────── */
.terms {
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--auth-text-faint);
  text-align: center;
  margin: 14px 0 0;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — 4 breakpoints
   - 640px: tablet
   - 480px: phone
   - 360px: phone XS
   - landscape phone (max-height: 600px)
   ═══════════════════════════════════════════════ */

/* Tablet y phones grandes */
@media (max-width: 640px) {
  body {
    padding: 24px 16px;
    padding-bottom: max(72px, env(safe-area-inset-bottom));
  }
  .auth-card {
    padding: 34px 26px 28px;
    border-radius: 18px;
  }
  .auth-title { font-size: 24px; }
  .auth-sub { font-size: 13.5px; margin-bottom: 22px; }
}

/* Phone estándar — fix iOS zoom + ajustes finos */
@media (max-width: 480px) {
  .auth-card {
    padding: 30px 22px 26px;
    border-radius: 18px;
  }
  .auth-logo img { height: 36px; }
  .auth-logo .logo-wordmark { font-size: 22px; }
  .auth-title { font-size: 22px; }
  .auth-sub { font-size: 13.5px; margin-bottom: 20px; }
  /* CRITICAL: 16px previene auto-zoom de iOS al enfocar input */
  .fg input { font-size: 16px; padding: 13px 14px; }
  .btn-auth { padding: 14px; font-size: 15px; }
  .welcome-bonus { padding: 12px 13px; }
  .welcome-bonus p { font-size: 12.5px; }
  .auth-toast { font-size: 12.5px; padding: 10px 14px; }
  body.auth-just-out { padding-top: max(76px, calc(env(safe-area-inset-top) + 56px)); }
}

/* Phone XS — el botón Google necesita encoger */
@media (max-width: 360px) {
  .auth-card { padding: 26px 18px 22px; }
  .auth-title { font-size: 20px; letter-spacing: -0.3px; }
  .auth-sub { font-size: 13px; }
  .auth-logo { gap: 7px; margin-bottom: 18px; }
  .auth-logo img { height: 32px; }
  .auth-logo .logo-wordmark { font-size: 20px; }
}

/* Landscape phone: card muy alto + safe areas */
@media (max-height: 640px) {
  body {
    align-items: flex-start;
    padding-top: 24px;
  }
  .auth-card {
    padding-top: 28px;
    padding-bottom: 24px;
  }
  /* En landscape el botón "Volver al inicio" se vuelve absolute para no
     quitarle espacio al card */
  .auth-exit {
    position: static;
    transform: none;
    margin: 16px auto 0;
    display: inline-flex;
  }
  .auth-exit:hover { transform: translateY(-2px); }
}

/* Reduce motion — accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .auth-card,
  .auth-toast,
  .btn-auth,
  .auth-error {
    animation: none !important;
  }
  .btn-auth:hover:not(:disabled) { transform: none; }
  .auth-logo:hover { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   "Desbloqueo" cinematic — transición auth → dashboard.
   Se dispara al hacer login/registro exitoso. Duración total ~1300ms.

   Estructura: 5 fases secuenciales (inhale → click → shockwave →
   text → fade) que dan sensación de candado abriéndose, no
   simplemente de página cambiando.

   - Fase 1 (0-180ms): "Inhale" — card se comprime, brillo baja.
     Tensión que precede al click.
   - Fase 2 (180-380ms): "Click" — flash brillante del logo, card
     hace overshoot a 1.03. El "snap" del cerrojo.
   - Fase 3 (300-1100ms): "Shockwave" — 3 anillos naranja se
     expanden radialmente desde el centro (delays 300/450/600ms).
     Core glow naranja-blanco crece y se desvanece.
   - Fase 4 (500-1100ms): texto "ACCESO DESBLOQUEADO" aparece
     debajo del centro, letter-spacing crece.
   - Fase 5 (700-1300ms): bg fade al color del dashboard (#0B1120),
     card sube y desaparece. Listo para hand-off al welcome cinematic.

   Si el usuario tiene prefers-reduced-motion, el overlay no se
   muestra y la card simplemente se desvanece en 200ms.
   ═══════════════════════════════════════════════════════════════ */

.auth-unlock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
}

/* Background fade — capa que se vuelve dashboard-bg al final */
.auth-unlock-bg {
  position: absolute;
  inset: 0;
  background: var(--auth-bg, #0B1120);
  opacity: 0;
  animation: unlock-bg 1.3s ease-in forwards;
}

/* Core: glow naranja-blanco central — el "fuego" del desbloqueo */
.auth-unlock-core {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 235, 180, 1) 0%,
    rgba(255, 180, 70, 0.95) 22%,
    rgba(255, 138, 0, 0.65) 45%,
    rgba(255, 90, 0, 0.20) 70%,
    transparent 100%
  );
  filter: blur(0.5px);
  opacity: 0;
  transform: scale(0.4);
  animation: unlock-core 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Shockwave: 3 anillos staggered — sensación de pulso radial.
   Cada anillo más débil que el anterior, simulando la onda
   expansiva real de un cerrojo soltándose. */
.auth-unlock-ring {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255, 138, 0, 0.9);
  opacity: 0;
  transform: scale(0);
  animation: unlock-ring 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow:
    0 0 24px rgba(255, 138, 0, 0.5),
    inset 0 0 12px rgba(255, 138, 0, 0.35);
}
.auth-unlock-ring--1 { animation-delay: 200ms; }
.auth-unlock-ring--2 {
  animation-delay: 360ms;
  border-color: rgba(255, 200, 120, 0.75);
  box-shadow: 0 0 20px rgba(255, 200, 120, 0.4);
}
.auth-unlock-ring--3 {
  animation-delay: 520ms;
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.3);
}

/* Texto "ACCESO DESBLOQUEADO" — aparece después del shockwave */
.auth-unlock-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 80px);
  font-family: 'Nunito', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 0 18px rgba(255, 138, 0, 0.85),
    0 0 6px rgba(255, 180, 70, 0.6);
  opacity: 0;
  white-space: nowrap;
  animation: unlock-text 1.3s ease forwards;
  animation-delay: 480ms;
}

/* Card durante el cinematic — overshoot + escape upward */
.auth-card.auth-card--unlocking {
  animation: unlock-card 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none;
}

/* Body durante cinematic */
body.auth-unlocking { overflow: hidden; }
body.auth-unlocking .auth-exit,
body.auth-unlocking .auth-toast { animation: unlock-fadeout 0.4s ease forwards; }

/* ─── Keyframes ─────────────────────────────────────── */

@keyframes unlock-card {
  /* Inhale */
  0%   { transform: translateY(0) scale(1); opacity: 1; filter: brightness(1); }
  12%  { transform: translateY(2px) scale(0.97); opacity: 1; filter: brightness(0.78); }
  /* Click overshoot */
  20%  { transform: translateY(-2px) scale(1.035); opacity: 1; filter: brightness(1.35); }
  /* Settle */
  30%  { transform: translateY(-4px) scale(1.02); opacity: 0.95; filter: brightness(1.1); }
  /* Escape upward + fade */
  60%  { transform: translateY(-14px) scale(1.08); opacity: 0.45; filter: brightness(0.9); }
  100% { transform: translateY(-28px) scale(1.16); opacity: 0; filter: brightness(0.5); }
}

@keyframes unlock-core {
  0%   { opacity: 0; transform: scale(0.4); }
  18%  { opacity: 1; transform: scale(0.95); }
  35%  { opacity: 1; transform: scale(1.45); }
  65%  { opacity: 0.85; transform: scale(2.6); }
  100% { opacity: 0; transform: scale(5); }
}

@keyframes unlock-ring {
  0%   { opacity: 0; transform: scale(0); border-width: 4px; }
  8%   { opacity: 1; transform: scale(0.35); border-width: 4px; }
  50%  { opacity: 0.8; transform: scale(2.8); border-width: 2px; }
  100% { opacity: 0; transform: scale(7.5); border-width: 0.5px; }
}

@keyframes unlock-text {
  0%   { opacity: 0; transform: translate(-50%, 90px); letter-spacing: 2px; }
  28%  { opacity: 1; transform: translate(-50%, 70px); letter-spacing: 4px; }
  70%  { opacity: 1; transform: translate(-50%, 64px); letter-spacing: 5px; }
  100% { opacity: 0; transform: translate(-50%, 50px); letter-spacing: 6px; }
}

@keyframes unlock-bg {
  0%   { opacity: 0; }
  55%  { opacity: 0.35; }
  100% { opacity: 1; }
}

@keyframes unlock-fadeout {
  to { opacity: 0; }
}

/* Reduce motion — sin cinematic, solo fade simple */
@media (prefers-reduced-motion: reduce) {
  .auth-unlock { display: none; }
  .auth-card.auth-card--unlocking {
    animation: none;
    transition: opacity 0.25s ease;
    opacity: 0;
  }
  body.auth-unlocking::after {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--auth-bg, #0B1120);
    z-index: 90;
    opacity: 0;
    animation: unlock-bg 0.3s ease-in forwards;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Edgar 2026-07-06: Refinamiento estilo Notion/Apple
   Ajustes puntuales sobre el sistema existente para elevar el feel
   a nivel producto premium (Notion/Apple):
   - Labels lowercase con weight normal, mas legible
   - Focus rings mas sutiles (2px vs 3px, opacity mas baja)
   - Transiciones mas largas con cubic-bezier tipo Apple (0.4, 0, 0.2, 1)
   - Card con backdrop-filter para profundidad real
   - Divider mas discreto
   - Toggle in-place login/signup con fade+slide
   ═══════════════════════════════════════════════════════════════ */

/* Card — glassmorphism sutil estilo Apple */
.auth-card {
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  background:
    linear-gradient(180deg, rgba(26,35,54,0.88) 0%, rgba(22,30,46,0.94) 100%);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px !important;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Title/sub tipografia mas jerarquica */
.auth-title {
  font-size: 27px !important;
  font-weight: 800 !important;
  letter-spacing: -0.6px !important;
  line-height: 1.15 !important;
}
.auth-sub {
  font-size: 14.5px !important;
  font-weight: 500 !important;
  line-height: 1.55 !important;
  margin-bottom: 26px !important;
}

/* Labels: fuera del uppercase — estilo Notion/Apple con Sentence case */
.fg label {
  text-transform: none !important;
  letter-spacing: -0.1px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--auth-text-muted) !important;
  margin-bottom: 7px !important;
}

/* Inputs: border mas suave, focus ring mas discreto, transiciones mas largas */
.fg input {
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  background: rgba(255,255,255,0.025) !important;
  transition:
    border-color 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.fg input:hover:not(:focus) {
  border-color: rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.035) !important;
}
.fg input:focus {
  border-color: rgba(255,138,0,0.75) !important;
  background: rgba(255,138,0,0.03) !important;
  box-shadow: 0 0 0 2px rgba(255,138,0,0.14) !important;
}

/* CTA button: transiciones estilo Apple (mas largas, curva mas suave) */
.btn-auth {
  border-radius: 12px !important;
  padding: 14px 18px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: -0.1px !important;
  transition:
    background 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.32, 1.72, 0.6, 1),
    box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow:
    0 4px 14px rgba(255,138,0,0.28),
    inset 0 1px 0 rgba(255,255,255,0.16) !important;
}
.btn-auth:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow:
    0 8px 22px rgba(255,138,0,0.34),
    0 2px 8px rgba(255,138,0,0.20),
    inset 0 1px 0 rgba(255,255,255,0.22) !important;
}

/* Divider mas discreto — Sentence case sin uppercase */
.lm-divider,
.auth-divider {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--auth-text-faint) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin: 22px 0 !important;
}

/* Footer: menos peso visual */
.auth-footer {
  font-size: 13.5px !important;
  font-weight: 500 !important;
  margin-top: 22px !important;
}
.auth-footer a,
.auth-footer button.auth-mode-toggle {
  font-weight: 700 !important;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: var(--auth-orange);
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-footer a:hover,
.auth-footer button.auth-mode-toggle:hover {
  color: var(--auth-orange-hover) !important;
  text-decoration: none !important;
}

/* Toggle in-place login <-> signup: fade+slide subtle */
.fg--signup-only {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-bottom: 0 !important;
  transform: translateY(-8px);
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    margin-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body[data-auth-mode="signup"] .fg--signup-only {
  max-height: 90px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 16px !important;
}

/* Terms text (solo aparece en signup) */
.auth-terms {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--auth-text-faint);
  line-height: 1.5;
  text-align: center;
  margin: 12px 0 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition:
    max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    margin 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body[data-auth-mode="signup"] .auth-terms {
  max-height: 60px;
  opacity: 1;
  margin: 14px 0 0;
}

/* Fade suave del titulo/sub cuando cambia el modo */
.auth-title,
.auth-sub {
  transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
body.auth-mode-switching .auth-title,
body.auth-mode-switching .auth-sub {
  opacity: 0;
}

/* 2FA form: hereda todo el look del login. Ajuste puntual del input OTP */
#form-totp input#login-totp-code {
  text-align: center !important;
  font-size: 26px !important;
  letter-spacing: 12px !important;
  font-weight: 700 !important;
  padding: 16px !important;
  font-family: "SF Mono", "Monaco", "Consolas", ui-monospace, monospace !important;
}
#form-totp .auth-sub {
  margin-bottom: 22px !important;
}
#btn-totp-cancel {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--auth-text-muted) !important;
  box-shadow: none !important;
  margin-top: 10px !important;
}
#btn-totp-cancel:hover:not(:disabled) {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: var(--auth-text) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Edgar 2026-07-07: input TOTP (2FA) — mismo estilo Notion/Apple, 15px
   mobile / 22px desktop, letter-spacing amplio para separacion visual. */
#form-totp #login-totp-code {
  text-align: center !important;
  font-size: 22px !important;
  letter-spacing: 8px !important;
  font-weight: 700 !important;
  padding: 14px !important;
  font-family: "SF Mono", "Menlo", "Consolas", ui-monospace, monospace !important;
}
@media (max-width: 480px) {
  #form-totp #login-totp-code {
    font-size: 20px !important;
    letter-spacing: 6px !important;
  }
}

/* Checkbox trust device — estilo Apple/iOS con animacion suave */
.auth-trust-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px;
  margin: 0 0 14px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.auth-trust-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.auth-trust-check-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--auth-border, rgba(255,255,255,0.14));
  background: rgba(255,255,255,0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition:
    background 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.15s cubic-bezier(0.32, 1.72, 0.6, 1);
  margin-top: 1px;
}
.auth-trust-check:hover .auth-trust-check-box {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.04);
}
.auth-trust-check input:checked + .auth-trust-check-box {
  background: var(--auth-orange, #FF8A00);
  border-color: var(--auth-orange, #FF8A00);
  color: #FFFFFF;
  transform: scale(1.06);
}
.auth-trust-check input:checked + .auth-trust-check-box:hover {
  background: var(--auth-orange-hover, #FF9A1F);
}
.auth-trust-check input:focus-visible + .auth-trust-check-box {
  box-shadow: 0 0 0 3px rgba(255,138,0,0.22);
  outline: none;
}
.auth-trust-check-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--auth-text-muted, rgba(241,245,249,0.72));
  line-height: 1.4;
  padding-top: 1px;
}
.auth-trust-check:hover .auth-trust-check-text {
  color: var(--auth-text, #F1F5F9);
}

/* Boton ghost (cancelar) — variante del btn-auth sin bg naranja */
.btn-auth--ghost {
  background: transparent !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--auth-text-muted, rgba(241,245,249,0.72)) !important;
  box-shadow: none !important;
  margin-top: 10px !important;
}
.btn-auth--ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: var(--auth-text, #F1F5F9) !important;
  box-shadow: none !important;
  transform: none !important;
}
