/* ============================================================
 * Not Found / 404 page — namespace .nf-
 * Brand : #16489f (var --app-them), #1ea64a (var --app-second-them)
 * ========================================================== */

html, body { margin: 0; padding: 0; overflow-x: hidden; }
body { background: #f8fafc; }
/* template-error wraps content in .page-content[style=display:none] — force visible */
.page-content { display: block !important; }

.nf-page {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at 20% 20%, rgba(22, 72, 159, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(30, 166, 74, 0.10) 0%, transparent 55%),
        linear-gradient(135deg, #f8fafc 0%, #eef2f8 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1;
    box-sizing: border-box;
}

.nf-page::before,
.nf-page::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}
.nf-page::before {
    width: 420px; height: 420px;
    top: -120px; left: -120px;
    background: rgba(22, 72, 159, 0.18);
}
.nf-page::after {
    width: 360px; height: 360px;
    bottom: -100px; right: -100px;
    background: rgba(30, 166, 74, 0.16);
}

.nf-card {
    position: relative;
    z-index: 1;
    padding: 3.5rem 3rem 2.75rem;
    text-align: center;
    max-width: 520px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: nf-fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nf-card > * {
    flex: 0 0 auto;
}

@keyframes nf-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ====== Orbital compass mark ====== */
.nf-orbit {
    position: relative;
    width: 168px;
    height: 168px;
    margin: 0 auto 1.5rem;
}

.nf-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(22, 72, 159, 0.10);
}
.nf-ring-1 {
    inset: 12px;
    border-color: rgba(22, 72, 159, 0.14);
    animation: nf-spin 14s linear infinite;
}
.nf-ring-2 {
    inset: 24px;
    border-color: rgba(22, 72, 159, 0.18);
    border-style: dashed;
    animation: nf-spin 22s linear infinite reverse;
}
.nf-ring-3 {
    inset: 0;
    border-color: rgba(22, 72, 159, 0.06);
}

@keyframes nf-spin {
    to { transform: rotate(360deg); }
}

.nf-mark {
    position: absolute;
    inset: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16489f 0%, #1d5fc9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow:
        0 18px 35px -12px rgba(22, 72, 159, 0.55),
        inset 0 2px 4px rgba(255, 255, 255, 0.25);
    animation: nf-wobble 6s ease-in-out infinite;
}
.nf-mark i {
    font-size: 48px;
    line-height: 1;
}

@keyframes nf-wobble {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-6deg); }
    75%      { transform: rotate(6deg); }
}

/* ====== Brand lockup ====== */
.nf-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 1.25rem 0.6rem 0.6rem;
    background: linear-gradient(135deg, rgba(22, 72, 159, 0.08) 0%, rgba(30, 166, 74, 0.08) 100%);
    border: 1px solid rgba(22, 72, 159, 0.18);
    border-radius: 14px;
    margin: 0.75rem 0 2.25rem;
}

.nf-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #16489f 0%, #1d5fc9 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px -4px rgba(22, 72, 159, 0.5);
    flex-shrink: 0;
}
.nf-brand-mark i {
    font-size: 22px;
    line-height: 1;
}

.nf-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.nf-brand-name {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.nf-brand-name span {
    color: #0f172a;
}
.nf-brand-name strong {
    color: #1ea64a;
    font-weight: 800;
}

.nf-brand-tagline {
    margin-top: 0.18rem;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

/* ====== Content ====== */
.nf-code {
    font-size: 3.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1;
    background: linear-gradient(135deg, #16489f 0%, #1ea64a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-shadow: 0 6px 24px rgba(22, 72, 159, 0.18);
    margin: 0 0 0.75rem;
}

.nf-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem;
    line-height: 1.25;
}

.nf-subtitle {
    font-size: 1rem;
    color: #475569;
    margin: 0 0 0.6rem;
    line-height: 1.6;
}

.nf-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 2.25rem;
    line-height: 1.55;
}

/* ====== Actions ====== */
.nf-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.nf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.78rem 1.5rem;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    cursor: pointer;
    border: 1px solid transparent;
}
.nf-btn i {
    font-size: 1.15rem;
    line-height: 1;
}

.nf-btn-primary {
    background: #16489f;
    color: #ffffff;
    box-shadow: 0 8px 20px -6px rgba(22, 72, 159, 0.55);
}
.nf-btn-primary:hover {
    background: #103a82;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -6px rgba(22, 72, 159, 0.65);
}

.nf-btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #e2e8f0;
}
.nf-btn-secondary:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* ====== Responsive ====== */
@media (max-width: 540px) {
    .nf-card {
        padding: 2.5rem 1.5rem 2rem;
    }
    .nf-orbit { width: 140px; height: 140px; }
    .nf-mark i { font-size: 40px; }
    .nf-code { font-size: 2.85rem; }
    .nf-title { font-size: 1.5rem; }
    .nf-subtitle { font-size: 0.93rem; }
    .nf-actions { flex-direction: column; }
    .nf-btn { width: 100%; justify-content: center; }
}
