<?php
/**
 * @var \App\Model\Entity\Booking $booking
 */
$slot = $booking->slot ?? null;
$teacher = $booking->teacher ?? null;
?>
<!DOCTYPE html>
<html>
<body style="margin:0;padding:24px;background:#FAF8F5;font-family:'Plus Jakarta Sans',Arial,sans-serif;color:#1C1917;">
    <table role="presentation" style="max-width:560px;margin:0 auto;background:#fff;border-radius:16px;padding:32px;border:1px solid #E7E2DA;">
        <tr>
            <td>
                <h1 style="font-size:22px;font-weight:800;letter-spacing:-0.02em;margin:0 0 8px;">You're booked in, <?= h($booking->customer_name) ?>.</h1>
                <p style="color:#44403C;margin:0 0 18px;line-height:1.5;">Thank you for your payment. Here's what to expect on the day.</p>

                <div style="margin:20px 0;padding:18px;background:#FAF8F5;border-radius:12px;font-size:14px;color:#1C1917;">
                    <?php if ($teacher): ?>
                        <strong>Teacher:</strong> <?= h($teacher->full_name) ?><br>
                    <?php endif; ?>
                    <?php if ($slot && $slot->starts_at): ?>
                        <strong>When:</strong> <?= h($slot->starts_at->format('l, j F · g:i A')) ?><br>
                    <?php endif; ?>
                    <strong>Class type:</strong> <?= h(ucfirst($slot->class_type ?? '—')) ?><br>
                    <strong>Amount paid:</strong> A$<?= h($booking->getAmountDollars()) ?><br>
                    <strong>Booking ref:</strong> CC-<?= sprintf('%06d', (int)$booking->id) ?>
                </div>

                <p style="color:#78716C;font-size:13px;">Wear something you don't mind getting dusty. Clay sticks. Water is around. Tea is free.</p>
                <p style="color:#78716C;font-size:13px;margin:16px 0 0;">If you need to reschedule, just reply to this email at least 24 hours before your slot.</p>
                <p style="color:#78716C;font-size:13px;margin:4px 0 0;">— CandleCraft Academy</p>
            </td>
        </tr>
    </table>
</body>
</html>
