<?php $editing = ($deniedAction ?? 'view') === 'edit';
$module = $deniedModule ?? t('access.requested'); ?>
<div class="row justify-content-center py-5">
    <div class="col-md-8 col-lg-6">
        <div class="card text-center overflow-hidden">
            <div class="card-status-top bg-orange"></div>
            <div class="card-body p-5">
                <div class="display-3 mb-3">🔒</div>
                <div class="text-uppercase text-muted fw-bold small mb-2"><?= h(t('access.denied')) ?></div>
                <h2 class="mb-3"><?= h(t($editing ? 'access.edit_denied' : 'access.page_denied')) ?></h2>
                <p class="text-muted mb-4">
                    <?= h(t($editing ? 'access.explanation_edit' : 'access.explanation_view', ['module' => $module])) ?>
                </p>
                <div class="d-flex flex-wrap justify-content-center gap-2"><a class="btn btn-primary"
                        href="<?= h(PermissionService::firstAllowedPath()) ?>"><?= h(t('access.back_space')) ?></a><button
                        class="btn btn-outline-secondary" type="button"
                        onclick="history.back()"><?= h(t('access.previous')) ?></button></div>
            </div>
        </div>
    </div>
</div>
