<style>
    @page {
        header: html_myHeader;
        footer: html_myFooter;
        margin-top: 3cm;
    }

    h1 {
        text-align: center;
        font-weight: bold;
        font-size: 16pt;
    }

    .content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .label {
        font-weight: bold;
    }

    .section {
        margin-bottom: 20pt;
    }

    .text-center {
        text-align: center;
    }

    .text-right {
        text-align: right;
    }

    .font-bold {
        font-weight: bold;
    }

    .underline {
        text-decoration: underline;
    }
</style>

<htmlpageheader name="myHeader" style="display:none">
    <table width="100%" border="0">
        <tr>
            <td width="50%" style="color: #777; font-size: 9pt;">
                {% if consent.offer %}
                    <span style="font-weight: bold">{{ consent.offer.name }}</span> #{{ consent.offer.id }}
                {% elseif consent.edition %}
                    <span style="font-weight: bold">{{ consent.edition.name }}</span>
                {% endif %}
            </td>
            <td width="50%" align="right" style="font-weight: bold;font-size: 12pt"></td>
        </tr>
    </table>
</htmlpageheader>

<htmlpagefooter name="myFooter" style="display:none">
    <table width="100%">
        <tr>
            <td width="50%" style="font-size: 8pt; color: #777">Export: {DATE j.m.Y H:i}</td>
            <td width="50%" style="font-size: 8pt; color: #777; text-align: right;">Seite {PAGENO}/{nbpg}</td>
        </tr>
    </table>
</htmlpagefooter>

<div class="content">
    <h1>Einwilligungserklärung</h1>

    <div class="section text-center">

        <div>
            {% if consent.participant %}
                <div class="font-bold">Im Namen von</div>
                <div class="underline">
                    {{ consent.participant.firstname }} {{ consent.participant.lastname }}
                </div>
                <div>erkläre ich</div>
                <div class="underline">{{ consent.user.name }}:</div>
            {% else %}
                Konto ({{ consent.user.name }})
            {% endif %}
        </div>

    </div>

    <div class="section text-center">
        <div>{{ (consent.consentText.text ?? consent.consentForm.text)|nl2br }}</div>
    </div>

    <div class="section text-right">
        <div>
            {% if consent.decision == 1 %}
                [X] Ich stimme zu
                <br>[ ] Ich lehne ab
            {% else %}
                [ ] Ich stimme zu
                <br>[X] Ich lehne ab
            {% endif %}
        </div>
    </div>

    <div class="section">
        <table width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="text-right" width="50%" style="vertical-align: top;">
                    <span class="label">Datum:</span>
                    <span class="underline">{{ consent.signedAt|date('d.m.Y H:i') }}</span>
                </td>
                <td class="text-right" width="50%" style="vertical-align: top;">
                    <span class="label">Unterschrift:</span>
                    <span class="underline">{{ consent.user.name }}</span>
                </td>
            </tr>
        </table>
    </div>
</div>
