        /* Variables Globales */
        :root {
            --bg-main: linear-gradient(135deg, #e3edf7 0%, #cbdcf0 100%);
            --bg-card: rgba(255, 255, 255, 0.4);
            --bg-navbar: rgba(255, 255, 255, 0.2);
            --border-card: rgba(255, 255, 255, 0.6);
            --blur-effect: blur(25px);
            
            --text-primary: #1c1c1e;
            --text-secondary: #6e6e73;
            --shadow-card: 0 20px 40px rgba(31, 38, 135, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
            
            --accent-blue: #0071e3;
            --accent-green: #34c759;
            --accent-orange: #ff9500;
            --accent-red: #ff3b30;
            --accent-purple: #af52de;
            --accent-teal: #5ac8fa;
            
            --svg-opacity: 0.12;
        }

        [data-theme="dark"] {
            --bg-main: linear-gradient(135deg, #0f111a 0%, #171926 100%);
            --bg-card: rgba(25, 28, 41, 0.45);
            --bg-navbar: rgba(15, 17, 26, 0.5);
            --border-card: rgba(255, 255, 255, 0.07);
            
            --text-primary: #f5f5f7;
            --text-secondary: #8e8e93;
            --shadow-card: 0 25px 50px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
            
            --svg-opacity: 0.05;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            
            /* Desactiva la selección de texto en toda la aplicación */
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            -webkit-touch-callout: none;
        }

        body {
            background: var(--bg-main);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 15px;
            position: relative;
            overflow-x: hidden;
            overflow-y: auto; 
        }

        /* SVG de fondo decorativo */
        .bg-svg-container {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 2;
            overflow: hidden;
        }

        .bg-svg-container svg {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: auto;
            opacity: var(--svg-opacity);
            transition: opacity 0.3s ease;
        }

        /* Esferas de luz de fondo */
        body::before, body::after {
            content: '';
            position: absolute;
            border-radius: 50%;
            z-index: 1;
            filter: blur(60px);
            opacity: 0.5;
            animation: float 12s infinite alternate ease-in-out;
        }
        
        body::before {
            width: 160px;
            height: 160px;
            background: #a2c2e8;
            top: 5%;
            left: 5%;
        }
        body::after {
            width: 140px;
            height: 140px;
            background: #e8c5d8;
            bottom: 5%;
            right: 5%;
        }

        @keyframes float {
            0% { transform: translateY(0) scale(1); }
            100% { transform: translateY(-15px) scale(1.05); }
        }

        /* Tarjeta Contenedora Principal (Glassmorphism) */
        .login-card {
            background: var(--bg-card);
            backdrop-filter: var(--blur-effect);
            -webkit-backdrop-filter: var(--blur-effect);
            border: 1px solid var(--border-card);
            border-radius: 24px;
            width: 100%;
            max-width: 380px;
            box-shadow: var(--shadow-card);
            z-index: 10;
            position: relative;
            overflow: hidden;
            display: grid;
            grid-template-columns: 100%;
            animation: fadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        /* Columna Izquierda: Panel Visual del Logo */
        .login-visual-panel {
            display: none;
            position: relative;
            background: rgba(255, 255, 255, 0.12);
            border-right: 1px solid var(--border-card);
            overflow: hidden;
            justify-content: center;
            align-items: center;
            padding: 25px;
        }

        [data-theme="dark"] .login-visual-panel {
            background: rgba(0, 0, 0, 0.15);
        }

        .brand-logo {
            width: 105px;
            height: 105px;
            object-fit: cover;
            border-radius: 20px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
            border: 2px solid rgba(255, 255, 255, 0.5);
            z-index: 5;
        }

        /* Columna Derecha: El Formulario */
        .login-form-panel {
            padding: 30px 20px;
            text-align: center;
            width: 100%;
        }

        .login-header h2 {
            color: var(--text-primary);
            font-size: 22px;
            font-weight: 700;
            margin-bottom: 6px;
            letter-spacing: -0.03em;
        }

        .login-header p {
            color: var(--text-secondary);
            font-size: 13px;
            margin-bottom: 20px;
        }

        /* Grupos de Formulario */
        .form-group {
            text-align: left;
            margin-bottom: 14px;
            position: relative;
        }

        .form-group label {
            display: block;
            color: var(--text-primary);
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 5px;
            padding-left: 4px;
        }

        /* AJUSTADO: El contenedor ahora controla la alineación relativa de sus hijos */
        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
            width: 100%;
        }

        /* Permitir la entrada de texto solo en los inputs */
        .input-wrapper input {
            width: 100%;
            padding: 11px 40px 11px 40px; /* Margen simétrico para iconos en ambos lados */
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 10px;
            background: rgba(255, 255, 255, 0.23);
            color: var(--text-primary);
            font-size: 14px;
            outline: none;
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            user-select: text;
        }

        /* AJUSTADO: Centrado vertical matemático para el icono izquierdo */
        .input-wrapper i.main-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 14px;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* AJUSTADO: Centrado vertical matemático para el icono del ojo (derecho) */
        .toggle-password {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            padding: 4px;
            user-select: none;
            transition: color 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .toggle-password:hover {
            color: var(--accent-blue);
        }

        [data-theme="dark"] .input-wrapper input {
            background: rgba(0, 0, 0, 0.2);
            border-color: rgba(255, 255, 255, 0.05);
        }

        .input-wrapper input:focus {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
            background: rgba(255, 255, 255, 0.45);
        }

        .options-wrapper {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 18px;
            padding: 0 4px;
            font-size: 12px;
            gap: 10px;
        }

        .checkbox-label {
            display: flex;
            align-items: center;
            color: var(--text-secondary);
            cursor: pointer;
            user-select: none;
        }

        .checkbox-label input {
            margin-right: 6px;
            accent-color: var(--accent-blue);
            width: 14px;
            height: 14px;
        }

        .forgot-link {
            color: var(--accent-blue);
            text-decoration: none;
            font-weight: 500;
        }
        .forgot-link:hover {
            text-decoration: underline;
        }

        .btn-submit {
            width: 100%;
            padding: 12px;
            border: none;
            border-radius: 10px;
            background: var(--accent-blue);
            color: #ffffff;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(0, 113, 227, 0.2);
            transition: all 0.25s ease;
        }

        .btn-submit:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 18px rgba(0, 113, 227, 0.3);
        }

        /* Alertas SweetAlert2 */
        .swal-ios-popup {
            background: var(--bg-card) !important;
            backdrop-filter: var(--blur-effect) !important;
            border: 1px solid var(--border-card) !important;
            border-radius: 20px !important;
        }
        .swal-ios-title { color: var(--text-primary) !important; }
        .swal-ios-html { color: var(--text-secondary) !important; }
        .swal-ios-confirm {
            background-color: var(--accent-blue) !important;
            border-radius: 10px !important;
            padding: 10px 24px !important;
        }

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

        /* Media Query para pantallas con emulación o tamaño de escritorio */
        @media (min-width: 768px) {
            .bg-svg-container {
                display: block;
            }

            body {
                padding: 30px;
            }

            body::before {
                width: 320px;
                height: 320px;
                top: 8%;
                left: 10%;
                filter: blur(90px);
            }
            body::after {
                width: 280px;
                height: 280px;
                bottom: 8%;
                right: 10%;
                filter: blur(90px);
            }

            .login-card {
                max-width: 690px;
                grid-template-columns: 40% 60%; 
                border-radius: 24px;
            }

            .login-visual-panel {
                display: flex;
                padding: 30px;
            }

            .login-form-panel {
                padding: 40px 35px;
            }

            .login-header h2 {
                font-size: 26px;
                margin-bottom: 6px;
            }

            .login-header p {
                font-size: 14px;
                margin-bottom: 24px;
            }

            .form-group {
                margin-bottom: 18px;
            }

            .input-wrapper input {
                font-size: 15px;
                padding: 13px 44px 13px 44px; /* Ajuste simétrico de padding en escritorio */
                border-radius: 11px;
            }

            .btn-submit {
                padding: 13px;
                font-size: 15px;
                border-radius: 11px;
            }
        }

        @media (min-width: 1200px) {
            .login-card {
                max-width: 760px; 
            }
            .brand-logo {
                width: 120px;
                height: 120px;
            }
            .login-form-panel {
                padding: 45px 40px;
            }
        }
        
        
        
        
        
        
        .pwa-install-banner {
            display: none; /* Se muestra únicamente vía JS cuando esté listo */
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid #cbdcf0;
            padding: 12px 16px;
            border-radius: 14px;
            margin-bottom: 20px;
            align-items: center;
            justify-content: space-between;
            box-shadow: 0 4px 12px rgba(0, 113, 227, 0.08);
            animation: fadeInPwa 0.4s ease-out;
        }
        .pwa-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .pwa-info i {
            color: #0071e3;
            font-size: 20px;
        }
        .pwa-text p {
            margin: 0;
            font-size: 13px;
            color: #1c1c1e;
            font-weight: 600;
        }
        .btn-pwa-install {
            background-color: #0071e3;
            color: #ffffff;
            border: none;
            padding: 8px 14px;
            font-size: 12px;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .btn-pwa-install:active {
            background-color: #0056b3;
        }
        @keyframes fadeInPwa {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }