<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sign In — inz Kitchens CRM</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
    <style>
        body { background: #0a1628; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
        .card { background: #1e293b; border: 1px solid #334155; border-radius: 16px; padding: 40px; width: 100%; max-width: 420px; }
        .input { width: 100%; background: #0f172a; border: 1px solid #334155; color: #e2e8f0; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-top: 4px; }
        .input:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px #3b82f620; }
        label { font-size: 13px; font-weight: 500; color: #94a3b8; }
        .btn { width: 100%; padding: 11px; background: #1d4ed8; color: white; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; border: none; transition: background 0.15s; margin-top: 8px; }
        .btn:hover { background: #1e40af; }
        .error { color: #f87171; font-size: 13px; margin-top: 4px; }
    </style>
</head>
<body>
    <div class="card">
        <!-- Logo -->
        <div class="text-center mb-8">
           @php $_logo = \App\Models\AppSetting::get('company_logo'); @endphp
            @if($_logo && \Illuminate\Support\Facades\Storage::disk('public')->exists($_logo))
            <img src="{{ asset('storage/'.$_logo) }}" alt="Logo" style="width: 100%;" class="h-9 w-9 object-contain rounded flex-shrink-0">
            @else
            <div class="w-9 h-9 rounded-xl flex items-center justify-center flex-shrink-0" style="background: #1d4ed8;">
                <i class="fas fa-utensils text-white text-sm"></i>
            </div>
            @endif
            <!-- <h1 class="text-2xl font-bold text-white">inz Kitchens</h1>
            <p class="text-slate-400 text-sm mt-1">Business Management System</p> -->
        </div>

        <form method="POST" action="{{ route('login.post') }}">
            @csrf
            <div class="space-y-4">
                <div>
                    <label for="email">Email Address</label>
                    <input type="email" id="email" name="email" value="{{ old('email') }}" required autofocus
                           class="input" placeholder="you@inz.com.au">
                    @error('email')
                        <p class="error">{{ $message }}</p>
                    @enderror
                </div>
                <div>
                    <label for="password">Password</label>
                    <input type="password" id="password" name="password" required
                           class="input" placeholder="••••••••">
                    @error('password')
                        <p class="error">{{ $message }}</p>
                    @enderror
                </div>
                <div class="flex items-center justify-between">
                    <label class="flex items-center gap-2 cursor-pointer">
                        <input type="checkbox" name="remember" class="rounded">
                        <span class="text-sm text-slate-400">Remember me</span>
                    </label>
                    <a href="#" class="text-sm text-blue-400 hover:text-blue-300">Forgot password?</a>
                </div>
                <button type="submit" class="btn">
                    <i class="fas fa-sign-in-alt mr-2"></i> Sign In
                </button>
            </div>
        </form>

        <p class="text-center text-xs text-slate-500 mt-6">
            &copy; {{ date('Y') }} inz Kitchens. All rights reserved.
        </p>
    </div>
</body>
</html>
