{% extends "base.html" %}
{% block title %}Reset Password — Quartermaster{% endblock %}
{% block content %}
<div style="max-width:400px;margin:2rem auto">
    <h1>Set New Password</h1>
    {% if let Some(err) = error %}
    <div class="toast toast-error">{{ err }}</div>
    {% endif %}
    {% if token_valid %}
    <form method="post" action="/reset-password">
        <input type="hidden" name="csrf_token" value="{{ csrf_token }}">
        <input type="hidden" name="token" value="{{ token }}">
        <div class="form-group">
            <label for="password">New Password</label>
            <input type="password" name="password" id="password" minlength="8" maxlength="128" required>
        </div>
        <div class="form-group">
            <label for="password_confirm">Confirm Password</label>
            <input type="password" name="password_confirm" id="password_confirm" minlength="8" maxlength="128" required>
        </div>
        <button type="submit" class="btn" style="width:100%">Set Password</button>
    </form>
    {% endif %}
</div>
{% endblock %}
