<?php
$pageTitle = 'Forgot Password';
$pageDescription = 'Reset your password to regain access to your account.';
include __DIR__ . '/../layout/header.php';
?>

<div class="container mx-auto px-4 py-8">
    <div class="max-w-md mx-auto bg-card-bg rounded-xl shadow-lg overflow-hidden">
        <div class="p-6">
            <div class="text-center mb-6">
                <?php if (!empty($settings['logo_path'])): ?>
                <img src="<?= htmlspecialchars($settings['logo_path']) ?>" alt="<?= htmlspecialchars($settings['site_title'] ?? 'Game Portal') ?>" class="h-12 mx-auto mb-4">
                <?php else: ?>
                <h1 class="text-2xl font-bold text-primary"><?= htmlspecialchars($settings['site_title'] ?? 'Game Portal') ?></h1>
                <?php endif; ?>
                <h2 class="text-xl font-semibold">Forgot Your Password?</h2>
                <p class="text-gray-400 mt-1">Enter your email to reset your password</p>
            </div>
            
            <?php if (!empty($error)): ?>
            <div class="bg-red-900/50 border border-red-500 text-red-100 px-4 py-3 rounded mb-4">
                <p><?= htmlspecialchars($error) ?></p>
            </div>
            <?php endif; ?>
            
            <?php if (!empty($success)): ?>
            <div class="bg-green-900/50 border border-green-500 text-green-100 px-4 py-3 rounded mb-4">
                <p><?= htmlspecialchars($success) ?></p>
            </div>
            <?php endif; ?>
            
            <form method="POST" action="/forgot-password" class="space-y-4">
                <div>
                    <label for="email" class="block text-sm font-medium text-gray-300 mb-1">Email</label>
                    <input type="email" id="email" name="email" class="w-full px-4 py-2 rounded-lg bg-darker border border-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent" required value="<?= htmlspecialchars($_POST['email'] ?? '') ?>">
                </div>
                
                <div>
                    <button type="submit" class="w-full bg-primary hover:bg-primary-dark text-white font-bold py-2 px-4 rounded-lg transition duration-200">
                        Send Reset Link
                    </button>
                </div>
                
                <div class="text-center text-sm text-gray-400">
                    Remember your password? <a href="/login" class="text-primary hover:underline">Login</a>
                </div>
            </form>
        </div>
    </div>
</div>

<?php include __DIR__ . '/../layout/footer.php'; ?>
