{% extends "accounts/login.html" %}

{% block content %}
<div class="container-fluid min-vh-100 d-flex align-items-center justify-content-center py-4">
    <div class="auth-wrapper w-100" style="max-width: 500px;">
        <div class="auth-card row g-0">
            <div class="col-12 auth-form-side">
                
                <div class="text-center mb-4">
                    <div class="auth-brand-mark mx-auto mb-3">
                        <i class="fas fa-key fa-2x text-primary d-block"></i>
                    </div>
                    <h2 class="auth-title mb-2">Reset Password</h2>
                    <p class="auth-subtitle mb-0">
                        Enter your email address and we'll send you a link to securely reset your password.
                    </p>
                </div>

                <form method="post" novalidate>
                    {% csrf_token %}
                    
                    {% if form.non_field_errors %}
                        <div class="alert alert-danger mb-3" role="alert">
                            {% for error in form.non_field_errors %}
                                <div>{{ error }}</div>
                            {% endfor %}
                        </div>
                    {% endif %}

                    <div class="mb-4">
                        <label for="id_email" class="auth-input-label mb-1">Email Address</label>
                        <input
                            type="email"
                            name="email"
                            required
                            id="id_email"
                            class="form-control form-control-auth"
                            placeholder="e.g. you@yourcompany.com"
                            autofocus>
                        {% if form.email.errors %}
                            <div class="invalid-feedback d-block">
                                {{ form.email.errors.0 }}
                            </div>
                        {% endif %}
                    </div>

                    <div class="d-grid mb-4">
                        <button type="submit" class="btn btn-auth-primary">
                            Send Reset Link <i class="fas fa-arrow-right ms-2"></i>
                        </button>
                    </div>

                    <div class="text-center">
                        <a href="{% url 'login' %}" class="text-decoration-none small fw-semibold text-muted">
                            <i class="fas fa-arrow-left me-1"></i> Back to login
                        </a>
                    </div>
                </form>

            </div>
        </div>
        
        <div class="text-center mt-3 auth-footer-text text-light">
            &copy; {% now "Y" %} SwiftPOS. Safe & Secure System.
        </div>
    </div>
</div>
{% endblock %}
