{block name='account-login'}
    {et_isShopVersionAtLeast value="5.4.0-rc.1" assign='shopIsAtLeast54'}
    {et_isShopVersionAtLeast value="5.5.0-rc.1" assign='shopIsAtLeast55'}
    {block name='account-login-heading'}
        <h1>{if !empty($oRedirect->cName)}{$oRedirect->cName}{else}{lang key='loginTitle' section='login'}{/if}</h1>
    {/block}
    {if !$bCookieErlaubt}
        {block name='account-login-alert-no-cookie'}
            <div role="alert" class="alert alert-danger d-none" id="no-cookies-warning">
                <strong>{lang key='noCookieHeader' section='errorMessages'}</strong>
                {lang key='noCookieDesc' section='errorMessages' assign='noCookieDesc'}
                <p>{sprintf($noCookieDesc, $ShopURL)}</p>
            </div>
        {/block}
        {block name='account-login-script-no-cookie'}
            {inline_script}<script>
               $(function() {
                   if (navigator.cookieEnabled === false) {
                       $('#no-cookies-warning').show();
                   }
               });
            </script>{/inline_script}
        {/block}
    {elseif !$alertNote}
        {block name='account-login-alert'}
            <div role="alert" class="alert alert-info">
                {lang key='loginDesc' section='login'}
                {if isset($oRedirect->cName) && $oRedirect->cName}{lang key='redirectDesc1'} {$oRedirect->cName} {lang key='redirectDesc2'}.{/if}
            </div>
        {/block}
    {/if}

    {block name='account-login-form'}
        {opcMountPoint id='opc_before_login'}
        <div class="et-boxed-content">
            <div class="row login-form">
                <div class="col-12">
                    {block name='account-login-amazonpay-login-placeholder'}
                        <div id="amapay-login" class="amapay-login"></div>
                    {/block}
                    <form
                        method="post"
                        action="{get_static_route id='jtl.php'}"
                        role="form"
                        id="login_form"
                        class="jtl-validate label-slide"
                    >
                        {csrf_token}
                        {if $shopIsAtLeast54 && $showTwoFAForm|default:false}
                            {block name='et-account-login-form-twofa-include'}
                                {include file='snippets/two_fa_login.tpl'}
                            {/block}
                        {else}
                            <fieldset>
                                {block name='account-login-form-submit-legend-login'}
                                    <div class="h3">
                                        {lang key='loginForRegisteredCustomers' section='checkout'}
                                    </div>
                                    {block name='et-account-login-form-required-info'}
                                        {if $shopIsAtLeast55}
                                            <div class="required-info">{lang key='requiredInfo'}</div>
                                        {/if}
                                    {/block}
                                {/block}
                                {block name='account-login-form-submit-body'}
                                    {include file='snippets/form_group_simple.tpl'
                                        options=[
                                            'email', 'email', 'email', null,
                                            {lang key='emailadress'}, true, null, "email"
                                        ]
                                    }

                                    {include file='snippets/form_group_simple.tpl'
                                        options=[
                                            'password', 'password', 'passwort', null,
                                            {lang key='password' section='account data'}, true, null, "current-password"
                                        ]
                                    }

                                    {if isset($showLoginCaptcha) && $showLoginCaptcha}
                                        {block name='account-login-form-submit-captcha'}
                                        {formgroup class="simple-captcha-wrapper"}
                                                {captchaMarkup getBody=true}
                                        {/formgroup}
                                        {/block}
                                    {/if}

                                    {block name='account-login-form-submit'}
                                        {formgroup class="login-form-submit"}
                                            <input type="hidden" name="login" value="1" />
                                            {if !empty($oRedirect->cURL)}
                                                {foreach $oRedirect->oParameter_arr as $oParameter}
                                                    <input type="hidden" name="{$oParameter->Name}" value="{$oParameter->Wert}" />
                                                {/foreach}
                                                <input type="hidden" name="r" value="{$oRedirect->nRedirect}" />
                                                <input type="hidden" name="cURL" value="{$oRedirect->cURL}" />
                                            {/if}
                                            {block name='account-login-form-submit-button'}
                                                {include file="widgets/base/button.tpl" classes="btn-block" variant="primary" type="submit" value="1" label="{lang key='login' section='checkout'}"}
                                            {/block}
                                        {/formgroup}
                                    {/block}
                                    {block name='account-login-form-submit-register'}
                                        <span class="register-wrapper">
                                            {lang key='newHere'}
                                            <a class="register" href="{get_static_route id='registrieren.php'}">
                                                {lang key='registerNow'}
                                            </a>
                                        </span>
                                    {/block}
                                    {block name='account-login-form-submit-resetpw'}
                                        <span class="resetpw-wrapper">
                                        <a class="resetpw" href="{get_static_route id='pass.php'}">
                                            <span class="{et_getIcon key="forgotPassword"}"></span> {lang key='forgotPassword'}
                                        </a>
                                        </span>
                                    {/block}
                                {/block}
                            </fieldset>
                        {/if}
                    </form>
                </div>
            </div>
        </div>
    {/block}
{/block}
