/**
 * ============================================================================
 * LOGIN.CSS - Página de Inicio de Sesión
 * ============================================================================
 * 
 * DESCRIPCIÓN:
 * Estilos premium para la página de login del sistema SIRET-DIGESETT.
 * Incluye fondo animado con degradados, partículas flotantes, y diseño
 * moderno estilo "glassmorphism" para una experiencia visual atractiva.
 * 
 * USO:
 * - Layout: Areas/Identity/Pages/Shared/_LoginLayout.cshtml
 * - Página: Areas/Identity/Pages/Account/Login.cshtml
 * - Ruta: /Identity/Account/Login
 * - Primera impresión del sistema para usuarios
 * 
 * COMPONENTES VISUALES:
 * - Background animado con gradientes (keyframe animation)
 * - Partículas flotantes decorativas (5 elementos)
 * - Card de login con efecto glassmorphism
 * - Logo y branding DIGESETT
 * - Formulario floating labels
 * - Botón toggle mostrar/ocultar contraseña
 * - Toggle de dark mode (esquina superior derecha)
 * - Badge de versión del sistema
 * 
 * ANIMACIONES:
 * - gradientShift: Movimiento suave del fondo (15s loop)
 * - float: Partículas con movimiento vertical (3-7s)
 * - fadeIn: Entrada suave de la card (0.6s)
 * - slideUp: Entrada desde abajo (0.8s)
 * 
 * CARACTERÍSTICAS:
 * - Fully responsive (móvil, tablet, desktop)
 * - Dark mode support con transiciones
 * - Accesibilidad ARIA labels
 * - Validación visual de formularios
 * - Estados hover y focus elegantes
 * - Performance optimizado (GPU acceleration)
 * 
 * PALETA DE COLORES:
 * Light Mode:
 * - Primary gradient: #667eea → #764ba2 (púrpura vibrante)
 * - Card: rgba(255, 255, 255, 0.95) con blur
 * 
 * Dark Mode:
 * - Gradient: #232526 → #414345 (gris oscuro)
 * - Card: rgba(30, 30, 30, 0.95)
 * 
 * DEPENDENCIAS:
 * - Bootstrap 5.3+ (formularios y grid)
 * - Bootstrap Icons (iconografía)
 * - login-theme.js (toggle dark mode)
 * - login.js (funcionalidad formulario)
 * 
 * INSPIRACIÓN:
 * Diseño moderno basado en tendencias de UI 2025 con glassmorphism
 * y animaciones sutiles para experiencia premium.
 * 
 * AUTOR: JhomeDesign (2025)
 * ============================================================================
 */

/* ===== LOGIN PAGE STYLES ===== */

:root {
  --granite-primary: #2c3e50;
  --granite-secondary: #34495e;
  --granite-accent: #3498db;
  --granite-light: #ecf0f1;
  --granite-dark: #1a252f;
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-medium: rgba(0, 0, 0, 0.2);
  --shadow-heavy: rgba(0, 0, 0, 0.3);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-dark: linear-gradient(135deg, #232526 0%, #414345 100%);
}

/* ===== BACKGROUND ===== */
.login-body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: auto;
  min-height: 100vh;
}

.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-primary);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(1px);
}

/* ===== FLOATING PARTICLES ===== */
.floating-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 20s infinite linear;
}

.particle:nth-child(1) {
  width: 80px;
  height: 80px;
  left: 10%;
  animation-delay: 0s;
  animation-duration: 25s;
}

.particle:nth-child(2) {
  width: 60px;
  height: 60px;
  left: 20%;
  animation-delay: 2s;
  animation-duration: 20s;
}

.particle:nth-child(3) {
  width: 100px;
  height: 100px;
  left: 60%;
  animation-delay: 4s;
  animation-duration: 30s;
}

.particle:nth-child(4) {
  width: 40px;
  height: 40px;
  left: 80%;
  animation-delay: 6s;
  animation-duration: 18s;
}

.particle:nth-child(5) {
  width: 70px;
  height: 70px;
  left: 90%;
  animation-delay: 8s;
  animation-duration: 22s;
}

/* ===== MAIN CONTENT ===== */
.login-main {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

/* ===== LOGIN CONTAINER ===== */
.login-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ===== FLOATING CARD ===== */
.floating-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow:
    0 20px 40px var(--shadow-heavy),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 40px 30px;
  transform: translateY(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardFloat 6s ease-in-out infinite;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-card:hover {
  transform: translateY(-5px);
  box-shadow:
    0 30px 60px var(--shadow-heavy),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* ===== LOGIN HEADER ===== */
.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
  box-shadow: 0 10px 30px var(--shadow-medium);
  animation: logoSpin 10s linear infinite;
}

.login-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--granite-primary);
  margin-bottom: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: #6c757d;
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
}

/* ===== FORM STYLES ===== */
.login-form {
  margin-bottom: 25px;
}

.form-floating {
  position: relative;
}

.form-floating > .form-control {
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
}

.form-floating > .form-control:focus {
  border-color: var(--granite-accent);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
}

.form-floating > label {
  color: #6c757d;
  transition: all 0.3s ease;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--granite-accent);
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-check {
  margin: 1rem 0;
}

.form-check-input:checked {
  background-color: var(--granite-accent);
  border-color: var(--granite-accent);
}

.form-check-label {
  color: #6c757d;
  font-size: 0.9rem;
}

/* ===== PASSWORD TOGGLE BUTTON ===== */
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  padding: 0.375rem;
  z-index: 10;
  cursor: pointer;
  transition: color 0.3s ease;
}

.password-toggle:hover {
  color: var(--granite-accent);
}

.password-toggle:focus {
  outline: none;
  color: var(--granite-accent);
}

.password-input {
  padding-right: 3rem !important;
}

/* ===== BUTTON STYLES ===== */
.login-btn {
  background: var(--gradient-primary);
  border: none;
  border-radius: 12px;
  padding: 14px 30px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.login-btn:hover::before {
  left: 100%;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px var(--shadow-medium);
}

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

/* ===== FOOTER LINKS ===== */
.login-footer {
  text-align: center;
}

.login-links a {
  color: var(--granite-accent);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
}

.login-links a:hover {
  background: rgba(52, 152, 219, 0.1);
  transform: translateY(-1px);
}

/* ===== EXTERNAL LOGIN ===== */
.external-login .btn {
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.external-login .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow-light);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.theme-toggle .btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  color: white;
  transition: all 0.3s ease;
}

.theme-toggle .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ===== VERSION INFO ===== */
.version-info {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
}

/* ===== ANIMATIONS ===== */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* ===== DARK THEME ===== */
[data-bs-theme='dark'] .floating-card {
  background: rgba(33, 37, 41, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme='dark'] .login-title {
  color: #f8f9fa;
}

[data-bs-theme='dark'] .login-subtitle {
  color: #adb5bd;
}

[data-bs-theme='dark'] .form-floating > .form-control {
  background: rgba(33, 37, 41, 0.9);
  border-color: #495057;
  color: #f8f9fa;
}

[data-bs-theme='dark'] .form-floating > .form-control:focus {
  background: rgba(33, 37, 41, 1);
  border-color: var(--granite-accent);
}

[data-bs-theme='dark'] .form-floating > label {
  color: #adb5bd;
}

[data-bs-theme='dark'] .form-check-label {
  color: #adb5bd;
}

[data-bs-theme='dark'] .background-image {
  background: var(--gradient-dark);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  .login-body {
    overflow: auto;
  }

  .floating-card {
    padding: 30px 20px;
    margin: 20px;
    border-radius: 15px;
  }

  .login-logo {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .theme-toggle {
    top: 15px;
    right: 15px;
  }

  .theme-toggle .btn {
    width: 45px;
    height: 45px;
  }

  .version-info {
    bottom: 15px;
    left: 15px;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 0 10px;
  }

  .floating-card {
    padding: 20px 14px;
    margin: 12px;
  }

  .login-title {
    font-size: 1.3rem;
  }

  .login-subtitle {
    font-size: 0.85rem;
  }

  .form-floating > .form-control {
    padding: 0.875rem 0.75rem;
  }

  .login-btn {
    padding: 12px 25px;
    font-size: 0.95rem;
  }
}

/* Reduce animaciones para usuarios con preferencias de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  .floating-card,
  .login-logo,
  .background-image,
  .particle,
  .login-btn::before {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== VALIDATION STYLES ===== */
.text-danger {
  font-size: 0.875rem;
  margin-top: 0.25rem;
  color: #dc3545 !important;
}

.validation-summary-errors {
  background: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

/* ===== LOADING STATES ===== */
.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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