{% extends 'base.html' %}
{% load widget_tweaks %}

{% block title %}login{% endblock title %}

{% block content %}

{% if messages %}
    {% for message in messages  %}
        {% if 'error' in message.tags %}
            {% include 'components/alert.html' with is_info=False title="Error" body=message %}
        {% endif %}
    {% endfor %}
{% endif %}

<div class="flex justify-center mt-10">
    <div class="border border-slate-300 rounded-lg p-6 w-1/2">
        <form method="POST" autocomplete="off">
            {% csrf_token %}
            {% for field in form %} 
        
                <div class="mb-4">
                    <label class="block text-gray-700 text-sm font-bold mb-2" for="{{ field.id_for_label }}">{{ field.label }}</label> 
                    {% render_field field class="bg-slate-100 dark:bg-slate-300 text-slate-800 rounded-lg p-3 drop-shadow-xl w-full" %} 
                </div> 
        
            {% endfor %} 
            <button type="submit" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Submit</button>
        </form>
    </div>
</div>

{% endblock content %}