<?php require APPROOT . '/app/Views/layouts/header.php'; ?>
<div class="max-w-md mx-auto mt-10 mb-10">
    <div class="bg-white dark:bg-gray-800 p-8 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700/50 relative overflow-hidden">
        <div class="absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-primary to-blue-500"></div>

        <div class="text-center mb-8">
            <h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-2">Reset Password</h2>
            <p class="text-sm text-gray-600 dark:text-gray-400">Enter your registered email address and we will send you a secure link to reset your password.</p>
        </div>
        
        <form action="<?php echo URLROOT; ?>/users/forgotPassword" method="POST" class="space-y-6">
            <?php echo csrfField(); ?>
            
            <div>
                <label for="email" class="block text-[10px] font-bold text-gray-500 uppercase tracking-wider mb-2">Email Address</label>
                <input type="email" name="email" class="w-full px-4 py-2.5 rounded-lg border <?php echo (!empty($data['email_err'])) ? 'border-red-500' : 'border-gray-300 dark:border-gray-700'; ?> bg-gray-50 dark:bg-gray-900/50 text-gray-900 dark:text-white focus:ring-2 focus:ring-primary focus:outline-none transition-colors" value="<?php echo $data['email']; ?>" autofocus>
                <span class="text-xs text-red-500 mt-1 block"><?php echo $data['email_err']; ?></span>
            </div>
            
            <div class="pt-2 flex flex-col space-y-4">
                <button type="submit" class="w-full bg-primary hover:opacity-90 text-white font-bold py-2.5 px-6 rounded-lg transition-all focus:ring-4 focus:ring-primary/50 shadow-sm">
                    Send Reset Link
                </button>
                <div class="text-center">
                    <a href="<?php echo URLROOT; ?>/users/login" class="text-sm text-gray-500 dark:text-gray-400 hover:text-primary dark:hover:text-primary font-medium transition-colors flex items-center justify-center">
                        <svg class="w-4 h-4 mr-1.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path></svg>
                        Back to Login
                    </a>
                </div>
            </div>
        </form>
    </div>
</div>
<?php require APPROOT . '/app/Views/layouts/footer.php'; ?>