{% extends 'base.html' %}
{% load static %}
{% block title %}Passwort zurücksetzen{% endblock %}
{% block content %}
    <div class="grid place-content-center h-120 mt-12 mb-12 ">
    <div class="w-80 p-4 m-2 border-blue-600 border-2 rounded-xl shadow-md lg:w-90">
        <h2 class="text-2xl text-center p-4 font-black dark:text-white">Passwort zurücksetzen</h2>
        {% if validlink %} 
        <form class="space-y-4" method="post">
            {% if form.errors %}
            <div class=" items-center text-red-600 font-black overflow-x-auto break-words text-center">
                <ul>
                    {% for field, errors in form.errors.items %}
                        {% for error in errors %}
                            <li>{{ error }}</li>
                        {% endfor %}
                    {% endfor %}
                </ul>
            </div>
            {% endif %}
            {% csrf_token %}
            
        <div class="register">
            
            <span class="dark:text-white">{{ form.new_password1.label_tag }}   </span> 
            <input type="password" name="new_password1" placeholder="NEUES PASSWORT" /> 
        </div>
            <div class="register ">
            <span class="dark:text-white">{{ form.new_password2.label_tag }}  </span>
            <input type="password" name="new_password2" placeholder="NEUES PASSWORT WIEDERHOLEN" /> 

        </div>
            <button class="w-full p-3 rounded-full bg-blue-600 text-white font-black hover:scale-105 transition duration-200" type="submit">Bestätigen</button>
            <button class="text-center text-sm w-full mt-2 font-light text-blue-600"><a href="{% url 'accounts:home' %}" class="register_link">Doch nicht zurücksetzen?</a></button>
        </form>
        {% else %}
        Dieser Link ist leider nicht mehr gültig oder abgelaufen. Bitte versuchen Sie es erneut:
        <button class="text-center text-sm w-full mt-2 font-light text-blue-600"><a href="{% url 'accounts:password_reset' %}" class="register_link">Passwort zurücksetzen</a></button>
        {% endif %}
      
    </div>
    </div>
{% endblock %}