<script>
    function login() {
        const email = document.getElementById("email").value;
        const password = document.getElementById("password").value;
        doLogin(email, password);
    }

    function doLogin(email, password) {
        const data = new URLSearchParams();
        data.append("action", "login");
        data.append("email", email);
        data.append("password", password);

        doAccountAction(data, "Login Successful!", "Login failed. Please check your credentials.");
    }
</script>

<div class="form-container" id="loginForm">
    <h1>Login</h1>
    <form>
        <label for="email">Email:</label>
        <input type="text" id="email" name="email" required>

        <label for="password">Password:</label>
        <input type="password" id="password" name="password" required>

        <button type="button" onclick="login()">Login</button>
    </form>
</div>

<!-- Centralized Status Message -->
<p id="StatusMessage"></p>