<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Final Notice Before Collections</title>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; margin: 0; padding: 0; background-color: #f4f4f4; }
        .container { max-width: 600px; margin: 20px auto; background: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 8px rgba(0,0,0,0.3); border: 3px solid #B71C1C; }
        .header { background: #B71C1C; color: #ffffff; padding: 30px; text-align: center; }
        .final-notice { background: #7f0000; color: white; padding: 10px 25px; border-radius: 25px; display: inline-block; margin-bottom: 15px; font-weight: bold; font-size: 18px; }
        .content { padding: 30px; }
        .invoice-details { background: #ffcdd2; padding: 25px; border-radius: 5px; margin: 20px 0; border: 3px solid #B71C1C; }
        .invoice-details table { width: 100%; }
        .invoice-details td { padding: 12px 0; font-size: 16px; }
        .invoice-details td:first-child { font-weight: bold; width: 45%; }
        .amount { font-size: 36px; color: #7f0000; font-weight: bold; }
        .critical-box { background: #7f0000; color: white; padding: 25px; margin: 20px 0; border-radius: 5px; }
        .button { display: inline-block; padding: 20px 60px; background: #7f0000; color: #ffffff; text-decoration: none; border-radius: 5px; margin: 20px 0; font-weight: bold; font-size: 18px; }
        .button:hover { background: #4a0000; }
        .legal-notice { background: #ffebee; border: 2px solid #B71C1C; padding: 20px; margin: 20px 0; font-size: 14px; }
        .footer { background: #f4f4f4; padding: 20px; text-align: center; font-size: 12px; color: #666; }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <span class="final-notice">⛔ FINAL NOTICE BEFORE LEGAL ACTION</span>
            <h1>Account in Default</h1>
        </div>
        <div class="content">
            <p>Dear {{customer_name}},</p>
            
            <p><strong>This is your FINAL NOTICE. Your account is seriously delinquent and will be forwarded to our collection agency if payment is not received within 72 hours.</strong></p>
            
            <div class="invoice-details">
                <table>
                    <tr>
                        <td>Invoice Number:</td>
                        <td><strong>{{invoice_number}}</strong></td>
                    </tr>
                    <tr>
                        <td>Original Amount:</td>
                        <td><strong>{{currency_symbol}}{{amount_due}}</strong></td>
                    </tr>
                    <tr>
                        <td>Original Due Date:</td>
                        <td><strong>{{due_date}}</strong></td>
                    </tr>
                    <tr>
                        <td>Days Overdue:</td>
                        <td><strong style="color: #7f0000; font-size: 20px;">{{days_overdue}} days</strong></td>
                    </tr>
                    <tr>
                        <td>Accumulated Late Fees:</td>
                        <td><strong style="color: #B71C1C;">{{currency_symbol}}{{late_fees}}</strong></td>
                    </tr>
                    <tr>
                        <td>Collection Fees:</td>
                        <td><strong style="color: #B71C1C;">{{currency_symbol}}{{collection_fees}}</strong></td>
                    </tr>
                    <tr style="border-top: 3px solid #B71C1C;">
                        <td>TOTAL AMOUNT DUE:</td>
                        <td class="amount">{{currency_symbol}}{{total_with_fees}}</td>
                    </tr>
                </table>
            </div>
            
            <div class="critical-box">
                <h3 style="margin-top: 0;">🚨 CRITICAL: PAYMENT REQUIRED WITHIN 72 HOURS</h3>
                <p style="font-size: 16px; margin: 10px 0;">Failure to remit payment will result in:</p>
                <ul style="font-size: 16px;">
                    <li>Immediate referral to collection agency</li>
                    <li>Negative credit reporting</li>
                    <li>Legal action and court proceedings</li>
                    <li>Additional legal and collection fees</li>
                    <li>Permanent termination of services</li>
                </ul>
            </div>
            
            <p style="font-size: 18px; font-weight: bold; color: #B71C1C;">DO NOT IGNORE THIS NOTICE. IMMEDIATE PAYMENT IS REQUIRED.</p>
            
            <center>
                <a href="{{payment_link}}" class="button">PAY NOW TO AVOID COLLECTIONS</a>
            </center>
            
            <div class="legal-notice">
                <h4 style="margin-top: 0;">LEGAL NOTICE</h4>
                <p>This is a formal demand for payment. If payment is not received by {{final_deadline}}, this account will be:</p>
                <ol>
                    <li>Referred to {{collection_agency}} for collection proceedings</li>
                    <li>Reported to credit bureaus, negatively impacting your credit score</li>
                    <li>Subject to legal action, including court costs and attorney fees</li>
                </ol>
                <p><strong>Total fees and costs may exceed the original invoice amount.</strong></p>
            </div>
            
            <p>If you dispute this debt or require verification, you must contact us in writing within 30 days as required by the Fair Debt Collection Practices Act.</p>
            
            <p>If you have already made payment, provide immediate proof by calling {{company_phone}} or emailing proof to {{company_email}}.</p>
            
            <p><strong>This is your last chance to resolve this matter before legal action.</strong></p>
            
            <p>Collections Department<br>
            {{company_name}}<br>
            {{company_phone}} (URGENT)<br>
            {{company_email}}</p>
        </div>
        <div class="footer">
            <p><strong>FINAL NOTICE - LEGAL ACTION PENDING</strong></p>
            <p>This communication is from a debt collector. This is an attempt to collect a debt.</p>
        </div>
    </div>
    <img src="{{tracking_pixel_url}}" width="1" height="1" alt="" />
</body>
</html>