/** * Password visibility toggle for login.php. * Toggles between 'password' and 'text' input type * and swaps the eye icon accordingly. */ function togglePassword() { var pw = document.getElementById('password'); var btn = document.getElementById('toggle-password'); if (pw.type === 'password') { pw.type = 'text'; btn.textContent = '🙈'; } else { pw.type = 'password'; btn.textContent = '👁'; } } // Bind magic link button — clears password field before submit document.addEventListener('DOMContentLoaded', function () { var magicBtn = document.getElementById('magic-link-btn'); if (magicBtn) { magicBtn.addEventListener('click', function () { document.getElementById('password').value = ''; }); } });