/*
    The "API unavailable" dialog, Pages/Shared/_ApiUnavailableDialog.cshtml.

    Copied from the V1 front end's ErrorDialog.razor.css so the two look the
    same while both are live. Two changes: the backdrop click is a separate
    .ed-overlay element (Datastar has no stopPropagation on a parent's handler,
    which is how V1 kept clicks inside the dialog from closing it), and the
    primary button style is gone because there is no Try again button.
*/

.ed-backdrop {
    --ed-ink: #1E2227;
    --ed-muted: #4A5058;
    --ed-line: #E6E8EB;
    --ed-accent: #7B1E28;
    position: fixed;
    inset: 0;
    z-index: 1060; /* above Bootstrap's modal (1055) and the Kendo dialogs */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ed-fade 140ms ease-out;
}

.ed-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 34, 39, 0.55);
}

.ed-dialog {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 40px 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
    color: var(--ed-ink);
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    outline: none;
    animation: ed-rise 180ms ease-out;
}

.ed-x {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--ed-muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.ed-x:hover {
    background: #F1F2F4;
}

.ed-badge {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ed-accent);
    border-radius: 50%;
    background: #F2E8E9; /* fallback for browsers without color-mix */
    background: color-mix(in srgb, var(--ed-accent) 10%, #FFFFFF);
}

.ed-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ed-title {
    margin: 0;
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ed-ink);
}

.ed-message {
    margin: 0;
    font-size: 15px;
    line-height: 23px;
    color: var(--ed-muted);
}

.ed-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.ed-btn {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
}

.ed-btn-secondary {
    color: var(--ed-ink);
    background: #FFFFFF;
    border: 1px solid #C3C8CF;
}

.ed-btn-secondary:hover {
    background: #F6F7F8;
}

.ed-btn:focus-visible,
.ed-x:focus-visible,
.ed-phone:focus-visible {
    outline: 2px solid var(--ed-accent);
    outline-offset: 2px;
}

.ed-support {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding-top: 16px;
    font-size: 14px;
    line-height: 22px;
    color: var(--ed-muted);
    border-top: 1px solid var(--ed-line);
}

.ed-phone {
    font-weight: 600;
    white-space: nowrap;
    color: var(--ed-accent);
    text-decoration: none;
}

.ed-phone:hover {
    text-decoration: underline;
}

@media (max-width: 400px) {
    .ed-dialog {
        padding: 36px 20px 20px;
    }
}

@keyframes ed-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ed-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ed-backdrop,
    .ed-dialog {
        animation: none;
    }
}
