`;
root.innerHTML = `${html}`;
// Behaviors (inside Shadow Root)
const $$ = (sel) => Array.from(root.querySelectorAll(sel));
$$('#lead-form').forEach ? null : null; // no-op to avoid minifier warnings
// Smooth scroll for shadow anchors
$$('a[href^="#"]').forEach(a => {
a.addEventListener('click', e => {
const id = a.getAttribute('href');
if (id && id.length > 1) {
const el = root.getElementById(id.slice(1));
if (el) { e.preventDefault(); el.scrollIntoView({ behavior: 'smooth', block: 'start' }); }
}
});
});
// Form submit (demo)
const form = root.getElementById('lead-form');
if (form) {
form.addEventListener('submit', (e) => {
e.preventDefault();
const ok = root.getElementById('ok');
if (ok) ok.style.display = 'block';
form.reset();
});
}
})();
