// Contact form success response - vanilla JavaScript (no jQuery)
(function() {
  var resultEl = document.getElementById('contact-us-result');
  if (resultEl) {
    resultEl.innerHTML = '<div class="bg-green-50 border border-green-200 text-green-800 px-4 py-3 rounded-lg mb-4"><div class="flex items-center"><svg class="w-5 h-5 mr-2" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg><span><%= j @flash %></span></div></div>';
  }
  
  // Reset form if it exists
  var form = document.querySelector('form[action="/contact_us.js"]');
  if (form) {
    form.reset();
  }
  
  // Hide prompt
  var promptEl = document.getElementById('contact-us-prompt');
  if (promptEl) {
    promptEl.classList.add('hidden');
  }
})();
