/* styles_login.css - Versión moderna */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Variables específicas del login */
:root {
  --login-overlay: rgba(0, 0, 0, 0.4);
  --login-blur: blur(8px);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
}

body, html {
  height: 100%;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

/* Overlay con efecto de cristal */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--login-overlay);
  backdrop-filter: var(--login-blur);
  z-index: 1;
}

.container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  animation: fadeInUp 0.8s ease-out;
}

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

/* Título principal */
.container h1 {
  color: white;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  max-width: 800px;
}

/* Formulario con efecto glassmorphism */
form {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

form:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Grupos de input */
.input-group {
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
}

/* Labels flotantes */
label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
  transition: all 0.3s ease;
}

/* Inputs modernos */
input[type="text"],
input[type="password"] {
  width: 90%;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 400;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.8);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 0 0 4px rgba(59, 130, 246, 0.2),
    0 4px 20px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

/* Botón moderno */
button {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 1rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
}

/* Footer moderno */
footer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 3;
  padding: 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  text-align: right;
  font-weight: 400;
}

/* Estados de error y validación */
.input-error {
  border-color: rgba(239, 68, 68, 0.8) !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

.error-message {
  color: #fca5a5;
  font-size: 0.75rem;
  margin-top: 0.5rem;
  display: block;
}

/* Loading state */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .container h1 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
  }
  
  form {
    padding: 2rem 1.5rem;
    border-radius: 20px;
  }
  
  input[type="text"],
  input[type="password"] {
    padding: 0.875rem 1rem;
    font-size: 16px; /* Previene zoom en iOS */
  }
  
  button {
    padding: 0.875rem 1.25rem;
  }
  
  footer {
    padding: 1rem;
    text-align: center;
  }
  
  footer p {
    text-align: center;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .container h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  form {
    padding: 1.5rem 1rem;
    border-radius: 16px;
  }
  
  .input-group {
    margin-bottom: 1.25rem;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Alto contraste */
@media (prefers-contrast: high) {
  form {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid white;
  }
  
  input[type="text"],
  input[type="password"] {
    background: rgba(255, 255, 255, 0.9);
    color: black;
    border: 2px solid white;
  }
  
  label {
    color: white;
    font-weight: 600;
  }
}