<?= $this->extend('layout/email_layout') ?>

<?= $this->section('email_content') ?>
<h2>Refund Processing</h2>

<p>Dear <?= esc($parentName ?? 'Parent') ?>,</p>

<?php if (isset($studentName) && is_array($studentName) && !empty($studentName)): ?>
    <p>Your withdrawal requests for the following <?= count($studentName) ?> students have been approved:</p>
    <ul style="padding-left:20px;">
        <?php foreach ($studentName as $name): ?>
            <li><?= esc($name) ?></li>
        <?php endforeach; ?>
    </ul>
<?php else: ?>
    <p>Your withdrawal request for <?= esc($studentName ?? 'your student') ?> has been approved.</p>
<?php endif; ?>

<p>
    <?php if (!empty($refundAmount)): ?>
        A refund in the amount of <?= esc($refundAmount) ?> is being processed.
    <?php else: ?>
        A refund is being processed.
    <?php endif; ?>
    Please allow 7–10 business days for the refund to be issued to your original payment method.
</p>

<p>You will receive a confirmation email once the refund has been processed.</p>
<p>If you have any questions, please contact our billing department.</p>

<p style="margin:16px 0;">
    <a href="<?= base_url() ?>" target="_blank" rel="noopener"
        style="display:inline-block; padding:10px 16px; text-decoration:none; border-radius:6px;
            background:#198754; color:#ffffff; font-weight:600; font-size:16px;">
        Access My Account
    </a>
</p>

<p>Best regards,<br>Billing Department</p>
<?= $this->endSection() ?>