/**
 * CRM toast notifications — shared across all modules (Jinja + React shell).
 * Top-right stack; success / error / warning / info variants.
 */

.crm-toast-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    pointer-events: none;
    width: min(420px, calc(100vw - 2rem));
}

body.logged-in .crm-toast-host {
    top: 5.25rem;
}

.crm-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 0.875rem 0.875rem 1rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #ffffff;
    box-shadow:
        0 16px 40px rgba(15, 23, 42, 0.12),
        0 4px 12px rgba(15, 23, 42, 0.06);
    opacity: 0;
    transform: translateX(calc(100% + 1.25rem));
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.crm-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.crm-toast.is-leaving {
    opacity: 0;
    transform: translateX(calc(100% + 1.25rem));
}

.crm-toast__icon-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1rem;
    line-height: 1;
}

.crm-toast__content {
    flex: 1;
    min-width: 0;
    padding-top: 0.1rem;
}

.crm-toast__title {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.25;
    margin: 0 0 0.15rem;
    color: #0f172a;
}

.crm-toast__message {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.45;
    color: #475569;
    margin: 0;
    word-break: break-word;
}

.crm-toast__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: -0.15rem -0.15rem 0 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.crm-toast__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #475569;
}

.crm-toast__close:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* Success */
.crm-toast--success {
    border-color: #a7f3d0;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.crm-toast--success .crm-toast__icon-wrap {
    background: #dcfce7;
    color: #059669;
}

/* Error */
.crm-toast--error {
    border-color: #fecaca;
    background: linear-gradient(180deg, #ffffff 0%, #fef2f2 100%);
}

.crm-toast--error .crm-toast__icon-wrap {
    background: #fee2e2;
    color: #dc2626;
}

/* Warning */
.crm-toast--warning {
    border-color: #fde68a;
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%);
}

.crm-toast--warning .crm-toast__icon-wrap {
    background: #fef3c7;
    color: #d97706;
}

/* Info */
.crm-toast--info {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.crm-toast--info .crm-toast__icon-wrap {
    background: #dbeafe;
    color: #2563eb;
}

@media (max-width: 575.98px) {
    .crm-toast-host {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        align-items: stretch;
    }

    body.logged-in .crm-toast-host {
        top: 4.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .crm-toast {
        transition: opacity 0.15s ease;
        transform: none;
    }

    .crm-toast.is-visible,
    .crm-toast.is-leaving {
        transform: none;
    }
}
