{% trans_default_domain 'admin' %}
{% set title = title|default('pageTitle') %}

{% extends '@FerienpassAdmin/layout/base.html.twig' %}

{% block body %}

    {% set logo = logo|default('bundles/ferienpassadmin/images/ferienpass-logo.svg') %}
    {% set splashImage = splashImage|default('bundles/ferienpassadmin/images/splash.jpg') %}

    <div class="min-h-screen flex">

        <div class="flex-1 flex flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">

            {% block main %}
                <div class="mx-auto w-full max-w-sm">
                    <div>
                        {% block logo %}
                            <div class="w-48">
                                <img class="max-h-24 w-auto" src="{{ brand_logo() ?? asset(logo) }}" alt="Logo"/>
                            </div>
                        {% endblock %}

                        <h2 class="mt-4 text-3xl leading-9 font-extrabold text-gray-900 dark:text-gray-50">
                            {{ title|trans }}
                        </h2>
                    </div>

                    {% block content %}
                    {% endblock %}

                    <div class="mt-12 flex justify-center">
                        <a href="https://ferienpass.online" target="_blank"
                           class="opacity-50 filter-grayscale hover:filter-none hover:opacity-100 transition duration-150">
                            <img class="h-6"
                                 src="{{ asset('bundles/ferienpassadmin/images/ferienpass-logo.svg') }}" alt="">
                        </a>
                    </div>
                </div>
            {% endblock %}
        </div>

        <div class="hidden lg:block relative w-0 flex-1 dark:opacity-70">
            <img class="absolute inset-0 h-full w-full object-cover" src="{{ asset(splashImage) }}" alt="">
        </div>
    </div>

    {# minimal.html.twig overrides base's {% block body %} entirely, so it
       must mount the flash container itself. Without this, the cookie-driven
       flash flow (FOS FlashMessageListener → `flashes` cookie → Stimulus
       controller inside <twig:Admin:Notifications />) has no target and
       flashes on login/lost-password/etc. would never appear. #}
    <twig:Admin:Notifications />

{% endblock %}
