<?php
declare(strict_types=1);
?>
<section class="content-section form-section">
    <div class="container narrow-container auth-card">
        <p class="eyebrow"><?= quaeriva_t($translator, 'auth.login') ?></p>
        <h1><?= quaeriva_t($translator, 'auth.login_title') ?></h1>
        <p class="section-lede"><?= quaeriva_t($translator, 'auth.login_intro') ?></p>
        <?php if (($error ?? '') !== ''): ?><p class="notice notice-error" role="alert"><?= quaeriva_escape($error) ?></p><?php endif; ?>
        <?php if (($notice ?? '') !== ''): ?><p class="notice notice-muted" role="status"><?= quaeriva_escape($notice) ?></p><?php endif; ?>
        <form class="question-form" method="post" action="<?= quaeriva_escape(quaeriva_url('login')) ?>">
            <input type="hidden" name="_csrf" value="<?= quaeriva_escape($csrfToken) ?>">
            <input type="hidden" name="redirect" value="<?= quaeriva_escape($redirect ?? '') ?>">
            <div class="field-group"><label for="login-email"><?= quaeriva_t($translator, 'auth.email') ?></label><input id="login-email" name="email" type="email" required autocomplete="email" value="<?= quaeriva_escape($values['email'] ?? '') ?>"></div>
            <div class="field-group"><label for="login-password"><?= quaeriva_t($translator, 'auth.password') ?></label><input id="login-password" name="password" type="password" required autocomplete="current-password"></div>
            <div class="field-group auth-remember-group"><label class="checkbox-label" for="login-remember"><input id="login-remember" name="remember" type="checkbox" value="1" <?= !empty($values['remember']) ? 'checked' : '' ?>> <span><?= quaeriva_t($translator, 'auth.remember_me') ?></span></label></div>
            <button class="button" type="submit"><?= quaeriva_t($translator, 'auth.login') ?></button>
        </form>
        <div class="auth-links"><?php if (($site['registration_enabled'] ?? true) === true): ?><a href="<?= quaeriva_escape(quaeriva_url('register')) ?>"><?= quaeriva_t($translator, 'auth.create_account') ?></a><?php endif; ?><a href="<?= quaeriva_escape(quaeriva_url('forgot-password')) ?>"><?= quaeriva_t($translator, 'auth.forgot_password') ?></a></div>
    </div>
</section>
