<?php
$tenant = service('tenantContext')->hasTenant() ? service('tenantContext')->getTenant() : null;
$primaryColor   = safe_hex_color($tenant->primary_color ?? null, '#4f46e5');
$secondaryColor = safe_hex_color($tenant->secondary_color ?? null, '#f59e0b');
$hotelName      = $tenant->hotel_name ?? 'MaxYields PMS';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include APPPATH . 'Views/public/_shell_head.php'; ?>
    <style>
        body { display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #16a34a, #15803d); }
        .kiosk-card { background: #fff; border-radius: 24px; padding: 3rem 2.5rem; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.35); text-align: center; }
    </style>
</head>
<body>
<div class="kiosk-card">
    <i class="bi bi-emoji-smile-fill text-success" style="font-size: 4rem;"></i>
    <h1 class="h3 mt-3 mb-1">Welcome, <?= esc(explode(' ', $fullName)[0]) ?>!</h1>
    <p class="text-muted mb-0">You're checked in to <?= esc($event->event_name) ?>. Enjoy!</p>
</div>
<script>
// Auto-reset back to the entry screen after a few seconds so the next
// attendee can walk up without staff having to touch the tablet.
setTimeout(function () {
    window.location.href = <?= json_encode(site_url('event-checkin/' . $token)) ?>;
}, 8000);
</script>
</body>
</html>
