<?php
/**
 * Connexion admin (Tabler).
 * @var ?string $error
 */

use App\Core\Csrf;
use App\Core\Settings;
?>
<div class="text-center mb-4">
    <span class="h2"><?= e(Settings::get('site_title', 'DANIEL TIZIANI')) ?></span>
</div>
<form class="card card-md" method="post" action="<?= e(base_url('admin/login')) ?>">
    <div class="card-body">
        <h2 class="h3 text-center mb-4">Connexion à l'administration</h2>

        <?php if (!empty($error)): ?>
            <div class="alert alert-danger"><?= e($error) ?></div>
        <?php endif; ?>

        <?= Csrf::field() ?>

        <div class="mb-3">
            <label class="form-label">Email</label>
            <input type="email" name="email" class="form-control" placeholder="vous@exemple.com" required autofocus autocomplete="username">
        </div>
        <div class="mb-3">
            <label class="form-label">Mot de passe</label>
            <input type="password" name="password" class="form-control" placeholder="Mot de passe" required autocomplete="current-password">
        </div>
        <div class="form-footer">
            <button type="submit" class="btn btn-primary w-100">Se connecter</button>
        </div>
    </div>
</form>
