{% extends "base.html" %}
{% block title %}Register — Quartermaster{% endblock %}
{% block flash %}{% endblock %}
{% block content %}
<div class="card auth-card auth-center">
    <h2>Register</h2>
    {% if let Some(error) = error %}
    <div class="alert alert-error">{{ error }}</div>
    {% endif %}
    <form method="post" action="/register">
        <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
        <input type="hidden" name="code" value="{{ code }}">
        <label for="profile">SPT Profile</label>
        <select id="profile" name="profile_id" required>
            <option value="">— Select your profile —</option>
            {% for p in profiles %}
            <option value="{{ p.aid }}">{{ p.username }}</option>
            {% endfor %}
        </select>
        <label for="password">Password</label>
        <input type="password" id="password" name="password" required minlength="4">
        <label for="password_confirm">Confirm Password</label>
        <input type="password" id="password_confirm" name="password_confirm" required minlength="4">
        <button type="submit" class="btn">Register</button>
    </form>
</div>
{% endblock %}
