@-webkit-keyframes not-found-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes not-found-rise {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@-webkit-keyframes not-found-digit-in {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes not-found-digit-in {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@-webkit-keyframes not-found-ring-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 var(--accent-shadow-soft),
            inset 0 0 24px var(--accent-shadow-light);
    }
    50% {
        transform: scale(1.03);
        box-shadow:
            0 0 48px var(--accent-shadow-strong),
            inset 0 0 32px var(--accent-shadow-medium);
    }
}

@keyframes not-found-ring-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 0 var(--accent-shadow-soft),
            inset 0 0 24px var(--accent-shadow-light);
    }
    50% {
        transform: scale(1.03);
        box-shadow:
            0 0 48px var(--accent-shadow-strong),
            inset 0 0 32px var(--accent-shadow-medium);
    }
}

@-webkit-keyframes not-found-orb-drift {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(18px, -24px) scale(1.08);
    }
}

@keyframes not-found-orb-drift {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(18px, -24px) scale(1.08);
    }
}

.not-found-page {
    --not-found-digit-size: clamp(7rem, 28vw, 15rem);
    --not-found-zero-size: clamp(5.5rem, 22vw, 11.5rem);
    --not-found-logo-chip-width: min(100%, 280px);
    --not-found-shul-icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36.629 36'%3E%3Cpath d='M0 0V36H36.629V0H0ZM20.3969 33.3999H16.2359V20.4887C16.2359 19.3595 17.1694 18.4457 18.3145 18.4457C19.4597 18.4457 20.3931 19.3632 20.3931 20.4887V33.3999H20.3969ZM27.1997 33.3999H23.0424V20.4887C23.0424 17.9257 20.9222 15.8456 18.3183 15.8456C15.7144 15.8456 13.5942 17.9294 13.5942 20.4887V33.3999H9.43693V20.4961C9.43693 15.6822 13.4241 11.7635 18.3221 11.7635C23.2201 11.7635 27.2072 15.6822 27.2072 20.4961V33.3999H27.1997ZM33.9835 33.3999H29.8452V20.4961C29.8452 14.2485 24.6713 9.16343 18.3145 9.16343C11.9577 9.16343 6.78386 14.2485 6.78386 20.4961V33.3999H2.64551V2.60008H33.9835V33.3999Z'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;

    &.not-found-page--no-bg {
        background-image: none;
        background:
            radial-gradient(circle at 12% 18%, var(--accent-tint-end) 0%, transparent 42%),
            radial-gradient(circle at 88% 82%, var(--accent-tint-start) 0%, transparent 38%),
            linear-gradient(165deg, var(--gray-bg) 0%, var(--gray-300) 100%);
    }

    &.member-layout-background .not-found-page__shell::before {
        content: '';
        position: fixed;
        inset: 0;
        z-index: 0;
        background: color-mix(in srgb, var(--gray-900) 62%, transparent);
        -webkit-backdrop-filter: blur(3px);
                backdrop-filter: blur(3px);
    }

    .bottomMemberBar {
        display: none;
    }
}

.not-found-page__shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
}

.not-found-page__backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.not-found-page__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.55;
    -webkit-animation: not-found-orb-drift 14s ease-in-out infinite;
            animation: not-found-orb-drift 14s ease-in-out infinite;

    &--one {
        top: 8%;
        left: -4%;
        width: min(42vw, 320px);
        height: min(42vw, 320px);
        background: var(--accent-tint-end);
    }

    &--two {
        right: -6%;
        bottom: 18%;
        width: min(36vw, 280px);
        height: min(36vw, 280px);
        background: var(--accent-shadow-soft);
        -webkit-animation-delay: -4s;
                animation-delay: -4s;
    }

    &--three {
        top: 42%;
        left: 38%;
        width: min(24vw, 180px);
        height: min(24vw, 180px);
        background: var(--accent-tint-light);
        -webkit-animation-delay: -8s;
                animation-delay: -8s;
    }
}

.not-found-page__header {
    position: relative;
    z-index: 2;
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 28px 20px 24px;
    box-sizing: border-box;
}

.not-found-page__hero {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 48px 20px 24px;
    box-sizing: border-box;
}

.not-found-page__logo-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--not-found-logo-chip-width);
    min-height: 68px;
    padding: 14px 24px;
    border-radius: 14px;
    background: var(--color-light);
    box-shadow: 0 8px 28px var(--shadow-card);
    box-sizing: border-box;
    -webkit-animation: not-found-rise 0.7s ease both;
            animation: not-found-rise 0.7s ease both;

    &--brand {
        margin-bottom: 0;
    }

    &--footer {
        -webkit-animation-delay: 0.35s;
                animation-delay: 0.35s;
    }
}

.not-found-page__logo-chip-image {
    display: block;
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.not-found-page__logo-chip .congregation-name-fallback {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.25;
    color: var(--text-color);
    text-align: center;
}

.not-found-page__code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.35rem, 2.5vw, 1.25rem);
    width: 100%;
    max-width: 1100px;
    margin: 0 0 clamp(1rem, 4vw, 2rem);
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
}

.not-found-page__digit {
    font-family: var(--font-sans);
    font-size: var(--not-found-digit-size);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.06em;
    color: transparent;
    background: linear-gradient(
        160deg,
        var(--color-light) 8%,
        var(--accent-light) 38%,
        var(--accent) 72%,
        var(--accent-dark) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
    filter: drop-shadow(0 10px 28px var(--accent-shadow-strong));
    -webkit-animation: not-found-digit-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
            animation: not-found-digit-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;

    &:first-child {
        -webkit-animation-delay: 0.05s;
                animation-delay: 0.05s;
    }

    &:last-child {
        -webkit-animation-delay: 0.2s;
                animation-delay: 0.2s;
    }
}

.not-found-page.member-layout-background .not-found-page__digit {
    background: linear-gradient(
        160deg,
        var(--white-fixed) 10%,
        var(--accent-light) 42%,
        var(--accent) 100%
    );
    background-clip: text;
    -webkit-background-clip: text;
}

.not-found-page__zero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--not-found-zero-size);
    height: var(--not-found-zero-size);
    -webkit-animation: not-found-digit-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
            animation: not-found-digit-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

.not-found-page__zero-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: clamp(10px, 1.8vw, 18px) solid transparent;
    background:
        linear-gradient(var(--field-bg), var(--field-bg)) padding-box,
        linear-gradient(145deg, var(--accent-light), var(--accent), var(--accent-dark)) border-box;
    box-shadow:
        0 16px 48px var(--accent-shadow-strong),
        inset 0 0 28px var(--accent-shadow-light);
    -webkit-animation: not-found-ring-pulse 4s ease-in-out infinite;
            animation: not-found-ring-pulse 4s ease-in-out infinite;
}

.not-found-page.member-layout-background .not-found-page__zero-ring {
    background:
        linear-gradient(color-mix(in srgb, var(--gray-900) 30%, transparent), color-mix(in srgb, var(--gray-900) 30%, transparent)) padding-box,
        linear-gradient(145deg, var(--white-fixed), var(--accent-light), var(--accent)) border-box;
}

.not-found-page__zero-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 44%;
    height: 44%;
    background: color-mix(in srgb, var(--accent) 24%, transparent);
    -webkit-mask-image: var(--not-found-shul-icon-mask);
    mask-image: var(--not-found-shul-icon-mask);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}


.not-found-page__panel {
    width: 100%;
    max-width: 520px;
    -webkit-animation: not-found-rise 0.8s ease 0.25s both;
            animation: not-found-rise 0.8s ease 0.25s both;
}

.not-found-page__panel-inner {
    padding: clamp(24px, 4vw, 32px);
    border-radius: 20px;
    text-align: center;
    background: color-mix(in srgb, var(--field-bg) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
    box-shadow: 0 20px 50px var(--shadow-strong);
    -webkit-backdrop-filter: blur(12px);
            backdrop-filter: blur(12px);
}

.not-found-page__errors:empty {
    display: none;
}

.not-found-page__title {
    margin: 0 0 10px;
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

.not-found-page__message {
    margin: 0 0 24px;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--label-color);
}

.not-found-page__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: min(100%, 260px);
    height: 46px;
    padding: 0 28px;
    font-size: 15px;
    color: var(--text-on-accent);
    text-decoration: none;

    &:hover,
    &:focus,
    &:active {
        color: var(--text-on-accent);
        text-decoration: none;
    }
}

.not-found-page__footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    padding: 20px 20px 28px;
}

@media (max-width: 575.98px) {
    .not-found-page__header {
        padding: 20px 16px 16px;
    }

    .not-found-page__hero {
        padding-top: 24px;
    }

    .not-found-page__code {
        gap: 0.15rem;
    }

    .not-found-page__panel-inner {
        padding: 20px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .not-found-page__digit,
    .not-found-page__zero,
    .not-found-page__panel,
    .not-found-page__header,
    .not-found-page__logo-chip,
    .not-found-page__orb,
    .not-found-page__zero-ring {
        -webkit-animation: none;
                animation: none;
    }
}

