<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Mot de passe oublié | RJLResaka</title>
    <meta name="description" content="Générez un lien de réinitialisation du mot de passe pour votre compte RJLResaka.">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/app.css">
</head>
<body class="auth-body">
    <main class="auth-shell branded">
        <section class="auth-panel glass">
            <div class="auth-brand">
                <img src="${pageContext.request.contextPath}/assets/img/logo_resaka.png" alt="Logo RJLResaka" width="56" height="56">
                <div><strong>RJLResaka</strong><span>Réinitialisation</span></div>
            </div>
            <a class="ghost-link" href="${pageContext.request.contextPath}/login">← Retour</a>
            <span class="hero-badge">Réinitialisation</span>
            <h1>Mot de passe oublié</h1>
            <p class="auth-copy">Entrez votre email. Pour l'instant, le lien est affiché à l'écran; ensuite vous pourrez brancher JavaMail.</p>
            <% if (request.getAttribute("error") != null) { %><div class="alert error"><%= request.getAttribute("error") %></div><% } %>
            <% if (request.getAttribute("success") != null) { %><div class="alert success"><%= request.getAttribute("success") %></div><% } %>
            <form action="${pageContext.request.contextPath}/forgot-password" method="post" class="stack-form">
                <label><span>Email</span><input type="email" name="email" required></label>
                <button class="button primary" type="submit">Générer le lien</button>
            </form>
            <% if (request.getAttribute("resetLink") != null) { %><div class="token-box"><strong>Lien généré :</strong><br><span><%= request.getAttribute("resetLink") %></span><br><br><strong>Token :</strong> <%= request.getAttribute("generatedToken") %></div><% } %>
            <% if (request.getAttribute("debugMessage") != null) { %><p class="debug-note">Détail technique: <%= request.getAttribute("debugMessage") %></p><% } %>
        </section>
    </main>
    <script src="${pageContext.request.contextPath}/assets/js/app.js"></script>
</body>
</html>
