<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <script src="https://unpkg.com/htmx.org@1.9.11"></script>
    <meta charset="UTF-8">
    <title>Changement de mot de passe - AS Talange</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <style>
        body { font-family: 'Inter', sans-serif; }
    </style>
</head>
<body class="bg-gray-50 flex items-center justify-center min-h-screen">

<div class="bg-white p-8 rounded-2xl shadow-xl w-full max-w-md border border-gray-100">
    <div class="text-center mb-8">
        <h1 class="text-3xl font-bold text-gray-900 mb-2">Première connexion</h1>
        <p class="text-gray-500">Pour des raisons de sécurité, veuillez modifier votre mot de passe temporaire.</p>
    </div>

    <div th:if="${error}" class="bg-red-50 text-red-600 p-4 rounded-lg mb-6 text-sm" th:text="${error}">
        Une erreur est survenue.
    </div>

    <form th:action="@{/change-password}" method="post" class="space-y-6">
        <div>
            <label for="newPassword" class="block text-sm font-medium text-gray-700 mb-1">Nouveau mot de passe</label>
            <input type="password" id="newPassword" name="newPassword" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors" required autofocus>
            <p class="text-xs text-gray-400 mt-1">Le mot de passe doit être différent de AsTalange123.</p>
        </div>

        <div>
            <label for="confirmPassword" class="block text-sm font-medium text-gray-700 mb-1">Confirmer le nouveau mot de passe</label>
            <input type="password" id="confirmPassword" name="confirmPassword" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors" required>
        </div>

        <button type="submit" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-4 rounded-lg transition-colors duration-200">
            Enregistrer le mot de passe
        </button>
    </form>
</div>

</body>
</html>
