@if($newsletter_enabled ?? false)
<div class="newsletter-widget">
    @if(session('newsletter_success'))
        <p class="text-emerald-400 text-sm font-medium">{{ session('newsletter_success') }}</p>
    @elseif(session('newsletter_info'))
        <p class="text-amber-400 text-sm">{{ session('newsletter_info') }}</p>
    @else
        <form method="POST" action="{{ route('newsletter.subscribe') }}" class="flex flex-col gap-3 w-full max-w-lg">
            @csrf
            <div class="flex flex-col sm:flex-row gap-2">
                <input type="email" name="email" required placeholder="Votre email" class="flex-1 min-w-0 px-4 py-2.5 rounded-xl text-sm bg-white/10 border border-white/20 placeholder-white/60 focus:ring-2 focus:ring-white/30 focus:border-white/40" style="color: inherit;">
                <input type="text" name="name" placeholder="Nom (optionnel)" class="sm:w-28 px-4 py-2.5 rounded-xl text-sm bg-white/10 border border-white/20 placeholder-white/60 focus:ring-2 focus:ring-white/30" style="color: inherit;">
            </div>
            @include('partials.captcha-widget', ['context' => 'newsletter'])
            <button type="submit" class="self-start px-5 py-2.5 bg-white/20 hover:bg-white/30 rounded-xl font-medium transition text-sm whitespace-nowrap" style="color: inherit;">S'inscrire</button>
        </form>
    @endif
</div>
@endif
