document.addEventListener('DOMContentLoaded', function() { const steps = document.querySelectorAll('.form-step'); const nextButtons = document.querySelectorAll('.btn-next'); const prevButtons = document.querySelectorAll('.btn-prev'); const progressBar = document.querySelector('.progress-bar'); const form = document.getElementById('gtm-form'); let currentStep = 0; function updateProgress() { const progress = ((currentStep + 1) / steps.length) * 100; progressBar.style.width = progress + '%'; progressBar.setAttribute('aria-valuenow', progress); } function showStep(stepIndex) { steps.forEach((step, index) => { step.classList.toggle('active', index === stepIndex); }); currentStep = stepIndex; updateProgress(); } nextButtons.forEach(button => { button.addEventListener('click', () => { if (currentStep < steps.length - 1) { showStep(currentStep + 1); } }); }); prevButtons.forEach(button => { button.addEventListener('click', () => { if (currentStep > 0) { showStep(currentStep - 1); } }); }); form.addEventListener('submit', function(e) { e.preventDefault(); const formData = new FormData(form); fetch('submit_profile.php', { method: 'POST', body: formData }) .then(response => response.json()) .then(data => { if (data.success) { document.getElementById('form-container').innerHTML = '