<!DOCTYPE html>
<html lang="<?= current_locale() ?>">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= __('auth.forgot_title') ?></title>
    <link rel="stylesheet" href="/admin/assets/css/admin.css">
</head>
<body class="login-body">
    <div class="login-container">
        <div class="login-header">
            <h1 class="login-logo">ITSWEBER <span>CMS</span></h1>
        </div>

        <h2 class="login-subtitle"><?= __('auth.forgot_heading') ?></h2>
        <p class="login-hint"><?= __('auth.forgot_text') ?></p>

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

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

        <?php if (empty($success)): ?>
        <form method="POST" action="/admin/forgot-password" class="login-form">
            <?= csrf_field() ?>
            <div class="form-group">
                <label for="email"><?= __('auth.forgot_email') ?></label>
                <input type="email" id="email" name="email" required autofocus
                       placeholder="<?= __('auth.forgot_email_placeholder') ?>">
            </div>
            <button type="submit" class="btn btn-primary btn-full"><?= __('auth.forgot_submit') ?></button>
        </form>
        <?php endif; ?>

        <p class="login-forgot">
            <a href="/admin/login"><?= __('auth.forgot_back') ?></a>
        </p>
    </div>
</body>
</html>
