/* ============================================================================
   auth.css · Experiencia de acceso a pantalla completa (login / registro /
   recuperación). Layout dividido en desktop, inmersivo en móvil.
   Firma: aurora + grilla de módulos QR + línea de escaneo. Usa theme.css.
   No depende de JS: todo el markup decorativo es inerte.
   ============================================================================ */

/* La página de auth ocupa toda la pantalla */
.auth-page { overflow-x: hidden; }

/* Fondo inmersivo (detrás de todo) */
.auth-page .auth-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: var(--glow);
}
.auth-page .auth-bg::before {
  content: ""; position: absolute; width: 64vmax; height: 64vmax; left: -14vmax; top: -22vmax;
  background: radial-gradient(closest-side, rgba(124,90,210,.14), transparent 70%);
  filter: blur(30px);
}
.auth-page .auth-bg::after {
  content: ""; position: absolute; width: 50vmax; height: 50vmax; right: -16vmax; bottom: -18vmax;
  background: radial-gradient(closest-side, rgba(232,168,90,.08), transparent 70%);
  filter: blur(30px);
}
.auth-page .auth-bg .scanline { display: none; }

/* Topbar flotante y transparente sobre el fondo */
.auth-page .topbar {
  position: absolute; top: 0; left: 0; right: 0;
  background: transparent; border: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.auth-page .topbar nav a[href="/login"] { display: none; } /* redundante en la propia auth */

/* Estructura general */
.auth-wrap {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.04fr .96fr;
  padding: 0;
}

/* ── Panel lateral (solo desktop) · relato del producto ─────────────────── */
.auth-aside {
  position: sticky; top: 0; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px clamp(40px, 5vw, 88px);
  border-right: 1px solid var(--border);
  background:
    linear-gradient(160deg, rgba(157,107,255,.12), transparent 55%),
    linear-gradient(20deg, rgba(245,169,60,.08), transparent 50%);
}
.aside-inner { max-width: 460px; position: relative; z-index: 2; }
.aside-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 50px;
  background: var(--vs); border: 1px solid var(--brh); color: var(--vd);
  font: 600 12px/1 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 26px;
}
.aside-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--am); box-shadow: 0 0 0 4px var(--ams); }
.aside-title { font-size: clamp(30px, 3vw, 44px); line-height: 1.05; letter-spacing: -.04em; margin-bottom: 16px; }
.aside-title .grad { background: var(--vgr); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aside-sub { color: var(--text-soft); font-size: 17px; max-width: 42ch; margin: 0 0 30px; }
.aside-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.aside-points li { display: flex; align-items: flex-start; gap: 13px; color: var(--text); font-size: 15px; }
.aside-points .ic {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  font-size: 16px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.aside-points li b { font-weight: 700; }
.aside-points li span { color: var(--text-soft); font-size: 13.5px; display: block; }
.aside-foot { margin-top: 38px; display: flex; align-items: center; gap: 10px; color: var(--text-dim); font: 500 12.5px var(--font-mono); letter-spacing: .03em; }
.aside-foot .lk { width: 22px; height: 22px; border-radius: 7px; background: var(--vgr); display: grid; place-items: center; font-size: 11px; }
/* tarjeta "chapita" flotante decorativa */
.aside-chip {
  position: absolute; right: clamp(24px, 4vw, 70px); top: 50%; transform: translateY(-50%) rotate(7deg);
  width: 150px; height: 150px; border-radius: 34px; z-index: 1; opacity: .9;
  background: var(--vgr); box-shadow: var(--shadow), 0 0 60px -10px var(--v);
  display: grid; place-items: center; animation: floaty 6s ease-in-out infinite;
}
.aside-chip::before { content: ""; position: absolute; inset: 12px; border-radius: 24px; border: 2px dashed rgba(255,255,255,.45); }
.aside-chip .emoji { font-size: 58px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
@media (max-width: 1180px){ .aside-chip { display: none; } }

/* ── Panel del formulario ───────────────────────────────────────────────── */
.auth-panel {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh; padding: 88px 24px 30px;
  background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 480px; position: relative;
  max-height: calc(100dvh - 124px); overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
  background: transparent; border: none;
  border-radius: var(--radius-lg); padding: 6px 4px;
  box-shadow: none;
  animation: popIn .6s cubic-bezier(.16,1,.3,1) both;
}
/* el login NO es un modal: anula cualquier caja heredada de .card */
.auth-card.card {
  background: transparent; border: none; box-shadow: none; padding: 6px 4px;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.auth-card::-webkit-scrollbar { width: 8px; }
.auth-card::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
.auth-card::-webkit-scrollbar-track { background: transparent; }
/* sin filo: ya no hay tarjeta tipo modal */
.auth-card::before { display: none; }

.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo {
  width: 64px; height: 64px; border-radius: 20px; background: var(--vgr);
  display: grid; place-items: center; font-size: 32px; margin: 0 auto 16px;
  box-shadow: 0 14px 30px -8px var(--v), 0 0 0 1px rgba(255,255,255,.16) inset, var(--glow-v);
  animation: floaty 7s ease-in-out infinite;
}
.auth-head h1 { font-size: 27px; margin-bottom: 6px; letter-spacing: -.035em; }
.auth-head .muted { font-size: 14.5px; }

.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 14px; flex-wrap: wrap; }
.auth-links a { color: var(--text-soft); font-weight: 500; transition: var(--trans); }
.auth-links a:hover { color: var(--v); }

/* Eyebrow de sección (registro) */
.section-title {
  font: 700 12px/1 var(--font-mono); color: var(--vd); text-transform: uppercase; letter-spacing: .1em;
  margin: 24px 0 14px; display: flex; align-items: center; gap: 9px;
}
.section-title::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--am); }

/* En auth, los inputs respiran un poco más */
.auth-card .field label { margin-bottom: 7px; }

/* ── Tablet: una sola columna, tarjeta centrada cómoda ──────────────────── */
@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-panel { padding: 80px 20px 28px; }
  .auth-card { max-width: 480px; padding: 32px 26px; border-radius: 24px; }
}

/* ── Celular: PANTALLA COMPLETA real (sin tarjeta flotante / sin "modal") ── */
@media (max-width: 600px) {
  .auth-page { background: var(--bg); }
  .auth-panel {
    padding: 0; min-height: 100dvh;
    align-items: stretch; justify-content: stretch;
  }
  .auth-card,
  .auth-card.card {
    max-width: none !important; width: 100%;
    min-height: 100dvh; max-height: none; overflow: visible;
    margin: 0; border: none !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    display: flex; flex-direction: column; justify-content: center;
    padding: calc(env(safe-area-inset-top, 0px) + 84px) 20px
             calc(env(safe-area-inset-bottom, 0px) + 40px);
    animation: fade .45s ease both;
  }
  .auth-card::before { display: none; }      /* sin filo: ya no hay tarjeta */
  .auth-head { margin-bottom: 26px; }
  .auth-head h1 { font-size: 26px; }
  .auth-logo {
    width: 66px; height: 66px; font-size: 33px;
    box-shadow: 0 16px 36px -8px var(--v), var(--glow-v);
  }
}
@media (max-width: 380px) {
  .auth-card,
  .auth-card.card { padding-left: 15px; padding-right: 15px; }
  .auth-head h1 { font-size: 23px; }
  .auth-logo { width: 60px; height: 60px; font-size: 30px; }
}

/* ── Animaciones de entrada (aside + tarjeta) ───────────────────────────── */
.auth-aside .aside-badge { animation: riseIn .6s .05s both; }
.auth-aside .aside-title { animation: riseIn .6s .12s both; }
.auth-aside .aside-sub   { animation: riseIn .6s .19s both; }
.auth-aside .aside-points li { animation: riseIn .55s both; }
.auth-aside .aside-points li:nth-child(1) { animation-delay: .26s; }
.auth-aside .aside-points li:nth-child(2) { animation-delay: .34s; }
.auth-aside .aside-points li:nth-child(3) { animation-delay: .42s; }
.auth-aside .aside-foot  { animation: riseIn .6s .5s both; }
/* barrido de luz sobre el filo superior de la tarjeta (desktop/tablet) */
.auth-card::after { display: none; }
@keyframes authSheen {
  0%, 100% { transform: translateX(0); opacity: 0; }
  10% { opacity: .8; }
  50% { transform: translateX(calc(min(430px, 70vw) - 60px)); opacity: .15; }
  60% { opacity: 0; }
}
@media (max-width: 600px) { .auth-card::after { display: none; } }

/* Pantallas anchas: que el formulario no quede gigante */
@media (min-width: 1500px){ .auth-card { max-width: 460px; } }

/* ============================================================================
   Visor 3D decorativo de la chapita (logo de registro + chip del login)
   El <canvas> lo inyecta chapita3d.js; el emoji queda de respaldo y se funde.
   ============================================================================ */
[data-chapita3d] { position: relative; overflow: hidden; }
[data-chapita3d] .c3d-canvas {
  position: absolute; inset: 0; z-index: 1; display: block;
  width: 100% !important; height: 100% !important;
}
[data-chapita3d] .emoji-fallback,
[data-chapita3d] .emoji { position: relative; z-index: 2; transition: opacity .55s ease; }
[data-chapita3d].c3d-ready .emoji-fallback,
[data-chapita3d].c3d-ready .emoji { opacity: 0; }
[data-chapita3d] .c3d-canvas { cursor: inherit; }

/* el logo del registro respira un poco más para darle aire al modelo */
/* el logo de la tarjeta: modelo 3D grande, sin caja ni fondo violeta */
.auth-logo[data-chapita3d] {
  width: 224px; height: 224px; border-radius: 0;
  background: none; box-shadow: none; overflow: visible; margin-bottom: 8px;
}
.auth-logo[data-chapita3d] .emoji-fallback { font-size: 110px; }
@media (max-width: 600px) { .auth-logo[data-chapita3d] { width: 196px; height: 196px; } }
@media (max-width: 380px) { .auth-logo[data-chapita3d] { width: 176px; height: 176px; } }

/* la chapita del login: borde punteado por encima del modelo + halo que late */
.aside-chip { animation: floaty 6s ease-in-out infinite, chipGlow 4.6s ease-in-out infinite; }
.aside-chip::before { z-index: 3; }
@keyframes chipGlow {
  0%, 100% { box-shadow: var(--shadow), 0 0 50px -14px var(--v); }
  50%      { box-shadow: var(--shadow), 0 0 78px -8px var(--v), 0 0 30px -6px var(--am); }
}

/* ── Más vida en el panel lateral del login (orbes + degradado animado) ──── */
.auth-aside { background-size: 220% 220%; animation: gradientShift 18s ease-in-out infinite; }
.aside-orb {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: 0;
  filter: blur(34px); opacity: .55;
}
.aside-orb.o1 {
  width: 210px; height: 210px; left: 6%; top: 16%;
  background: radial-gradient(closest-side, rgba(157,107,255,.55), transparent 70%);
  animation: orbFloat 15s ease-in-out infinite;
}
.aside-orb.o2 {
  width: 170px; height: 170px; right: 12%; bottom: 14%;
  background: radial-gradient(closest-side, rgba(245,169,60,.42), transparent 70%);
  animation: orbFloat 19s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(22px, -26px) scale(1.12); }
}
.aside-points .ic { transition: transform var(--spring), border-color var(--trans); }
.aside-points li:hover .ic { transform: translateY(-2px) scale(1.06); border-color: var(--brh); }
