<?= $this->extend('layouts/main') ?>
<?= $this->section('content') ?>

<div class="container">
    <div class="text-center mt-5 mb-4">
        <h2>Join Job Portal</h2>
        <p class="text-muted">Choose how you'd like to get started</p>
    </div>

    <div class="row justify-content-center g-4" style="max-width: 800px; margin: 0 auto;">
        <div class="col-md-6">
            <div class="card shadow-sm h-100">
                <div class="card-body p-4 text-center">
                    <h5>I'm looking for a job</h5>
                    <p class="text-muted">Create a candidate profile, apply to jobs, and get discovered by recruiters.</p>
                    <a href="#candidateForm" data-bs-toggle="collapse" class="btn btn-primary w-100">Sign up as Candidate</a>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card shadow-sm h-100">
                <div class="card-body p-4 text-center">
                    <h5>I'm hiring</h5>
                    <p class="text-muted">Post jobs, search the candidate database, and manage your hiring pipeline.</p>
                    <a href="<?= base_url('register/agency') ?>" class="btn btn-outline-primary w-100">Sign up as Agency</a>
                </div>
            </div>
        </div>
    </div>

    <div class="collapse mt-4" id="candidateForm">
        <div class="card auth-card shadow-sm">
            <div class="card-body p-4">
                <h5 class="mb-3">Create your candidate account</h5>
                <form method="post" action="<?= base_url('register/candidate') ?>">
                    <?= csrf_field() ?>
                    <div class="mb-3">
                        <label class="form-label">Full Name</label>
                        <input type="text" name="name" class="form-control" value="<?= old('name') ?>" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Email</label>
                        <input type="email" name="email" class="form-control" value="<?= old('email') ?>" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Mobile Number</label>
                        <input type="text" name="phone" class="form-control" value="<?= old('phone') ?>" placeholder="e.g. 03001234567" required>
                        <div class="form-text">You'll receive a verification code via SMS.</div>
                    </div>
                    <div class="mb-3">
                        <label class="form-label">Password</label>
                        <input type="password" name="password" class="form-control" minlength="8" required>
                        <div class="form-text">Minimum 8 characters.</div>
                    </div>
                    <button type="submit" class="btn btn-primary w-100">Create Account</button>
                </form>
            </div>
        </div>
    </div>

    <p class="text-center mt-4">Already have an account? <a href="<?= base_url('login') ?>">Log in</a></p>
</div>

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