{% form_theme form with app_form_themes() only %}

<div {{ attributes }}>
    {{ form_start(form, {
        attr: {
            class: 'mt-6 grid gap-4',
            'data-model': 'on(input)|*',
            'data-action': 'live#action:prevent',
            'data-live-action-param': 'submitRegister',
            novalidate: 'true'
        }
    }) }}
        <div class="grid gap-2">
            {{ form_label(form.email, null, {'label_attr': {'class': 'font-label text-[10px] font-semibold uppercase tracking-[0.16em] text-primary/70'}}) }}
            {{ form_widget(form.email, {'attr': {
                class: 'min-h-[46px] rounded-none border border-primary/12 bg-white px-4 text-[15px] text-primary placeholder:text-primary/35 outline-none transition focus:border-primary'
            }}) }}
            <div class="text-sm text-red-600">{{ form_errors(form.email) }}</div>
        </div>
        <label class="inline-flex items-start gap-3 border border-primary/10 bg-white px-4 py-3 text-sm leading-6 text-primary/72">
            {{ form_widget(form.marketingOptIn, {'attr': {'class': 'mt-1 border-primary/20 text-secondary focus:ring-0'}}) }}
            <span>{{ form.marketingOptIn.vars.label|trans({}, form.marketingOptIn.vars.translation_domain) }}</span>
        </label>
        <button
            type="submit"
            class="inline-flex min-h-[46px] items-center justify-center border border-primary bg-white px-5 py-3 font-label text-[10px] font-semibold uppercase tracking-[0.18em] text-primary transition hover:bg-primary hover:text-white disabled:cursor-not-allowed disabled:border-primary/20 disabled:text-primary/35 disabled:hover:bg-white"
            {% if not this.canSubmit %}disabled{% endif %}
        >
            {{ 'security.register.submit'|trans }}
        </button>
        <p class="text-xs leading-6 text-primary/65">
            {{ 'security.register.terms_prefix'|trans }}
            <a href="{{ path('legals') }}#conditions-utilisation" class="underline underline-offset-4 transition hover:text-primary">
                {{ 'security.register.terms_link'|trans }}
            </a>.
        </p>
        {% if form.captcha is defined %}
            {{ form_row(form.captcha) }}
        {% endif %}
        <div class="hidden">{{ form_rest(form) }}</div>
    {{ form_end(form) }}
</div>
