<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Admin Login | School Management</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>
    <style>
        body {
            background: #f0f2f5;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Segoe UI', sans-serif;
        }

        .login-card {
            width: 100%;
            max-width: 400px;
            border: none;
            border-radius: 15px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
            overflow: hidden;
        }

        .card-header {
            background: #4e73df;
            color: white;
            padding: 30px;
            text-align: center;
            border: none;
        }

        .input-group-text {
            border-right: none;
            background-color: #f8f9fc;
        }

        .form-control {
            border-left: none;
        }

        .form-control:focus {
            box-shadow: none;
            border-color: #dee2e6;
        }

        .btn-login {
            background: #4e73df;
            color: white;
            font-weight: 600;
            padding: 12px;
            border-radius: 8px;
            transition: 0.3s;
            border: none;
        }

        .btn-login:hover {
            background: #2e59d9;
            transform: translateY(-1px);
        }
    </style>
</head>

<body>

    <div class="card login-card">
        <div class="card-header">
            <h4 class="mb-0"><i class="fas fa-school me-2"></i>Admin Portal</h4>
            <small class="opacity-75">Secure Management System</small>
        </div>
        <div class="card-body p-4">
            <div id="responseMsg"></div>

            <form id="loginForm">
                <div class="mb-3">
                    <label class="form-label small fw-bold">Username</label>
                    <div class="input-group">
                        <span class="input-group-text"><i class="fas fa-user text-muted"></i></span>
                        <input type="text" id="username" name="username" class="form-control" required
                            autocomplete="off">
                    </div>
                </div>
                <div class="mb-3">
                    <label class="form-label small fw-bold">Password</label>
                    <div class="input-group">
                        <span class="input-group-text"><i class="fas fa-lock text-muted"></i></span>
                        <input type="password" id="password" name="password" autocomplete="current-password" class="form-control" required>
                    </div>
                </div>
                <div class="mb-3 d-flex justify-content-center">
                    <div class="g-recaptcha" data-sitekey="6LduzUYsAAAAAHTx0hqwo4iG3GEDfchEHWk4Uv4g"></div>
                </div>
                <button type="submit" id="submitBtn" class="btn btn-login w-100">
                    <span id="btnText">Sign In</span>
                </button>
                <div class="text-end mt-2">
                    <a href="forgot_password.php" class="text-decoration-none small text-primary fw-bold">
                        Forgot Password?
                </div>
        </div>
        </form>
    </div>
    </div>

    <script src="js/login.js"></script>
</body>

</html>