${t('total_yield')}
${fmtPct(p.rentabilidade_total)}
${t('annual_yield')}
${fmtPct(p.rentabilidade_anual)}
${t('last_12_months')}
${fmtPct(p.rentabilidade_12m)}
`;}catch(e){m.innerHTML=`
${t('error')}: ${e.message}
`;}} function renderProfile(){document.getElementById('mainContent').innerHTML=`

🔐 ${t('change_password')}

`;} async function changePassword(e){e.preventDefault();const cur=document.getElementById('pwCurrent').value,nw=document.getElementById('pwNew').value,cf=document.getElementById('pwConfirm').value;if(nw!==cf){alert(t('passwords_not_match'));return;}try{await api('/profile/password',{method:'PUT',body:JSON.stringify({currentPassword:cur,newPassword:nw})});alert(t('password_changed'));document.getElementById('pwCurrent').value='';document.getElementById('pwNew').value='';document.getElementById('pwConfirm').value='';}catch(e){alert(e.message);}} const urlParams=new URLSearchParams(window.location.search); if(urlParams.get('token')&&window.location.pathname.includes('reset')){document.getElementById('loginFormDiv').classList.add('hidden');document.getElementById('resetFormDiv').classList.remove('hidden');} if(urlParams.get('token')&&window.location.pathname.includes('verify')){api('/auth/verify-email?token='+urlParams.get('token')).then(r=>{document.getElementById('loginSuccess').textContent=r.message;document.getElementById('loginSuccess').classList.remove('hidden');}).catch(e=>{document.getElementById('loginError').textContent=e.message;document.getElementById('loginError').classList.remove('hidden');});window.history.replaceState({},'','/');} document.querySelectorAll('.lang-select,.lang-select-mobile').forEach(s=>s.value=lang); checkAuth();