{% extends "base.html" %}

{% block title %}Reset Password - {{ config.INSTANCE_NAME }}{% endblock %}

{% block content %}
<div class="login-container">
    <div class="login-card">
        <h2>Reset Your Password</h2>
        <p class="login-description">
            Enter a new password for your account.
        </p>

        <div class="account-email">
            <strong>{{ email }}</strong>
        </div>

        {% if error %}
        <div class="flash flash-error">{{ error }}</div>
        {% endif %}

        <form method="POST" action="/auth/password/reset/confirm" class="login-form">
            <input type="hidden" name="email" value="{{ email }}">
            <input type="hidden" name="token" value="{{ token }}">

            <div class="form-group">
                <label for="password">New Password</label>
                <input type="password"
                       id="password"
                       name="password"
                       placeholder="Create a strong password"
                       required
                       autocomplete="new-password"
                       minlength="8"
                       autofocus>
                <small class="form-hint">At least 8 characters.</small>
            </div>

            <div class="form-group">
                <label for="confirm_password">Confirm Password</label>
                <input type="password"
                       id="confirm_password"
                       name="confirm_password"
                       placeholder="Re-enter your password"
                       required
                       autocomplete="new-password"
                       minlength="8">
            </div>

            <button type="submit" class="btn btn-primary btn-block">Reset Password</button>
        </form>

        <div class="login-links">
            <a href="/login/password" class="btn btn-link">Back to Login</a>
        </div>
    </div>
</div>
{% endblock %}
