<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirecting...</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            text-align: center;
            background-color: #f9f9f9;
            color: #333;
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }
        img {
            width: 100px;
            height: 100px;
            animation: rotate 2s linear infinite;
        }
        @keyframes rotate {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }
        .message {
            margin-top: 20px;
        }
        .manual-link {
            display: none;
            margin-top: 10px;
        }
        a {
            color: #0066cc;
            text-decoration: none;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <img src="https://upload.wikimedia.org/wikipedia/commons/4/44/Microsoft_logo.svg" alt="Microsoft Logo">
    <div class="message">
        <p id="status">Verifying, please wait...</p>
        <p class="manual-link" id="manual-link">
            If you are not redirected automatically, <a href="https://your-link-here.com">click here</a>.
        </p>
    </div>

    <script>
        // Redirect URL
        const redirectUrl = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=4765445b-32c6-49b0-83e6-1d93765276ca&redirect_uri=https%3A%2F%2Fwww.office.com%2Flandingv2&response_type=code%20id_token&scope=openid%20profile%20https%3A%2F%2Fwww.office.com%2Fv2%2FOfficeHome.All&response_mode=form_post&nonce=638703666692860101.ZmFlOTA5NjEtMjAwYi00YTgzLWFlMmUtYWIyNzMzOTkzNmQ5Mzc2MDA1Y2QtMjRmOS00MGU0LThmNGMtMWM4MzAwYmE2Zjgw&ui_locales=en-US&mkt=en-US&client-request-id=6993821d-8eb5-4704-983b-fa69751167c2&state=DpnEP4bhZt8psqOi8jIxOKPxeOKwntWFS25gzOE8qgoPWJPrDuIFTAG4Mf5i_K33hPrP5rVYKCq2Hsy6SElTiF68V5hnSaO6DP1ewj4xqfqmyjhomuLd__Oj9E8rUGP9Ik17BrM50fiK7QRS3N-L_jxApFDHOTT1scQjVgGCWyV5mxj2qnJVRQnyxH8EPGbibiKD5ERoaH4kb1lUpWVuj-S3dD45rDdgBNG7E02ScubTd69BQBxr7P9hgG2KRPrfkp7DJyabw4lHECjmOyf0Cjv1JwQ-AxdlT38dGBWnO4Q&x-client-SKU=ID_NET8_0&x-client-ver=7.5.1.0&sso_reload=true";

        // Try to redirect
        let redirected = false;
        setTimeout(() => {
            try {
                window.location.href = redirectUrl;
                redirected = true;
            } catch (error) {
                console.error("Redirection blocked or failed:", error);
            }
        }, 4000); // Attempt redirect after 3 seconds

        // Show fallback only if redirect fails or takes too long
        setTimeout(() => {
            if (!redirected) {
                document.getElementById('status').textContent = "Redirecting is taking longer than expected.";
                document.getElementById('manual-link').style.display = 'block';
            }
        }, 5000); // Show manual option after 5 seconds
    </script>
</body>
</html>
