/*
 * Cabling Wizards shared toast UI.
 * All TempData and AJAX/toastr notifications render into one physical stack.
 */

:root {
    --cw-toast-text: #243044;
    --cw-toast-muted: #687386;
    --cw-toast-border: rgba(28, 46, 74, .13);
    --cw-toast-shadow: 0 16px 42px rgba(22, 42, 72, .16);
    --cw-toast-success: #22a559;
    --cw-toast-success-soft: rgba(34, 165, 89, .11);
    --cw-toast-error: #e23b4d;
    --cw-toast-error-soft: rgba(226, 59, 77, .11);
    --cw-toast-info: #4169e1;
    --cw-toast-info-soft: rgba(65, 105, 225, .11);
    --cw-toast-warning: #d99a16;
    --cw-toast-warning-soft: rgba(217, 154, 22, .13);
    --cw-toast-stack-gap: 10px;
}

.cw-toast-stack {
    top: calc(var(--portal-mobile-header-height, 70px) + 12px) !important;
    right: 14px !important;
    z-index: 2060;
    display: flex;
    flex-direction: column;
    gap: var(--cw-toast-stack-gap);
    width: min(410px, calc(100vw - 28px));
    max-width: none;
    padding: 0 !important;
    pointer-events: none;
}

.cw-auth-body .cw-toast-stack {
    top: 16px !important;
}

.cw-toast {
    --cw-toast-accent: var(--cw-toast-info);
    --cw-toast-soft: var(--cw-toast-info-soft);
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 13px 14px 13px 12px;
    color: var(--cw-toast-text);
    background: rgba(255, 255, 255, .985);
    background-clip: padding-box;
    border: 1px solid var(--cw-toast-border);
    border-left: 4px solid var(--cw-toast-accent);
    border-radius: 16px;
    box-shadow: var(--cw-toast-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
    pointer-events: auto;
}

.cw-toast.show,
.cw-toast.showing {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: start;
    column-gap: 11px;
}

.cw-toast-success {
    --cw-toast-accent: var(--cw-toast-success);
    --cw-toast-soft: var(--cw-toast-success-soft);
}

.cw-toast-error {
    --cw-toast-accent: var(--cw-toast-error);
    --cw-toast-soft: var(--cw-toast-error-soft);
}

.cw-toast-info {
    --cw-toast-accent: var(--cw-toast-info);
    --cw-toast-soft: var(--cw-toast-info-soft);
}

.cw-toast-warning {
    --cw-toast-accent: var(--cw-toast-warning);
    --cw-toast-soft: var(--cw-toast-warning-soft);
}

.cw-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-top: 1px;
    border-radius: 11px;
    color: var(--cw-toast-accent);
    background: var(--cw-toast-soft);
    font-size: .92rem;
}

.cw-toast-content {
    min-width: 0;
}

.cw-toast-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
}

.cw-toast-title {
    margin: 0;
    color: var(--cw-toast-text);
    font-size: .86rem;
    font-weight: 700;
    line-height: 1.25;
}

.cw-toast-message {
    margin-top: 3px;
    color: var(--cw-toast-muted);
    font-size: .79rem;
    font-weight: 400;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cw-toast-close {
    flex: 0 0 auto;
    width: .7rem;
    height: .7rem;
    margin-left: auto;
    padding: .35rem;
    border-radius: 8px;
    opacity: .45;
    transition: opacity .16s ease, background-color .16s ease;
}

.cw-toast-close:hover,
.cw-toast-close:focus {
    opacity: .8;
    background-color: rgba(36, 48, 68, .08);
    box-shadow: none;
}

/*
 * The legacy Toastr API is still present for existing call sites, but toast-ui.js
 * routes its success/error/info/warning methods into #cwToastStack. If another
 * script somehow creates the old Toastr container, keep it out of the visual lane
 * rather than allowing a second notification stack to overlap this one.
 */
#toast-container {
    display: none !important;
}

@media (max-width: 575.98px) {
    .cw-toast-stack {
        top: calc(var(--portal-mobile-header-height, 64px) + 8px) !important;
        right: 10px !important;
        left: 10px !important;
        width: auto;
    }

    .cw-auth-body .cw-toast-stack {
        top: 10px !important;
    }

    .cw-toast {
        border-radius: 14px;
        padding: 12px 12px 12px 10px;
    }
}
