Ok. Finally got it. I had to remove the modal-dialog from the login form in the partial class.
Also, I updated the code for the top bar login link to:
<li>
<a asp-action="ModalAction"
asp-controller="Home"
asp-route-id="1"
data-target="#modal-container"
data-toggle="modal">
Log in
</a>
</li>
and created the following method in my home controller:
public ActionResult ModalAction(int Id)
{
ViewBag.Id = Id;
return PartialView("_LoginPartialForm");
}