<section class="relative py-32 bg-gradient-to-br from-indigo-50 via-purple-50 to-pink-50 overflow-hidden" id="community">
  <!-- Decorative elements -->
  <div class="absolute inset-0 overflow-hidden">
    <div class="absolute -top-40 -right-40 w-80 h-80 bg-indigo-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob"></div>
    <div class="absolute top-40 -left-40 w-80 h-80 bg-purple-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-2000"></div>
    <div class="absolute -bottom-40 left-20 w-80 h-80 bg-pink-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-4000"></div>
  </div>

  <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
    <div class="relative backdrop-blur-xl bg-white/30 border border-white/50 rounded-3xl p-16 shadow-[0_8px_30px_rgb(0,0,0,0.06)]">
      <!-- Decorative corner accents -->
      <div class="absolute top-0 left-0 w-20 h-20 border-t-2 border-l-2 border-indigo-400/30 rounded-tl-3xl"></div>
      <div class="absolute top-0 right-0 w-20 h-20 border-t-2 border-r-2 border-purple-400/30 rounded-tr-3xl"></div>
      <div class="absolute bottom-0 left-0 w-20 h-20 border-b-2 border-l-2 border-pink-400/30 rounded-bl-3xl"></div>
      <div class="absolute bottom-0 right-0 w-20 h-20 border-b-2 border-r-2 border-indigo-400/30 rounded-br-3xl"></div>
      
      <div class="max-w-xl mx-auto text-center">
        <!-- Animated badge -->
        <div class="inline-flex items-center px-3 py-1 rounded-full bg-indigo-100/80 text-indigo-600 text-sm font-medium mb-6">
          <span class="flex h-2 w-2 mr-2">
            <span class="animate-ping absolute inline-flex h-2 w-2 rounded-full bg-indigo-400 opacity-75"></span>
            <span class="relative inline-flex rounded-full h-2 w-2 bg-indigo-500"></span>
          </span>
          Join Our Community
        </div>
        
        <h2 class="text-4xl sm:text-5xl font-bold text-gray-900 mb-6 font-serif relative">
          {{sections.community.title}}
          <div class="absolute -bottom-3 left-1/2 transform -translate-x-1/2 w-24 h-1 bg-gradient-to-r from-indigo-400 via-purple-400 to-pink-400 rounded-full"></div>
        </h2>
        
        <p class="text-base sm:text-xl text-gray-700 mb-10 leading-relaxed">
          {{sections.community.subtitle}}
        </p>
        
        <!-- Fancy form with floating label effect -->
        <form class="relative group" id="subscribeForm">
          <div class="flex flex-col sm:flex-row gap-4 p-2 bg-white/80 backdrop-blur-sm rounded-xl shadow-[0_4px_20px_rgba(0,0,0,0.03)] border border-white/80">
            <div class="relative flex-1">
              <input
                type="email"
                placeholder=" "
                class="peer w-full px-6 py-4 bg-transparent border-0 focus:ring-0 focus:outline-none text-gray-800"
                required
              />
              <label class="absolute text-sm text-gray-500 duration-300 transform -translate-y-4 scale-75 top-4 z-10 origin-[0] left-6 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-4 peer-focus:text-indigo-600">
                Enter your email
              </label>
            </div>
            <button
              type="submit"
              class="px-8 py-4 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-medium rounded-lg hover:shadow-lg hover:shadow-indigo-500/20 transition-all duration-300 transform hover:-translate-y-1"
            >
              {{sections.community.cta.label}}
            </button>
          </div>
          
          <!-- Subtle form hint -->
          <p class="mt-3 text-xs text-gray-500">We respect your privacy and will never share your information.</p>
        </form>
      </div>
    </div>
    
    <!-- Success dialog with glass effect -->
    <div
      id="subscribeDialog"
      class="hidden fixed inset-0 bg-black/30 backdrop-blur-sm z-50 flex items-center justify-center"
      aria-modal="true"
      role="dialog"
    >
      <div class="relative bg-white/80 backdrop-blur-xl p-8 rounded-2xl shadow-[0_10px_50px_rgba(0,0,0,0.1)] max-w-md w-full mx-4 border border-white/50 transform transition-all duration-500 scale-100">
        <!-- Decorative elements -->
        <div class="absolute -top-10 -right-10 w-20 h-20 bg-indigo-400 rounded-full mix-blend-multiply filter blur-xl opacity-70"></div>
        <div class="absolute -bottom-10 -left-10 w-20 h-20 bg-pink-400 rounded-full mix-blend-multiply filter blur-xl opacity-70"></div>
        
        <!-- Success icon -->
        <div class="w-16 h-16 mx-auto mb-6 rounded-full bg-gradient-to-r from-indigo-500 to-purple-500 flex items-center justify-center">
          <svg class="w-8 h-8 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
          </svg>
        </div>
        
        <h3 class="text-2xl font-bold text-gray-900 mb-4 text-center">
          Subscribed!
        </h3>
        <p class="text-gray-600 mb-8 text-center">
          Thank you for trusting Wick & Wax. You're now part of our community!
        </p>
        <button
          onclick="document.getElementById('subscribeDialog').classList.add('hidden')"
          class="w-full py-4 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white font-medium rounded-lg hover:shadow-lg hover:shadow-indigo-500/20 transition-all duration-300"
        >
          Close
        </button>
      </div>
    </div>
  </div>
  
  <style>
    /* Custom animations */
    @keyframes blob {
      0%, 100% { transform: translate(0, 0) scale(1); }
      25% { transform: translate(20px, -20px) scale(1.1); }
      50% { transform: translate(-20px, 20px) scale(0.9); }
      75% { transform: translate(20px, 20px) scale(1.05); }
    }
    
    .animate-blob {
      animation: blob 15s infinite ease-in-out;
    }
    
    .animation-delay-2000 {
      animation-delay: 4s;
    }
    
    .animation-delay-4000 {
      animation-delay: 8s;
    }
  </style>
  
  <script>
    document
      .getElementById("subscribeForm")
      .addEventListener("submit", function (e) {
        e.preventDefault();
        const emailInput = this.querySelector('input[type="email"]');
        const email = emailInput.value.trim();
        const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
        if (email && emailRegex.test(email)) {
          const dialog = document.getElementById("subscribeDialog");
          dialog.classList.remove("hidden");
          dialog.querySelector("div").classList.add("scale-100");
          this.reset();
        }
      });
  </script>
</section>