{% extends 'mails/base.twig' %}

{% block content %}
    <mj-section background-color="#ffffff" padding-top="0px">
        <mj-column width="100%">
            <mj-text font-size="20px" color="#2563eb" font-family="Arial, sans-serif" font-weight="bold" align="center">
                Signature de votre devis
            </mj-text>
            <mj-divider border-color="#2563eb" border-width="2px" width="50px" />
            <mj-text font-size="16px" color="#333333" font-family="Arial, sans-serif" line-height="1.5">
                Bonjour <strong>{{ datas.devis.customer.name }} {{ datas.devis.customer.surname }}</strong>,
            </mj-text>
            <mj-text font-size="14px" color="#555555" font-family="Arial, sans-serif" line-height="1.5">
                Merci de nous avoir sollicités pour votre événement. Vous trouverez ci-dessous les détails de votre devis. Pour confirmer votre réservation, merci de le signer numériquement via le bouton ci-dessous.
            </mj-text>
        </mj-column>
    </mj-section>

    <mj-section background-color="#f9fafb" border="1px solid #e5e7eb" border-radius="8px">
        <mj-column width="100%">
            <mj-table font-family="Arial, sans-serif" font-size="14px">
                <tr style="border-bottom:1px solid #ecedee;text-align:left;padding:15px 0;">
                    <th style="padding: 10px 0;">Référence :</th>
                    <th style="padding: 10px 0; text-align:right;">#{{ datas.devis.num }}</th>
                </tr>
                {% if datas.devis.orderSession and datas.devis.orderSession.promotion %}
                    {% set discount = datas.devis|discountAmount %}
                    {% if discount > 0 %}
                    <tr>
                        <td style="padding: 10px 0; color: #888888;">Total HT Initial :</td>
                        <td style="padding: 10px 0; text-align:right; color: #888888; text-decoration: line-through;">{{ (datas.devis|totalQuotoBeforeDiscount)|number_format(2, ',', ' ') }} €</td>
                    </tr>
                    <tr>
                        <td style="padding: 10px 0; color: #2563eb;">Promotion : {{ datas.devis.orderSession.promotion.name }} (-{{ datas.devis.orderSession.promotion.percentage }}%)</td>
                        <td style="padding: 10px 0; text-align:right; color: #2563eb;">- {{ discount|number_format(2, ',', ' ') }} €</td>
                    </tr>
                    {% endif %}
                {% endif %}
                <tr>
                    <td style="padding: 10px 0;">Montant Total HT{% if datas.devis.orderSession and datas.devis.orderSession.promotion %} Remisé{% endif %} :</td>
                    <td style="padding: 10px 0; text-align:right; font-weight:bold;">{{ (datas.devis|totalQuotoHT)|number_format(2, ',', ' ') }} €</td>
                </tr>
                <tr>
                    <td style="padding: 5px 0; color:#888888; font-size:12px;" colspan="2">
                        (TVA non applicable, art. 293 B du CGI)
                    </td>
                </tr>
            </mj-table>
        </mj-column>
    </mj-section>

    <mj-section background-color="#ffffff">
        <mj-column width="100%">
            <mj-button background-color="#2563eb" color="white" font-size="16px" font-weight="bold" href="{{ datas.signLink }}" border-radius="10px" padding-top="20px">
                SIGNER MON DEVIS EN LIGNE
            </mj-button>
            <mj-text font-size="12px" color="#999999" align="center" padding-top="10px">
                Le lien de signature est sécurisé et conforme à la réglementation en vigueur.
            </mj-text>
        </mj-column>
    </mj-section>
{% endblock %}
