@extends('patient.layout') @section('title','Book an appointment') @section('content')

{{ $appointment?'Reschedule your appointment':'Book an appointment' }}

All times are shown in {{ config('app.timezone') }}. For urgent assistance, contact the clinic directly.

@if(!$policy->enabled)

Online booking is currently unavailable. Please contact the clinic to arrange an appointment.

@else
Booking and cancellation rules

Book at least {{ $policy->minimum_notice_hours }} hours ahead, up to {{ $policy->horizon_days }} days in advance. Online changes and cancellations close {{ $policy->change_notice_hours }} hours before the appointment.

@if($appointment)
Choose another time with the same clinician, facility and consultation type. Contact the clinic to change these details.
@endif
Step 1 · Choose your visit

Find a consultation

@if($appointment)@endif
Step 2 · Select a session

Consultation sessions on {{ \Illuminate\Support\Carbon::parse($date)->format('d M Y') }}

@forelse($sessions as $s)
{{ $s->clinician_name }} · {{ $s->specialty }}
{{ $s->facility_name }}{{ $s->department_name?' · '.$s->department_name:'' }} · {{ str_replace('_',' ',$s->modality) }}
{{ \Illuminate\Support\Carbon::parse($s->starts_at)->format('d M H:i') }} – {{ \Illuminate\Support\Carbon::parse($s->ends_at)->format('d M H:i') }} · {{ $s->slot_minutes }} minutes
Choose a time
@empty

No sessions match your selection. Try another date or contact the clinic.

@endforelse
@if($selected)
Step 3 · Confirm details

Confirm your {{ $appointment?'new time':'appointment' }}

{{ $selected->clinician_name }} · {{ $selected->facility_name }} · {{ str_replace('_',' ',$selected->modality) }} · {{ $selected->slot_minutes }} minutes

@if(count($slots))
@csrf @if(!$appointment)@endif

Your appointment is confirmed when saved. Availability is checked again when you submit.

@else

No available times remain in this session for you. Choose another session or contact the clinic.

@endif
@endif
@endif @endsection