/* =========================================================
   MAGEN OPS — LOGIN GLASS / TRANSPARENTE
   Diseño: tarjeta de cristal sobre fondos rotativos de espacio
   ========================================================= */

:root {
  --glass-bg: rgba(8, 10, 18, 0.55);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-input-bg: rgba(0, 0, 0, 0.35);
  --glass-input-border: rgba(255, 255, 255, 0.18);
  --texto-principal: #e8eaf0;
  --texto-suave: rgba(232, 234, 240, 0.65);
  --acento: rgba(255, 255, 255, 0.85);
  --error-texto: #ff7b7b;
  --error-fondo: rgba(40, 5, 5, 0.55);
  --error-borde: rgba(255, 90, 90, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Courier New', monospace;
  background: #05060a;
  color: var(--texto-principal);
}

/* ---------- FONDO ROTATIVO ---------- */

#bg-rotator {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 30% 20%, #101a33 0%, #05060a 60%);
}

.bg-slide {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1.8s ease-in-out, transform 22s linear;
  will-change: opacity, transform;
}

.bg-slide.visible {
  opacity: 1;
  transform: scale(1.06); /* efecto Ken Burns lento */
}

/* Capa oscura para legibilidad del cristal */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(3,4,8,0.35) 0%, rgba(3,4,8,0.6) 100%);
  pointer-events: none;
}

/* Respaldo sin imágenes: campo estelar con gradiente puro */
body.sin-fondos #bg-rotator {
  background:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #cfd8ff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 50%, #aab6ff 50%, transparent 51%),
    radial-gradient(2px 2px at 10% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 90% 85%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 50% 120%, #1b2a52 0%, #05060a 70%);
}

/* ---------- TARJETA DE CRISTAL ---------- */

.login-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.glass-card {
  width: 100%;
  max-width: 420px;
  padding: 44px 40px 36px;
  border-radius: 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255,255,255,0.08);
}

.brand {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.55em;
  color: var(--texto-suave);
  margin: 0 0 6px;
  text-indent: 0.55em; /* compensa el letter-spacing final */
}

.identificate {
  text-align: center;
  font-size: 0.8rem;
  color: var(--texto-suave);
  margin: 0 0 26px;
}

/* ---------- FORMULARIO ---------- */

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--texto-suave);
  margin-bottom: 7px;
}

.form-control {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--texto-principal);
  background: var(--glass-input-bg);
  border: 1px solid var(--glass-input-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.form-control::placeholder { color: rgba(232,234,240,0.35); }

.form-control:focus {
  border-color: rgba(160, 190, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(120, 150, 255, 0.15);
  background: rgba(0, 0, 0, 0.45);
}

/* Campo de contraseña con ojito */
.password-wrap { position: relative; }

.password-wrap .form-control { padding-right: 48px; }

.toggle-password {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--texto-suave);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.toggle-password:hover,
.toggle-password.activo { color: #fff; background: rgba(255,255,255,0.08); }

.toggle-password:focus-visible {
  outline: 2px solid rgba(160,190,255,0.6);
  outline-offset: 1px;
}

/* ---------- CAPTCHA ---------- */

.captcha-container {
  margin: 22px 0 18px;
  padding: 16px 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.captcha-titulo {
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--texto-suave);
  margin-bottom: 12px;
}

.captcha-fila {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.captcha-img {
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  width: 160px;
  height: 50px;
  display: block;
}

.btn-refresh {
  height: 50px;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  color: var(--texto-suave);
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-refresh:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: rgba(255,255,255,0.45); }

.btn-refresh svg { width: 16px; height: 16px; }

.input-captcha {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  text-align: center !important;
  border-style: dashed !important;
}

/* ---------- FILA EXTRA: RECORDAR / AYUDA ---------- */

.fila-opciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.72rem;
}

.recordar { display: flex; align-items: center; gap: 6px; color: var(--texto-suave); cursor: pointer; }
.recordar input { accent-color: #9db4ff; cursor: pointer; }

.ayuda-link { color: var(--texto-suave); text-decoration: none; transition: color 0.2s; }
.ayuda-link:hover { color: #fff; text-decoration: underline; }

/* ---------- BOTÓN INICIAR ---------- */

.btn-iniciar {
  width: 100%;
  height: 48px;
  margin-top: 24px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  color: var(--acento);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-iniciar:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #0b0d14;
  border-color: transparent;
  box-shadow: 0 8px 28px rgba(200, 215, 255, 0.25);
}

.btn-iniciar:active { transform: translateY(1px); }

/* ---------- ALERTA DE ERROR ---------- */

.alert-error {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 11px 14px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--error-texto);
  background: var(--error-fondo);
  border: 1px solid var(--error-borde);
  border-radius: 10px;
  animation: aparecerError 0.35s ease-out;
}

.alert-error svg { flex-shrink: 0; width: 16px; height: 16px; }

@keyframes aparecerError {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 480px) {
  .glass-card { padding: 34px 24px 28px; }
}
