/* Movido desde templates/login.html (23/10/2026, refactor fase 2). */
        :root {
            /* Colores oficiales Alianza Lima */
            --alianza-blue: #003DA5;
            --alianza-blue-dark: #002670;
            --alianza-blue-light: #0047BB;
            --alianza-white: #FFFFFF;
            --alianza-gray: #F5F7FA;
            --shadow-color: rgba(0, 61, 165, 0.15);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: auto;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, var(--alianza-blue-dark) 0%, var(--alianza-blue) 50%, var(--alianza-blue-light) 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow-x: hidden;
            overflow-y: auto;
            padding: 20px 0;
        }

        /* Patrón de fondo con franjas diagonales sutiles */
        body::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image:
                repeating-linear-gradient(
                    45deg,
                    transparent,
                    transparent 50px,
                    rgba(255, 255, 255, 0.03) 50px,
                    rgba(255, 255, 255, 0.03) 100px
                );
            pointer-events: none;
        }

        /* Esferas decorativas de fondo */
        .bg-sphere {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(60px);
            pointer-events: none;
        }

        .sphere-1 {
            width: 600px;
            height: 600px;
            top: -200px;
            right: -150px;
        }

        .sphere-2 {
            width: 400px;
            height: 400px;
            bottom: -100px;
            left: -100px;
        }

        /* Contenedor principal */
        .login-container {
            position: relative;
            z-index: 10;
            width: 100%;
            max-width: 480px;
            padding: 20px;
        }

        /* Card principal */
        .login-card {
            background: rgba(255, 255, 255, 0.98);
            border-radius: 24px;
            box-shadow:
                0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
            overflow: hidden;
            backdrop-filter: blur(20px);
        }

        /* Header con logo */
        .login-header {
            background: linear-gradient(135deg, var(--alianza-blue) 0%, var(--alianza-blue-light) 100%);
            padding: 50px 40px 40px;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .login-header::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
            animation: pulse 4s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 0.5; }
            50% { transform: scale(1.1); opacity: 0.8; }
        }

        .logo-container {
            position: relative;
            z-index: 2;
            margin-bottom: 20px;
        }

        .logo-circle {
            width: 120px;
            height: 120px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto;
            box-shadow:
                0 10px 30px rgba(0, 0, 0, 0.2),
                0 0 0 8px rgba(255, 255, 255, 0.2);
            padding: 15px;
        }

        .logo-circle img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .login-title {
            color: white;
            font-size: 28px;
            font-weight: 700;
            margin: 20px 0 8px;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            position: relative;
            z-index: 2;
        }

        .login-subtitle {
            color: rgba(255, 255, 255, 0.95);
            font-size: 15px;
            font-weight: 400;
            position: relative;
            z-index: 2;
        }

        /* Body del formulario */
        .login-body {
            padding: 45px 40px;
        }

        /* Labels */
        .form-label {
            color: #2D3748;
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 10px;
            display: block;
            letter-spacing: 0.3px;
        }

        /* Input groups */
        .input-group-custom {
            position: relative;
            margin-bottom: 28px;
        }

        .input-icon {
            position: absolute;
            left: 18px;
            top: 50%;
            transform: translateY(-50%);
            color: #718096;
            font-size: 18px;
            z-index: 2;
            transition: color 0.3s ease;
        }

        /* Inputs */
        .form-control-custom {
            width: 100%;
            padding: 16px 18px 16px 52px;
            border: 2px solid #E2E8F0;
            border-radius: 12px;
            font-size: 15px;
            color: #2D3748;
            background: #F7FAFC;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .form-control-custom:focus {
            outline: none;
            border-color: var(--alianza-blue);
            background: white;
            box-shadow: 0 0 0 4px rgba(0, 61, 165, 0.1);
        }

        .form-control-custom:focus + .input-icon {
            color: var(--alianza-blue);
        }

        .form-control-custom::placeholder {
            color: #A0AEC0;
            font-weight: 400;
        }

        /* Toggle password button */
        .toggle-password {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: #718096;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            transition: all 0.2s ease;
            z-index: 3;
        }

        .toggle-password:hover {
            background: #EDF2F7;
            color: var(--alianza-blue);
        }

        .toggle-password i {
            font-size: 18px;
        }

        /* Mensajes de error */
        .error-message {
            color: #E53E3E;
            font-size: 13px;
            margin-top: 8px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 500;
        }

        .error-message i {
            font-size: 14px;
        }

        /* Alert de Flask */
        .alert-custom {
            padding: 14px 18px;
            border-radius: 10px;
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 14px;
            font-weight: 500;
            border: none;
        }

        .alert-danger-custom {
            background: #FFF5F5;
            color: #C53030;
            border-left: 4px solid #E53E3E;
        }

        .alert-danger-custom i {
            font-size: 18px;
        }

        /* Botón de login */
        .btn-login {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, var(--alianza-blue) 0%, var(--alianza-blue-light) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 10px 25px rgba(0, 61, 165, 0.3);
            position: relative;
            overflow: hidden;
        }

        .btn-login::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.5s ease;
        }

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

        .btn-login:hover {
            transform: translateY(-2px);
            box-shadow: 0 14px 30px rgba(0, 61, 165, 0.4);
        }

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

        .btn-login i {
            margin-left: 8px;
            transition: transform 0.3s ease;
        }

        .btn-login:hover i {
            transform: translateX(4px);
        }

        /* Footer */
        .login-footer {
            text-align: center;
            padding: 25px 40px 35px;
            background: #F7FAFC;
            border-top: 1px solid #E2E8F0;
        }

        .login-footer p {
            color: #718096;
            font-size: 13px;
            margin: 0;
            font-weight: 500;
        }

        .login-footer strong {
            color: var(--alianza-blue);
            font-weight: 700;
        }

        /* Responsive */
        @media (max-width: 576px) {
            .login-container {
                padding: 10px;
            }

            .login-header {
                padding: 40px 25px 30px;
            }

            .logo-circle {
                width: 100px;
                height: 100px;
            }

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

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

            .login-body {
                padding: 35px 25px;
            }

            .login-footer {
                padding: 20px 25px 30px;
            }
        }

        /* Loading state */
        .btn-login.loading {
            pointer-events: none;
            opacity: 0.7;
        }

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

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