<?php $__env->startSection('title', 'Book a Stay'); ?>

<?php $__env->startSection('content'); ?>
    <section class="bg-slate-950 py-14 text-center text-white">
        <p class="text-xs font-bold uppercase tracking-[0.3em] text-gold-400">Reservations</p>
        <h1 class="mt-2 font-serif text-4xl font-bold">Book your stay</h1>
        <p class="mx-auto mt-3 max-w-lg px-4 text-slate-300">Reserve online in under a minute — our reception team will confirm right away.</p>
    </section>

    <section class="mx-auto max-w-2xl px-4 py-12 sm:px-6">
        <?php if($errors->any()): ?>
            <div class="mb-5 rounded-2xl border border-rose-200 bg-rose-50 px-4 py-3 text-sm text-rose-800">
                <ul class="list-inside list-disc"><?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><li><?php echo e($error); ?></li><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?></ul>
            </div>
        <?php endif; ?>

        <form method="POST" action="<?php echo e(route('site.book.submit')); ?>" class="space-y-5 rounded-3xl bg-white p-6 shadow-sm ring-1 ring-slate-200 sm:p-8">
            <?php echo csrf_field(); ?>
            <div class="grid gap-4 sm:grid-cols-2">
                <label class="sm:col-span-2"><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Full name</span>
                    <input name="name" value="<?php echo e(old('name', auth()->user()->name ?? '')); ?>" required class="w-full rounded-xl border-slate-200"></label>
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Email</span>
                    <input type="email" name="email" value="<?php echo e(old('email', auth()->user()->email ?? '')); ?>" required class="w-full rounded-xl border-slate-200"></label>
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Phone</span>
                    <input name="phone" value="<?php echo e(old('phone', auth()->user()->phone ?? '')); ?>" required class="w-full rounded-xl border-slate-200"></label>
            </div>

            <label class="block"><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Room type</span>
                <select name="room_type_id" required class="w-full rounded-xl border-slate-200">
                    <?php $__currentLoopData = $roomTypes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($type->id); ?>" <?php if(old('room_type_id', $selected) == $type->id): echo 'selected'; endif; ?>><?php echo e($type->name); ?> — <?php echo e($CUR); ?><?php echo e(number_format($type->base_price)); ?>/night</option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select></label>

            <div class="grid grid-cols-2 gap-4">
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Check-in</span>
                    <input type="date" name="check_in" min="<?php echo e(today()->toDateString()); ?>" value="<?php echo e(old('check_in', today()->toDateString())); ?>" required class="w-full rounded-xl border-slate-200"></label>
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Check-out</span>
                    <input type="date" name="check_out" min="<?php echo e(today()->addDay()->toDateString()); ?>" value="<?php echo e(old('check_out', today()->addDay()->toDateString())); ?>" required class="w-full rounded-xl border-slate-200"></label>
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Adults</span>
                    <input type="number" name="adults" min="1" max="10" value="<?php echo e(old('adults', 2)); ?>" required class="w-full rounded-xl border-slate-200"></label>
                <label><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Children</span>
                    <input type="number" name="children" min="0" max="10" value="<?php echo e(old('children', 0)); ?>" class="w-full rounded-xl border-slate-200"></label>
            </div>

            <label class="block"><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Special requests</span>
                <textarea name="notes" rows="3" class="w-full rounded-xl border-slate-200" placeholder="Airport pickup, dietary needs, celebration…"><?php echo e(old('notes')); ?></textarea></label>

            <label class="block"><span class="mb-1 block text-xs font-bold uppercase tracking-wide text-slate-500">Promo code</span>
                <input name="promo_code" value="<?php echo e(old('promo_code')); ?>" style="text-transform:uppercase" placeholder="e.g. WELCOME10" class="w-full rounded-xl border-slate-200 font-mono uppercase tracking-wider">
                <span class="mt-1 block text-xs text-slate-400">Have a code? Discount is applied on your reservation total.</span></label>

            <button class="w-full rounded-xl bg-gradient-to-r from-gold-400 to-gold-600 py-4 text-sm font-extrabold text-slate-950 shadow-lg shadow-gold-500/20 hover:brightness-110">Reserve my room →</button>
            <p class="text-center text-xs text-slate-400">No payment needed now — pay on arrival or via transfer once confirmed.</p>
        </form>
    </section>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.site', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\wamp64\www\hms\resources\views/site/book.blade.php ENDPATH**/ ?>