/* Error / 404 page — CSS-only graphic */

.err-page {
    --err-bg: #f1f5f9;
    --err-card: #ffffff;
    --err-text: #0f172a;
    --err-muted: #64748b;
    --err-line: rgba(148, 163, 184, 0.35);
    --err-blue: #3b82f6;
    --err-indigo: #4f46e5;
    direction: rtl;
    text-align: center;
    font-family: iransans, yekan, Tahoma, sans-serif;
    color: var(--err-text);
    padding: 28px 0 56px;
    background:
        radial-gradient(ellipse 70% 45% at 100% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
        radial-gradient(ellipse 55% 40% at 0% 20%, rgba(99, 102, 241, 0.1), transparent 50%),
        var(--err-bg);
    position: relative;
    overflow: hidden;
}

.err-page a { text-decoration: none !important; }

.err-shell {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 36px 28px 32px;
    background: var(--err-card);
    border: 1px solid var(--err-line);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

/* Decorative CSS shapes — no images */
.err-page::before,
.err-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.err-page::before {
    width: 280px;
    height: 280px;
    top: -60px;
    left: -80px;
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.22), transparent 70%);
    animation: err-float 8s ease-in-out infinite;
}

.err-page::after {
    width: 220px;
    height: 220px;
    bottom: -40px;
    right: -50px;
    background: radial-gradient(circle at 70% 70%, rgba(99, 102, 241, 0.2), transparent 70%);
    animation: err-float 10s ease-in-out infinite reverse;
}

.err-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    margin: 0 auto 18px;
    user-select: none;
}

.err-visual-ring {
    position: absolute;
    width: 168px;
    height: 168px;
    border-radius: 50%;
    border: 2px dashed rgba(99, 102, 241, 0.35);
    animation: err-spin 22s linear infinite;
}

.err-visual-ring::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.18);
}

.err-code {
    position: relative;
    z-index: 1;
    margin: 0;
    font-family: yekan, iransans, Arial, sans-serif;
    font-size: clamp(88px, 18vw, 128px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #1e293b 0%, #3b82f6 45%, #6366f1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: err-pulse 3.6s ease-in-out infinite;
}

.err-code span {
    display: inline-block;
    animation: err-bounce 2.8s ease-in-out infinite;
}

.err-code span:nth-child(2) { animation-delay: .12s; }
.err-code span:nth-child(3) { animation-delay: .24s; }

.err-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
}

.err-badge i { color: #4f46e5; }

.err-title {
    margin: 0 0 10px;
    font-family: yekan, iransans;
    font-size: clamp(22px, 4vw, 28px);
    font-weight: 700;
    color: var(--err-text);
}

.err-sub {
    margin: 0 auto 22px;
    max-width: 420px;
    font-size: 14px;
    line-height: 2;
    color: var(--err-muted);
}

.err-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.err-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-family: yekan, iransans;
    font-size: 13px;
    font-weight: 700;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.err-btn-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.err-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(59, 130, 246, 0.35);
    color: #fff !important;
}

.err-btn-ghost {
    color: #334155 !important;
    background: #f8fafc;
    border: 1px solid var(--err-line);
}

.err-btn-ghost:hover {
    background: #eef2ff;
    color: #3730a3 !important;
}

.err-hints {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid #f1f5f9;
}

.err-hint {
    padding: 14px 10px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.err-hint i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
    font-size: 14px;
}

.err-hint strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--err-text);
}

.err-hint span {
    display: block;
    font-size: 12px;
    line-height: 1.8;
    color: var(--err-muted);
}

@keyframes err-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(18px); }
}

@keyframes err-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes err-pulse {
    0%, 100% { filter: saturate(1); opacity: 1; }
    50% { filter: saturate(1.15); opacity: 0.92; }
}

@keyframes err-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@media screen and (max-width: 640px) {
    .err-page { padding: 16px 0 40px; }

    .err-shell {
        padding: 28px 18px 24px;
        border-radius: 20px;
    }

    .err-visual { min-height: 140px; }

    .err-visual-ring {
        width: 132px;
        height: 132px;
    }

    .err-hints {
        grid-template-columns: 1fr;
    }

    .err-actions {
        flex-direction: column;
    }

    .err-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .err-page::before,
    .err-page::after,
    .err-visual-ring,
    .err-code,
    .err-code span {
        animation: none;
    }
}
