@extends('public.layout')
@section('title', 'Kontak')
@section('content')

<section class="max-w-6xl mx-auto px-6 py-24 grid md:grid-cols-2 gap-16">
    <div>
        <p class="text-xs font-semibold text-gray-400 uppercase tracking-widest mb-4 flex items-center gap-2">
            <span class="w-4 h-px bg-gray-400 inline-block"></span> Kontak
        </p>
        <h1 class="text-5xl font-bold leading-tight mb-6">Hubungi<br>kami</h1>
        <p class="text-gray-500 leading-relaxed mb-8">
            Kirimkan pesan, pertanyaan, atau saran. Kami akan merespons secepatnya.
        </p>
        <div class="space-y-3 text-sm text-gray-500">
            <p>📍 Desa Karangdadap, Kecamatan Kalibagor, Kabupaten Banyumas</p>
        </div>
    </div>

    <div>
        @if(session('success'))
        <div class="border border-gray-200 bg-gray-50 rounded-xl px-5 py-4 mb-6 text-sm text-gray-700">
            {{ session('success') }}
        </div>
        @endif

        <form method="POST" action="{{ route('kontak.store') }}" class="space-y-4">
            @csrf
            <div>
                <label class="block text-xs font-medium text-gray-500 uppercase tracking-widest mb-1.5">Nama *</label>
                <input type="text" name="name" value="{{ old('name') }}" required
                    class="w-full border border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-gray-400 transition @error('name') border-red-300 @enderror">
                @error('name')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
            </div>

            <div class="grid grid-cols-2 gap-4">
                <div>
                    <label class="block text-xs font-medium text-gray-500 uppercase tracking-widest mb-1.5">Email</label>
                    <input type="email" name="email" value="{{ old('email') }}"
                        class="w-full border border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-gray-400 transition">
                </div>
                <div>
                    <label class="block text-xs font-medium text-gray-500 uppercase tracking-widest mb-1.5">Telepon</label>
                    <input type="text" name="phone" value="{{ old('phone') }}"
                        class="w-full border border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-gray-400 transition">
                </div>
            </div>

            <div>
                <label class="block text-xs font-medium text-gray-500 uppercase tracking-widest mb-1.5">Subjek *</label>
                <input type="text" name="subject" value="{{ old('subject') }}" required
                    class="w-full border border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-gray-400 transition @error('subject') border-red-300 @enderror">
                @error('subject')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
            </div>

            <div>
                <label class="block text-xs font-medium text-gray-500 uppercase tracking-widest mb-1.5">Pesan *</label>
                <textarea name="message" rows="5" required
                    class="w-full border border-gray-200 rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-gray-400 transition @error('message') border-red-300 @enderror">{{ old('message') }}</textarea>
                @error('message')<p class="text-red-500 text-xs mt-1">{{ $message }}</p>@enderror
            </div>

            <button type="submit"
                class="w-full bg-gray-900 text-white font-medium py-3 rounded-full text-sm hover:bg-gray-700 transition">
                Kirim Pesan
            </button>
        </form>
    </div>
</section>

@endsection
