(function(){
var btn=document.getElementById('rsvpSubmit'), name=document.getElementById('guestName'), note=document.getElementById('rsvpNote');
btn.onclick=function(){
var choice=document.querySelector('input[name="attendance"]:checked');
if(!name.value.trim() || !choice){note.textContent='يرجى كتابة الاسم واختيار حالة الحضور.'; return;}
localStorage.setItem('zd_rsvp_name',name.value.trim()); localStorage.setItem('zd_rsvp_attendance',choice.value);
note.textContent='تم تسجيل اختيارك على هذا الجهاز ❤️';
};
})();