/* =====================================================================
   "You can't open this" / "Page not found" — iOS 26 card
   ---------------------------------------------------------------------
   Markup: app/Views/errors/friendly_card.php, used by /forbidden, the
   404 override (App\Controllers\Not_found) and the stand-alone
   errors/html/error_404.php (show_404()).
   Colours come from the --ios26-* tokens (assets/css/ios26-tokens.css),
   which flip under body.color-1E202D, so one rule set covers light and
   dark. The fallbacks after each var() are the light values, for a page
   that did not load the tokens.
   ===================================================================== */

.nz-err26 {
    --e-ink: var(--ios26-text, #1d1d1f);
    --e-muted: var(--ios26-muted, #6e6e73);
    --e-surface: var(--ios26-surface-strong, rgba(255, 255, 255, .78));
    --e-group: var(--ios26-fill, rgba(17, 24, 39, .05));
    --e-hairline: var(--ios26-hairline, rgba(17, 24, 39, .08));
    --e-edge: var(--ios26-edge, rgba(255, 255, 255, .65));
    --e-accent: #2f5fd6; /* white on it 5.3:1 — the token #4076f2 is 4.1:1 */
    --e-accent-soft: var(--ios26-accent-soft, rgba(102, 144, 244, .12));
    --e-shadow: var(--ios26-shadow-2, 0 2px 6px rgba(17, 24, 39, .06), 0 18px 44px rgba(17, 24, 39, .13));
    --e-inset: var(--ios26-inset, inset 0 1px 0 rgba(255, 255, 255, .7));
    --e-blur: var(--ios26-blur, blur(24px) saturate(170%));
    --e-spring: var(--ios26-spring, cubic-bezier(.34, 1.32, .5, 1));
    --e-glyph: #4076f2;
    --e-glyph-2: #8fb0ff;
    --e-btn-ink: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 48px 16px;
}

.nz-err26-not_found {
    --e-glyph: #c2410c;
    --e-glyph-2: #fdba74;
}

body.color-1E202D .nz-err26 {
    --e-accent: #8ea2ff;
    --e-glyph: #8ea2ff;
    --e-glyph-2: #4a61d8;
    --e-btn-ink: #10131c;
}

body.color-1E202D .nz-err26 .nz-err26-not_found {
    --e-glyph: #fdba74;
    --e-glyph-2: #c2410c;
}

/* ---------------------------------------------------------------- card */
.nz-err26-card {
    width: 100%;
    max-width: 520px;
    margin: 4vh auto 0;
    padding: 36px 32px 28px;
    text-align: center;
    color: var(--e-ink);
    background: var(--e-surface);
    -webkit-backdrop-filter: var(--e-blur);
    backdrop-filter: var(--e-blur);
    border: 1px solid var(--e-edge);
    border-radius: 28px;
    box-shadow: var(--e-shadow), var(--e-inset);
    animation: nz-err26-rise .55s var(--e-spring) both;
}

.nz-err26-in-modal {
    min-height: 0;
    padding: 8px 0;
}

.nz-err26-in-modal .nz-err26-card {
    margin: 0 auto;
    box-shadow: none;
    border: 0;
    background: transparent;
}

/* ---------------------------------------------------------------- hero */
.nz-err26-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.nz-err26-glyph {
    width: 88px;
    height: 88px;
    border-radius: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--e-accent-soft);
    border: 1px solid var(--e-hairline);
    box-shadow: var(--e-inset);
    --fa-primary-color: var(--e-glyph);
    --fa-secondary-color: var(--e-glyph-2);
    --fa-secondary-opacity: .55;
    animation: nz-err26-float 6s ease-in-out infinite;
}

.nz-err26-not_found .nz-err26-glyph {
    background: rgba(234, 88, 12, .10);
}

body.color-1E202D .nz-err26-not_found .nz-err26-glyph {
    background: rgba(253, 186, 116, .12);
}

.nz-err26-title,
.nz-err26-list li {
    font-family: inherit;
}

.nz-err26-title {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 10px;
    color: var(--e-ink);
}

.nz-err26-lead {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 auto 24px;
    max-width: 420px;
    color: var(--e-muted);
}

/* ------------------------------------------------- inset grouped list */
.nz-err26-group {
    text-align: left;
    margin-bottom: 18px;
}

.nz-err26-group-head {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--e-muted);
    padding: 0 14px 6px;
}

.nz-err26-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--e-group);
    border-radius: 16px;
    overflow: hidden;
}

.nz-err26-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--e-ink);
    position: relative;
}

.nz-err26-list li + li::before {
    content: "";
    position: absolute;
    top: 0;
    left: 54px;
    right: 0;
    border-top: 1px solid var(--e-hairline);
}

.nz-err26-row-icon {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--e-accent);
    background: var(--e-accent-soft);
}

.nz-err26-next {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
    color: var(--e-muted);
    margin: 0 0 24px;
    padding: 0 14px;
}

.nz-err26-next i {
    margin-top: 3px;
    color: var(--e-accent);
}

/* ------------------------------------------------------------- buttons */
.nz-err26-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nz-err26-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform .2s var(--e-spring), filter .2s ease, background-color .2s ease;
}

.nz-err26-btn:active {
    transform: scale(.97);
}

.nz-err26-btn:focus-visible {
    outline: 3px solid var(--ios26-accent-ring, rgba(102, 144, 244, .32));
    outline-offset: 2px;
}

.nz-err26-btn-primary,
.nz-err26-btn-primary:hover,
.nz-err26-btn-primary:focus {
    background: var(--e-accent);
    color: var(--e-btn-ink) !important;
}

.nz-err26-btn-primary:hover {
    filter: brightness(1.06);
}

.nz-err26-btn-tinted,
.nz-err26-btn-tinted:hover,
.nz-err26-btn-tinted:focus {
    background: var(--e-accent-soft);
    color: var(--e-accent) !important;
}

.nz-err26-btn-tinted:hover {
    filter: brightness(1.04);
}

/* -------------------------------------------- stand-alone page (show_404) */
body.nz-err26-page {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    min-height: 100vh;
    background: radial-gradient(1200px 600px at 50% -10%, #e6edff 0%, transparent 60%), #f2f3f7;
}

body.nz-err26-page.color-1E202D {
    background: radial-gradient(1200px 600px at 50% -10%, #262b44 0%, transparent 60%), #1e202d;
}

body.nz-err26-page .nz-err26 {
    min-height: 100vh;
}

/* -------------------------------------------------------------- motion */
@keyframes nz-err26-rise {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes nz-err26-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@media (prefers-reduced-motion: reduce) {
    .nz-err26-card,
    .nz-err26-glyph {
        animation: none;
    }
}

@media (max-width: 575px) {
    .nz-err26 {
        padding: 20px 16px;
        min-height: 0;
    }

    .nz-err26-card {
        margin-top: 8px;
        padding: 28px 20px 20px;
        border-radius: 24px;
    }

    .nz-err26-title {
        font-size: 22px;
    }
}
