<div class="login-page-wrapper">
<div class="form-login">
    <h2><?= t('Login') ?></h2>

    <?= $this->hook->render('template:auth:login-form:before') ?>

    <?php if (isset($errors['login'])): ?>
        <p class="alert alert-error"><?= $this->text->e($errors['login']) ?></p>
    <?php endif ?>

    <?php if (! HIDE_LOGIN_FORM): ?>
    <form method="post" action="<?= $this->url->href('AuthController', 'check') ?>">

        <?= $this->form->csrf() ?>

        <div class="input-icon-wrapper">
            <?= $this->form->label(t('Username'), 'username') ?>
            <i class="fa fa-user" aria-hidden="true"></i>
            <?= $this->form->text('username', $values, $errors, array('autofocus', 'required', 'autocomplete="username"', 'placeholder="'.t('Username').'"')) ?>
        </div>

        <div class="input-icon-wrapper">
            <?= $this->form->label(t('Password'), 'password') ?>
            <i class="fa fa-lock" aria-hidden="true"></i>
            <?= $this->form->password('password', $values, $errors, array('required', 'autocomplete="current-password"', 'placeholder="'.t('Password').'"')) ?>
        </div>

        <?php if (isset($captcha) && $captcha): ?>
            <?= $this->form->label(t('Enter the text below'), 'captcha') ?>
            <img src="<?= $this->url->href('CaptchaController', 'image') ?>" alt="Captcha">
            <?= $this->form->text('captcha', array(), $errors, array('required')) ?>
        <?php endif ?>

        <?php if (REMEMBER_ME_AUTH): ?>
            <div class="remember-me-wrapper">
                <?= $this->form->checkbox('remember_me', t('Remember Me'), 1, true) ?>
            </div>
        <?php endif ?>

        <div class="form-actions">
            <button type="submit" class="btn btn-blue"><?= t('Sign in') ?></button>
        </div>
        <?php if ($this->app->config('password_reset') == 1): ?>
            <div class="reset-password">
                <?= $this->url->link(t('Forgot password?'), 'PasswordResetController', 'create') ?>
            </div>
        <?php endif ?>
    </form>
    <?php endif ?>

    <?= $this->hook->render('template:auth:login-form:after') ?>
</div>
</div>
