<!-- app/Views/user/password_reset_confirmation.php -->
<div class="modal fade" id="emailConfirmModal" tabindex="-1" aria-labelledby="emailConfirmLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content rounded-4 shadow border-0" style="max-width: 600px; margin: auto;">

            <div class="modal-body text-center">
                <img src="<?= base_url('assets/images/alrahma_logo.png') ?>" alt="Logo" style="width: 120px; height: 120px; border-radius: 50%; object-fit: cover;">
                <h5 class="modal-title text-success" id="emailConfirmLabel">Check Your Email</h5>
                <p class="lead mt-3">
                    A link to reset the password has been sent to this email:<br>
                    <strong><?= esc(session()->getFlashdata('email')) ?></strong>
                </p>
                <p>Please check your inbox and follow the instructions to reset the password.</p>
                <a href="<?= base_url('login') ?>" class="btn btn-success mt-3">Return to Login</a>
            </div>
        </div>
    </div>
</div>

<?php if (session()->getFlashdata('show_modal')): ?>
    <script>
        window.addEventListener('DOMContentLoaded', function() {
            const modal = new bootstrap.Modal(document.getElementById('emailConfirmModal'));
            modal.show();
        });
    </script>
<?php endif; ?>