document.addEventListener('DOMContentLoaded', () => { // Form submission const form = document.querySelector('form'); if (form) { form.addEventListener('submit', (e) => { e.preventDefault(); const name = form.querySelector('#name').value; const phone = form.querySelector('#phone').value; const business = form.querySelector('#business').value; const tariff = form.querySelector('#tariff').value; alert(`Спасибо, ${name}! Ваша заявка на тариф "${tariff}" принята. Мы свяжемся с вами в ближайшее время по телефону ${phone}.`); form.reset(); // Here you would typically send the data to your backend // fetch('/api/leads', { // method: 'POST', // body: JSON.stringify({ name, phone, business, tariff }), // headers: { 'Content-Type': 'application/json' } // }); }); } // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); });