{% extends 'email/base.html.twig' %}

{% block content %}
<table width="600" cellpadding="0" cellspacing="0" style="margin: 0 auto;">
    <tr>
        <td style="padding: 32px;">
            {% set greeting = customer.raisonSociale ? 'Chez ' ~ customer.raisonSociale : 'Bonjour ' ~ customer.firstName %}
            <h1 style="font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: 700; color: #111827; margin: 0 0 16px;">{{ greeting }},</h1>

            <div style="background: #fef2f2; border-left: 4px solid #dc2626; padding: 16px; margin: 0 0 20px;">
                <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: 700; color: #dc2626; margin: 0;">
                    E-Flex {{ eflex.reference }} annule
                </p>
            </div>

            <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #374151; line-height: 22px; margin: 0 0 16px;">
                Votre contrat de financement E-Flex a ete automatiquement annule suite a des rejets repetes de prelevement. Le solde restant reste du.
            </p>

            <table width="100%" cellpadding="0" cellspacing="0" style="margin: 20px 0; border: 1px solid #e5e7eb;">
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb; width: 35%;">Reference</td>
                    <td style="padding: 10px 16px; font-family: monospace; font-size: 13px; font-weight: 700;">{{ eflex.reference }}</td>
                </tr>
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb;">Total contrat</td>
                    <td style="padding: 10px 16px; font-family: monospace; font-size: 14px; font-weight: 700;">{{ eflex.totalAmount|number_format(2, ',', ' ') }} &euro;</td>
                </tr>
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb;">Deja paye</td>
                    <td style="padding: 10px 16px; font-family: monospace; font-size: 14px; font-weight: 700; color: #16a34a;">{{ eflex.totalPaid|number_format(2, ',', ' ') }} &euro;</td>
                </tr>
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb;">Restant du</td>
                    <td style="padding: 10px 16px; font-family: monospace; font-size: 16px; font-weight: 700; color: #dc2626;">{{ (eflex.totalAmount|number_format(2, '.', '') - eflex.totalPaid)|number_format(2, ',', ' ') }} &euro;</td>
                </tr>
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb;">Echeances payees</td>
                    <td style="padding: 10px 16px; font-size: 13px;">{{ eflex.nbPaid }}/{{ eflex.nbLines }}</td>
                </tr>
                <tr>
                    <td style="padding: 10px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: #f9fafb;">Rejets</td>
                    <td style="padding: 10px 16px; font-size: 13px; font-weight: 700; color: #dc2626;">{{ eflex.nbFailed }} echec(s)</td>
                </tr>
            </table>

            <p style="font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #374151; line-height: 22px; margin: 16px 0;">
                Veuillez contacter notre service pour regulariser votre situation dans les plus brefs delais.
            </p>

            <p style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #9ca3af; margin: 16px 0 0;">
                Pour toute question : <a href="mailto:client@e-cosplay.fr" style="color: #fabf04;">client@e-cosplay.fr</a>
            </p>
        </td>
    </tr>
</table>
{% endblock %}
