<?php
// views/forgot_password_request.php

// Tampilkan pesan dari sesi
if (isset($_SESSION['error_message'])) {
    echo "<div style='color: #dc3545; background-color: #f8d7da; padding: 12px; border-radius: 6px; text-align: center; margin-bottom: 15px; font-weight: 600;'>" 
        . htmlspecialchars($_SESSION['error_message']) . "</div>";
    unset($_SESSION['error_message']);
}
if (isset($_SESSION['success_message'])) {
    echo "<div style='color: #28a745; background-color: #d4edda; padding: 12px; border-radius: 6px; text-align: center; margin-bottom: 15px; font-weight: 600;'>" 
        . htmlspecialchars($_SESSION['success_message']) . "</div>";
    unset($_SESSION['success_message']);
}
?>

<div style="max-width: 460px; margin: 60px auto; padding: 30px 35px; background-color: #fff; border-radius: 12px; border: 1px solid #eee; box-shadow: 0 8px 24px rgba(0,0,0,0.06); font-family: 'Segoe UI', sans-serif;">
    <h2 style="text-align: center; color: #333; margin-bottom: 16px;">🔐 Lupa Kata Sandi?</h2>
    <p style="text-align: center; color: #666; font-size: 15px; margin-bottom: 30px;">
        Masukkan alamat email yang terdaftar. Kami akan mengirimkan link untuk mengatur ulang kata sandi kamu.
    </p>
    
    <form action="index.php?hal=forgot_password_send_link" method="POST" style="display: flex; flex-direction: column; gap: 20px;">
        <div>
            <label for="email" style="display: block; margin-bottom: 8px; font-weight: 600; color: #444;">Alamat Email</label>
            <input type="email" id="email" name="email" required
                   placeholder="contoh@email.com"
                   style="width: 100%; padding: 12px 14px; border: 1px solid #ccc; border-radius: 6px; font-size: 15px;">
        </div>

        <button type="submit" 
                style="padding: 12px; background-color: #007bff; color: #fff; font-size: 16px; font-weight: bold; border: none; border-radius: 6px; cursor: pointer; transition: background-color 0.2s ease;">
            Kirim Link Reset
        </button>

        <p style="text-align: center; margin-top: 18px; font-size: 14px; color: #666;">
            <a href="index.php?hal=login" style="color: #007bff; text-decoration: none;">← Kembali ke Halaman Login</a>
        </p>
    </form>
</div>
