{# Success panel — replaces the form right after a successful application.
   Lot mode words it as a lottery entry instead of an instant confirmation.
   Include WITHOUT `only` (needs offer, applicationSystem). #}

{% set is_lot = applicationSystem is not null and applicationSystem.type == 'lot' %}

<div class="px-2 py-6 text-center">
    <div class="mx-auto mb-4 grid size-16 place-items-center rounded-full bg-[#e5efe9] text-[#2f6f57] dark:bg-[#2f6f57]/20 dark:text-[#5f9a7e]">
        <twig:ux:icon name="lucide:check" class="size-8" />
    </div>
    <h3 class="text-2xl font-semibold tracking-tight text-gray-900 dark:text-gray-50">
        {{ (is_lot ? 'applicationForm.success.titleLot' : 'applicationForm.success.title')|trans({}, 'cms') }}
    </h3>
    <p class="mx-auto mt-2 max-w-md text-sm leading-6 text-gray-600 dark:text-gray-300">
        {{ (is_lot ? 'applicationForm.success.textLot' : 'applicationForm.success.text')|trans({offer: offer.name}, 'cms') }}
    </p>

    <div class="mt-6 flex flex-wrap items-center justify-center gap-2.5">
        <twig:Cms:Button variant="secondary"
                         href="{{ path('cms', { to: 'offer_list', edition: offer.edition }) }}">
            {{ 'applicationForm.success.browse'|trans({}, 'cms') }}
        </twig:Cms:Button>
        <twig:Cms:Button variant="primary"
                         href="{{ path('cms', { to: 'applications' }) }}">
            {{ 'applicationForm.success.toApplications'|trans({}, 'cms') }}
        </twig:Cms:Button>
    </div>

    {# back into the form, e.g. to register a sibling — `proceed` with an
       unknown id is a no-op re-render that clears the one-off confirm #}
    <button type="button"
            data-action="live#action"
            data-live-action-param="proceed"
            data-live-participant-param="0"
            class="mt-5 text-xs font-medium text-gray-500 underline-offset-2 hover:text-gray-700 hover:underline dark:text-gray-400 dark:hover:text-gray-200">
        {{ 'applicationForm.success.another'|trans({}, 'cms') }}
    </button>
</div>
