/* Error screens (404 / 403 / 500) — Components/Ui/ErrorScreen.razor and the fatal overlay in index.html. */
.mx-error {
    --mx-accent: var(--muafa-teal, #00a99d);
    --mx-ink: var(--muafa-ink, #182230);
    --mx-muted: var(--muafa-muted, #667085);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    color: var(--mx-ink);
    text-align: center;
}
.mx-error--403 { --mx-accent: #7a5af8; }
.mx-error--500 { --mx-accent: #f04438; }

.mx-error--full { min-height: 100vh; min-height: 100dvh; padding: 32px 16px; background: var(--muafa-canvas, #f4f7fb); }
.mx-error--inline { min-height: min(72vh, 640px); padding: 24px 0; border-radius: var(--muafa-radius, 14px); }

.mx-error__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.mx-error__blob { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(70px); opacity: .32; animation: mx-drift 16s ease-in-out infinite alternate; }
.mx-error__blob--a { top: -140px; inset-inline-start: -120px; background: var(--muafa-primary, #1048a2); }
.mx-error__blob--b { bottom: -160px; inset-inline-end: -120px; background: var(--mx-accent); animation-delay: -8s; }
.mx-error--inline .mx-error__blob { width: 300px; height: 300px; opacity: .2; }
.mx-error__grid {
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(16, 72, 162, .13) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
}

.mx-error__card {
    width: 100%;
    max-width: 560px;
    padding: 36px 32px 30px;
    border: 1px solid rgba(230, 234, 240, .9);
    border-radius: 24px;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 24px 60px rgba(16, 24, 40, .1), 0 2px 6px rgba(16, 24, 40, .04);
    animation: mx-rise .55s cubic-bezier(.2, .8, .2, 1) both;
}

.mx-error__brand { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 10px; color: var(--muafa-primary, #1048a2); font-size: 1.2rem; font-weight: 800; text-decoration: none; letter-spacing: -.03em; }
.mx-error__brand img { width: 32px; height: 32px; }

.mx-error__art { width: min(100%, 320px); margin: 4px auto 6px; }
.mx-error__art svg { display: block; width: 100%; height: auto; overflow: visible; }

.mx-error__code {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .28rem .8rem; margin-bottom: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--mx-accent) 12%, #fff);
    color: color-mix(in srgb, var(--mx-accent) 80%, #101828);
    font-size: .78rem; font-weight: 700; letter-spacing: .02em;
}
.mx-error__code::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mx-accent); animation: mx-blink 1.6s ease-in-out infinite; }

.mx-error__title { margin: 0 0 10px; font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.9rem); font-weight: 800; line-height: 1.35; color: var(--mx-ink); outline: none; }
.mx-error__message { max-width: 430px; margin: 0 auto 18px; color: var(--mx-muted); font-size: .98rem; line-height: 1.85; }

.mx-error__chip {
    display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem;
    max-width: 100%; margin: 0 auto 20px; padding: .45rem .85rem;
    border: 1px dashed #d0d5dd; border-radius: 12px; background: #f9fafb;
    color: var(--mx-muted); font-size: .84rem;
}
.mx-error__chip .fa { color: var(--mx-accent); font-size: 1.05rem; }
.mx-error__chip code { max-width: 100%; overflow-wrap: anywhere; color: var(--mx-ink); background: transparent; font-size: .82rem; }

.mx-error__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.mx-error__btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding-inline: 1.15rem; border-radius: 12px; font-weight: 600; transition: transform .15s ease, box-shadow .15s ease; }
.mx-error__btn:hover { transform: translateY(-1px); }
.mx-error__btn.btn-primary { box-shadow: 0 8px 20px rgba(16, 72, 162, .25); }
.mx-error__btn.btn-light { border: 1px solid var(--muafa-border, #e6eaf0); background: #fff; }
.mx-error__btn .fa { font-size: 1.1rem; }

.mx-error__links { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--muafa-border, #e6eaf0); }
.mx-error__links-title { display: block; margin-bottom: 12px; color: var(--mx-muted); font-size: .82rem; font-weight: 600; }
.mx-error__links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mx-error__links-grid a {
    display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem;
    border: 1px solid var(--muafa-border, #e6eaf0); border-radius: 12px; background: #fff;
    color: var(--mx-ink); font-size: .9rem; font-weight: 600; text-decoration: none; text-align: start;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.mx-error__links-grid a:hover, .mx-error__links-grid a:focus-visible { border-color: var(--muafa-primary, #1048a2); color: var(--muafa-primary, #1048a2); box-shadow: 0 6px 16px rgba(16, 72, 162, .1); transform: translateY(-1px); }
.mx-error__links-grid .fa { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: #EEF3FA; color: var(--muafa-primary, #1048a2); font-size: 1.1rem; }

.mx-error__foot { margin: 22px 0 0; color: #98a2b3; font-size: .78rem; }

/* Illustration parts */
.mx-digit { font: 800 118px/1 "Segoe UI", Tahoma, Arial, sans-serif; text-anchor: middle; }
.mx-lens { fill: none; stroke-width: 11; }
.mx-lens-glass { fill: #fff; opacity: .9; }
.mx-handle { stroke-width: 13; stroke-linecap: round; }
.mx-ecg { fill: none; stroke: var(--muafa-teal, #00a99d); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: mx-trace 2.6s ease-in-out infinite; }
.mx-ecg--alert { stroke: #fda29b; stroke-width: 3.5; stroke-dasharray: 360; stroke-dashoffset: 360; animation-duration: 2.2s; }
.mx-screen { fill: #101828; }
.mx-blink { fill: #f04438; animation: mx-blink 1s steps(2, start) infinite; }
.mx-ring { fill: none; stroke: #e4e7ec; stroke-width: 2; stroke-dasharray: 4 7; }
.mx-ring--pulse { stroke: #7a5af8; stroke-dasharray: none; opacity: 0; transform-origin: 160px 75px; animation: mx-pulse 2.6s ease-out infinite; }
.mx-orbit { transform-origin: 160px 75px; animation: mx-spin 14s linear infinite; }
.mx-shackle { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; transform-origin: 172px 70px; animation: mx-shake 3.2s ease-in-out infinite; }
.mx-float { animation: mx-float 4.5s ease-in-out infinite; }

@keyframes mx-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes mx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes mx-trace { 0% { stroke-dashoffset: 260; opacity: 1; } 60% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.mx-ecg--alert { animation-name: mx-trace-alert; }
@keyframes mx-trace-alert { 0% { stroke-dashoffset: 360; opacity: 1; } 65% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes mx-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes mx-pulse { 0% { opacity: .55; transform: scale(.82); } 100% { opacity: 0; transform: scale(1.18); } }
@keyframes mx-spin { to { transform: rotate(360deg); } }
@keyframes mx-shake { 0%, 78%, 100% { transform: rotate(0); } 82% { transform: rotate(-9deg); } 88% { transform: rotate(7deg); } 94% { transform: rotate(-4deg); } }
@keyframes mx-drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.12); } }

@media (max-width: 575.98px) {
    .mx-error__card { padding: 26px 18px 22px; border-radius: 20px; }
    .mx-error__actions { flex-direction: column; }
    .mx-error__btn { width: 100%; }
    .mx-error__links-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .mx-error *, .mx-error *::before, .mx-error__card { animation: none !important; transition: none !important; }
    .mx-ecg { stroke-dashoffset: 0; }
}

/* Fatal error overlay: Blazor shows #blazor-error-ui when the app itself stopped. */
#blazor-error-ui.mx-fatal {
    position: fixed; inset: 0; z-index: 2000;
    display: none; align-items: center; justify-content: center;
    padding: 16px; background: rgba(16, 24, 40, .55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    box-shadow: none; color: var(--muafa-ink, #182230);
}
#blazor-error-ui.mx-fatal[style*="block"] { display: flex !important; }
.mx-fatal__card { width: 100%; max-width: 440px; padding: 30px 26px 24px; border-radius: 22px; background: #fff; text-align: center; box-shadow: 0 30px 80px rgba(16, 24, 40, .3); animation: mx-rise .4s cubic-bezier(.2, .8, .2, 1) both; }
.mx-fatal__icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px; background: #fef3f2; color: #f04438; font-size: 2rem; }
.mx-fatal__card h2 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; }
.mx-fatal__card p { margin: 0 0 18px; color: var(--muafa-muted, #667085); line-height: 1.8; }
.mx-fatal__card .reload { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; width: 100%; min-height: 46px; border-radius: 12px; background: var(--muafa-primary, #1048a2); color: #fff; font-weight: 700; text-decoration: none; }
.mx-fatal__card .reload:hover { background: var(--muafa-primary-dark, #252d8d); }
#blazor-error-ui.mx-fatal .dismiss { position: static; display: inline-block; margin-top: 12px; color: var(--muafa-muted, #667085); font-size: .85rem; cursor: pointer; }
#blazor-error-ui.mx-fatal .dismiss:hover { color: var(--muafa-ink, #182230); text-decoration: underline; }
