{% extends "themis/base.html" %}

{% block title %}Reset Password — {{ themis_app_name }}{% endblock %}

{% block content %}
<div class="flex justify-center items-center min-h-[60vh]">
    <div class="card bg-base-200 shadow-xl w-full max-w-md">
        <div class="card-body">
            <h2 class="card-title text-2xl justify-center mb-2">Reset Password</h2>
            <p class="text-base-content/70 text-center mb-4">
                Enter your email address and we'll send you a link to reset your password.
            </p>

            {% if form.errors %}
            <div class="alert alert-error mb-4">
                <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 shrink-0" fill="none"
                     viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                          d="M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
                </svg>
                <div>
                    {% for field in form %}
                        {% for error in field.errors %}
                        <p>{{ error }}</p>
                        {% endfor %}
                    {% endfor %}
                </div>
            </div>
            {% endif %}

            <form method="post">
                {% csrf_token %}

                <div class="form-control mb-6">
                    <label class="label" for="id_email">
                        <span class="label-text">Email address</span>
                    </label>
                    <input type="email" name="email" id="id_email"
                           class="input input-bordered w-full"
                           autofocus required maxlength="254">
                </div>

                <div class="form-control mt-2">
                    <button type="submit" class="btn btn-primary w-full">Send Reset Link</button>
                </div>
            </form>

            <div class="divider">OR</div>

            <div class="text-center">
                <a href="{% url 'account_login' %}" class="link link-hover text-sm">Back to Log In</a>
            </div>
        </div>
    </div>
</div>
{% endblock %}
