<!DOCTYPE html>
<html lang="id" data-bs-theme="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Login - TurboTopup</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;800&display=swap" rel="stylesheet">
    <style>
        :root {
            --primary: #5c3ff6;
            --primary-hover: #4a2ed9;
            --bg: #0a0c10;
            --surface: #151821;
        }
        body {
            font-family: 'Outfit', sans-serif;
            background-color: var(--bg);
            color: #fff;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0;
            overflow: hidden;
        }
        .login-card {
            background: var(--surface);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 24px;
            padding: 48px;
            width: 100%;
            max-width: 420px;
            box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
            position: relative;
            z-index: 1;
        }
        .login-card::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            background: linear-gradient(135deg, #a78bfa, #5c3ff6);
            border-radius: 26px;
            z-index: -1;
            opacity: 0.15;
        }
        .brand-logo {
            font-size: 2rem;
            font-weight: 800;
            margin-bottom: 32px;
            text-align: center;
            background: linear-gradient(135deg, #a78bfa, #5c3ff6);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .form-label {
            font-weight: 600;
            color: #9ca3af;
            margin-bottom: 8px;
        }
        .form-control {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            padding: 12px 16px;
            color: #fff;
            transition: all 0.2s;
        }
        .form-control:focus {
            background: rgba(255, 255, 255, 0.05);
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(92, 63, 246, 0.15);
            color: #fff;
        }
        .btn-login {
            background: var(--primary);
            border: none;
            border-radius: 12px;
            padding: 14px;
            font-weight: 700;
            width: 100%;
            margin-top: 24px;
            transition: all 0.2s;
        }
        .btn-login:hover {
            background: var(--primary-hover);
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(92, 63, 246, 0.3);
        }
        .back-link {
            display: block;
            text-align: center;
            margin-top: 24px;
            color: #9ca3af;
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 600;
            transition: color 0.2s;
        }
        .back-link:hover {
            color: #fff;
        }
        .alert {
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 600;
            border: none;
        }
        .alert-danger {
            background: rgba(231, 76, 60, 0.1);
            color: #e74c3c;
        }
        .alert-success {
            background: rgba(46, 204, 113, 0.1);
            color: #2ecc71;
        }
        .bg-glow {
            position: absolute;
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, rgba(92, 63, 246, 0.15) 0%, rgba(92, 63, 246, 0) 70%);
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 0;
            pointer-events: none;
        }
    </style>
</head>
<body>
    <div class="bg-glow"></div>
    
    <div class="login-card">
        <div class="brand-logo">ADMIN WYZSTORE</div>
        
        <p class="text-center text-muted mb-4">Silakan login untuk mengakses dashboard.</p>

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

        @if(session('logout_success'))
            <div class="alert alert-success mb-3">
                {{ session('logout_success') }}
            </div>
        @endif

        @if($errors->has('login'))
            <div class="alert alert-danger mb-3">
                {{ $errors->first('login') }}
            </div>
        @endif

        <form action="{{ route('admin.login.post') }}" method="POST">
            @csrf
            <div class="mb-3">
                <label for="email" class="form-label">Email Address</label>
                <input type="email" class="form-control" id="email" name="email" value="{{ old('email') }}" placeholder="admin@example.com" required autofocus>
                @error('email')
                    <div class="text-danger small mt-1">{{ $message }}</div>
                @enderror
            </div>
            
            <div class="mb-3">
                <label for="password" class="form-label">Password</label>
                <input type="password" class="form-control" id="password" name="password" placeholder="••••••••" required>
                @error('password')
                    <div class="text-danger small mt-1">{{ $message }}</div>
                @enderror
            </div>

            <button type="submit" class="btn btn-primary btn-login">Login ke Dashboard</button>
        </form>

        <a href="/" class="back-link">← Kembali ke Halaman Utama</a>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
