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

{% block title %}Redirection externe - Association E-Cosplay{% endblock %}

{% block header %}
    <header class="sticky top-0 z-50 glass-heavy" >
        <div class="flex justify-center items-center h-16">
            <a href="{{ path('app_home') }}" aria-label="CRM E-Cosplay - Accueil">
                <img class="h-10 md:h-12 w-auto" src="{{ 'logo.jpg' | imagine_filter('logo') }}" alt="CRM E-Cosplay" loading="eager">
            </a>
        </div>
    </header>
{% endblock %}

{% block body %}
<div class="flex items-center justify-center min-h-[calc(100vh-5rem)] px-4">
    <div class="w-full max-w-md">
        <div class="glass-heavy overflow-hidden p-8 text-center">
            <div class="mb-4">
                <svg class="w-12 h-12 mx-auto text-yellow-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"/></svg>
            </div>
            <h1 class="text-xl font-bold uppercase mb-2">Redirection externe</h1>
            <p class="text-sm text-gray-600 mb-4">Vous etes sur le point de quitter CRM E-Cosplay pour un site externe.</p>

            {% if url %}
                <div class="border-2 border-gray-200 bg-gray-50 p-3 mb-6 break-all">
                    <p class="text-xs font-mono text-gray-500">{{ url }}</p>
                </div>

                <div class="flex flex-col gap-3">
                    <a href="{{ url }}" rel="noopener noreferrer" class="w-full px-6 py-3 btn-gold text-sm font-bold uppercase tracking-wider text-gray-900 text-center">
                        Continuer
                    </a>
                    <a href="{{ path('app_home') }}" class="text-xs font-bold text-gray-500 hover:text-indigo-600 transition-colors">
                        Retour a l'accueil
                    </a>
                </div>
            {% else %}
                <p class="text-sm text-red-600 font-bold mb-4">Aucune URL de redirection fournie.</p>
                <a href="{{ path('app_home') }}" class="inline-block px-6 py-3 glass bg-[#fabf04] font-bold uppercase text-sm tracking-widest hover:bg-yellow-500 transition-all">
                    Retour a l'accueil
                </a>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}
