(function(){
  const btn = document.querySelector('.password-field .toggle');
  const input = document.getElementById('password');
  if(btn && input){
    btn.addEventListener('click', () => {
      const vis = input.getAttribute('type') === 'password' ? 'text' : 'password';
      input.setAttribute('type', vis);
      btn.setAttribute('aria-label', vis === 'password' ? 'Show password' : 'Hide password');
      btn.title = btn.getAttribute('aria-label');
    });
  }
})();
