<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $title ?? 'Authenticate — BOAFO' ?></title>
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500&display=swap" rel="stylesheet">
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- FontAwesome for Icons -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <!-- Custom Theme Stylesheet -->
    <link rel="stylesheet" href="<?= APP_URL ?>/assets/css/boafo.css">
    <style>
        body.auth-page {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4ebf5 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px 0;
        }
        .auth-card-container {
            width: 100%;
            max-width: 480px;
            padding: 0 15px;
        }
    </style>
</head>
<body class="auth-page">
    <div class="auth-card-container">
        <!-- Logo Header -->
        <div class="text-center mb-4">
            <a href="<?= APP_URL ?>" class="d-inline-flex align-items-center text-decoration-none">
                <i class="fa-solid fa-graduation-cap text-primary fs-2 me-2"></i>
                <span class="font-outfit fw-bold text-dark fs-3">BOAFO</span>
            </a>
            <p class="text-muted text-sm mt-1">Mentorship & University Transition System</p>
        </div>

        <?php if ($success = $_SESSION['flash']['success'] ?? null): unset($_SESSION['flash']['success']); ?>
            <div class="alert alert-success alert-dismissible fade show border-0 shadow-sm mb-3" role="alert">
                <i class="fa-solid fa-circle-check me-2"></i> <?= $success ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <?php if ($error = $_SESSION['flash']['error'] ?? null): unset($_SESSION['flash']['error']); ?>
            <div class="alert alert-danger alert-dismissible fade show border-0 shadow-sm mb-3" role="alert">
                <i class="fa-solid fa-circle-exclamation me-2"></i> <?= htmlspecialchars($error) ?>
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
            </div>
        <?php endif; ?>

        <!-- Render Child View Content -->
        <?= $content ?>

        <!-- Mini Footer -->
        <div class="text-center mt-4">
            <p class="text-xs text-muted">&copy; <?= date('Y') ?> BOAFO - Mentorship & University Transition System.</p>
        </div>
    </div>

    <!-- Bootstrap 5 Bundle JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
