{% extends "base.html" %}

{% block title %}Login - Inspection Reporting{% endblock %}

{% block content %}
<div class="max-w-md w-full mx-auto bg-white rounded-lg shadow-md overflow-hidden">
    <div class="px-6 py-8">
        <h2 class="text-2xl font-bold text-center mb-6 text-gray-800">Login to Your Account</h2>
        <form method="POST" action="{{ url_for('auth.login') }}">
            {{ form.hidden_tag() }}
            <div class="mb-4">
                <label for="{{ form.username.id }}" class="block text-sm font-medium text-gray-700 mb-2">Username</label>
                {{ form.username(class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent") }}
                {% if form.username.errors %}
                    <span class="text-red-500 text-sm">{{ form.username.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="mb-6">
                <label for="{{ form.password.id }}" class="block text-sm font-medium text-gray-700 mb-2">Password</label>
                {{ form.password(class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent") }}
                {% if form.password.errors %}
                    <span class="text-red-500 text-sm">{{ form.password.errors[0] }}</span>
                {% endif %}
            </div>
            <div class="flex items-center justify-between">
                <div class="flex items-center">
                    {{ form.remember(class="h-4 w-4 text-primary-600 focus:ring-primary-500") }}
                    <label for="{{ form.remember.id }}" class="ml-2 block text-sm text-gray-700">Remember me</label>
                </div>
                <a href="#" class="text-sm text-blue-600 hover:underline">Forgot password?</a>
            </div>
            <div class="mt-6">
                {{ form.submit(class="w-full bg-primary-600 hover:bg-primary-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2") }}
            </div>
        </form>
        <div class="mt-8 text-center text-sm text-gray-500">
            <p>Don't have an account? Contact your administrator to create one.</p>
        </div>
    </div>
</div>
{% endblock %}