{% set form_url = page.header.typeform_url|default('https://form.typeform.com/to/XqgB4bDq') %}
{% set clean_url = form_url|split('?')|first|trim('/') %}
{% set form_id = clean_url|split('/')|last %}
{% set heading_tag = page.header.heading_level == 'h1' ? 'h1' : 'h2' %}
<section id="{{ page.header.anchor|default(page.slug)|e }}" class="form-section spacing-{{ page.header.spacing|default('standard')|e }} bg-{{ page.header.background|default('white')|e }}" aria-labelledby="{{ page.slug|e }}-heading">
    <div class="form-intro">
        <{{ heading_tag }} id="{{ page.slug|e }}-heading">{{ page.header.heading|default(page.title)|e }}</{{ heading_tag }}>
        {% if page.header.text %}<p>{{ page.header.text|e|nl2br }}</p>{% endif %}
    </div>
    <div class="form-wrapper">
        <div class="typeform" data-form-id="{{ form_id|e }}" aria-label="{{ page.header.form_label|default('Modulo Typeform')|e }}"></div>
        <p class="typeform-fallback">{{ page.header.fallback_text|default('Se il modulo non viene visualizzato,')|e }} <a href="{{ form_url|e }}">{{ page.header.fallback_link_text|default('aprilo direttamente su Typeform')|e }}</a>.</p>
    </div>
</section>