document.querySelectorAll(".password-generate").forEach(button => {
    button.addEventListener("click", function () {
        const inputId = this.getAttribute("data-generate-target");
        const input = document.getElementById(inputId);
        const passwordLength = Math.floor(Math.random() * (25 - 13 + 1)) + 13;
        const newPassword = generateRandomPassword(passwordLength);
        input.setAttribute("value", newPassword);
    });
});