<%@ 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>Inscription | RJLResaka</title>
    <meta name="description" content="Créez votre compte RJLResaka pour discuter avec les autres utilisateurs.">
    <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 wide 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>Créer un compte</span></div>
            </div>
            <a class="ghost-link" href="${pageContext.request.contextPath}/home">← Retour</a>
            <span class="hero-badge">Inscription</span>
            <h1>Créez votre compte</h1>
            <p class="auth-copy">Une seule inscription suffit pour commencer vos discussions privées.</p>
            <% if (request.getAttribute("error") != null) { %><div class="alert error"><%= request.getAttribute("error") %></div><% } %>
            <form action="${pageContext.request.contextPath}/register" method="post" class="stack-form two-col">
                <label><span>Nom complet</span><input type="text" name="fullName" required></label>
                <label><span>Nom d'utilisateur</span><input type="text" name="username" required></label>
                <label><span>Email</span><input type="email" name="email" required></label>
                <label><span>Mot de passe</span><input type="password" name="password" required></label>
                <label><span>Confirmer le mot de passe</span><input type="password" name="confirmPassword" required></label>
                <div class="button-row"><button class="button primary" type="submit">Créer le compte</button></div>
            </form>
            <div class="auth-links left"><a href="${pageContext.request.contextPath}/login">J'ai déjà un compte</a></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>
