@inject IViewLocalizer Localizer
@using Microsoft.AspNetCore.Mvc.Localization
@model LiteCharmsSecurity.STS.Identity.ViewModels.Account.LoginWith2faViewModel
@{
    ViewData["Title"] = Localizer["Title"];
}

<div class="py-8">
    <h1 class="text-4xl font-bold mb-2">@ViewData["Title"]</h1>

    @await Html.PartialAsync("_ValidationSummary")

    <div class="card mt-6 max-w-md">
        <div class="card-header">
            <p class="card-description">@Localizer["Info"]</p>
        </div>
        <div class="card-content">
            <form method="post" asp-route-returnUrl="@Model.ReturnUrl" class="space-y-6">
                <input asp-for="RememberMe" type="hidden" />
                <input asp-for="ReturnUrl" type="hidden" />
                <div class="form-item">
                    <label asp-for="TwoFactorCode" class="form-label">
                        <lucideicon name="shield-check" class="inline-block h-4 w-4 mr-1" />
                        @Localizer["Code"]
                    </label>
                    <input asp-for="TwoFactorCode" class="input" autocomplete="off" autofocus tw-validation />
                    <span asp-validation-for="TwoFactorCode" class="form-message"></span>
                </div>
                <div class="form-item">
                    <div class="flex items-center space-x-2">
                        <input asp-for="RememberMachine" type="checkbox" class="checkbox" id="RememberMachine" />
                        <label for="RememberMachine" class="label cursor-pointer">
                            @Localizer["Remember"]
                        </label>
                    </div>
                </div>
                <div>
                    <button type="submit" class="btn-default">
                        <lucideicon name="log-in" class="inline-block h-4 w-4 mr-2" />
                        @Localizer["LogIn"]
                    </button>
                </div>
            </form>
        </div>
    </div>

    <p class="mt-6">
        @Localizer["NoAuthenticatorDevice"]
        <a class="text-primary hover:underline" asp-action="LoginWithRecoveryCode" asp-route-returnUrl="@Model.ReturnUrl">@Localizer["LoginWithRecoveryCode"]</a>
    </p>
</div>