 :root {
     --primary-blue: #0099CC;
     --accent-blue: #37A8D4;
     --dark-bg: #002856;
     --card-bg: rgba(45, 45, 45, 0);
     --glass-border: #ffffff1a;
     --text-primary: #ffffff;
     --text-secondary: rgba(255, 255, 255, 0.7);
     --input-bg: rgba(255, 255, 255, 0.1);
     --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, #37A8D4 100%);
 }

 * {
     box-sizing: border-box;
     -webkit-tap-highlight-color: transparent;
 }

 body {
     font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
     background: var(--dark-bg);
     margin: 0;
     padding: 0;
     min-height: 100vh;
     overflow-x: hidden;
     -webkit-font-smoothing: antialiased;
     -moz-osx-font-smoothing: grayscale;
 }

 /* Partículas simplificadas para mejor rendimiento en Apple */
 .particles {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     pointer-events: none;
     z-index: 1;
     opacity: 0.3;
 }

 .particle {
     position: absolute;
     width: 4px;
     height: 4px;
     background: linear-gradient(45deg, var(--primary-blue), var(--accent-blue));
     border-radius: 50%;
     animation: float 15s infinite linear;
     will-change: transform;
 }

 @keyframes float {
     0% {
         transform: translateY(100vh) rotate(0deg);
         opacity: 0;
     }

     10% {
         opacity: 1;
     }

     90% {
         opacity: 1;
     }

     100% {
         transform: translateY(-100px) rotate(360deg);
         opacity: 0;
     }
 }

 /* Container principal */
 .login-container {
     display: flex;
     align-items: center;
     justify-content: center;
     min-height: 100vh;
     padding: 20px;
     position: relative;
     z-index: 2;
 }

 /* Card de login optimizada */
 .login-card {
     background: var(--card-bg);
     backdrop-filter: blur(20px);
     -webkit-backdrop-filter: blur(20px);
     border: 1px solid var(--glass-border);
     border-radius: 20px;
     padding: 40px 30px;
     width: 100%;
     max-width: 400px;
     box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
     animation: fadeIn 0.6s ease-out;
     transform: translateZ(0);
     /* Fuerza aceleración por hardware */
 }

 @keyframes fadeIn {
     from {
         opacity: 0;
         transform: translateY(30px) scale(0.95);
     }

     to {
         opacity: 1;
         transform: translateY(0) scale(1);
     }
 }

 /* Logo y título */
 .logo-section {
     text-align: center;
     margin-bottom: 30px;
 }

 .logo {
     width: 80px;
     height: 80px;
     margin: 0 auto 20px;
     background: var(--gradient-primary);
     border-radius: 20px;
     display: flex;
     align-items: center;
     justify-content: center;
     box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
 }

 .logo img {
     max-width: 60px;
     max-height: 60px;
     /*  filter: brightness(0) invert(1); */
 }

 .login-title {
     color: var(--text-primary);
     font-size: 28px;
     font-weight: 700;
     margin-bottom: 10px;
     letter-spacing: -0.5px;
 }

 .login-subtitle {
     color: var(--text-secondary);
     font-size: 14px;
     font-weight: 400;
     margin-bottom: 0;
     line-height: 1.4;
 }

 /* Formulario optimizado para Apple */
 form {
     margin-top: 30px;
 }

 .form-floating {
     position: relative;
     margin-bottom: 20px;
 }

 .form-floating .input-group-text {
     position: absolute;
     left: 15px;
     top: 50%;
     transform: translateY(-50%);
     background: none;
     border: none;
     color: var(--text-secondary);
     z-index: 5;
     padding: 0;
     font-size: 16px;
 }

 .form-control {
     background: var(--input-bg);
     border: 1px solid rgba(255, 255, 255, 0.1);
     border-radius: 12px;
     color: var(--text-primary);
     font-size: 16px;
     /* Evita zoom en iOS */
     padding: 18px 15px 18px 45px;
     height: auto;
     transition: all 0.3s ease;
     -webkit-appearance: none;
     appearance: none;
 }

 .form-control:focus {
     background: rgba(255, 255, 255, 0.15);
     border-color: var(--primary-blue);
     box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
     color: var(--text-primary);
 }

 .form-control::placeholder {
     color: var(--text-secondary);
     opacity: 1;
 }

 .form-floating>label {
     color: var(--text-secondary);
     padding: 18px 15px 18px 45px;
     font-size: 14px;
     opacity: 0.8;
 }

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

 /* Botón toggle password optimizado para touch */
 .password-toggle {
     position: absolute;
     right: 15px;
     top: 50%;
     transform: translateY(-50%);
     background: none;
     border: none;
     color: var(--text-secondary);
     font-size: 18px;
     z-index: 6;
     padding: 10px;
     cursor: pointer;
     touch-action: manipulation;
     -webkit-touch-callout: none;
 }

 .password-toggle:active {
     transform: translateY(-50%) scale(0.95);
 }

 /* Checkbox remember me */
 .form-check {
     margin: 25px 0;
 }

 .form-check-input {
     background-color: var(--input-bg);
     border: 1px solid rgba(255, 255, 255, 0.3);
     width: 18px;
     height: 18px;
 }

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

 .form-check-label {
     color: var(--text-secondary);
     font-size: 14px;
     margin-left: 8px;
 }

 /* Botón principal optimizado */
 .btn-login {
     width: 100%;
     background: var(--gradient-primary);
     border: none;
     border-radius: 12px;
     color: white;
     font-size: 16px;
     font-weight: 600;
     padding: 16px 20px;
     margin-top: 10px;
     position: relative;
     overflow: hidden;
     transition: all 0.3s ease;
     touch-action: manipulation;
     -webkit-touch-callout: none;
 }

 .btn-login:hover {
     transform: translateY(-1px);
     box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
 }

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

 .btn-login.loading {
     pointer-events: none;
     opacity: 0.8;
 }

 .spinner {
     display: none;
     width: 20px;
     height: 20px;
     border: 2px solid rgba(255, 255, 255, 0.3);
     border-radius: 50%;
     border-top-color: white;
     animation: spin 1s ease-in-out infinite;
     margin-right: 10px;
 }

 @keyframes spin {
     to {
         transform: rotate(360deg);
     }
 }

 /* Enlaces */
 .forgot-password {
     text-align: center;
     margin-top: 20px;
 }

 .forgot-password a {
     color: var(--accent-blue);
     text-decoration: none;
     font-size: 14px;
     font-weight: 500;
 }

 .forgot-password a:hover {
     text-decoration: underline;
 }

 /* Alertas optimizadas */
 .alert-glass {
     background: rgba(220, 53, 69, 0.1);
     border: 1px solid rgba(220, 53, 69, 0.3);
     color: #ffb3ba;
     border-radius: 12px;
     margin-bottom: 20px;
     padding: 12px 15px;
     font-size: 14px;
 }

 .alert-glass .btn-close {
     filter: invert(1);
     opacity: 0.8;
 }

 /* Estados de validación */
 .form-control.is-valid {
     border-color: #28a745;
     box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
 }

 .form-control.is-invalid {
     border-color: #dc3545;
     box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
 }

 .invalid-feedback {
     color: #ffb3ba;
     font-size: 12px;
     margin-top: 5px;
 }

 /* Responsive específico para dispositivos Apple */
 @media (max-width: 480px) {
     .login-card {
         padding: 30px 25px;
         margin: 10px;
         border-radius: 15px;
     }

     .login-title {
         font-size: 24px;
     }

     .login-subtitle {
         font-size: 13px;
     }

     .form-control {
         font-size: 16px;
         /* Mantener 16px para evitar zoom */
     }
 }

 /* Optimizaciones específicas para Safari */
 @supports (-webkit-appearance: none) {
     .form-control {
         -webkit-appearance: none;
     }

     .btn-login {
         -webkit-appearance: none;
     }
 }

 /* Evitar el zoom en inputs en iOS */
 @media screen and (-webkit-min-device-pixel-ratio: 0) {

     input[type="email"],
     input[type="password"] {
         font-size: 16px !important;
     }
 }

 /* Reducir animaciones en dispositivos con menos potencia */
 @media (prefers-reduced-motion: reduce) {
     * {
         animation-duration: 0.01ms !important;
         animation-iteration-count: 1 !important;
         transition-duration: 0.01ms !important;
     }
 }
