<?php
session_start();
if (!isset($_SESSION['email'])) {
    header('Location: index.php');
    exit;
}
?>
<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Verifikasi OTP</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <form action="verify_otp.php" method="post" class="mt-5">
        <h3 class="text-center">Masukkan Kode OTP</h3>
        <?php if (isset($_SESSION['status'])) {
            $split = explode(',', $_SESSION['status']);
            echo "<div class='alert alert-{$split[0]}'>{$split[1]}</div>";
            unset($_SESSION['status']);
        } ?>
        <div class="mb-3">
            <label for="otp">Kode OTP</label>
            <input type="text" class="form-control" name="otp" id="otp" required maxlength="6">
        </div>
        <button type="submit" class="btn btn-primary w-100">Verifikasi</button>
        <!-- <p class="mt-3 text-center">Tidak menerima kode? <a href="resend.php">Kirim ulang OTP</a></p> -->
    </form>
</div>
</body>
</html>
