<!DOCTYPE html>
<html lang="<?= current_locale() ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= __('auth.login_title') ?></title>
    <link rel="stylesheet" href="/admin/assets/css/admin.css">
</head>
<body class="login-body">
    <div class="login-container">
        <div class="login-header">
            <a href="/" class="login-brand-link" title="<?= __('auth.login_to_site') ?>">
                <img src="/admin/assets/images/brand/itsweber-logo.png"
                     alt="ITSWEBER"
                     class="login-brand-logo"
                     onerror="this.style.display='none';this.nextElementSibling.style.display='block'">
                <h1 class="login-logo" style="display:none">ITSWEBER <span>CMS</span></h1>
            </a>
        </div>

        <?php if (!empty($reset_done)): ?>
        <div class="alert alert-success"><?= htmlspecialchars($reset_done) ?></div>
        <?php endif; ?>

        <?php if (!empty($error)): ?>
        <div class="alert alert-error"><?= htmlspecialchars($error) ?></div>
        <?php endif; ?>

        <form method="POST" action="/admin/login" class="login-form">
            <?= csrf_field() ?>
            <div class="form-group">
                <label for="username"><?= __('auth.login_username') ?></label>
                <input type="text" id="username" name="username" required autofocus>
            </div>
            <div class="form-group">
                <label for="password"><?= __('auth.login_password') ?></label>
                <input type="password" id="password" name="password" required>
            </div>
            <button type="submit" class="btn btn-primary btn-full"><?= __('auth.login_submit') ?></button>
        </form>
        <p class="login-forgot">
            <a href="/admin/forgot-password"><?= __('auth.login_forgot') ?></a>
        </p>
    </div>
</body>
</html>
