@page "/login"
@using FoodsharingSiegen.Shared.Helper
@layout LoginLayout

@inherits FoodsharingSiegen.Server.BaseClasses.FsBase

<PageTitle>@AppSettings.Terms.Title</PageTitle>

<div class="d-flex justify-content-center align-items-center" style="height: 100vh;">
    <div class="card" style="width: 100%; max-width: 380px;">
        <div class="card-header">@AppSettings.Terms.Title</div>
        <div class="card-body">
            <Validation Validator="ValidationHelper.ValidateMail" @bind-Status="@IsValidMail">
                <TextEdit @bind-Text="MailAddress" Role="TextRole.Email" Placeholder="E-Mail" Class="mt-0" KeyUp="TextEdit_KeyUp"></TextEdit>
            </Validation>

            <Validation Validator="ValidationHelper.ValidatePassword" @bind-Status="@IsValidPassword">
                <TextEdit @bind-Text="Password" Role="TextRole.Password" Placeholder="Passwort" Class="my-3" KeyUp="TextEdit_KeyUp"></TextEdit>
            </Validation>

            <div class="d-flex justify-content-center">
                <Button Clicked="PerformLogin" Disabled="@(IsValidMail != ValidationStatus.Success || IsValidPassword != ValidationStatus.Success)">Einloggen</Button>
            </div>

        </div>
    </div>
</div>