document.querySelectorAll(".password-toggle").forEach(button => {
    button.addEventListener("click", function () {
        const inputId = this.getAttribute("data-toggle-target");
        const input = document.getElementById(inputId);
        const icon = this.querySelector("i");

        if (input.type === "password") {
            input.type = "text";
            icon.classList.replace("fa-eye", "fa-eye-slash");
        } else {
            input.type = "password";
            icon.classList.replace("fa-eye-slash", "fa-eye");
        }
    });
});