<?= $this->extend('layout/auth') ?>
<?= $this->section('content') ?>

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

<form method="POST" action="/login">
    <?= csrf_field() ?>
    <div class="mb-3">
        <label class="form-label">Email</label>
        <input type="email" name="email" class="form-control" placeholder="admin@satt.tn" required autofocus>
    </div>
    <div class="mb-3">
        <label class="form-label">Mot de passe</label>
        <input type="password" name="password" class="form-control" placeholder="••••••••" required>
    </div>
    <div class="mb-3 d-flex justify-content-between align-items-center">
        <div class="form-check">
            <input type="checkbox" name="remember" class="form-check-input" id="remember">
            <label class="form-check-label" for="remember">Se souvenir de moi</label>
        </div>
        <a href="/forgot-password" class="small text-decoration-none">Mot de passe oublie?</a>
    </div>
    <button type="submit" class="btn btn-auth">Connexion</button>
</form>

<div class="text-center mt-3">
    <small class="text-muted">Demo: admin@satt.tn / admin123</small>
</div>

<?= $this->endSection() ?>
