{% extends 'base.html.twig' %}

{% block body %}
    <div class="min-h-screen flex items-center justify-center bg-[#0a0a0a] px-4 sm:px-6 lg:px-8">
        <div class="w-full max-w-[90%] sm:max-w-md">
            <div class="text-center mb-8">
                <h2 class="text-xl sm:text-2xl font-medium text-gray-200">Abiball Admin Panel</h2>
            </div>

            {% if error %}
                <div class="bg-red-500 text-white p-2 rounded-md">
                {{ error.message }}
                </div>
            {% endif %}

            <form method="post" class="space-y-4 sm:space-y-6" action="{{ path('admin_login') }}">
                <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
                
                <div>
                    <label for="username" class="block text-sm font-medium text-gray-300">Benutzername</label>
                    <div class="mt-1 relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <twig:ux:icon name="mdi:account" class="h-4 w-4 sm:h-5 sm:w-5 text-gray-500" />
                        </div>
                        <input type="text" 
                               id="username"
                               name="_username"
                               required
                               class="block w-full pl-9 sm:pl-10 py-2 sm:py-2.5 text-sm sm:text-base bg-[#2a2a2a] border border-[#333333] text-gray-200 rounded-md focus:ring-2 focus:ring-orange-500/20 focus:border-orange-500 transition-colors" 
                               placeholder="username" />
                    </div>
                </div>

                <div>
                    <label for="password" class="block text-sm font-medium text-gray-300">Passwort</label>
                    <div class="mt-1 relative">
                        <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                            <twig:ux:icon name="mdi:lock" class="h-4 w-4 sm:h-5 sm:w-5 text-gray-500" />
                        </div>
                        <input type="password" 
                               id="password"
                               name="_password"
                               required
                               class="block w-full pl-9 sm:pl-10 py-2 sm:py-2.5 text-sm sm:text-base bg-[#2a2a2a] border border-[#333333] text-gray-200 rounded-md focus:ring-2 focus:ring-orange-500/20 focus:border-orange-500 transition-colors" 
                               placeholder="••••••••" />
                    </div>
                </div>

                <hr>

                <div>
                    <button type="submit" 
                            class="w-full flex justify-center py-2 sm:py-2.5 px-4 text-sm sm:text-base bg-orange-500 hover:bg-orange-600 text-white font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#0a0a0a] focus:ring-orange-500 transition-colors">
                        Anmelden
                    </button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}