<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Daftar Akun | BERKAH.TRF</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap" rel="stylesheet">
    <style>
        body { font-family: 'Plus Jakarta Sans', sans-serif; }
    </style>
    <x-pwa />
</head>
<body class="bg-[#F8FAFC] flex items-center justify-center min-h-screen p-6">
    <x-loading />

    <div class="w-full max-w-md">
        {{-- LOGO --}}
        <div class="text-center mb-10">
            <h1 class="text-3xl font-black italic tracking-tighter text-blue-600 mb-2">BERKAH.TRF</h1>
            <p class="text-gray-400 font-medium">Buat akun dan mulai belanja thrift keren!</p>
        </div>

        {{-- CARD REGISTER --}}
        <div class="bg-white p-8 sm:p-10 rounded-[2.5rem] shadow-xl shadow-blue-900/5 border border-gray-100">
            
            <h2 class="text-xl font-extrabold text-gray-900 mb-6">Daftar Akun Baru</h2>

            <form action="{{ route('register.post') }}" method="POST" class="space-y-5">
                @csrf

                {{-- NAMA LENGKAP --}}
                <div>
                    <label class="block text-[11px] font-black text-gray-400 uppercase tracking-widest mb-2">Nama Lengkap</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-user text-gray-300"></i>
                        </div>
                        <input type="text" name="name" value="{{ old('name') }}" required autofocus
                            class="w-full pl-11 pr-4 py-3 bg-gray-50 border border-gray-100 text-gray-900 text-sm rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block transition-all placeholder-gray-300 font-bold" 
                            placeholder="Contoh: Budi Santoso">
                    </div>
                    @error('name')
                        <p class="text-red-500 text-xs mt-1 font-bold">{{ $message }}</p>
                    @enderror
                </div>

                {{-- EMAIL --}}
                <div>
                    <label class="block text-[11px] font-black text-gray-400 uppercase tracking-widest mb-2">Alamat Email</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-envelope text-gray-300"></i>
                        </div>
                        <input type="email" name="email" value="{{ old('email') }}" required
                            class="w-full pl-11 pr-4 py-3 bg-gray-50 border border-gray-100 text-gray-900 text-sm rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block transition-all placeholder-gray-300 font-bold" 
                            placeholder="nama@email.com">
                    </div>
                    @error('email')
                        <p class="text-red-500 text-xs mt-1 font-bold">{{ $message }}</p>
                    @enderror
                </div>

                {{-- NOMOR HP / WA --}}
                <div>
                    <label class="block text-[11px] font-black text-gray-400 uppercase tracking-widest mb-2">No. Whatsapp / Telpon</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-phone text-gray-300"></i>
                        </div>
                        <input type="number" name="phone" value="{{ old('phone') }}" required
                            class="w-full pl-11 pr-4 py-3 bg-gray-50 border border-gray-100 text-gray-900 text-sm rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block transition-all placeholder-gray-300 font-bold" 
                            placeholder="Contoh: 08123456789">
                    </div>
                    @error('phone')
                        <p class="text-red-500 text-xs mt-1 font-bold">{{ $message }}</p>
                    @enderror
                </div>

                {{-- PASSWORD --}}
                <div>
                    <label class="block text-[11px] font-black text-gray-400 uppercase tracking-widest mb-2">Password</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-lock text-gray-300"></i>
                        </div>
                        <input type="password" name="password" required
                            class="w-full pl-11 pr-4 py-3 bg-gray-50 border border-gray-100 text-gray-900 text-sm rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block transition-all placeholder-gray-300 font-bold" 
                            placeholder="Password">
                    </div>
                    @error('password')
                        <p class="text-red-500 text-xs mt-1 font-bold">{{ $message }}</p>
                    @enderror
                </div>

                {{-- KONFIRMASI PASSWORD --}}
                <div>
                    <label class="block text-[11px] font-black text-gray-400 uppercase tracking-widest mb-2">Ulangi Password</label>
                    <div class="relative">
                        <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                            <i class="fas fa-check-circle text-gray-300"></i>
                        </div>
                        <input type="password" name="password_confirmation" required
                            class="w-full pl-11 pr-4 py-3 bg-gray-50 border border-gray-100 text-gray-900 text-sm rounded-xl focus:ring-2 focus:ring-blue-500 focus:border-blue-500 block transition-all placeholder-gray-300 font-bold" 
                            placeholder="ulangi password">
                    </div>
                </div>

                {{-- TOMBOL SUBMIT --}}
                <button type="submit" class="w-full py-4 bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white font-bold rounded-xl shadow-lg shadow-blue-200 transition-all transform active:scale-95 flex justify-center items-center gap-2">
                    <span>Daftar Sekarang</span>
                    <i class="fas fa-arrow-right"></i>
                </button>
            </form>

            {{-- LINK KE LOGIN --}}
            <div class="mt-8 text-center">
                <p class="text-sm text-gray-400 font-medium">
                    Sudah punya akun? 
                    <a href="{{ route('login') }}" class="text-blue-600 font-bold hover:text-blue-700 transition">Login disini</a>
                </p>
            </div>
        </div>

        {{-- COPYRIGHT --}}
        <p class="text-center text-gray-300 text-xs mt-10 font-bold tracking-widest uppercase">
            2026 Berkah.Trf Store
        </p>
    </div>

</body>
</html>