<section class="features-section"><div class="container">
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="text-center mb-4"><h2>Verify <span style="color:var(--secondary)">Certificate</span></h2><p class="text-secondary">Enter a certificate number or scan a QR code to verify authenticity.</p></div>
<?php if (!empty($error)): ?><div class="alert-cix alert-cix-error"><i class="fas fa-exclamation-circle"></i> <?= $error ?></div><?php endif; ?>
<div class="card-cix">
    <form method="POST"><div class="form-group-cix"><label class="form-label-cix">Certificate Number</label><input type="text" name="certificate_number" class="form-control-cix" placeholder="COA-CERT-2026-000001" required value="<?= e($_POST['certificate_number'] ?? '') ?>"></div>
    <button type="submit" class="btn-cix btn-cix-primary w-100"><i class="fas fa-search me-1"></i> Verify</button></form>
</div>
<?php if (!empty($result)): ?>
<div class="certificate-card mt-4">
    <div class="cert-header"><p style="color:var(--secondary);font-weight:800">CIX ORBIT ACADEMY</p><p class="small">Certificate of Completion</p></div>
    <div class="cert-body">
        <p>This certifies that</p>
        <div class="cert-name"><?= e($result['student_name']) ?></div>
        <p>has successfully completed</p>
        <div class="cert-course"><?= e($result['course_name']) ?></div>
        <p class="mt-2">Student Number: <?= e($result['student_number']) ?></p>
        <p>Certificate Number: <strong><?= e($result['certificate_number']) ?></strong></p>
        <p>Final Mark: <?= $result['final_mark'] ?>% | Date: <?= date('d M Y', strtotime($result['issue_date'])) ?></p>
    </div>
    <div class="cert-footer"><div><p class="text-secondary small mb-0">CIX Connect</p><p class="text-secondary small">Academy Director</p></div><div><p class="text-secondary small mb-0"><?= date('d M Y') ?></p><p class="text-secondary small">Date of Issue</p></div></div>
</div>
<?php endif; ?>
</div></div></div></section>
