:root {
    --sphere-navy: #10233f;
    --sphere-blue: #1769aa;
    --sphere-blue-hover: #0f568f;
    --sphere-text: #1d2939;
    --sphere-muted: #667085;
    --sphere-border: #d0d5dd;
    --sphere-surface: #ffffff;
    --sphere-background: #f4f7fb;
}

.sphere-error-page {
    color-scheme: light;
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    min-height: 100vh;
    padding: 32px 20px;
    overflow: auto;
    color: var(--sphere-text);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(23, 105, 170, .11), transparent 34rem),
        var(--sphere-background);
}

.sphere-error-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    width: min(100%, 760px);
    padding: clamp(28px, 5vw, 48px);
    border: 1px solid rgba(16, 35, 63, .10);
    border-radius: 20px;
    background: var(--sphere-surface);
    box-shadow: 0 24px 70px rgba(16, 35, 63, .12);
}

.sphere-error-brand {
    margin-top: 4px;
}

.sphere-error-content h1 {
    margin: 0 0 14px;
    color: var(--sphere-navy);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.sphere-error-kicker {
    margin: 0 0 8px;
    color: var(--sphere-blue);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sphere-error-summary,
.sphere-error-hint,
.sphere-error-support {
    max-width: 62ch;
    margin: 0;
    color: var(--sphere-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.sphere-error-hint {
    margin-top: 10px;
    color: #344054;
}

.sphere-error-reference {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 7px 12px;
    margin: 24px 0;
    padding: 14px 16px;
    border: 1px solid #dbe4ee;
    border-radius: 10px;
    background: #f8fafc;
    color: #475467;
    font-size: .86rem;
}

.sphere-error-reference code {
    color: var(--sphere-navy);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: .95rem;
    font-weight: 700;
}

.sphere-error-time {
    margin-left: auto;
    color: #98a2b3;
    white-space: nowrap;
}

.sphere-error-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.sphere-error-actions button,
.sphere-error-actions a {
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.sphere-error-primary {
    border: 1px solid var(--sphere-blue);
    color: #fff;
    background: var(--sphere-blue);
}

.sphere-error-primary:hover {
    border-color: var(--sphere-blue-hover);
    background: var(--sphere-blue-hover);
}

.sphere-error-secondary {
    border: 1px solid var(--sphere-border);
    color: #344054;
    background: #fff;
}

.sphere-error-secondary:hover {
    background: #f9fafb;
}

.sphere-error-link {
    border: 1px solid transparent;
    color: var(--sphere-blue);
    background: transparent;
}

.sphere-error-link:hover {
    background: #eef6fc;
}

.sphere-error-support {
    margin-top: 20px;
    font-size: .88rem;
}

@media (max-width: 600px) {
    .sphere-error-page {
        place-items: start center;
        padding: 18px 12px;
    }

    .sphere-error-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 26px 22px;
    }

    .sphere-error-brand {
        width: 44px;
        height: 44px;
    }

    .sphere-error-time {
        width: 100%;
        margin-left: 0;
    }

    .sphere-error-actions,
    .sphere-error-actions button,
    .sphere-error-actions a {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
