:root {
  --bg-dark: #000c31;
  --primary: #007BFF;
  --primary-dark: #0044CC;
  --accent: #4da3ff;
  --glass-bg: rgba(0, 12, 49, 0.75);
  --glass-border: rgba(255, 255, 255, 0.15);
  --text-white: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --error-color: #ff4d4d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
}

body {
  background-color: var(--bg-dark);
  background: radial-gradient(circle at top left, #001f52, #000c31, #000000);
  background-size: 200% 200%;
  animation: bgMove 15s ease infinite;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Orbes decorativos */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  animation: floatOrb 10s ease-in-out infinite;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: #0044cc;
  top: -50px;
  left: -50px;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: #007BFF;
  bottom: -50px;
  right: -50px;
  animation-delay: -5s;
}

/* =========================================
   TARJETA DE LOGIN (Glassmorphism)
   ========================================= */
.login-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  /* IMPORTANTE: Centrar textos si es necesario, pero los inputs deben llenar el ancho */
  align-items: stretch; 
}

/* Títulos */
.login-header, 
.login-card h1, 
.login-card p {
  text-align: center;
}

.login-title, 
.login-card h1 {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.login-subtitle, 
.login-card p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 25px; /* Espacio extra abajo del subtítulo */
}

/* Mensaje de Error */
.login-error {
  width: 100%;
  background: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: #ffcccc;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: shake 0.4s ease-in-out;
}

/* =========================================
   INPUTS Y LABELS (Soporta .field y .input-group)
   ========================================= */
form {
  width: 100%;
}

/* Contenedor de cada input */
.input-group, 
.field {
  position: relative;
  margin-bottom: 20px;
  display: block; /* Asegura que ocupe toda la línea */
  width: 100%;
}

/* Etiquetas */
.input-group label, 
.field label {
  display: block; /* Fuerza que el label esté ARRIBA del input */
  color: var(--text-white);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 500;
  padding-left: 4px;
  text-align: left;
}

/* Wrapper para iconos (opcional) */
.input-wrapper {
  position: relative;
}

/* Estilo general para TODOS los inputs dentro de la tarjeta */
.login-input,
.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="email"] {
  width: 100%; /* Forzar ancho completo */
  padding: 14px 16px; /* Padding cómodo */
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  display: block;
}

/* Efectos al escribir */
.login-input:focus,
.login-card input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 15px rgba(77, 163, 255, 0.25);
}

.login-card input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Iconos (si usas la estructura nueva) */
.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
  transition: color 0.3s;
}

/* Ajustar padding si hay icono */
.input-wrapper input {
  padding-left: 48px;
}

/* =========================================
   BOTONES
   ========================================= */
.btn-submit,
.btn-primary,
.login-card button[type="submit"] {
  width: 100%;
  padding: 14px;
  margin-top: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase; /* Opcional: hace que se vea más fuerte */
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: block;
}

.btn-submit:hover,
.btn-primary:hover,
.login-card button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
  background: linear-gradient(90deg, #006ce0, #0036a3);
}

/* =========================================
   EXTRAS
   ========================================= */
.card-footer {
  margin-top: 25px;
  text-align: center;
}

.forgot-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.forgot-link:hover {
  color: white;
  text-decoration: underline;
}

/* Ojo de contraseña */
.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
}

/* Animaciones */
@keyframes bgMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -20px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 480px) {
  .login-card {
    padding: 30px 24px;
    border-radius: 20px;
  }
}