<!DOCTYPE html>
<html lang="fr"  th:replace="~{modele-page :: layout('Login',~{::link} , ~{::#container-main})}" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<body>
<div class="container" id="container-main">
    <div class="row justify-content-center mt-5">
        <div class="col-md-6">
            <h2 class="text-center mb-4">Pour se Connecter :</h2>
            <form th:action="@{/login}" method="post">
                <div class="mb-3">
                    <label for="username" class="form-label">Identifiant:</label>
                    <input type="text" class="form-control" name="username" id="username" placeholder="Entrez votre identifiant" th:value="${savedUsername}"/>
                </div>
                <div class="mb-3">
                    <label for="password" class="form-label">Mot de passe:</label>
                    <input type="password" class="form-control" name="password" id="password" placeholder="Entrez votre mot de passe" th:value="${savedPassword}"/>
                </div>
                <div class="mb-3 form-check">
                    <input type="checkbox" class="form-check-input" id="remember-me" name="remember-me">
                    <label class="form-check-label" for="remember-me">Se souvenir de moi</label>
                </div>
                <div class="mb-3">
                    <a href="/forgotPassword">Mot de passe oublié</a>
                </div>
                <div class="mb-3">
                    <button type="submit" class="btn btn-primary">Connexion</button>
                    <a class="btn btn-warning text-light" href="/inscription">Créer un compte</a>
                </div>
            </form>
            <div th:if="${param.error}" class="text-danger">
                Identifiant ou mot de passe incorrect
            </div>
            <div th:if="${param.logout}" class="text-success">
                Vous avez été déconnecté
            </div>
            <div th:if="${param.emailForForgotPassword}" class="text-danger">
                Vous devez entrée une adresse mail valide !
            </div>
        </div>
    </div>
</div>
</body>
</html>