document.addEventListener("DOMContentLoaded", function () {
    var showHideElements = document.querySelectorAll(".show-hide");

    showHideElements.forEach(function (element) {
        element.style.display = "block";

        let pswInput = element.parentElement.querySelector("input[type='password']");
        let textObj = element.parentElement.querySelector("span");
        textObj.classList.add("show");

        element.addEventListener("click", function () {
            if (pswInput && textObj) {
                if (textObj.classList.contains("show")) {
                    pswInput.setAttribute("type", "text");
                    textObj.classList.remove("show");
                } else {
                    pswInput.setAttribute("type", "password");
                    textObj.classList.add("show");
                }
            }
        });
    });
});
