<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Admin Login | {{$generalsetting->name}}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    @if(isset($generalsetting->favicon))
    <link rel="shortcut icon" href="{{ asset(str_replace('public/', '', $generalsetting->favicon)) }}" type="image/x-icon" />
    @endif
    <link href="{{asset('backEnd/')}}/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;700&family=Hind+Siliguri:wght@400;500;700&display=swap" rel="stylesheet">
    <style>
        :root {
            --amz-navy: #131921;
            --amz-navy-light: #232f3e;
            --amz-orange: #febd69;
        }
        body {
            background-color: #f0f2f2;
            font-family: 'Outfit', 'Hind Siliguri', sans-serif;
            color: #111;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            margin: 0;
        }
        .login-container {
            width: 100%;
            max-width: 400px;
            padding: 20px;
        }
        .login-logo {
            text-align: center;
            margin-bottom: 30px;
        }
        .login-logo img {
            max-height: 60px;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
        }
        .login-card {
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 30px;
            background: #fff;
            box-shadow: 0 10px 25px rgba(0,0,0,0.05);
        }
        .login-card h1 {
            font-size: 24px;
            font-weight: 500;
            margin-bottom: 25px;
            text-align: center;
            color: var(--amz-navy);
        }
        .form-label {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #444;
        }
        .form-control {
            height: 45px;
            padding: 10px 15px;
            border: 1px solid #a6a6a6;
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.2s;
        }
        .form-control:focus {
            border-color: var(--amz-orange);
            box-shadow: 0 0 0 3px rgba(254, 189, 105, 0.2);
            outline: none;
        }
        .btn-premium {
            width: 100%;
            background: var(--amz-navy);
            border: 1px solid var(--amz-navy);
            border-radius: 6px;
            padding: 12px;
            font-size: 16px;
            font-weight: 600;
            color: #fff;
            margin-top: 20px;
            transition: all 0.3s;
            cursor: pointer;
        }
        .btn-premium:hover {
            background: var(--amz-navy-light);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .footer {
            margin-top: 30px;
            text-align: center;
            font-size: 13px;
            color: #666;
        }
        .alert {
            font-size: 13px;
            padding: 10px 15px;
            border-radius: 6px;
            margin-bottom: 20px;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <div class="login-logo">
            @php
                $loginLogo = $generalsetting?->white_logo;
                if ($loginLogo && !str_starts_with($loginLogo, 'http')) {
                    $loginLogo = str_replace('public/', '', $loginLogo);
                }
            @endphp
            <a href="{{url('/')}}">
                <img src="{{asset($loginLogo ?? 'public/logo.png')}}" alt="Logo">
            </a>
        </div>
        <div class="login-card">
            <h1>Admin Portal Access</h1>
            
            @if($errors->any())
                <div class="alert alert-danger">
                    <ul class="mb-0 list-unstyled">
                        @foreach($errors->all() as $error)
                            <li><i class="fe-alert-octagon me-1"></i> {{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

            <form action="{{ route('login') }}" method="POST">
                @csrf
                <div class="mb-3">
                    <label class="form-label">Email Address</label>
                    <input type="email" name="email" class="form-control" placeholder="Enter your email" required autofocus>
                </div>
                <div class="mb-3">
                    <label class="form-label">Password</label>
                    <input type="password" name="password" class="form-control" placeholder="Enter your password" required>
                </div>
                <button type="submit" class="btn btn-premium">Sign In to Dashboard</button>
            </form>
        </div>
        
        <div class="footer">
            <p>&copy; {{date('Y')}} {{$generalsetting->name}}. All rights reserved.</p>
        </div>
    </div>
</body>
</html>
