{block name='account-password-content'}
    {et_isShopVersionAtLeast value="5.2.0-beta" assign='shopIsAtLeast52'}
    {et_isShopVersionAtLeast value="5.3.0-rc.3" assign='shopIsAtLeast53'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {block name='account-password-include-extension'}
        {include file='snippets/extension.tpl'}
    {/block}
    {$inWidget = $inWidget|default:false}
    <div class="{if !$inWidget}container{if isset($Link) && $Link->getIsFluid() === true}-fluid{/if}{/if} account-password">
        <div class="et-boxed-content">
            {if !$inWidget}
                {block name='account-password-heading'}
                    <div class="account-password-heading">
                        <h1>{lang key='forgotPassword' section='global'}</h1>
                    </div>
                {/block}
            {/if}
            {if $step === 'formular' || $shopIsAtLeast52 && $step !== 'confirm'}
                <div class="row">
                    <div class="col col-12">
                        {block name='account-password-alert'}
                            {$alertList->displayAlertByKey('forgotPasswordDesc')}
                        {/block}
                        {block name='account-password-form-password-reset'}
                            <form id="passwort_vergessen"
                                action="{get_static_route id='pass.php'}{if $bExclusive === true}?exclusive_content=1{/if}"
                                method="post"
                                class="jtl-validate label-slide"
                            >
                                {csrf_token}
                                {if $shopIsAtLeast53}{honeypot}{/if}
                                {block name='account-password-form-password-reset-content'}
                                    {block name='et-account-password-form-password-reset-required-info'}
                                        {if $shopIsAtLeast55}
                                            <div class="required-info">{lang key='requiredInfo'}</div>
                                        {/if}
                                    {/block}
                                    <fieldset>
                                        {block name='account-password-form-reset-legend'}
                                            {* intentionally left empty - JTL would add a <legend>{lang key='emailadress'}</legend> element here, but this is not consistent with other forms. *}
                                        {/block}
                                        {include file='snippets/form_group_simple.tpl'
                                        options=[
                                        'email', 'email', 'email', "{if $presetEmail !== ''}{$presetEmail}{/if}",
                                        {lang key='emailadress'}, true
                                        ]
                                        }
                                        {if (!isset($smarty.session.bAnti_spam_already_checked) || $smarty.session.bAnti_spam_already_checked !== true)
                                        && isset($Einstellungen.kunden.forgot_password_captcha) && $Einstellungen.kunden.forgot_password_captcha !== 'N'}
                                            <div class="form-group float-label-control{if isset($fehlendeAngaben.captcha) && $fehlendeAngaben.captcha !== false} has-error{/if}">
                                                {captchaMarkup getBody=true}
                                            </div>
                                            <hr>
                                        {/if}
                                        {block name='account-password-form-reset-submit'}
                                            <div class="row">
                                                <div class="col col-md-auto ml-md-auto">
                                                    {if $bExclusive === true}
                                                        <input type="hidden" name="exclusive_content" value="1" />
                                                    {/if}
                                                    <input type="hidden" name="passwort_vergessen" value="1" />
                                                    {include file="widgets/base/button.tpl" type="submit" value="1" variant="primary" classes="btn-block submit_once" label="{lang key='createNewPassword' section='forgot password'}"}
                                                </div>
                                            </div>
                                        {/block}
                                    </fieldset>
                                {/block}
                            </form>
                        {/block}
                    </div>
                </div>
            {elseif $shopIsAtLeast52 || $step === 'confirm'}
                <div class="row">
                    <div class="col col-12">
                        {block name='account-password-form-password-reset-confirm'}
                            <div class="h3">
                                {block name='account-password-password-reset-confirm-title'}{lang key='customerInformation' section='global'}{/block}
                            </div>
                            <form id="passwort_vergessen" action="{get_static_route id='pass.php'}{if $bExclusive === true}?exclusive_content=1{/if}" method="post" class="jtl-validate label-slide">
                                {csrf_token}

                                {block name='account-password-form-password-reset-confirm-content'}
                                    <fieldset>
                                        {include file='snippets/form_group_simple.tpl'
                                        options=[
                                        "password", "pw_new", "pw_new", null,
                                        {lang key='password' section='account data'}, true, null, "new-password"
                                        ]
                                        }
                                        {include file='snippets/form_group_simple.tpl'
                                        options=[
                                        "password", "pw_new_confirm", "pw_new_confirm", null,
                                        {lang key='passwordRepeat' section='account data'}, true, null, "new-password"
                                        ]
                                        }
                                        {block name='account-password-form-confirm-submit'}
                                            {formgroup}
                                                {if $bExclusive === true}
                                                    <input type="hidden" name="exclusive_content" value="1">
                                                {/if}
                                                <input type="hidden" name="fpwh" value="{$fpwh}" />
                                                {include file="widgets/base/button.tpl" type="submit" value="1" variant="primary" classes="btn-block submit_once" label="{lang key='confirmNewPassword' section='forgot password'}"}
                                            {/formgroup}
                                        {/block}
                                    </fieldset>
                                {/block}
                            </form>
                        {/block}
                    </div>
                </div>
            {elseif !$shopIsAtLeast52}
                {* The language variable used here has been removed from the core in Shop 5.2.x *}
                {block name='account-password-alert-success'}
                    <div role="alert" class="alert alert-success">{lang key='newPasswortWasGenerated' section='forgot password'}</div>
                {/block}
            {/if}
            </div>
    </div>
{/block}