<?= $this->extend('layout/admin') ?>
<?= $this->section('content') ?>

<div class="container d-flex justify-content-center align-items-center min-vh-100">
    <div class="col-md-5">

        <div class="card shadow-lg border-0 rounded-4">
            <div class="card-header bg-primary text-white text-center rounded-top-4">
                <h4 class="mb-0 fw-bold">
                    <i class="fas fa-user-graduate me-2"></i>
                    Pendaftaran Akun Calon Siswa
                </h4>
                <small>PPDB Online</small>
            </div>

            <div class="card-body p-4">

                <?php if (session()->getFlashdata('error')): ?>
                    <div class="alert alert-danger">
                        <?= session()->getFlashdata('error') ?>
                    </div>
                <?php endif; ?>

                <form method="post" action="<?= site_url('ppdb/account/register') ?>">

                    <div class="mb-3">
                        <label class="form-label fw-semibold">Nama Lengkap</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-id-card"></i></span>
                            <input type="text" name="full_name" class="form-control" required>
                        </div>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-semibold">Username</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-user"></i></span>
                            <input type="text" name="username" class="form-control"
                                   placeholder="opsional, bisa diisi email">
                        </div>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-semibold">Email Aktif</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-envelope"></i></span>
                            <input type="email" name="email" class="form-control" required>
                        </div>
                        <small class="text-muted">Email digunakan untuk login & notifikasi PPDB</small>
                    </div>

                    <div class="mb-3">
                        <label class="form-label fw-semibold">No Handphone</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-phone"></i></span>
                            <input type="text" name="phone" class="form-control" required>
                        </div>
                    </div>

                    <div class="mb-4">
                        <label class="form-label fw-semibold">Password</label>
                        <div class="input-group">
                            <span class="input-group-text"><i class="fas fa-lock"></i></span>
                            <input type="password" name="password" class="form-control" required>
                        </div>
                        <small class="text-muted">Minimal 8 karakter</small>
                    </div>

                    <div class="d-grid">
                        <button class="btn btn-primary btn-lg fw-bold">
                            <i class="fas fa-user-plus me-1"></i>
                            Daftar Akun
                        </button>
                    </div>

                </form>

            </div>

            <div class="card-footer text-center bg-light rounded-bottom-4">
                <small>
                    Sudah punya akun?
                    <a href="<?= site_url('ppdb/account/register') ?>" class="fw-bold text-primary">
                        Login di sini
                    </a>
                </small>
            </div>
        </div>

    </div>
</div>

<?= $this->endSection() ?>
