<x-guest-layout>
    <!-- Main Container -->
    <div class="min-h-screen bg-indigo-50 flex items-center justify-center p-4">
        <div class="w-full max-w-6xl grid lg:grid-cols-2 gap-0 bg-white rounded-3xl shadow-2xl overflow-hidden">
            
            <!-- Left Panel - Branding & Visual -->
            <div class="hidden lg:flex flex-col justify-center items-center bg-gradient-to-b from-indigo-800 to-indigo-900 p-12 relative overflow-hidden">
                <!-- Background Pattern -->
                <div class="absolute inset-0 opacity-10">
                    <svg class="w-full h-full" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
                        <defs>
                            <pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse">
                                <path d="M 10 0 L 0 0 0 10" fill="none" stroke="white" stroke-width="0.5"/>
                            </pattern>
                        </defs>
                        <rect width="100" height="100" fill="url(#grid)" />
                    </svg>
                </div>
                
                <!-- Logo & Branding -->
                <div class="relative z-10 text-center">
                    <div class="mb-8">
                        <div class="w-64 h-64 mx-auto mb-6 flex items-center justify-center bg-white p-4 rounded-2xl shadow-md">
                            <img src="{{ asset('images/logo.png') }}" alt="Omika Bangun Mandiri" class="w-full h-auto">
                        </div>
                        <h1 class="text-4xl font-bold text-white mb-3">OMIKA BANGUN MANDIRI</h1>
                        <p class="text-xl text-indigo-100 mb-8">Integrated Operational System</p>
                    </div>
                    
                    <!-- Features List -->
                    <div class="space-y-4 text-left max-w-sm">
                        <div class="flex items-center space-x-3 text-indigo-100">
                            <div class="w-2 h-2 bg-indigo-200 rounded-full"></div>
                            <span>Manajemen Operasional Terintegrasi</span>
                        </div>
                        <div class="flex items-center space-x-3 text-indigo-100">
                            <div class="w-2 h-2 bg-indigo-200 rounded-full"></div>
                            <span>Dashboard Analytics Real-time</span>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Right Panel - Login Form -->
            <div class="flex flex-col justify-center p-8 lg:p-12">
                <!-- Mobile Logo -->
                <div class="lg:hidden text-center mb-8">
                    <!-- Untuk tampilan mobile -->
                    <div class="w-40 h-40 mx-auto mb-4 flex items-center justify-center bg-white p-3 rounded-xl shadow-md">
                        <img src="{{ asset('images/logo.png') }}" alt="Omika Bangun Mandiri" class="w-full h-auto">
                    </div>
                    <h2 class="text-2xl font-bold text-indigo-800">OMIKA BANGUN MANDIRI</h2>
                </div>
                
                <!-- Welcome Text -->
                <div class="text-center lg:text-left mb-8">
                    <h2 class="text-3xl font-bold text-indigo-800 mb-2">Selamat Datang Kembali</h2>
                    <p class="text-indigo-600">Masuk ke akun Anda untuk melanjutkan</p>
                </div>
                
                <!-- Login Form -->
                <form method="POST" action="{{ route('login') }}" class="space-y-6">
                    @csrf
                    
                    <!-- Email Field -->
                    <div class="space-y-2">
                        <label for="email" class="block text-sm font-semibold text-indigo-700">Email Address</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <svg class="h-5 w-5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"/>
                                </svg>
                            </div>
                            <input id="email" name="email" type="email" autocomplete="email" required 
                                   class="block w-full pl-10 pr-3 py-3 border border-indigo-300 rounded-xl shadow-sm placeholder-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition duration-200" 
                                   placeholder="nama@email.com" value="{{ old('email') }}">
                        </div>
                        @error('email')
                            <p class="text-red-500 text-xs mt-1">{{ $message }}</p>
                        @enderror
                    </div>
                    
                    <!-- Password Field -->
                    <div class="space-y-2">
                        <label for="password" class="block text-sm font-semibold text-indigo-700">Password</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <svg class="h-5 w-5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"/>
                                </svg>
                            </div>
                            <input id="password" name="password" type="password" autocomplete="current-password" required 
                                   class="block w-full pl-10 pr-12 py-3 border border-indigo-300 rounded-xl shadow-sm placeholder-indigo-400 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition duration-200" 
                                   placeholder="Masukkan password Anda">
                            <button type="button" onclick="togglePassword()" class="absolute inset-y-0 right-0 pr-3 flex items-center">
                                <svg id="eyeIcon" class="h-5 w-5 text-indigo-400 hover:text-indigo-600 transition duration-200" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
                                </svg>
                            </button>
                        </div>
                        @error('password')
                            <p class="text-red-500 text-xs mt-1">{{ $message }}</p>
                        @enderror
                    </div>
                    
                    <!-- Remember Me & Forgot Password -->
                    <div class="flex items-center justify-between">
                        <label class="flex items-center">
                            <input type="checkbox" name="remember" class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-indigo-300 rounded">
                            <span class="ml-2 text-sm text-indigo-600">Ingat saya</span>
                        </label>
                        <a href="{{ route('password.request') }}" class="text-sm text-indigo-600 hover:text-indigo-500 font-medium transition duration-200">
                            Lupa password?
                        </a>
                    </div>
                    
                    <!-- Login Button -->
                    <button type="submit" class="w-full flex justify-center py-3 px-4 border border-transparent rounded-xl shadow-sm text-sm font-semibold text-white bg-gradient-to-b from-indigo-800 to-indigo-900 hover:from-indigo-700 hover:to-indigo-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition duration-200 transform hover:scale-[1.02]">
                        <svg class="-ml-1 mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"/>
                        </svg>
                        Masuk ke Sistem
                    </button>
                    
                    <!-- Divider -->
                    <div class="relative my-6">
                        <div class="absolute inset-0 flex items-center">
                            <div class="w-full border-t border-indigo-200"></div>
                        </div>
                        <div class="relative flex justify-center text-sm">
                            <span class="px-2 bg-white text-indigo-500">atau</span>
                        </div>
                    </div>
                    
                    <!-- Register Link -->
                    <div class="text-center">
                        <span class="text-sm text-indigo-600">Belum punya akun?</span>
                        <a href="{{ route('register') }}" class="text-sm text-indigo-700 hover:text-indigo-800 font-semibold ml-1 transition duration-200">
                            Daftar sekarang
                        </a>
                    </div>
                </form>
            </div>
        </div>
    </div>
    
    <!-- Password Toggle Script -->
    <script>
        function togglePassword() {
            const passwordInput = document.getElementById('password');
            const eyeIcon = document.getElementById('eyeIcon');
            
            if (passwordInput.type === 'password') {
                passwordInput.type = 'text';
                eyeIcon.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"/>
                `;
            } else {
                passwordInput.type = 'password';
                eyeIcon.innerHTML = `
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/>
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/>
                `;
            }
        }
    </script>
</x-guest-layout>