<?php
/**
 * Minimal shell for unauthenticated flows (forgot/reset password).
 * Matches SSBS-ISCMS tokens: Bootstrap 5, Remix, iscms-app.css, brand gradient.
 */
declare(strict_types=1);

require_once __DIR__ . '/iscms_layout.php';

function iscms_public_session(): void
{
    if (session_status() === PHP_SESSION_NONE) {
        session_start();
    }
}

function iscms_public_head(string $htmlTitle): void
{
    iscms_public_session();
    ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= iscms_h($htmlTitle) ?> - SSBS-ISCMS</title>
    <meta name="robots" content="noindex, nofollow">
    <link rel="stylesheet" href="assets/libs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/libs/remixicon/remixicon.css">
    <link rel="stylesheet" href="assets/css/iscms-app.css">
    <style>
        .iscms-public-auth-body {
            min-height: 100vh;
            background: linear-gradient(135deg, #0d1f3c 0%, #1a3a6b 50%, #1a4a2e 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
        }
        .iscms-public-auth-card {
            max-width: 440px;
            width: 100%;
            background: #fff;
            border-radius: 16px;
            box-shadow: 0 25px 60px rgba(0,0,0,.35);
            overflow: hidden;
        }
        .iscms-public-auth-card .iscms-pub-h {
            background: var(--ssbs-blue, #1a3a6b);
            color: #fff;
            padding: 1.25rem 1.5rem;
            font-weight: 600;
            font-size: 1.05rem;
        }
        .iscms-public-auth-card .iscms-pub-b { padding: 1.5rem; }
        .iscms-public-auth-card .iscms-pub-foot {
            padding: 0 1.5rem 1.25rem;
            font-size: .82rem;
        }
        .iscms-public-auth-card a.brand-back { color: var(--ssbs-blue, #1a3a6b); text-decoration: none; font-weight: 500; }
        .iscms-public-auth-card a.brand-back:hover { text-decoration: underline; }
    </style>
</head>
<body class="iscms-public-auth-body">
<div class="iscms-public-auth-card">
<?php
}

function iscms_public_foot(): void
{
    ?>
</div>
<script src="assets/libs/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>
<?php
}
