<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - Sistem Tracer Study STIAB Jinarakkhita</title>
    <!-- Tailwind CSS -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css">
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    <style>
        body { font-family: 'Poppins', sans-serif; background-color: #f0f4f8; }
        .login-gradient { background: linear-gradient(135deg, #004080 0%, #0067b3 100%); }
        .input-focus:focus { border-color: #0067b3; box-shadow: 0 0 0 3px rgba(0, 103, 179, 0.15); }
        .btn-hover:hover { transform: translateY(-2px); }
        .card-shadow { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
    </style>
</head>
<body class="min-h-screen flex items-center justify-center p-4">
    <div class="container max-w-md">
        <div class="bg-white rounded-xl card-shadow overflow-hidden">
            <div class="login-gradient p-6 text-white text-center">
                <div class="flex justify-center">
                    <!-- ganti logo sesuai aset -->
                    <img src="{{ asset('images/logo-stiab.png') }}" alt="Logo STIAB Jinarakkhita" class="h-16 drop-shadow-lg">
                </div>
                <h1 class="text-xl font-bold mt-3">Sistem Tracer Study</h1>
                <p class="mt-1 text-blue-100 text-sm">STIAB Jinarakkhita Lampung</p>
            </div>

            <div class="p-6">
                <h2 class="text-xl font-semibold text-center text-gray-800 mb-6">Masuk ke Akun Anda</h2>

                <form method="POST" action="{{ route('login') }}">
                    @csrf

                    <div class="mb-5">
                        <label for="login_field" class="block text-sm font-medium text-gray-700 mb-1">Email atau NPM</label>
                        <div class="relative group">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-400">
                                <i class="fas fa-user" id="login-icon"></i>
                            </div>
                            <input id="login_field" type="text" name="login_field" required autofocus
                                class="pl-10 w-full h-10 border border-gray-300 rounded-md shadow-sm input-focus"
                                placeholder="Masukkan Email atau NPM">
                        </div>
                        <p class="mt-1 text-xs text-gray-500">
                            <i class="fas fa-info-circle mr-1"></i>
                            Admin: gunakan email | Alumni: gunakan NPM
                        </p>
                    </div>

                    <div class="mb-5">
                        <label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
                        <div class="relative group">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-400">
                                <i class="fas fa-lock"></i>
                            </div>
                            <input id="password" type="password" name="password" required
                                class="pl-10 w-full h-10 border border-gray-300 rounded-md shadow-sm input-focus"
                                placeholder="••••••••">
                            <div class="absolute inset-y-0 right-0 pr-3 flex items-center">
                                <button type="button" id="togglePassword" class="text-gray-400 hover:text-gray-600">
                                    <i class="fas fa-eye"></i>
                                </button>
                            </div>
                        </div>
                    </div>

                    <div class="flex items-center justify-between mb-6">
                        <div class="flex items-center">
                            <input id="remember_me" type="checkbox" name="remember"
                                class="w-4 h-4 rounded border-gray-300 text-blue-600">
                            <label for="remember_me" class="ml-2 text-sm text-gray-700">Ingat Saya</label>
                        </div>
                        <a href="{{ route('password.request') }}" class="text-sm text-blue-600 hover:text-blue-800">Lupa Password?</a>
                    </div>

                    <button type="submit" class="w-full py-2.5 bg-blue-600 text-white rounded-md shadow-md hover:bg-blue-700 transition-all btn-hover">
                        <i class="fas fa-sign-in-alt mr-2"></i> Masuk
                    </button>
                </form>

                <div class="mt-6 text-center">
                    <p class="text-sm text-gray-600">Belum memiliki akun? <a href="{{ route('register') }}" class="text-blue-600 hover:text-blue-800">Daftar</a></p>
                </div>
            </div>
        </div>

        <div class="mt-4 text-center">
            <p class="text-sm text-gray-500">&copy; {{ date('Y') }} Sistem Tracer Study - STIAB Jinarakkhita Lampung</p>
        </div>
    </div>

    <script>
        // Toggle password visibility
        document.getElementById('togglePassword').addEventListener('click', function() {
            const password = document.getElementById('password');
            const icon = this.querySelector('i');
            if (password.type === 'password') {
                password.type = 'text';
                icon.classList.replace('fa-eye','fa-eye-slash');
            } else {
                password.type = 'password';
                icon.classList.replace('fa-eye-slash','fa-eye');
            }
        });
    </script>
</body>
</html>
