<?php /** @var array $state; @var array $artists */ $step = 6; include __DIR__ . '/_wizard-shell.php';
$gi = $state['general_info'] ?? [];
$td = $state['tattoo_details'] ?? [];
$artistId = $state['artist_id'] ?? '';
$artistName = '';
foreach ($artists as $a) { if (($a['id'] ?? '') === $artistId) { $artistName = $a['display_name'] ?? ''; break; } }
$start = $state['start_at'] ?? '';
?>
<section class="max-w-3xl mx-auto px-6 pb-28">
  <h2 class="text-2xl font-display mb-6"><?= e(t('booking.review.title')) ?></h2>
  <div class="bg-ink/40 border border-white/10 rounded-xl p-6 space-y-5">
    <div class="grid grid-cols-2 gap-4 text-sm">
      <div><div class="text-xs uppercase tracking-widest text-gold/70"><?= e(t('booking.review.artist')) ?></div><div><?= e($artistName ?: t('booking.no_preference')) ?></div></div>
      <div><div class="text-xs uppercase tracking-widest text-gold/70"><?= e(t('booking.review.datetime')) ?></div><div><?= $start ? e((new DateTimeImmutable($start))->format('D M j, Y · g:i A')) : '—' ?></div></div>
      <div><div class="text-xs uppercase tracking-widest text-gold/70"><?= e(t('booking.review.name')) ?></div><div><?= e(($gi['first_name'] ?? '') . ' ' . ($gi['last_name'] ?? '')) ?></div></div>
      <div><div class="text-xs uppercase tracking-widest text-gold/70"><?= e(t('booking.review.contact')) ?></div><div><?= e($gi['email'] ?? '') ?><br><?= e($gi['phone'] ?? '') ?></div></div>
      <div class="col-span-2"><div class="text-xs uppercase tracking-widest text-gold/70"><?= e(t('booking.review.tattoo')) ?></div>
        <div><?= e(($td['description'] ?? '') ?: '—') ?></div>
        <div class="text-bone/50"><?= e(($td['size'] ?? '') . ($td['placement'] ? ' · ' . $td['placement'] : '')) ?></div>
      </div>
    </div>
  </div>
  <form method="POST" action="<?= url('/book/submit') ?>" class="mt-6 flex justify-between">
    <?= csrf_field() ?>
    <a href="<?= url('/book/step/5') ?>" class="text-sm text-bone/50 hover:text-bone">← <?= e(t('booking.back')) ?></a>
    <button class="btn-gold"><?= e(t('booking.review.confirm')) ?></button>
  </form>
</section>
