<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@yield('title', 'Installation') — {{ config('cms.name') }} — {{ config('cms.tagline') }}</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
    {{-- Palette gdevstudio.fr : sky + violet (#9333ea / violet du site) --}}
    <style>
        :root {
            --gdev-primary: #0ea5e9;
            --gdev-primary-hover: #0284c7;
            --gdev-primary-soft: #38bdf8;
            --gdev-bg-page: #f0f9ff;
            --gdev-accent: #7c3aed;
            --gdev-accent-hover: #6d28d9;
        }
        body { font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
        .gdev-btn {
            display: inline-block;
            padding: 0.75rem 1.5rem;
            background-color: var(--gdev-primary);
            color: #fff;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: background-color 0.15s ease;
        }
        .gdev-btn:hover { background-color: var(--gdev-primary-hover); }
        .gdev-btn-block {
            display: block;
            width: 100%;
            text-align: center;
            padding: 1rem 1.5rem;
            background-color: var(--gdev-primary);
            color: #fff;
            border-radius: 0.5rem;
            font-weight: 500;
            transition: background-color 0.15s ease;
        }
        .gdev-btn-block:hover { background-color: var(--gdev-primary-hover); }
        .gdev-step-done { background-color: var(--gdev-primary-hover); }
        .gdev-step-active { background-color: var(--gdev-primary-soft); }
        .gdev-step-pending { background-color: #e2e8f0; }
        .gdev-footer-link {
            color: var(--gdev-primary);
            font-weight: 500;
        }
        .gdev-footer-link:hover { color: var(--gdev-primary-hover); }
        .gdev-footer-link:hover .gdev-powered-accent { color: var(--gdev-accent-hover); }
        .gdev-powered-accent { color: var(--gdev-accent); }
    </style>
</head>
<body class="min-h-screen flex flex-col" style="background: linear-gradient(180deg, var(--gdev-bg-page) 0%, #f8fafc 100%);">
    <div class="max-w-2xl mx-auto px-4 py-10 flex-1 w-full">
        <div class="bg-white rounded-xl shadow-lg shadow-sky-900/5 border border-slate-100 p-8">
            <div class="flex items-center gap-4 mb-8">
                <a href="https://gdevstudio.fr" target="_blank" rel="noopener noreferrer" class="shrink-0" title="GdevStudio">
                    <img src="https://gdevstudio.fr/logo2.svg" alt="GdevStudio" class="h-11 w-auto max-w-[200px] object-contain object-left">
                </a>
                <div class="min-w-0 border-l border-slate-200 pl-4">
                    <h1 class="text-lg sm:text-xl font-bold text-slate-800 leading-tight">{{ config('cms.name') }}</h1>
                    <p class="text-sm text-slate-600">{{ config('cms.tagline') }}</p>
                    <p class="text-xs text-slate-400 mt-0.5">Assistant d’installation</p>
                </div>
            </div>

            <div class="flex gap-2 mb-8">
                @php $steps = ['Accueil', 'Prérequis', 'Base de données', 'Administrateur', 'Terminé']; @endphp
                @foreach($steps as $i => $step)
                    @php
                        $cs = $currentStep ?? 1;
                        $barClass = $cs > $i + 1 ? 'gdev-step-done' : ($cs == $i + 1 ? 'gdev-step-active' : 'gdev-step-pending');
                    @endphp
                    <div class="flex-1 h-1 rounded {{ $barClass }}" title="{{ $step }}"></div>
                @endforeach
            </div>

            @if($errors->any())
                <div class="mb-6 p-4 bg-red-50 border border-red-200 rounded-lg">
                    <ul class="text-sm text-red-700">
                        @foreach($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

            @yield('content')
        </div>
    </div>

    <footer class="py-6 px-4 text-center text-sm text-slate-600">
        <a href="https://gdevstudio.fr" target="_blank" rel="noopener noreferrer" class="gdev-footer-link inline-flex items-center gap-1.5">
            <span>Propulsé par</span>
            <span class="gdev-powered-accent font-semibold">GdevStudio</span>
        </a>
    </footer>
</body>
</html>
