@model LoginFormModel
@{
    ViewData["Title"] = "Log in";
}

<div class="row">
    <div class="col-sm-12 offset-lg-2 col-lg-8 offset-xl-4 col-xl-3">
        <section>
            <h1 class="text-center">@ViewData["Title"]</h1>
            <form id="account" method="post">
                <h2 class="text-center">Use a local account to log in.</h2>
                <hr />
                <div asp-validation-summary="ModelOnly" class="text-danger"></div>
                <div class="form-floating" style="margin-top: 1rem">
                    <input asp-for="LoginCredential" class="form-control" autocomplete="username" aria-required="true" />
                    <label asp-for="LoginCredential" class="form-label"></label>
                    <span asp-validation-for="LoginCredential" class="text-danger"></span>
                </div>
                <div class="form-floating" style="margin-top: 1rem">
                    <input asp-for="Password" class="form-control" autocomplete="current-password" aria-required="true" />
                    <label asp-for="Password" class="form-label"></label>
                    <span asp-validation-for="Password" class="text-danger"></span>
                </div>
                <div>
                    <div class="checkbox">
                        <label asp-for="RememberMe" class="form-label">
                            <input class="form-check-input" asp-for="RememberMe" />
                            @Html.DisplayNameFor(m => m.RememberMe)
                        </label>
                    </div>
                </div>
                <div>
                    <button id="login-submit" type="submit" class="w-100 btn btn-lg btn-primary">Log in</button>
                </div>
                <div>
                    <p>
                        <a asp-action="Register" asp-route-returnUrl="@Model?.Utilities?.ReturnUrl">Register as a new user</a>
                    </p>
                </div>
            </form>
        </section>
    </div>
    <div class="col-md-6 col-md-offset-2">
        <section>
            <h3>Use another service to log in.</h3>
            <hr />
            <form id="external-account" asp-action="ExternalLogin" asp-route-returnUrl="@Model?.Utilities?.ReturnUrl" method="post" class="form-horizontal">
                <div>
                    <p>
                        @foreach (var provider in Model?.Utilities?.ExternalLogins!)
                        {
                            <button type="submit" class="btn btn-primary" name="provider" value="@provider.Name" title="Log in using your @provider.DisplayName account">@provider.DisplayName</button>
                        }
                    </p>
                </div>
            </form>
        </section>
    </div>
</div>

@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}
