<!doctype html>
<html lang="id">
<head>
    <meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
    <title><?= esc($title) ?> | Undangan Khitanan</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap" rel="stylesheet">
    <style>body{font-family:Poppins;background:#f8f1e5}.login-card{max-width:430px;border:1px solid #d4af37;border-radius:24px}.brand{font-family:"Playfair Display";color:#0f5132}.btn-emerald{background:#0f5132;color:#fff}.btn-emerald:hover{background:#083a23;color:#fff}</style>
</head>
<body class="min-vh-100 d-flex align-items-center">
<main class="container">
    <div class="login-card bg-white shadow-lg p-4 p-md-5 mx-auto">
        <div class="text-center mb-4"><i class="bi bi-moon-stars-fill fs-1 text-warning"></i><h1 class="brand h3 mt-2">Admin Khitanan</h1><p class="text-secondary small">Kelola undangan digital dengan aman.</p></div>
        <?php if(session('error')): ?><div class="alert alert-danger"><?= esc(session('error')) ?></div><?php endif ?>
        <?php if(session('success')): ?><div class="alert alert-success"><?= esc(session('success')) ?></div><?php endif ?>
        <form method="post" action="<?= base_url('login') ?>"><?= csrf_field() ?>
            <div class="mb-3"><label class="form-label">Email</label><input class="form-control form-control-lg" type="email" name="email" value="<?= old('email') ?>" required></div>
            <div class="mb-4"><label class="form-label">Password</label><input class="form-control form-control-lg" type="password" name="password" required></div>
            <button class="btn btn-emerald btn-lg w-100"><i class="bi bi-box-arrow-in-right me-2"></i>Masuk</button>
        </form>
        <a class="d-block text-center mt-4 small text-secondary" href="<?= base_url() ?>">Kembali ke undangan</a>
    </div>
</main>
</body></html>
