<!DOCTYPE html>
<html>
<head>
    <title>Login</title>

    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">

<div class="container">
    <div class="row justify-content-center align-items-center vh-100">

        <div class="col-md-4">
            <div class="card p-4 shadow">

                <h3 class="text-center mb-3">Admin Login</h3>

                {{-- Success Message --}}
                @if(session('success'))
                    <div class="alert alert-success">
                        {{ session('success') }}
                    </div>
                @endif

                {{-- Error Message --}}
                @if(session('error'))
                    <div class="alert alert-danger">
                        {{ session('error') }}
                    </div>
                @endif

                {{-- Validation Errors --}}
                @if ($errors->any())
                    <div class="alert alert-danger">
                        <ul class="mb-0">
                            @foreach ($errors->all() as $error)
                                <li>{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif

                <form method="POST" action="{{ url('admin/login') }}">
                    @csrf

                    <input
                        type="email"
                        name="email"
                        class="form-control mb-2"
                        placeholder="Email"
                        value="{{ old('email') }}"
                    >

                    <input
                        type="password"
                        name="password"
                        class="form-control mb-3"
                        placeholder="Password"
                    >

                    <button type="submit" class="btn btn-primary w-100">
                        Login
                    </button>
                </form>

            </div>
        </div>

    </div>
</div>

</body>
</html>