@model MemberCenter.Web.Models.Account.LoginViewModel
@{
    Layout = "_AuthLayout";
    ViewData["Title"] = L["Login"];
    var googleLoginEnabled = ViewData["GoogleLoginEnabled"] as bool? == true;
}

<div class="auth-heading-row">
  <div>
    <h1>@L["Login"]</h1>
    <p>@L["Welcome back"]</p>
  </div>
  <a href="#register-modal">@L["Create account"]</a>
</div>

@if (googleLoginEnabled)
{
  <form class="auth-provider-form" method="post" asp-area="" asp-controller="Account" asp-action="ExternalLogin">
    <input type="hidden" name="provider" value="Google" />
    <input type="hidden" name="returnUrl" value="@Model.ReturnUrl" />
    <input type="hidden" asp-for="RememberMe" />
    <button type="submit" class="auth-provider-button">@L["Continue with Google"]</button>
  </form>

  <div class="auth-divider"><span>@L["Or sign in with email"]</span></div>
}

<div asp-validation-summary="All"></div>
<form class="auth-form" method="post">
  <div class="form-field">
    <label>@L["Email"]</label>
    <input asp-for="Email" placeholder="@L["Enter your email"]" />
    <span asp-validation-for="Email"></span>
  </div>

  <div class="form-field">
    <label>@L["Password"]</label>
    <input asp-for="Password" type="password" placeholder="@L["Enter your password"]" />
    <span asp-validation-for="Password"></span>
  </div>

  <input type="hidden" asp-for="ReturnUrl" />
  <div class="auth-form-meta">
    <label class="auth-checkbox">
      <input asp-for="RememberMe" />
      <span>@L["Remember me"]</span>
    </label>
    <a asp-area="" asp-controller="Account" asp-action="ForgotPassword">@L["Forgot password?"]</a>
  </div>
  <button type="submit" class="auth-submit-button">@L["Login"]</button>
</form>

<div id="register-modal" class="auth-modal" role="dialog" aria-modal="true" aria-labelledby="register-modal-title">
  <a class="auth-modal-backdrop" href="#" aria-label="@L["Close register dialog"]"></a>
  <div class="auth-modal-panel">
    <a class="auth-modal-close" href="#" aria-label="@L["Close register dialog"]">×</a>
    <div class="auth-modal-heading">
      <h2 id="register-modal-title">@L["New account"]</h2>
      <p>@L["Welcome aboard"]</p>
    </div>

    <div asp-validation-summary="All"></div>
    <form class="auth-form" method="post" asp-area="" asp-controller="Account" asp-action="Register">
      <div class="form-field">
        <label>@L["Email"]</label>
        <input name="Email" type="email" placeholder="@L["Enter your email"]" />
      </div>

      <div class="form-field">
        <label>@L["Password"]</label>
        <input name="Password" type="password" placeholder="@L["Enter your password"]" />
      </div>

      <div class="form-field">
        <label>@L["Confirm Password"]</label>
        <input name="ConfirmPassword" type="password" placeholder="@L["Enter your password again"]" />
      </div>

      <label class="auth-terms">
        <input name="AcceptTerms" type="checkbox" value="true" />
        <input name="AcceptTerms" type="hidden" value="false" />
        <span>
          @L["I have read and agree to the"]
          <a asp-area="" asp-controller="Home" asp-action="Terms" target="_blank" rel="noopener">@L["Terms of Service"]</a>
          @L["and"]
          <a asp-area="" asp-controller="Home" asp-action="Privacy" target="_blank" rel="noopener">@L["Privacy Policy"]</a>.
        </span>
      </label>

      <button type="submit" class="auth-submit-button">@L["Create"]</button>
    </form>
  </div>
</div>
