<!doctype html>
<html lang="en" data-bs-theme="dark">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Login - Qpanel</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <link rel="stylesheet" href="{{ url_for('static', path='/css/custom.css') }}">
    <script src="https://unpkg.com/htmx.org@1.9.12"></script>
    <style>
        body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
    </style>
</head>
<body class="bg-dark-eops">
    <div class="card" style="width: 25rem;">
        <div class="card-body p-4">
            <div class="text-center mb-4">
                <i class="bi bi-robot" style="font-size: 2.5rem;"></i>
                <h3 class="mt-2">Qpanel Login</h3>
            </div>
            
            <form id="login-form"
                  hx-post="/api/login"
                  hx-swap="innerHTML"
                  hx-target="#feedback"
                  hx-on::after-request="if(event.detail.successful) window.location.href='/'">
                <div class="mb-3">
                    <label for="password" class="form-label">Master Password</label>
                    <input type="password" class="form-control" id="password" name="password" required autofocus>
                </div>
                <div id="feedback" class="mb-3"></div>
                <button type="submit" class="btn btn-primary w-100">
                    <span class="htmx-indicator spinner-border spinner-border-sm me-2"></span>
                    Login
                </button>
            </form>
        </div>
    </div>
</body>
</html>