<!DOCTYPE html>
<html lang="en" data-bs-theme="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MCLogger – Site Admin Login</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <style>
        body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0d1117; }
        .login-card { width: 100%; max-width: 400px; }
    </style>
</head>
<body>
<div class="login-card p-4">
    <div class="text-center mb-4">
        <i class="bi bi-shield-fill-check fs-1 text-danger"></i>
        <h3 class="fw-bold mt-2">Site Admin</h3>
        <p class="text-muted small">Administrative Access</p>
    </div>

    {% with messages = get_flashed_messages(with_categories=true) %}
    {% if messages %}
        {% for cat, msg in messages %}
        <div class="alert alert-{{ cat }}">{{ msg }}</div>
        {% endfor %}
    {% endif %}
    {% endwith %}

    <div class="card border-danger">
        <div class="card-body">
            <form method="post">
                <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
                <div class="mb-3">
                    <label class="form-label">Username</label>
                    <div class="input-group">
                        <span class="input-group-text text-danger"><i class="bi bi-person-fill"></i></span>
                        <input type="text" name="username" class="form-control" required autofocus
                               value="{{ request.form.get('username', '') }}">
                    </div>
                </div>
                <div class="mb-3">
                    <label class="form-label">Password</label>
                    <div class="input-group">
                        <span class="input-group-text text-danger"><i class="bi bi-lock-fill"></i></span>
                        <input type="password" name="password" class="form-control" required>
                    </div>
                </div>
                <button type="submit" class="btn btn-danger w-100">
                    <i class="bi bi-shield-lock-fill me-1"></i> Admin Login
                </button>
            </form>
        </div>
    </div>

    <div class="text-center mt-3">
        <a href="{{ url_for('auth.login') }}" class="text-muted small">
            <i class="bi bi-arrow-left me-1"></i>Back to regular login
        </a>
    </div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
