/* Login "Lámpara Animada / Neón" — pantalla propia, aislada de css/style.css. */

html:has(> body.neon-login) { overflow-x: hidden; }

.neon-login {
  --neon: #00ffc3;
  --neon-dim: #00c49a;
  --neon-deep: #006655;
  --neon-bg: #021a12;
  --neon-card: rgba(6, 26, 20, 0.55);
  --neon-border: rgba(0, 255, 195, 0.25);
  --neon-text: #eafff6;
  --neon-text-dim: #7fb8a8;

  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--neon-bg);
  color: var(--neon-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  position: relative;
  cursor: none;
}
.neon-login * { box-sizing: border-box; }

@media (max-width: 720px), (hover: none) {
  .neon-login { cursor: auto; }
  .neon-login .cursor-glow { display: none; }
}

/* ---------- Fondo ---------- */
.neon-login .grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 255, 195, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 195, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 90%);
  z-index: 0;
}
.neon-login .noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.neon-login .blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.neon-login .blob-1 {
  width: 380px; height: 380px;
  background: var(--neon);
  top: -120px; left: -100px;
  animation: blobFloat1 16s ease-in-out infinite;
}
.neon-login .blob-2 {
  width: 320px; height: 320px;
  background: var(--neon-deep);
  bottom: -140px; right: -80px;
  animation: blobFloat2 20s ease-in-out infinite;
}
.neon-login .blob-3 {
  width: 260px; height: 260px;
  background: var(--neon-dim);
  bottom: 10%; left: 8%;
  animation: blobFloat3 13s ease-in-out infinite;
}
@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.15); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, -30px) scale(1.1); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -50px) scale(1.2); }
}

/* ---------- Escena (lámpara + robot + tarjeta) ---------- */
.neon-login .scene {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 60px;
  overflow-x: hidden;
}

.neon-login .card {
  min-width: 0;
}

.neon-login .stage-row {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.neon-login .light-column {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.neon-login .lamp-wrap {
  position: relative;
  width: 100%;
  max-width: 220px;
  cursor: pointer;
  touch-action: manipulation;
}
.neon-login .lamp-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px rgba(0, 255, 195, 0.5));
  transition: filter 0.4s ease;
}
.neon-login.lamp-off .lamp-svg { filter: none; }

.neon-login .light-cone {
  position: relative;
  width: min(70vw, 460px);
  height: 340px;
  margin-top: -6px;
  background: linear-gradient(180deg, rgba(0, 255, 195, 0.35), rgba(0, 255, 195, 0.05) 60%, transparent 100%);
  clip-path: polygon(46% 0%, 54% 0%, 100% 100%, 0% 100%);
  filter: blur(2px);
  opacity: 0.85;
  transition: opacity 0.5s ease;
  animation: coneFlicker 5s ease-in-out infinite;
}
.neon-login.lamp-off .light-cone { opacity: 0.06; animation: none; }
@keyframes coneFlicker {
  0%, 100% { opacity: 0.85; }
  48% { opacity: 0.85; }
  50% { opacity: 0.65; }
  52% { opacity: 0.85; }
  75% { opacity: 0.78; }
}

.neon-login .robot-col {
  position: relative;
  width: min(90vw, 340px);
  margin-top: -260px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.neon-login .floor-glow {
  position: absolute;
  left: 50%;
  bottom: -30px;
  width: 340px;
  height: 90px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 255, 195, 0.45), transparent 70%);
  filter: blur(10px);
  z-index: 0;
  transition: opacity 0.5s ease;
}
.neon-login.lamp-off .floor-glow { opacity: 0.15; }

/* Detrás del video: sin esto, el fondo negro del clip (sin canal alfa) no
   se "borra" del todo con mix-blend-mode — el screen necesita algo con
   brillo detrás para poder disolver el negro. */
.neon-login .robot-glow {
  position: absolute;
  left: 50%;
  top: -40px;
  width: 360px;
  height: 360px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(0, 255, 195, 0.6), rgba(0, 196, 154, 0.35) 45%, rgba(0, 196, 154, 0.12) 65%, transparent 78%);
  filter: blur(4px);
  z-index: 0;
  transition: opacity 0.5s ease;
}
.neon-login.lamp-off .robot-glow { opacity: 0.2; }

.neon-login #particles-canvas {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 340px;
  height: 320px;
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
}

.neon-login .hero-robot {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 18px rgba(0, 255, 195, 0.35));
  margin-top: 10px;
}

/* ---------- Tarjeta ---------- */
.neon-login .card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  margin-top: 4px;
  padding: 28px 26px 30px;
  border-radius: 18px;
  background: var(--neon-card);
  border: 1px solid var(--neon-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow:
    0 0 0 1px rgba(0, 255, 195, 0.05) inset,
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 255, 195, 0.08);
  text-align: center;
  animation: cardRise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.neon-login .card h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 0 18px rgba(0, 255, 195, 0.5);
}
.neon-login .card .subtitle {
  margin: 0 0 22px;
  font-size: 0.82rem;
  color: var(--neon-text-dim);
}

.neon-login .neon-error {
  margin: 0 0 16px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #ffb4b4;
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.35);
}

.neon-login .neon-form { display: flex; flex-direction: column; gap: 16px; text-align: left; }

.neon-login .neon-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.neon-login .neon-field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-text-dim);
}
.neon-login .neon-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 195, 0.2);
  background: rgba(0, 40, 30, 0.4);
  color: var(--neon-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.neon-login .neon-field input::placeholder { color: rgba(234, 255, 246, 0.3); }
.neon-login .neon-field input:focus {
  border-color: var(--neon);
  background: rgba(0, 50, 38, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 255, 195, 0.12), 0 0 18px rgba(0, 255, 195, 0.35);
}
.neon-login .neon-field .field-line {
  position: absolute;
  left: 14px; right: 14px; bottom: 0;
  height: 2px;
  background: var(--neon);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s ease;
  box-shadow: 0 0 8px var(--neon);
}
.neon-login .neon-field input:focus ~ .field-line { transform: scaleX(1); }

.neon-login .neon-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  font-size: 0.78rem;
  color: var(--neon-text-dim);
}
.neon-login .neon-checkbox { display: flex; align-items: center; gap: 7px; cursor: pointer; flex-shrink: 0; }
.neon-login .neon-checkbox input { accent-color: var(--neon); width: 15px; height: 15px; flex-shrink: 0; }
.neon-login .neon-forgot {
  color: var(--neon-dim);
  text-decoration: none;
  background: none;
  border: none;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  text-align: right;
  min-width: 0;
}
.neon-login .neon-forgot:hover { color: var(--neon); text-decoration: underline; }

.neon-login .neon-btn {
  position: relative;
  margin-top: 4px;
  padding: 13px;
  border-radius: 10px;
  border: 1px solid var(--neon);
  background: linear-gradient(180deg, rgba(0, 255, 195, 0.18), rgba(0, 255, 195, 0.06));
  color: var(--neon);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.neon-login .neon-btn:hover {
  color: #04140f;
  background: var(--neon);
  box-shadow: 0 0 24px rgba(0, 255, 195, 0.65), 0 0 60px rgba(0, 255, 195, 0.25);
}
.neon-login .neon-btn:active { transform: scale(0.97); }
.neon-login .neon-btn.is-loading { color: transparent; pointer-events: none; }
.neon-login .neon-btn.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(4, 20, 15, 0.35);
  border-top-color: #04140f;
  animation: neonSpin 0.7s linear infinite;
}
@keyframes neonSpin { to { transform: rotate(360deg); } }

.neon-login .neon-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  z-index: 5;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 40, 30, 0.9);
  border: 1px solid var(--neon-border);
  color: var(--neon-text);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 0 24px rgba(0, 255, 195, 0.2);
}
.neon-login .neon-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Cursor de seguimiento ---------- */
.neon-login .cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 195, 0.9), transparent 70%);
  box-shadow: 0 0 22px 6px rgba(0, 255, 195, 0.35);
  z-index: 9999;
  pointer-events: none;
  transform: translate(-100px, -100px);
  transition: transform 0.06s linear, opacity 0.2s ease;
}

@media (max-width: 480px) {
  .neon-login .light-cone { height: 260px; }
  .neon-login .robot-col { margin-top: -190px; }
  .neon-login #particles-canvas { width: 280px; height: 240px; }
  .neon-login .hero-robot { width: 160px; height: 160px; }
}

/* En pantallas anchas el robot y la tarjeta quedan al mismo nivel, uno al
   lado del otro, en vez de uno arriba del otro. */
@media (min-width: 860px) {
  .neon-login .stage-row {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 56px;
    max-width: 900px;
  }
  .neon-login .light-column { width: auto; }
  .neon-login .card { margin-top: 0; }
}
