<!DOCTYPE html>
<html lang="ms">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Log Masuk — mySijil@MBIP</title>
    @vite(['resources/css/app.css', 'resources/js/app.js'])
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <style>
        body { background: linear-gradient(135deg, #1a56a0 0%, #2563eb 100%); min-height: 100vh; }
        .login-card { border-radius: 1rem; border: none; box-shadow: 0 8px 32px rgba(0,0,0,0.2); max-width: 420px; }
    </style>
</head>
<body class="d-flex align-items-center justify-content-center py-5">
    <div class="w-100 px-3">
        <div class="text-center mb-4">
            <img src="{{ asset('images/MBIP-2024-300x300.png') }}" alt="MBIP"
                 style="width:80px;height:80px;object-fit:contain;border-radius:12px;background:white;padding:6px;">
            <h4 class="text-white fw-bold mt-2 mb-0">mySijil@MBIP</h4>
            <small class="text-white opacity-75">Sistem Pengurusan Sijil Digital</small>
        </div>

        <div class="card login-card mx-auto">
            <div class="card-body p-4">
                <h5 class="card-title fw-semibold mb-4">Log Masuk Admin</h5>

                @if(session('status'))
                <div class="alert alert-info">{{ session('status') }}</div>
                @endif

                <form method="POST" action="{{ route('login') }}">
                    @csrf
                    <div class="mb-3">
                        <label for="email" class="form-label fw-medium">Alamat Emel</label>
                        <input id="email" type="email" name="email"
                               value="{{ old('email') }}" required autofocus autocomplete="username"
                               class="form-control @error('email') is-invalid @enderror"
                               placeholder="admin@mbip.gov.my">
                        @error('email')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="mb-3">
                        <div class="d-flex justify-content-between">
                            <label for="password" class="form-label fw-medium">Kata Laluan</label>
                            @if(Route::has('password.request'))
                            <a href="{{ route('password.request') }}" class="small text-decoration-none">
                                Terlupa kata laluan?
                            </a>
                            @endif
                        </div>
                        <input id="password" type="password" name="password"
                               required autocomplete="current-password"
                               class="form-control @error('password') is-invalid @enderror"
                               placeholder="••••••••">
                        @error('password')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="mb-4 form-check">
                        <input type="checkbox" name="remember" id="remember" class="form-check-input">
                        <label class="form-check-label" for="remember">Ingat saya</label>
                    </div>

                    <button type="submit" class="btn w-100 text-white fw-semibold" style="background: var(--mbip-primary);">
                        <i class="bi bi-box-arrow-in-right me-1"></i> Log Masuk
                    </button>
                </form>
            </div>
        </div>

        <div class="text-center mt-3">
            <small class="text-white opacity-60">Majlis Bandaraya Iskandar Puteri &copy; {{ date('Y') }}</small>
        </div>
    </div>
</body>
</html>
