<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Lupa Password | SIM Sari Rasa</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css">
    <style>
        body {
            background: url('<?= base_url('uploads/back_sari.png') ?>') no-repeat center center fixed !important;
            background-size: cover !important;
        }
        body::before {
            content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(240, 253, 244, 0.4); z-index: -1;
        }
        .btn-emerald { background-color: #10b981; color: white; border: none; }
        .btn-emerald:hover { background-color: #059669; color: white; }
        .text-emerald { color: #059669; }
    </style>
</head>
<body class="hold-transition login-page">
    <div class="login-box" style="width: 450px;">
        <div class="card card-emerald card-outline shadow">
            <div class="card-body login-card-body rounded">
                <h4 class="text-center font-weight-bold text-dark mb-3">Pemulihan Akun</h4>
                <p class="login-box-msg text-muted p-0 mb-3">Masukkan alamat surel terdaftar Anda untuk mendapatkan tautan pemulihan.</p>

                <?php if (session()->getFlashdata('error')): ?>
                    <div class="alert alert-danger text-center text-sm py-2">
                        <i class="fas fa-exclamation-triangle"></i> <?= session()->getFlashdata('error') ?>
                    </div>
                <?php endif; ?>

                <?php if (session()->getFlashdata('simulasi_email')): ?>
                    <div class="alert alert-info shadow-sm p-3 mb-3">
                        <h6 class="font-weight-bold"><i class="fas fa-envelope-open-text mr-1"></i> </h6>
                        <p class="text-xs mb-2">Sistem mendeteksi email valid. Gunakan tautan di bawah ini </p>
                        <a href="<?= session()->getFlashdata('simulasi_email') ?>" class="btn btn-warning btn-sm btn-block text-bold text-dark text-wrap">
                            <i class="fas fa-external-link-alt mr-1"></i> Klik untuk Reset Password Akun Anda
                        </a>
                    </div>
                <?php endif; ?>

                <form action="<?= base_url('auth/kirim_token_simulasi') ?>" method="post">
                    <div class="input-group mb-3">
                        <input type="email" name="surel" class="form-control" placeholder="Masukkan Alamat Surel (Contoh: admin@sarirasa.id)" required autofocus>
                        <div class="input-group-append">
                            <div class="input-group-text"><span class="fas fa-envelope"></span></div>
                        </div>
                    </div>
                    <button type="submit" class="btn btn-emerald btn-block font-weight-bold">Minta Tautan Pemulihan</button>
                </form>

                <p class="text-center mt-3 mb-0">
                    <a href="<?= base_url('auth') ?>" class="text-sm text-secondary"><i class="fas fa-arrow-left mr-1"></i> Kembali ke Login</a>
                </p>
            </div>
        </div>
    </div>
</body>
</html>