@page "/login"
@layout SecurityLayout

<PageTitle Title="Login" Hidden="true" />

<div class="hold-transition login-page">
	<div class="login-box">
		<div class="card card-outline card-primary">
			<div class="card-header text-center">
				<h1><b>VKS</b>Rynárec</h1>
			</div>
			<div class="card-body">
				<p class="login-box-msg">Přihlášení do systému</p>

				@if (!isLoginSuccessful)
				{
					<div class="validation-message text-center">
						Email nebo heslo jsou nesprávné
					</div>
				}

				<EditForm OnValidSubmit="HandleSubmitAsync" Model="loginAccount">
					<DataAnnotationsValidator />

					<ValidationMessage For="@(() => loginAccount.Email)" />
					<div class="input-group mb-3">
						<InputText @bind-Value="loginAccount.Email" class="form-control" type="email" placeholder="email" />
						<div class="input-group-append">
							<div class="input-group-text">
								<span class="fas fa-envelope"></span>
							</div>
						</div>
					</div>

					<ValidationMessage For="@(() => loginAccount.Password)" />
					<div class="input-group mb-3">
						<InputText @bind-Value="loginAccount.Password" class="form-control" type="password" placeholder="heslo" />
						<div class="input-group-append">
							<div class="input-group-text">
								<span class="fas fa-lock"></span>
							</div>
						</div>
					</div>

					<div class="d-flex flex-row-reverse">
						<div class="p-2">
							<button type="submit" class="btn btn-primary btn-block">Přihlásit</button>
						</div>
					</div>

					@*<div class="row">
						<div class="col-8">
							<div class="icheck-primary">
								<input type="checkbox" id="remember">
								<label for="remember">
								Remember Me
								</label>
							</div>
						</div>
						<div class="col-4">
							<button type="submit" class="btn btn-primary btn-block">Přihlásit</button>
						</div>
					</div>*@
				</EditForm>

				<p class="mb-1">
					<a href="forgottenpassword">Zapomenuté heslo</a>
				</p>
				<p class="mb-0">
					<a href="signup" class="text-center">Registrovat se</a>
				</p>
			</div>
		</div>
	</div>
</div>