/* ===================== Responsive ===================== */
@media (max-width: 767px) {
  html {
    zoom: 1;
  }
  .login-wrapper {
    max-width: 100vw;
    padding: 0.5rem 0.2rem;
  }
  .login-box {
    max-width: 98vw;
    padding: 18px 4vw;
    border-radius: 16px;
  }
  .login-box input,
  .login-box button {
    font-size: 16px;
    min-height: 44px;
  }
  .login-box label,
  .login-box .login-title {
    font-size: 18px;
  }
}

@media (max-width: 1023px) {
  .login-wrapper {
    max-width: 98vw;
  }
  .login-box {
    max-width: 96vw;
  }
}
/* ==========================================
   login.css — Pantalla de Login (Cyberpunk)
   Municipio El Marqués
   ========================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  zoom: 0.85;
}

body {
  min-height: 100vh;
  background: #000;
  font-family: 'Orbitron', sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* Capa base de particulas digitales */
body::before {
  background:
    radial-gradient(circle, rgba(0, 255, 255, 0.22) 1px, transparent 1.6px),
    radial-gradient(circle, rgba(30, 144, 255, 0.16) 1px, transparent 1.8px);
  background-size: 40px 40px, 58px 58px;
  background-position: 0 0, 18px 24px;
  animation: moveGrid 22s linear infinite;
}

/* Capa secundaria para profundidad */
body::after {
  background:
    radial-gradient(circle, rgba(0, 255, 255, 0.12) 1px, transparent 2px);
  background-size: 72px 72px;
  background-position: 10px 10px;
  animation: moveGridAlt 34s linear infinite;
}

@keyframes moveGrid {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-40px, -40px, 0); }
}

@keyframes moveGridAlt {
  from { transform: translate3d(0, 0, 0); opacity: 0.55; }
  50%  { opacity: 0.85; }
  to   { transform: translate3d(72px, -72px, 0); opacity: 0.55; }
}

/* ── Video de fondo ────────────────────────── */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* ── Contenedor principal ──────────────────── */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 520px;
  padding: 0.5rem;
}

.login-box {
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 480px;
  padding: clamp(25px, 5vw, 45px) clamp(20px, 4vw, 40px);
  border-radius: 28px;
  background: rgba(15, 20, 30, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow:
    0 0 25px rgba(0, 255, 255, 0.15),
    0 10px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto;
}

/* HUD Corners — esquinas tecnológicas */
.login-box::before,
.login-box::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid #00ffff;
  z-index: 20;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.login-box::before {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
}

.login-box::after {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.9);
  z-index: 30;
}

.login-box.scan-active .scan-line {
  animation: scan 3s linear;
}

@keyframes scan {
  0% { top: 0; opacity: 0; }
  50% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* ── Mascota ────────────────────────────────── */
.mascot-container {
  width: clamp(100px, 22vw, 220px);
  height: clamp(100px, 22vw, 220px);
  margin-bottom: clamp(12px, 3vw, 20px);
}

.mascot {
  width: 100%;
  height: 100%;
  display: block;
  animation: logo-pulse 3.5s ease-in-out infinite;
}

/* Capa 1 — base blanca */
.raccoon-base {
  fill: #ffffff;
}

/* Capa 2 — glow cian fijo */
.raccoon-glow {
  fill: rgba(0, 255, 255, 0.14);
}

/* Capa 3 — trazo animado */
.raccoon-trace {
  fill: none;
  stroke: #1E90FF;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 250 2750;
  animation: neon-trace 4s linear infinite;
  filter:
    drop-shadow(0 0 6px #1E90FF)
    drop-shadow(0 0 18px #1E90FF);
}

/* Pulsación general del logo */
@keyframes logo-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 6px rgba(0, 255, 255, 0.85))
      drop-shadow(0 0 16px rgba(0, 255, 255, 0.4));
  }
  50% {
    filter:
      drop-shadow(0 0 10px rgba(0, 255, 255, 1))
      drop-shadow(0 0 26px rgba(0, 255, 255, 0.65));
  }
}

/* Recorrido de energía por el contorno */
@keyframes neon-trace {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -3000; }
}

/* ── Textos ─────────────────────────────────── */
.titulo {
  margin-bottom: clamp(15px, 3vw, 25px);
  font-size: clamp(1.5rem, 6vw, 2.5rem);
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  color: #00F7FF;
  text-shadow:
    0 0 6px #00F7FF,
    0 0 18px #00F7FF,
    0 0 40px #00F7FF;
  letter-spacing: clamp(3px, 1.5vw, 8px);
  animation: neonPulse 2.5s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    text-shadow:
      0 0 4px #00F7FF,
      0 0 12px #00F7FF;
  }
  25% {
    text-shadow:
      0 0 6px #00F7FF,
      0 0 18px #00F7FF,
      0 0 35px #00F7FF;
  }
  50% {
    text-shadow:
      0 0 12px #00F7FF,
      0 0 30px #00F7FF,
      0 0 60px #00F7FF;
  }
  75% {
    text-shadow:
      0 0 6px #00F7FF,
      0 0 18px #00F7FF,
      0 0 35px #00F7FF;
  }
}

.subtitulo {
  font-size: 0.78rem;
  color: rgba(0, 255, 255, 0.55);
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

/* ── Formulario ────────────────────────────── */
form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.campo-grupo {
  position: relative;
  width: 100%;
  margin-bottom: clamp(15px, 3vw, 25px);
}

#project-group {
  display: none;
}

#project-group.is-visible {
  display: block;
}

/* Input base */
.campo-grupo input {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 255, 255, 0.08);
  border: 2px solid #00ffff;
  border-radius: 8px;
  color: #00ffff;
  font-size: 0.85rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  letter-spacing: 2px;
  outline: none;
  transition: all 0.3s;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  box-shadow: 0 0 6px rgba(0, 255, 255, 0.2);
}

.campo-grupo select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0, 255, 255, 0.08);
  border: 2px solid #00ffff;
  border-radius: 8px;
  color: #00ffff;
  font-size: 0.85rem;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  letter-spacing: 1px;
  outline: none;
  transition: all 0.3s;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  box-shadow: 0 0 6px rgba(0, 255, 255, 0.2);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #00ffff 50%),
    linear-gradient(135deg, #00ffff 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.campo-grupo select:disabled {
  opacity: 0.75;
}

/* Placeholder invisible (necesario para la etiqueta flotante) */
.campo-grupo input::placeholder {
  color: transparent;
}

/* Foco */
.campo-grupo input:focus {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.25);
  box-shadow: 
    0 0 15px #00ffff,
    inset 0 0 8px rgba(0, 255, 255, 0.1);
  animation: inputScan 1.5s ease-in-out infinite;
}

@keyframes inputScan {
  0%, 100% {
    box-shadow: 
      0 0 15px #00ffff,
      inset 0 0 8px rgba(0, 255, 255, 0.1);
  }
  50% {
    box-shadow: 
      0 0 20px #00ffff,
      inset 0 0 12px rgba(0, 255, 255, 0.2);
  }
}

.campo-grupo select:focus {
  border-color: #00ffff;
  background: rgba(0, 255, 255, 0.25);
  box-shadow:
    0 0 15px #00ffff,
    inset 0 0 8px rgba(0, 255, 255, 0.1);
}

/* Etiqueta flotante — input normal */
.campo-grupo label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #00ffff;
  pointer-events: none;
  font-size: 0.95rem;
  font-family: 'Orbitron', sans-serif;
  transition: all 0.3s;
}

.campo-grupo input:focus + label,
.campo-grupo input:not(:placeholder-shown) + label {
  top: -20px;
  left: 8px;
  transform: none;
  font-size: 0.9rem;
  color: #00ffff;
  border-radius: 6px;
  padding: 0 8px;
}

.campo-grupo select:focus + label,
.campo-grupo select.has-value + label {
  top: -20px;
  left: 8px;
  transform: none;
  font-size: 0.9rem;
  color: #00ffff;
  border-radius: 6px;
  padding: 0 8px;
}

/* ── Password con ojo ─────────────────────── */
.password-wrap {
  width: 100%;
  margin: 0 auto 18px;
}

.password-wrap input {
  width: 100%;
  padding: 8px 38px 8px 10px;
}

.password-wrap label {
  left: 12px;
}

.password-wrap input:focus + label,
.password-wrap input:not(:placeholder-shown) + label {
  top: -20px;
  left: 8px;
  transform: none;
  font-size: 0.9rem;
  padding: 0 6px;
}

.eye-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #00ffff;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.eye-icon:hover {
  opacity: 1;
}

/* ── Mensaje de error ─────────────────────── */
.error-msg {
  color: #ff6b6b;
  font-size: 0.8rem;
  min-height: 1rem;
  text-align: center;
  font-weight: 500;
  font-family: 'Orbitron', sans-serif;
  text-shadow: 0 0 8px rgba(255, 80, 80, 0.6);
  margin-top: -8px;
  margin-bottom: 4px;
}

.force-password-panel {
  width: 100%;
  margin: 8px 0 14px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 107, 0.55);
  border-radius: 10px;
  background: rgba(255, 80, 80, 0.07);
}

.recover-password-panel {
  width: 100%;
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  border-radius: 10px;
  background: rgba(0, 255, 255, 0.06);
}

.recover-password-title {
  color: #8cf7ff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
  text-align: center;
}

.recover-password-copy {
  color: rgba(160, 248, 255, 0.86);
  font-size: 0.68rem;
  line-height: 1.45;
  margin-bottom: 12px;
  text-align: center;
}

.recover-password-result {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 12, 20, 0.58);
  border: 1px solid rgba(0, 255, 255, 0.22);
}

.recover-password-ok {
  color: #8cf7ff;
  font-size: 0.68rem;
  line-height: 1.5;
  margin-bottom: 8px;
  text-align: center;
}

.recover-password-temp {
  color: #00ffff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 255, 255, 0.55);
  margin-bottom: 8px;
}

.recover-password-note {
  color: rgba(170, 247, 255, 0.78);
  font-size: 0.64rem;
  line-height: 1.5;
  text-align: center;
}

.force-password-title {
  color: #ff8a8a;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-align: center;
}

.force-password-show-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: rgba(255, 180, 180, 0.92);
  font-size: 0.72rem;
  user-select: none;
}

.force-password-show-toggle input {
  accent-color: #ff8a8a;
}

/* ── Botón ────────────────────────────────── */
.btn-login {
  width: 100%;
  padding: 8px;
  background: rgba(0, 255, 255, 0.08);
  border: 2px solid #00ffff;
  border-radius: 8px;
  color: #00ffff;
  font-weight: bold;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.btn-login:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 15px #00ffff;
}

/* ── Sistema de mensajes terminales ────────── */
.system-messages {
  margin-top: 12px;
  width: 100%;
  max-height: 70px;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.65);
  text-align: left;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.system-line {
  height: 0;
  opacity: 0;
  transition: all 0.3s ease-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 8px;
  position: relative;
}

.system-line.active {
  height: auto;
  opacity: 1;
  animation: typing 2.5s steps(40) ease-out;
}

.system-line.active::after {
  content: ' ▌';
  animation: blink 0.8s infinite;
}

@keyframes typing {
  from {
    width: 0;
    opacity: 0.3;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* ── Indicador de seguridad ───────────────── */
.security-badge {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  font-size: 0.65rem;
  color: rgba(0, 255, 255, 0.6);
  border: 1px solid rgba(0, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(0, 255, 255, 0.05);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.08);
  font-family: 'Courier New', monospace;
  letter-spacing: 0.3px;
  animation: securityPulse 3s ease-in-out infinite;
}

.lock-icon {
  font-size: 0.85rem;
  display: inline-block;
  margin-top: 2px;
}

.security-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  flex: 1;
}

.security-title {
  font-weight: 700;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.security-subtitle {
  font-size: 0.6rem;
  color: rgba(0, 255, 255, 0.55);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.security-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-line {
  font-size: 0.58rem;
  color: rgba(0, 255, 255, 0.45);
  line-height: 1.4;
}

.status-ok {
  color: rgba(0, 255, 0, 0.75);
  font-weight: 600;
}

.status-version {
  color: rgba(30, 144, 255, 0.75);
  font-weight: 600;
}

@keyframes securityPulse {
  0%, 100% {
    border-color: rgba(0, 255, 255, 0.25);
    background: rgba(0, 255, 255, 0.05);
  }
  50% {
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.08);
  }
}

/* ── Opciones extra ───────────────────────── */
.options {
  margin-top: 15px;
  font-size: 0.7rem;
  color: #00ffff;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  line-height: 1.5;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.options a {
  color: #00ffff;
  text-decoration: none;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  letter-spacing: 3px;
}

.options a:hover {
  text-shadow: 0 0 10px #00ffff;
}

/* Responsive para HUD corners y security badge */
@media (max-width: 768px) {
  body {
    display: flex;
    align-items: flex-start;
    padding-top: 20px;
  }

  .login-wrapper {
    max-height: calc(100vh - 40px);
    padding: 0.75rem;
  }

  .login-box {
    padding: clamp(30px, 6vw, 50px) clamp(20px, 5vw, 35px);
  }

  .login-box::before,
  .login-box::after {
    width: 24px;
    height: 24px;
  }
}

/* Responsive para HUD corners y security badge */
@media (max-width: 480px) {
  .login-box {
    padding: 25px 20px;
    border-radius: 16px;
  }

  .login-box::before,
  .login-box::after {
    width: 18px;
    height: 18px;
  }

  .mascot-container {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
  }

  .titulo {
    font-size: 1.8rem;
    letter-spacing: 4px;
    margin-bottom: 15px;
  }

  .security-badge {
    font-size: 0.6rem;
    padding: 6px 10px;
  }

  .system-messages {
    font-size: 0.7rem;
  }
}
