<!DOCTYPE html>
<html lang="{{ locale|default('fr') }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ 'withdrawal.mail.customer.heading'|trans({}, 'messages', locale|default('fr')) }}</title>
</head>
<body style="margin:0; padding:0; background:#f7f2ea; color:#201917; font-family:Arial, Helvetica, sans-serif;">
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; background:#f7f2ea; margin:0; padding:0;">
    <tr>
        <td align="center" style="padding:32px 16px;">
            <table role="presentation" width="640" cellspacing="0" cellpadding="0" style="width:100%; max-width:640px; background:#ffffff;">
                <tr>
                    <td style="padding:36px 40px 24px; text-align:center; background:#fcfaf7;">
                        {% if contact and contact.image and contact.image.path %}
                            <img src="{{ absolute_url(asset(contact.image.path)|imagine_filter('logo_email_filter')) }}" alt="{{ contact.image.title ?: company }}" width="180" style="display:block; width:100%; max-width:180px; margin:0 auto 24px;">
                        {% endif %}
                        <div style="font-size:12px; letter-spacing:0.25em; text-transform:uppercase; color:#9d7c47;">{{ company }}</div>
                        <h1 style="margin:18px 0 0; font-family:Georgia, 'Times New Roman', serif; font-size:32px; line-height:1.25; font-weight:400;">{{ 'withdrawal.mail.customer.heading'|trans({}, 'messages', locale|default('fr')) }}</h1>
                    </td>
                </tr>
                <tr>
                    <td style="padding:32px 40px 40px; font-size:16px; line-height:1.7; color:#5d4b41;">
                        <p style="margin:0 0 20px;">{{ 'withdrawal.mail.customer.intro'|trans({}, 'messages', locale|default('fr')) }}</p>
                        <table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="width:100%; margin:0 0 24px; border:1px solid #e7ded4;">
                            <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.name'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.firstname }} {{ withdrawal_request.lastname }}</td></tr>
                            <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.reference'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.contractReference }}</td></tr>
                            <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.email'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.receiptEmail }}</td></tr>
                            <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.order_received'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ (withdrawal_request.orderReceived is same as(true) ? 'withdrawal.form.yes' : (withdrawal_request.orderReceived is same as(false) ? 'withdrawal.form.no' : 'withdrawal.form.not_provided'))|trans({}, 'messages', locale|default('fr')) }}</td></tr>
                            {% if withdrawal_request.orderReceived and withdrawal_request.receivedAt %}
                                <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.received_at'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.receivedAt|date('d/m/Y') }}</td></tr>
                            {% endif %}
                            {% if withdrawal_request.reasonCode %}
                                <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.reason'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ ('withdrawal.reason.' ~ withdrawal_request.reasonCode)|trans({}, 'messages', locale|default('fr')) }}</td></tr>
                            {% endif %}
                            {% if withdrawal_request.comment %}
                                <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.comment'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.comment|nl2br }}</td></tr>
                            {% endif %}
                            <tr><td style="padding:10px 14px; font-weight:700;">{{ 'withdrawal.summary.submitted_at'|trans({}, 'messages', locale|default('fr')) }}</td><td style="padding:10px 14px;">{{ withdrawal_request.submittedAt|date('d/m/Y H:i:s T') }}</td></tr>
                        </table>
                        <p style="margin:0;">{{ 'withdrawal.mail.customer.next_steps'|trans({}, 'messages', locale|default('fr')) }}</p>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
</body>
</html>
