document.addEventListener('DOMContentLoaded', function() { const loginForm = document.getElementById('loginForm'); if (loginForm) { loginForm.addEventListener('submit', function(e) { e.preventDefault(); // --- SIMULATED LOGIN --- // In a real application, you would send this to a server for validation. const email = document.getElementById('email').value; const password = document.getElementById('password').value; // Basic validation if (email && password) { // Simulate a successful login and redirect to the admin dashboard console.log('Simulating successful login...'); window.location.href = 'admin.php'; } else { // In a real app, you'd show a more specific error. alert('Please enter both email and password.'); } }); } });