{% extends 'admin/_layout.html.twig' %}

{% block title %}Nouveau revendeur - Administration - Association E-Cosplay{% endblock %}

{% block admin_content %}
<div class="page-container">
    <div class="flex items-center justify-between mb-8">
        <h1 class="text-2xl font-bold heading-page">Nouveau revendeur</h1>
        <a href="{{ path('app_admin_revendeurs_index') }}" class="px-4 py-2 glass font-bold uppercase text-xs tracking-widest hover:bg-gray-900 hover:text-white transition-all">Retour</a>
    </div>

    {% for type, messages in app.flashes %}
        {% for message in messages %}
            <div class="mb-6 p-4 glass font-medium text-sm {{ type == 'success' ? 'border-green-300 text-green-800' : 'border-red-300 text-red-800' }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endfor %}

    <form method="post" action="{{ path('app_admin_revendeurs_create') }}" class="flex flex-col gap-6">

        <section class="glass p-6">
            <h2 class="text-sm font-bold uppercase tracking-wider mb-4">Identite</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div>
                    <label for="firstName" class="block text-xs font-bold uppercase tracking-wider mb-2">Prenom *</label>
                    <input type="text" id="firstName" name="firstName" required placeholder="Prenom"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
                <div>
                    <label for="lastName" class="block text-xs font-bold uppercase tracking-wider mb-2">Nom *</label>
                    <input type="text" id="lastName" name="lastName" required placeholder="Nom"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
                <div>
                    <label for="email" class="block text-xs font-bold uppercase tracking-wider mb-2">Email *</label>
                    <input type="email" id="email" name="email" required placeholder="email@exemple.fr"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
            </div>
        </section>

        <section class="glass p-6">
            <h2 class="text-sm font-bold uppercase tracking-wider mb-4">Entreprise</h2>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <div>
                    <label for="raisonSociale" class="block text-xs font-bold uppercase tracking-wider mb-2">Raison sociale</label>
                    <input type="text" id="raisonSociale" name="raisonSociale" placeholder="Nom de l'entreprise"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
                <div>
                    <label for="siret" class="block text-xs font-bold uppercase tracking-wider mb-2">SIRET</label>
                    <input type="text" id="siret" name="siret" maxlength="14" placeholder="12345678901234"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
                <div>
                    <label for="phone" class="block text-xs font-bold uppercase tracking-wider mb-2">Telephone</label>
                    <input type="tel" id="phone" name="phone" placeholder="06 12 34 56 78"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
            </div>
        </section>

        <section class="glass p-6">
            <h2 class="text-sm font-bold uppercase tracking-wider mb-4">Adresse</h2>
            <div class="flex flex-col gap-4">
                <div>
                    <label for="address" class="block text-xs font-bold uppercase tracking-wider mb-2">Adresse</label>
                    <input type="text" id="address" name="address" placeholder="Numero et rue"
                           class="w-full px-4 py-3 input-glass text-sm font-medium">
                </div>
                <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                    <div>
                        <label for="zipCode" class="block text-xs font-bold uppercase tracking-wider mb-2">Code postal</label>
                        <input type="text" id="zipCode" name="zipCode" maxlength="10" placeholder="02800"
                               class="w-full px-4 py-3 input-glass text-sm font-medium">
                    </div>
                    <div>
                        <label for="city" class="block text-xs font-bold uppercase tracking-wider mb-2">Ville</label>
                        <input type="text" id="city" name="city" placeholder="Saint-Quentin"
                               class="w-full px-4 py-3 input-glass text-sm font-medium">
                    </div>
                </div>
            </div>
        </section>

        <section class="glass p-6">
            <h2 class="text-sm font-bold uppercase tracking-wider mb-4">Options</h2>
            <label for="rev-create-isUseStripe" class="flex items-center gap-2 cursor-pointer">
                <input type="checkbox" id="rev-create-isUseStripe" name="isUseStripe" value="1" class="accent-[#fabf04]">
                <span class="text-xs font-bold">Activer Stripe Connect</span>
            </label>
        </section>

        <div>
            <p class="text-xs text-gray-500 mb-4">Le code revendeur (EC-XXXX) sera genere automatiquement. Le mot de passe temporaire sera envoye par email.</p>
            <button type="submit"
                    class="px-6 py-3 btn-gold text-sm font-bold uppercase tracking-wider text-gray-900">
                Creer le revendeur
            </button>
        </div>
    </form>
</div>
{% endblock %}
