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

{% block title %}登录 - {{ site_name }}{% endblock %}

{% block content %}
<div class="min-h-screen flex items-center justify-center py-12 px-4">
    <div class="max-w-md w-full space-y-8">
        <div class="text-center">
            <h2 class="text-3xl font-bold text-white">登录账户</h2>
            <p class="mt-2 text-gray-400">请使用管理员提供的账户登录</p>
        </div>

        <form method="post" class="mt-8 space-y-6 bg-gray-900 border border-gray-800 rounded-lg p-8">
            {% csrf_token %}

            {% if messages %}
                <div class="space-y-2">
                    {% for message in messages %}
                        <div class="p-3 rounded-lg {% if message.tags == 'error' %}bg-red-900/30 border border-red-800 text-red-400{% else %}bg-blue-900/30 border border-blue-800 text-blue-400{% endif %}">
                            {{ message }}
                        </div>
                    {% endfor %}
                </div>
            {% endif %}

            <div class="space-y-4">
                <div>
                    <label for="username" class="block text-gray-300 text-sm mb-2">用户名</label>
                    <input type="text"
                           id="username"
                           name="username"
                           required
                           class="w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                           placeholder="请输入用户名">
                </div>

                <div>
                    <label for="password" class="block text-gray-300 text-sm mb-2">密码</label>
                    <input type="password"
                           id="password"
                           name="password"
                           required
                           class="w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
                           placeholder="请输入密码">
                </div>
            </div>

            <div>
                <button type="submit"
                        class="w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition duration-200">
                    登录
                </button>
            </div>

            <div class="text-center">
                <p class="text-gray-500 text-sm">
                    需要账户？请联系管理员创建
                </p>
            </div>
        </form>
    </div>
</div>
{% endblock %}