/* ======== GENERAL ======== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ======== SOMBRA FUERA DEL LOGIN (lado izquierdo) ======== */
body::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  left: -150px;
  top: 50%;
  transform: translateY(-50%) rotate(-25deg);
  background: radial-gradient(
    circle at 30% 30%,
    rgba(150, 100, 255, 0.18),
    transparent 70%
  );
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}

/* ======== CONTENEDOR PRINCIPAL ======== */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
}

/* ======== LOGIN BOX ======== */
.login-box {
  position: relative;
  z-index: 2;
  background: linear-gradient(758deg, #1f0532 52%, #6f24a2 100%);
  border-radius: 22px;
  padding: 44px 32px 36px 32px;
  width: 340px;
  box-shadow:
    0 12px 40px 0 rgba(81,38,136,0.25),
    0 1.5px 24px 0 rgba(140,110,255,0.10),
    0 0px 0px 2px rgba(180,150,255,0.07) inset;
  text-align: center;
  transition: 
    box-shadow 0.4s cubic-bezier(.29,1.01,1,1.01), 
    transform 0.22s cubic-bezier(.29,1.01,1,1.01);
  overflow: visible;
}

.login-box::before {
  /* Glow animado debajo */
  content: '';
  position: absolute;
  left: 50%; top: 100%;
  transform: translate(-50%, -35%);
  width: 120%;
  height: 56px;
  background: radial-gradient(ellipse at center,
      rgba(140,120,255,0.13) 0%,
      rgba(180,140,255,0.13) 35%,
      transparent 100%);
  z-index: -1;
  filter: blur(8px);
  opacity: 0.86;
  pointer-events: none;
  transition: opacity 0.5s;
}

.login-box:hover, .login-box:focus-within {
  box-shadow:
    0 18px 55px 0 rgba(81,38,136,0.32),
    0 4px 32px 0 rgba(140,110,255,0.17),
    0 0px 0px 4px rgba(180,150,255,0.10) inset;
  transform: translateY(-4px) scale(1.015);
}
.login-box:hover::before, .login-box:focus-within::before {
  opacity: 1;
}

/* ======== LOGO (sin contenedor) ======== */
.logo {
  width: 80%;
  max-width: 200px;
  height: auto;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 2px 12px rgba(120,70,200,0.11));
  transition: filter 0.3s;
}
.login-box:hover .logo {
  filter: drop-shadow(0 4px 20px rgba(150,100,255,0.16));
}

/* ======== TEXTO DE BIENVENIDA ======== */
.welcome-text {
  color: #f0eaff;
  font-size: 14.5px;
  margin-bottom: 18px;
  opacity: 0.97;
  letter-spacing: 0.01em;
}

/* ======== TÍTULO ======== */
.login-box h2 {
  color: #fff;
  margin-bottom: 26px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 1.5px 3px rgba(80,30,140,0.07);
}

/* ======== INPUTS ======== */
.login-box input {
  width: 100%;
  padding: 13px 15px;
  margin: 11px 0;
  background: rgba(255,255,255,0.08);
  border: 1.4px solid rgba(255,255,255,0.19);
  border-radius: 11px;
  color: #fff;
  font-size: 15.4px;
  outline: none;
  box-sizing: border-box;
  backdrop-filter: blur(1.5px);
  transition: border-color 0.25s, background 0.3s, box-shadow 0.22s;
  box-shadow: 0 1px 12px 0 rgba(140,110,255,0.04) inset;
  font-weight: 500;
}
.login-box input::placeholder {
  color: #ccc;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.login-box input:focus {
  border-color: #d5b8ff;
  background: rgba(255,255,255,0.16);
  box-shadow: 0 0 0 2.5px #d7b9ff4b;
}

/* ======== BOTÓN ======== */
.login-box button {
  width: 100%;
  padding: 13px;
  margin-top: 14px;
  background: linear-gradient(135deg, #360b5a, #8147c3);
  border: none;
  border-radius: 13px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 2px 8px 0 rgba(160,130,255,0.13);
  transition: 
    transform 0.2s cubic-bezier(.27,1.01,1,1.01), 
    box-shadow 0.21s cubic-bezier(.27,1.01,1,1.01), 
    background 0.25s;
}
.login-box button:hover {
  transform: scale(1.037);
  box-shadow: 0 0 16px 0 rgba(190,170,255,0.21);
  background: linear-gradient(135deg, #3a1b54, #9264ff 99%);
}

/* ======== LINK OLVIDASTE CONTRASEÑA ======== */
.forgot-password {
  display: block;
  margin-top: 16px;
  font-size: 13.5px;
  color: #e3d1ff;
  text-decoration: none;
  opacity: 0.97;
  transition: text-decoration 0.18s, color 0.23s;
}

.forgot-password:hover {
  text-decoration: underline;
  color: #f1e5ff;
}

/* ======== MENSAJES DE ERROR (del JS) ======== */
.login-box form > div[style*="color: #ffdedf"] {
  margin-top: 10px;
  border: 1px solid #f1c0ff30;
  background: linear-gradient(90deg,#924b7f21,#6d224960);
  color: #ffe0eb;
  border-radius: 10px;
  font-size: 14.2px;
  padding: 9px 8px;
  letter-spacing: 0.01em;
  transition: opacity 0.32s;
}


/* Suavizado al entrar */
.container, .login-box {
  transition: opacity .45s ease, transform .45s ease;
  will-change: opacity, transform;
}

/* Estado inicial: oculto y levemente desplazado */
.is-preload .container,
.is-preload .login-box {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

/* Accesibilidad: si el usuario prefiere menos movimiento, sin animar */
@media (prefers-reduced-motion: reduce) {
  .container, .login-box {
    transition: none !important;
  }
  .is-preload .container,
  .is-preload .login-box {
    opacity: 1;
    transform: none;
  }
}
