<x-site-layout title="Health Marketor Registration">

    {{-- Hero --}}
    <section class="relative bg-gradient-to-r from-rose-600 to-pink-700 py-16">
        <div class="absolute inset-0 bg-black opacity-10"></div>
        <div class="relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
            <span class="inline-block px-4 py-1 bg-white bg-opacity-20 rounded-full text-white text-sm font-medium mb-4">
                <i class="fas fa-heartbeat mr-1"></i> Health Marketor Registration
            </span>
            <h1 class="text-4xl md:text-5xl font-bold text-white mb-4">Become a Health Marketor</h1>
            <p class="text-rose-100 text-lg max-w-5xl mx-auto">
                Promote health services, run impactful campaigns, and connect communities with the health resources they need.
            </p>
            <div class="flex flex-wrap justify-center gap-6 mt-8 text-sm text-rose-100">
                <span><i class="fas fa-check-circle mr-1"></i> Run Health Campaigns</span>
                <span><i class="fas fa-check-circle mr-1"></i> Reach Communities</span>
                <span><i class="fas fa-check-circle mr-1"></i> Promote Services</span>
                <span><i class="fas fa-check-circle mr-1"></i> Measure Impact</span>
            </div>
        </div>
    </section>

    {{-- Breadcrumb --}}
    <div class="bg-gray-50 border-b border-gray-200">
        <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3">
            <nav class="flex items-center space-x-2 text-sm text-gray-600" aria-label="Breadcrumb">
                <a href="{{ url('/') }}" class="hover:text-rose-600 transition flex items-center">
                    <i class="fas fa-home mr-1"></i>Home
                </a>
                <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
                <span class="text-gray-500">Register</span>
                <i class="fas fa-chevron-right text-gray-400 text-xs"></i>
                <span class="text-gray-900 font-medium">Become a Health Marketor</span>
            </nav>
        </div>
    </div>

    <div class="bg-amber-50 border-b border-amber-200">
        <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-3 flex items-center gap-2 text-sm text-amber-800">
            <i class="fas fa-info-circle text-amber-500"></i>
            Applications are reviewed within <strong>3–5 business days</strong>. You will be notified by email.
        </div>
    </div>

    <section class="py-12 bg-gray-50">
        <div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8">

            @if(session('error'))
                <div class="mb-6 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-xl flex items-center gap-2">
                    <i class="fas fa-exclamation-circle"></i> {{ session('error') }}
                </div>
            @endif
            @if($errors->any())
                <div class="mb-6 bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-xl">
                    <p class="font-medium flex items-center gap-2"><i class="fas fa-exclamation-triangle"></i> Please fix the errors below.</p>
                </div>
            @endif

            <form action="{{ route('register.role.health-marketor.store') }}" method="POST" class="space-y-6">
                @csrf

                {{-- Personal Information --}}
                <div class="bg-white rounded-2xl shadow-sm overflow-hidden">
                    <div class="bg-gray-50 px-6 py-4 border-b border-gray-100">
                        <h2 class="text-base font-semibold text-gray-900 flex items-center gap-2">
                            <i class="fas fa-user text-rose-600"></i> Personal Information
                        </h2>
                    </div>
                    <div class="p-6 grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label for="first_name" class="block text-sm font-medium text-gray-700 mb-1">First Name <span class="text-red-500">*</span></label>
                            <input type="text" id="first_name" name="first_name" value="{{ old('first_name') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="First name" required>
                            @error('first_name')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="last_name" class="block text-sm font-medium text-gray-700 mb-1">Last Name <span class="text-red-500">*</span></label>
                            <input type="text" id="last_name" name="last_name" value="{{ old('last_name') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="Last name" required>
                            @error('last_name')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email Address <span class="text-red-500">*</span></label>
                            <input type="email" id="email" name="email" value="{{ old('email') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="your@email.com" required>
                            @error('email')<p class="mt-1 text-sm text-red-600">{!! $message !!}</p>@enderror
                        </div>
                        <div>
                            <label for="phone" class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label>
                            <input type="tel" id="phone" name="phone" value="{{ old('phone') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="+256 7XX XXX XXX">
                        </div>
                        <div>
                            <label for="city" class="block text-sm font-medium text-gray-700 mb-1">City</label>
                            <input type="text" id="city" name="city" value="{{ old('city') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="City">
                        </div>
                        <div>
                            <label for="country" class="block text-sm font-medium text-gray-700 mb-1">Country</label>
                            <input type="text" id="country" name="country" value="{{ old('country') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="Country">
                        </div>
                        <div class="md:col-span-2">
                            <label for="organization" class="block text-sm font-medium text-gray-700 mb-1">Organisation</label>
                            <input type="text" id="organization" name="organization" value="{{ old('organization') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="Your organisation or company">
                        </div>
                    </div>
                </div>

                {{-- Marketing Profile --}}
                <div class="bg-white rounded-2xl shadow-sm overflow-hidden">
                    <div class="bg-gray-50 px-6 py-4 border-b border-gray-100">
                        <h2 class="text-base font-semibold text-gray-900 flex items-center gap-2">
                            <i class="fas fa-bullhorn text-rose-600"></i> Marketing Profile
                        </h2>
                    </div>
                    <div class="p-6 space-y-5">
                        <div>
                            <label class="block text-sm font-medium text-gray-700 mb-2">Marketing Focus Areas <span class="text-red-500">*</span></label>
                            @php
                                $focusOptions = ['Digital Marketing','Community Outreach','Social Media','Health Campaigns','Behaviour Change Communication','Health Promotion','Media & PR','Event Marketing','Content Creation','Other'];
                                $selectedFocus = old('marketing_focus', []);
                            @endphp
                            <div class="grid grid-cols-2 md:grid-cols-3 gap-3">
                                @foreach($focusOptions as $option)
                                    <label class="flex items-center gap-2 cursor-pointer p-3 border border-gray-200 rounded-lg hover:bg-rose-50 hover:border-rose-300 transition">
                                        <input type="checkbox" name="marketing_focus[]" value="{{ $option }}"
                                               class="h-4 w-4 text-rose-600 border-gray-300 rounded focus:ring-rose-500"
                                               {{ in_array($option, $selectedFocus) ? 'checked' : '' }}>
                                        <span class="text-sm text-gray-700">{{ $option }}</span>
                                    </label>
                                @endforeach
                            </div>
                            @error('marketing_focus')<p class="mt-2 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
                            <div>
                                <label for="years_of_experience" class="block text-sm font-medium text-gray-700 mb-1">Years of Experience</label>
                                <input type="number" id="years_of_experience" name="years_of_experience" value="{{ old('years_of_experience') }}"
                                       class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                       min="0" max="60" placeholder="e.g. 5">
                                @error('years_of_experience')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                            </div>
                        </div>
                        <div>
                            <label for="target_audience" class="block text-sm font-medium text-gray-700 mb-1">Target Audience <span class="text-red-500">*</span></label>
                            <textarea id="target_audience" name="target_audience" rows="3"
                                      class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                      placeholder="Describe the communities or demographics you typically target..." required>{{ old('target_audience') }}</textarea>
                            @error('target_audience')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="campaign_experience" class="block text-sm font-medium text-gray-700 mb-1">Campaign Experience</label>
                            <textarea id="campaign_experience" name="campaign_experience" rows="3"
                                      class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                      placeholder="Describe notable campaigns or projects you have worked on...">{{ old('campaign_experience') }}</textarea>
                        </div>
                        <div>
                            <label for="bio" class="block text-sm font-medium text-gray-700 mb-1">Professional Bio <span class="text-red-500">*</span></label>
                            <textarea id="bio" name="bio" rows="4"
                                      class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                      placeholder="Tell us about your background in health marketing..." required>{{ old('bio') }}</textarea>
                            @error('bio')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                    </div>
                </div>

                {{-- Social Media --}}
                <div class="bg-white rounded-2xl shadow-sm overflow-hidden">
                    <div class="bg-gray-50 px-6 py-4 border-b border-gray-100">
                        <h2 class="text-base font-semibold text-gray-900 flex items-center gap-2">
                            <i class="fas fa-share-alt text-rose-600"></i> Social Media Links
                            <span class="text-xs text-gray-400 font-normal ml-1">(optional)</span>
                        </h2>
                    </div>
                    <div class="p-6 grid grid-cols-1 md:grid-cols-2 gap-5">
                        <div>
                            <label for="facebook" class="block text-sm font-medium text-gray-700 mb-1">
                                <i class="fab fa-facebook text-blue-600 mr-1"></i> Facebook
                            </label>
                            <input type="url" id="facebook" name="facebook" value="{{ old('facebook') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="https://facebook.com/yourpage">
                            @error('facebook')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="twitter" class="block text-sm font-medium text-gray-700 mb-1">
                                <i class="fab fa-twitter text-sky-500 mr-1"></i> Twitter / X
                            </label>
                            <input type="url" id="twitter" name="twitter" value="{{ old('twitter') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="https://twitter.com/yourhandle">
                            @error('twitter')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="linkedin" class="block text-sm font-medium text-gray-700 mb-1">
                                <i class="fab fa-linkedin text-blue-700 mr-1"></i> LinkedIn
                            </label>
                            <input type="url" id="linkedin" name="linkedin" value="{{ old('linkedin') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="https://linkedin.com/in/yourprofile">
                            @error('linkedin')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                        <div>
                            <label for="instagram" class="block text-sm font-medium text-gray-700 mb-1">
                                <i class="fab fa-instagram text-pink-600 mr-1"></i> Instagram
                            </label>
                            <input type="url" id="instagram" name="instagram" value="{{ old('instagram') }}"
                                   class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition"
                                   placeholder="https://instagram.com/yourhandle">
                            @error('instagram')<p class="mt-1 text-sm text-red-600">{{ $message }}</p>@enderror
                        </div>
                    </div>
                </div>

                {{-- Account Security --}}
                <div class="bg-white rounded-2xl shadow-sm overflow-hidden">
                    <div class="bg-gray-50 px-6 py-4 border-b border-gray-100">
                        <h2 class="text-base font-semibold text-gray-900 flex items-center gap-2">
                            <i class="fas fa-lock text-rose-600"></i> Account Security
                        </h2>
                    </div>
                    <div class="p-6">
                        @include('registration._partials.password-fields', ['color' => 'rose'])
                    </div>
                </div>

                {{-- Terms --}}
                <div class="bg-white rounded-2xl shadow-sm p-6">
                    <label class="flex items-start gap-3 cursor-pointer">
                        <input type="checkbox" name="terms_accepted" value="1"
                               class="mt-1 h-4 w-4 text-rose-600 border-gray-300 rounded focus:ring-rose-500"
                               {{ old('terms_accepted') ? 'checked' : '' }} required>
                        <span class="text-sm text-gray-600">
                            I agree to the <a href="{{ route('pages.terms') }}" class="text-rose-600 hover:underline" target="_blank">Terms and Conditions</a>
                            and <a href="{{ route('pages.privacy') }}" class="text-rose-600 hover:underline" target="_blank">Privacy Policy</a>.
                            I confirm all information provided is accurate. <span class="text-red-500">*</span>
                        </span>
                    </label>
                    @error('terms_accepted')<p class="mt-2 text-sm text-red-600">{{ $message }}</p>@enderror
                </div>

                @include('registration._partials.bottom-nav', ['color' => 'rose', 'submitLabel' => 'Submit Health Marketor Application'])
            </form>
        </div>
    </section>

</x-site-layout>
