// pw-toggle-init
(function initPwToggles(){
function attachToggle(inp){
if(!inp||inp.dataset.toggled)return;
inp.dataset.toggled='1';
var w=document.createElement('div');w.className='pw-wrap';
inp.parentNode.insertBefore(w,inp);w.appendChild(inp);
var btn=document.createElement('button');btn.type='button';btn.className='pw-toggle';
btn.textContent='👁';btn.setAttribute('aria-label','Toggle password');
btn.onclick=function(){inp.type=inp.type==='password'?'text':'password';btn.textContent=inp.type==='password'?'👁':'🙈';};
w.appendChild(btn);
}
var mo=new MutationObserver(function(){
['auth-pass'].forEach(function(id){attachToggle(document.getElementById(id));});
});
mo.observe(document.body,{childList:true,subtree:true});
// also try immediately after DOM ready
if(document.readyState==='loading'){
document.addEventListener('DOMContentLoaded',function(){['auth-pass'].forEach(function(id){attachToggle(document.getElementById(id));});});
} else {
['auth-pass'].forEach(function(id){attachToggle(document.getElementById(id));});
}
})();