@php
    $slot = $reservation->slot;
    $service = $slot?->service;
    $dateStr = $slot?->date ? $slot->date->locale('fr')->isoFormat('dddd D MMMM YYYY') : '—';
    $start = $slot ? \Carbon\Carbon::parse($slot->start_time)->format('H\hi') : '—';
    $end = $slot ? \Carbon\Carbon::parse($slot->end_time)->format('H\hi') : '—';
    $emailPrimary = \App\Models\Setting::get('primary_color', '#b66420');
    $emailSecondary = \App\Models\Setting::get('secondary_color', '#d3901d');
@endphp
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Confirmation de réservation</title>
    <style>
        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; line-height: 1.6; color: #334155; margin: 0; padding: 0; background: #f8fafc; }
        .container { max-width: 600px; margin: 0 auto; padding: 24px; }
        .card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-top: 4px solid {{ $emailPrimary }}; }
        h1 { color: #0f172a; font-size: 20px; margin: 0 0 16px 0; }
        .highlight { background: #fff7ed; border: 1px solid {{ $emailSecondary }}; border-radius: 8px; padding: 16px; margin: 16px 0; }
        .btn { display: inline-block; margin-top: 16px; padding: 12px 20px; background: {{ $emailPrimary }}; color: #fff !important; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: 14px; }
        .footer { margin-top: 24px; font-size: 13px; color: #94a3b8; }
    </style>
</head>
<body>
    <div class="container">
        <div class="card">
            <h1>Votre réservation est confirmée</h1>
            <p>Bonjour {{ $reservation->customer_name }},</p>
            <p>Nous avons bien enregistré votre réservation. Voici le récapitulatif :</p>

            <div class="highlight">
                <p style="margin:0 0 8px 0;"><strong>Prestation</strong><br>{{ $service?->name ?? '—' }}</p>
                <p style="margin:0 0 8px 0;"><strong>Date</strong><br>{{ $dateStr }}</p>
                <p style="margin:0;"><strong>Créneau</strong><br>{{ $start }} – {{ $end }}</p>
            </div>

            @if($reservation->notes)
            <p><strong>Votre message :</strong><br>{{ $reservation->notes }}</p>
            @endif

            <p><a href="{{ $confirmationUrl }}" class="btn">Voir ma réservation en ligne</a></p>

            <p class="footer">Conservez cet e-mail comme preuve de réservation. Ne répondez pas à cet e-mail — pour toute question, contactez-nous depuis le site.</p>
        </div>
    </div>
</body>
</html>
