<!DOCTYPE html>
<html lang="ms">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tetapkan Semula Kata Laluan — 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; }
        .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 mx-auto">
            <div class="card-body p-4">
                <h5 class="card-title fw-semibold mb-1">Tetapkan Semula Kata Laluan</h5>
                <p class="text-muted small mb-4">Masukkan kata laluan baru untuk akaun anda.</p>

                <form method="POST" action="{{ route('password.store') }}">
                    @csrf
                    <input type="hidden" name="token" value="{{ $request->route('token') }}">

                    <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', $request->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">
                        <label for="password" class="form-label fw-medium">Kata Laluan Baru</label>
                        <input id="password" type="password" name="password"
                               required autocomplete="new-password"
                               class="form-control @error('password') is-invalid @enderror"
                               placeholder="Min. 8 aksara">
                        @error('password')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <div class="mb-4">
                        <label for="password_confirmation" class="form-label fw-medium">Sahkan Kata Laluan Baru</label>
                        <input id="password_confirmation" type="password" name="password_confirmation"
                               required autocomplete="new-password"
                               class="form-control @error('password_confirmation') is-invalid @enderror"
                               placeholder="••••••••">
                        @error('password_confirmation')
                        <div class="invalid-feedback">{{ $message }}</div>
                        @enderror
                    </div>

                    <button type="submit" class="btn w-100 text-white fw-semibold mb-3"
                            style="background: var(--mbip-primary, #1a56a0);">
                        <i class="bi bi-key me-1"></i> Tetapkan Semula Kata Laluan
                    </button>

                    <div class="text-center">
                        <a href="{{ route('login') }}" class="small text-decoration-none text-muted">
                            <i class="bi bi-arrow-left me-1"></i> Kembali ke Log Masuk
                        </a>
                    </div>
                </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>
