/* ============================================================
   XCO.IR - Toast/Snackbar شناور
   ------------------------------------------------------------
   جایگزینِ Alert ثابتِ بوت‌استرپ در بالای صفحه برای پیام‌های
   موفقیت/خطا. اپ‌های نیتیو این پیام‌ها را همیشه به‌صورت یک نوارِ
   شناورِ نزدیک به محل تعامل کاربر (پایین صفحه، بالای bottom nav
   در صورت وجود) نشان می‌دهند که خودش محو می‌شود - بدون آنکه کاربر
   مجبور به اسکرول تا بالای صفحه شود و بدون قطع جریان صفحه.

   منطق ساخت/صف‌بندی/محو در xco-toast.js (window.XcoToast) است؛
   کانتینر (#xcoToastContainer) در صورت نبود، خودِ همان اسکریپت
   می‌سازد. جای‌گذاریِ اولیه در footer.php (رجوع کنید به بخش
   «پل پیام‌های فلش سرور»).
   ============================================================ */

.xco-toast-container {
    position: fixed;
    inset-inline: 0;
    bottom: 1rem;
    z-index: 3050;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .55rem;
    padding-inline: .85rem;
    pointer-events: none;
    transition: bottom .2s ease;
}

.xco-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    max-width: 30rem;
    width: 100%;
    margin-inline: auto;
    background: #fff;
    border-radius: var(--xco-radius-sm, .6rem);
    box-shadow: var(--xco-shadow-lg, 0 1.5rem 3rem rgba(0, 24, 68, .14));
    padding: .8rem .9rem;
    font-size: .86rem;
    line-height: 1.55;
    border-inline-start: 4px solid var(--xco-primary, #003087);
    opacity: 0;
    transform: translateY(14px) scale(.98);
    transition: opacity .25s ease, transform .25s ease;
}

.xco-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.xco-toast.is-leaving {
    opacity: 0;
    transform: translateY(8px) scale(.98);
}

.xco-toast-success { border-inline-start-color: #198754; }
.xco-toast-error   { border-inline-start-color: #dc3545; }
.xco-toast-warning { border-inline-start-color: #ffc107; }
.xco-toast-info    { border-inline-start-color: var(--xco-primary, #003087); }

.xco-toast-icon {
    flex: 0 0 auto;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.xco-toast-success .xco-toast-icon { background: rgba(25, 135, 84, .12); color: #198754; }
.xco-toast-error   .xco-toast-icon { background: rgba(220, 53, 69, .12); color: #dc3545; }
.xco-toast-warning .xco-toast-icon { background: rgba(255, 193, 7, .18); color: #92660a; }
.xco-toast-info    .xco-toast-icon { background: var(--xco-primary-soft, #eaf0fb); color: var(--xco-primary, #003087); }

.xco-toast-body {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--xco-ink, #0f172a);
    padding-top: .15rem;
}

.xco-toast-body ul {
    margin: 0;
    padding-inline-start: 1.1rem;
}

.xco-toast-body li + li {
    margin-top: .2rem;
}

.xco-toast-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    padding: .2rem;
    margin-inline-start: .1rem;
    border-radius: .3rem;
}

.xco-toast-close:hover,
.xco-toast-close:focus-visible {
    color: #475569;
    background: rgba(15, 23, 42, .05);
}

@media (min-width: 992px) {
    .xco-toast-container {
        align-items: flex-end;
        padding-inline-end: 2rem;
        bottom: 1.5rem;
    }

    .xco-toast {
        width: auto;
        min-width: 21rem;
        margin-inline: 0;
    }
}
