/* ========== 404 Page ========== */
.page404 {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 24px 64px;
    background:
        radial-gradient(circle at 20% 20%, rgba(247, 70, 84, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(4, 90, 255, 0.06) 0%, transparent 40%),
        #fafbfc;
    position: relative;
    overflow: hidden;
}
.page404::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(10, 14, 39, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 14, 39, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}
.page404-inner {
    position: relative;
    z-index: 1;
    max-width: 880px;
    width: 100%;
    text-align: center;
}

/* === Animated 404 graphic === */
.page404-graphic {
    position: relative;
    width: 360px;
    height: 200px;
    margin: 0 auto 32px;
}
.page404-orbit {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.page404-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F74654;
    opacity: 0.8;
    animation: floatDot 4s ease-in-out infinite;
}
.page404-dot-1 { top: 10%; left: 8%; background: #F74654; animation-delay: 0s; }
.page404-dot-2 { top: 60%; right: 10%; background: #045AFF; animation-delay: 1.3s; width: 6px; height: 6px; }
.page404-dot-3 { top: 25%; right: 18%; background: #ff9f0a; animation-delay: 2.6s; width: 5px; height: 5px; }

@keyframes floatDot {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0.8; }
    50% { transform: translateY(-18px) translateX(8px); opacity: 0.4; }
}

.page404-number {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}
.page404-digit {
    font-size: 168px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #0A0E27 0%, #2c3e50 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -8px;
    -webkit-user-select: none;
    user-select: none;
}
.page404-digit.page404-0 {
    width: 138px;
    height: 138px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: spin0 8s linear infinite;
}
.page404-digit.page404-0 svg { width: 100%; height: 100%; }
@keyframes spin0 {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === Text === */
.page404-title {
    font-size: 36px;
    font-weight: 800;
    color: #0A0E27;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}
.page404-subtitle {
    font-size: 17px;
    color: #5a6072;
    margin: 0 0 12px;
    line-height: 1.6;
}
.page404-path {
    font-size: 13px;
    color: #9aa0a6;
    margin: 0 0 28px;
}
.page404-path code {
    background: rgba(10, 14, 39, 0.05);
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 12.5px;
    color: #F74654;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    word-break: break-all;
}

/* === Action buttons === */
.page404-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 36px;
}
.page404-actions .btn-lg {
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
}

/* === Search === */
.page404-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: #ffffff;
    border: 1.5px solid rgba(10, 14, 39, 0.08);
    border-radius: 14px;
    padding: 4px 4px 4px 16px;
    max-width: 520px;
    margin: 0 auto 48px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(10, 14, 39, 0.04);
}
.page404-search:focus-within {
    border-color: var(--primary-blue);
    box-shadow: 0 6px 24px rgba(4, 90, 255, 0.12);
}
.page404-search svg { color: #9aa0a6; flex-shrink: 0; }
.page404-search input {
    flex: 1;
    border: none;
    outline: none;
    padding: 13px 12px;
    font-size: 14.5px;
    background: transparent;
    color: #0A0E27;
    font-family: inherit;
}
.page404-search input::placeholder { color: #9aa0a6; }
.page404-search button {
    padding: 11px 22px;
    border: none;
    background: linear-gradient(135deg, #F74654 0%, #e83545 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.page404-search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(247, 70, 84, 0.32);
}

/* === Suggestion grid === */
.page404-suggestions { margin-top: 48px; }
.page404-suggestions h2 {
    font-size: 18px;
    font-weight: 700;
    color: #0A0E27;
    margin: 0 0 20px;
    text-align: left;
}
.page404-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.page404-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid rgba(10, 14, 39, 0.06);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    text-align: left;
}
.page404-card:hover {
    transform: translateY(-3px);
    border-color: rgba(4, 90, 255, 0.2);
    box-shadow: 0 12px 28px rgba(10, 14, 39, 0.08);
}
.page404-card-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.page404-card-body h3 {
    font-size: 14.5px;
    font-weight: 700;
    color: #0A0E27;
    margin: 0 0 3px;
}
.page404-card-body p {
    font-size: 12.5px;
    color: #6b6b6b;
    margin: 0;
    line-height: 1.4;
}

.page404-help {
    margin-top: 36px;
    font-size: 14px;
    color: #6b6b6b;
}
.page404-help a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}
.page404-help a:hover { text-decoration: underline; }

/* === Responsive === */
@media (max-width: 768px) {
    .page404 { padding: 60px 16px 48px; }
    .page404-graphic { width: 280px; height: 160px; margin-bottom: 24px; }
    .page404-digit { font-size: 130px; letter-spacing: -6px; }
    .page404-digit.page404-0 { width: 108px; height: 108px; }
    .page404-title { font-size: 26px; }
    .page404-subtitle { font-size: 15px; }
    .page404-actions .btn-lg { padding: 12px 20px; font-size: 14px; }
    .page404-search { max-width: 100%; }
    .page404-search button { padding: 10px 16px; font-size: 13px; }
    .page404-grid { grid-template-columns: 1fr; gap: 10px; }
    .page404-card { padding: 14px; }
}
@media (max-width: 1024px) and (min-width: 769px) {
    .page404-grid { grid-template-columns: repeat(2, 1fr); }
}
