@inherits Dynamicweb.Rendering.ViewModelTemplate<UserForgotPasswordViewModel>
@using Dynamicweb.Users.Frontend.UserForgotPassword

<div class="mx-auto w-100" style="max-width: 30rem;">
    @if (Model.Result == UserForgotPasswordResultType.MissingValue)
    {
        <div class="alert alert-danger" role="alert">
            @Translate("Please provide either a username or email address")
        </div>
    }
    else if (Model.Result == UserForgotPasswordResultType.Success)
    {
        <div class="alert alert-success" role="alert">
            @Translate("Check your email - we sent you an email with a link to reset your password")
        </div>
    }
    else if (Model.Result != UserForgotPasswordResultType.None)
    {
        <div class="alert alert-danger">@Translate(Model.Result.ToString())</div>
    }

    <form method="post">
        <div class="form-floating mb-4">
            <input type="email" name="Email" id="Email" class="form-control" placeholder="@Translate("Email")" required>
            <label for="Email">@Translate("Email")</label>
            <div class="invalid-feedback" for="Email">@Translate("Please enter a valid email")</div>
        </div>

        <button type="submit" name="cmd" value="RecoverPassword" class="btn btn-primary w-100" data-dw-button="primary"
            id="PasswordRecoveryButton">@Translate("Send password link")</button>
    </form>
</div>
