/* ============================================================
   LOGIN CerraGest — Diseño elegante y profesional
   ============================================================ */

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.10) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(30, 58, 95, 0.20) 0%, transparent 45%),
    var(--bg);
  position: relative;
  /* overflow: auto permite scroll si el contenido es más alto que la pantalla */
  overflow-y: auto;
  overflow-x: hidden;
}

.login-body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  z-index: 0;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  margin: auto;
}

.login-card {
  background: linear-gradient(180deg, rgba(35, 43, 53, 0.6) 0%, rgba(26, 32, 40, 1) 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 32px 26px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(245, 158, 11, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: subirLogin 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

@keyframes subirLogin {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ------- LOGO COMPLETO ------- */
.login-logo {
  text-align: center;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.login-logo-img {
  width: 180px;
  max-width: 75%;
  height: auto;
  margin: 0 auto 8px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(245, 158, 11, 0.15));
}

.login-logo-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.login-version {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.8px;
}


/* ------- FORMULARIO ------- */
.login-form h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
  letter-spacing: -0.2px;
}

.login-form .campo { margin-bottom: 13px; }

.login-form .campo label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.login-form .campo input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.login-form .campo input::placeholder {
  color: #4a5563;
  opacity: 1;
}

.login-form .campo input:hover {
  border-color: #3a4550;
}

.login-form .campo input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(245, 158, 11, 0.03);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}


/* ------- CAMPO CON OJITO (SVG) ------- */
.campo-password {
  position: relative;
  display: flex;
  align-items: center;
}

.campo-password input {
  width: 100%;
  padding-right: 48px;
}

.btn-ojo {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0;
}

.btn-ojo:hover {
  background: var(--surface-2);
  color: var(--accent);
}

.btn-ojo svg {
  display: block;
  width: 18px;
  height: 18px;
}


/* ------- BOTÓN PRINCIPAL ------- */
.login-form .btn-guardar {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: #1a1a1a;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow:
    0 6px 20px rgba(245, 158, 11, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
  letter-spacing: 0.2px;
}

.login-form .btn-guardar:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 28px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.login-form .btn-guardar:active {
  transform: translateY(0);
}


/* ------- CHECK RECORDARME ------- */
.check-recordarme {
  margin-top: 2px;
}

.check-recordarme .check-linea {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-size: 12px !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  user-select: none;
}

.check-recordarme input[type="checkbox"] {
  width: auto !important;
  accent-color: var(--accent);
  transform: scale(1.1);
  cursor: pointer;
}


/* ------- LINKS ------- */
.login-link {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.login-link:first-of-type {
  margin-top: 14px;
}

.login-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}

.login-link a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}


/* ------- MENSAJES ------- */
.login-mensaje {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.5;
  animation: aparecerMensaje 0.25s ease-out;
}

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

.login-mensaje.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.login-mensaje.ok {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.25);
}


/* ------- HINTS ------- */
.login-hint {
  color: var(--text-muted);
  font-size: 11px;
  display: block;
  margin-top: 5px;
  line-height: 1.4;
}

.hidden { display: none !important; }


/* ------- BARRA DE FUERZA ------- */
#fuerza-barra {
  display: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

#fuerza-barra.visible { display: block; }

#fuerza-nivel {
  height: 100%;
  width: 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.fuerza-texto {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  font-weight: 600;
  min-height: 14px;
}


/* ------- RESPONSIVE ------- */
@media (max-width: 480px) {
  .login-body {
    padding: 16px;
  }
  .login-card {
    padding: 24px 20px 22px;
    border-radius: 18px;
  }
  .login-logo-img {
    width: 150px;
  }
}