<!DOCTYPE html>
<html lang="fa" dir="rtl" data-bs-theme="dark">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ورود به پنل مدیریت</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        body { background: #0a0e17; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
        .login-card { background: #131926; border: 1px solid #1e293b; border-radius: 16px; padding: 40px; width: 100%; max-width: 400px; }
        .login-card h2 { color: #e2e8f0; font-weight: 700; }
        .form-control { background: #1e293b; border: 1px solid #334155; color: #e2e8f0; }
        .form-control:focus { background: #1e293b; border-color: #6366f1; color: #e2e8f0; box-shadow: 0 0 0 0.2rem rgba(99,102,241,.25); }
        .btn-primary { background: #6366f1; border-color: #6366f1; }
        .btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }
    </style>
</head>
<body>
    <div class="login-card">
        <div class="text-center mb-4">
            <i class="bi bi-shield-lock fs-1 text-primary"></i>
        </div>
        <h2 class="text-center mb-4">پنل مدیریت ربات</h2>
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
        {% for cat, msg in messages %}
        <div class="alert alert-{{ cat }} py-2" role="alert">{{ msg }}</div>
        {% endfor %}
        {% endif %}
        {% endwith %}
        <form method="POST">
            <div class="mb-3">
                <label class="form-label">نام کاربری</label>
                <input type="text" name="username" class="form-control" required autofocus>
            </div>
            <div class="mb-3">
                <label class="form-label">رمز عبور</label>
                <input type="password" name="password" class="form-control" required>
            </div>
            <button type="submit" class="btn btn-primary w-100">ورود</button>
        </form>
    </div>
</body>
</html>
