<?php

ob_start();

?>

<div class="container py-5">

    <div class="row justify-content-center">

        <div class="col-md-5 col-lg-4">

            <div class="card shadow-sm">

                <div class="card-body p-4">

                    <h3 class="text-center mb-2">
                        HR Biometric Platform
                    </h3>

                    <p class="text-center text-muted mb-4">
                        Sign in to continue
                    </p>

                    <?php if (!empty($installed)): ?>

                        <div class="alert alert-success">

                            Administrator account created successfully.
                            You can now sign in.

                        </div>

                    <?php endif; ?>

                    <?php if (!empty($error)): ?>

                        <div class="alert alert-danger">

                            <?= htmlspecialchars(
                                $error,
                                ENT_QUOTES,
                                'UTF-8'
                            ) ?>

                        </div>

                    <?php endif; ?>

                    <form
                        method="POST"
                        action="/public/login">

                        <div class="mb-3">

                            <label class="form-label">
                                Username
                            </label>

                            <input
                                type="text"
                                name="username"
                                class="form-control"
                                autocomplete="username"
                                required
                                autofocus>

                        </div>

                        <div class="mb-3">

                            <label class="form-label">
                                Password
                            </label>

                            <input
                                type="password"
                                name="password"
                                class="form-control"
                                autocomplete="current-password"
                                required>

                        </div>

                        <button
                            type="submit"
                            class="btn btn-primary w-100">

                            Login

                        </button>

                    </form>

                </div>

            </div>

        </div>

    </div>

</div>

<?php

$content = ob_get_clean();

$title = 'Login';

include APP_PATH .
    '/Modules/Administration/Views/layouts/main.php';