<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>{{ ($title ?? $heading ?? 'Legal').' - '.config('app.name') }}</title>
    @isset($metaDescription)
        <meta name="description" content="{{ $metaDescription }}">
    @endisset

    <link rel="icon" href="/favicon.ico" sizes="any">
    <link rel="icon" href="/favicon.svg" type="image/svg+xml">
    <link rel="apple-touch-icon" href="/apple-touch-icon.png">

    <link rel="preconnect" href="https://fonts.bunny.net">
    <link href="https://fonts.bunny.net/css?family=inter:400,500,600&family=manrope:600,700,800,900&display=swap" rel="stylesheet" />

    {{-- CSS only — no @fluxAppearance: it applies Flux's `.dark` class from the OS
         preference, which overrides --color-accent to white. Legal pages render no
         Flux components, so they stay light like the rest of the public site. --}}
    @vite(['resources/css/app.css'])

    <script src="https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js" defer></script>
</head>
<body class="min-h-screen bg-[#f5ede5] text-zinc-900 antialiased">
    <nav class="fixed top-0 w-full z-50 bg-zinc-50/90 backdrop-blur-sm border-b border-zinc-300 px-6 py-4 md:px-12">
        <div class="max-w-7xl mx-auto flex items-center justify-between gap-6">
            <a class="flex items-center gap-3 shrink-0" href="/">
                <div class="w-9 h-9 md:w-10 md:h-10 rounded-lg bg-accent flex items-center justify-center shadow-md">
                    <iconify-icon class="text-white text-xl" icon="lucide:fuel"></iconify-icon>
                </div>
                <span class="text-xl md:text-2xl font-black font-display tracking-tighter text-accent">FuelAlert</span>
            </a>

            <div class="hidden lg:flex items-center gap-8 font-mono text-[11px] uppercase tracking-widest text-zinc-600">
                <a class="hover:text-accent transition-colors" href="/#how-it-works">How it works</a>
                <a class="hover:text-accent transition-colors" href="/#features">Why it works</a>
                <a class="hover:text-accent transition-colors" href="/#pricing">Pricing</a>
            </div>

            <div class="flex items-center gap-3 md:gap-5">
                @auth
                    <a class="bg-accent text-white px-5 py-2 rounded-full text-sm font-bold shadow-md hover:bg-primary-dark transition-all" href="/dashboard">
                        Dashboard
                    </a>
                @else
                    <a class="text-sm font-semibold text-zinc-600 hover:text-zinc-900 transition-colors" href="/login">Login</a>
                    <a class="hidden sm:inline-flex bg-accent text-white px-5 py-2 rounded-full text-sm font-bold shadow-md hover:bg-primary-dark transition-all" href="/register">
                        Get started
                    </a>
                @endauth
            </div>
        </div>
    </nav>

    <main class="mx-auto max-w-3xl px-6 pt-28 pb-12 md:pt-32">
        <article class="space-y-6 leading-relaxed text-zinc-800">
            <header class="space-y-3 border-b border-zinc-300 pb-6">
                <h1 class="font-display text-3xl font-black tracking-tight text-zinc-900 md:text-4xl">
                    {{ $heading }}
                </h1>
                @isset($lastUpdated)
                    <p class="text-sm text-zinc-500">Last updated: {{ $lastUpdated }}</p>
                @endisset
            </header>

            {{ $slot }}
        </article>
    </main>

    <footer class="mt-16 border-t border-zinc-300 bg-white/50">
        <div class="mx-auto max-w-3xl px-6 py-10 text-sm text-zinc-600">
            <nav class="flex flex-wrap gap-x-6 gap-y-2">
                <a class="hover:text-accent" href="{{ route('legal.privacy') }}">Privacy Policy</a>
                <a class="hover:text-accent" href="{{ route('legal.terms') }}">Terms of Service</a>
                <a class="hover:text-accent" href="{{ route('legal.refund') }}">Refund &amp; Cancellation</a>
                <a class="hover:text-accent" href="{{ route('legal.cookies') }}">Cookie Policy</a>
            </nav>
            <p class="mt-6 text-xs text-zinc-500">
                &copy; {{ date('Y') }} FuelAlert. A trading name of Ovidiu Ungureanu, sole trader, Peterborough, United Kingdom.
            </p>
        </div>
    </footer>
</body>
</html>
