<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Login - Portal Apresiasi Kab. Klaten</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="bg-slate-900 flex items-center justify-center min-h-screen p-4">

    <div class="bg-white p-8 rounded-2xl shadow-2xl w-full max-w-md border-t-8 border-indigo-600 relative overflow-hidden">
        <div class="absolute -top-16 -right-16 text-indigo-50/50">
            <i class="fa fa-award text-9xl"></i>
        </div>

        <div class="relative z-10 text-center mb-8">
            <h2 class="text-3xl font-black text-slate-800">Sistem Apresiasi</h2>
            <p class="text-sm text-slate-500 mt-1 font-medium">Masuk untuk mengelola data siswa berprestasi</p>
        </div>
        
        <?php if(session()->getFlashdata('error')): ?>
            <div class="bg-red-50 text-red-600 p-3 rounded-lg text-sm mb-4 border border-red-100 flex gap-2 items-center">
                <i class="fa fa-exclamation-circle"></i> <?= session()->getFlashdata('error') ?>
            </div>
        <?php endif; ?>

        <form action="/auth/loginProcess" method="POST" class="space-y-5 relative z-10">
            <?= csrf_field() ?>
            <div>
                <label class="text-xs font-bold text-slate-700 uppercase tracking-wider block mb-1.5">Username Pengguna</label>
                <div class="relative">
                    <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400"><i class="fa fa-user"></i></span>
                    <input type="text" name="username" required placeholder="Masukkan username" class="w-full border border-slate-300 pl-10 p-3 rounded-lg focus:ring-2 focus:ring-indigo-600 focus:border-indigo-600 outline-none bg-slate-50 text-sm font-medium transition-all">
                </div>
            </div>
            <div>
                <label class="text-xs font-bold text-slate-700 uppercase tracking-wider block mb-1.5">Kata Sandi</label>
                <div class="relative">
                    <span class="absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400"><i class="fa fa-lock"></i></span>
                    <input type="password" name="password" required placeholder="••••••••" class="w-full border border-slate-300 pl-10 p-3 rounded-lg focus:ring-2 focus:ring-indigo-600 focus:border-indigo-600 outline-none bg-slate-50 text-sm font-medium transition-all">
                </div>
            </div>
            <button type="submit" class="w-full bg-indigo-600 hover:bg-indigo-700 text-white font-bold py-3 rounded-lg transition-all shadow-lg shadow-indigo-600/30 mt-2">
                Otorisasi Akses <i class="fa fa-arrow-right ml-1"></i>
            </button>
        </form>
    </div>

</body>
</html>