:root {
  --background-color: #ffffff;
  --heading-color: #1f1a3f;
  --accent-color: #203c8a;
}

/* 1. CORRECCIÓN CRÍTICA: Bloquear todo scroll innecesario en el contenedor raíz */
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Adiós al movimiento lateral */
}

body {
  font-family: "Roboto", sans-serif;
  /* min-height: 100dvh es la unidad moderna que evita el espacio en blanco en móviles (ignora la barra del navegador) */
  min-height: 100vh;
  min-height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  padding: 24px; /* Margen de seguridad para que la tarjeta nunca toque los bordes del celular */

  background-image: url("/assets/img/tramas-02.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ==========================================
   BLOBS DECORATIVOS (Cero desbordamiento)
============================================= */
/* Los metemos en un contenedor fantasma para que NUNCA empujen la pantalla ni generen espacio en blanco abajo */
body::before,
body::after {
  content: "";
  position: fixed; /* Cambiado a fixed para que se queden congelados en su posición sin importar qué */
  border-radius: 50%;
  opacity: 0.08;
  z-index: 1;
  pointer-events: none;
}

/* En PC se ven grandes, en móviles se reducen automáticamente gracias a max() yvw */
body::before {
  width: max(300px, 40vw);
  height: max(300px, 40vw);
  background: var(--accent-color);
  top: -10%;
  right: -10%;
}

body::after {
  width: max(280px, 35vw);
  height: max(280px, 35vw);
  background: var(--heading-color);
  bottom: -10%;
  left: -10%;
}

/* ==========================================
   ESTRUCTURA PRINCIPAL (Fija y Limpia)
============================================= */
.login-wrapper {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 580px; /* Un tamaño premium balanceado */
  box-sizing: border-box;
}

.login-card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(31, 26, 63, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.6);

  /* Padding inteligente */
  padding: clamp(35px, 6vw, 55px) clamp(20px, 5vw, 45px);
  box-sizing: border-box;
  width: 100%;
}

/* HEADER */
.login-header {
  text-align: center;
  margin-bottom: clamp(25px, 5vw, 35px);
}

.logo {
  height: clamp(75px, 9vw, 105px);
  width: auto;
  object-fit: contain;
  margin-bottom: 15px;
}

.login-header h2 {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(22px, 3.5vw, 26px);
  color: var(--heading-color);
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.login-header p {
  font-size: clamp(14px, 1.8vw, 15px);
  color: #666;
  margin: 0;
}

/* INPUTS */
.form-control {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #e6e8f0;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 15px;
  transition: all 0.3s ease;
  background-color: #fff;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(32, 60, 138, 0.15);
}

/* BOTÓN */
.btn-login {
  width: 100%;
  box-sizing: border-box;
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 15px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
  margin-top: 8px;
}

.btn-login:hover {
  background: #1a3275;
  transform: translateY(-1px);
}

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

/* Evita brincos visuales extraños en pantallas táctiles */
@media (hover: none) {
  .btn-login:hover {
    transform: none;
  }
}
