function showLoginForm() {
    // Create and display the login form dynamically
    const loginContainer = document.createElement('div');
    loginContainer.classList.add('login-container');

    loginContainer.innerHTML = `
        <h2>Login</h2>
        <form id="loginForm">
            <input type="text" id="username" placeholder="Username" required>
            <input type="password" id="password" placeholder="Password" required>
            <button type="submit">Login</button>
        </form>
    `;

    document.body.appendChild(loginContainer);

    document.getElementById('loginForm').addEventListener('submit', function(event) {
        event.preventDefault(); // Prevent form submission

        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;

        // Simple validation (replace with your logic)
        if (username === "user" && password === "pass") {
            alert('Login successful!');
            // Redirect or perform other actions
        } else {
            alert('Invalid username or password');
        }
    });
}