/*
 * Rc.toast — the site's one notifier (assets/js/core/rc.toast.js). Loaded by the Panel, Auth and Home layouts.
 * RTL, top-center on desktop, full width at the top on phones. Colours come from Bootstrap variables when the
 * page has them, so light and dark themes follow the site; contrast of text on the surface is above 4.5:1.
 */
.rc-toasts {
    --rc-toast-primary: #ff6c2f;
    --rc-toast-bg: var(--bs-body-bg, #ffffff);
    --rc-toast-fg: var(--bs-body-color, #1e293b);
    --rc-toast-muted: var(--bs-secondary-color, #5b6474);
    --rc-toast-border: var(--bs-border-color, #e2e8f0);
    --rc-toast-success: #15803d;
    --rc-toast-info: #0369a1;
    --rc-toast-warning: #b45309;
    --rc-toast-error: #dc2626;
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 2000;
    width: min(420px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    direction: rtl;
}

[data-bs-theme="dark"] .rc-toasts,
[data-edu-theme="dark"] .rc-toasts,
.rc-toasts[data-theme="dark"] {
    --rc-toast-bg: var(--bs-tertiary-bg, #1f2430);
    --rc-toast-fg: var(--bs-body-color, #e5e7eb);
    --rc-toast-muted: var(--bs-secondary-color, #aab2c0);
    --rc-toast-border: var(--bs-border-color, #343a46);
    --rc-toast-success: #4ade80;
    --rc-toast-info: #38bdf8;
    --rc-toast-warning: #fbbf24;
    --rc-toast-error: #f87171;
}

.rc-toast {
    --rc-toast-accent: var(--rc-toast-info);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px 14px 8px;
    border: 1px solid var(--rc-toast-border);
    border-inline-start: 4px solid var(--rc-toast-accent);
    border-radius: 12px;
    background: var(--rc-toast-bg);
    color: var(--rc-toast-fg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .08);
    font-family: inherit;
    font-size: .9rem;
    line-height: 1.6;
    overflow: hidden;
    pointer-events: auto;
    animation: rc-toast-in .24s cubic-bezier(.2, .8, .2, 1);
}

.rc-toast:focus-visible { outline: 2px solid var(--rc-toast-primary); outline-offset: 2px; }
.rc-toast--success { --rc-toast-accent: var(--rc-toast-success); }
.rc-toast--info { --rc-toast-accent: var(--rc-toast-info); }
.rc-toast--warning { --rc-toast-accent: var(--rc-toast-warning); }
.rc-toast--error { --rc-toast-accent: var(--rc-toast-error); }

.rc-toast__icon {
    flex: 0 0 auto;
    font-size: 1.5rem;
    line-height: 1;
    margin-top: 2px;
    color: var(--rc-toast-accent);
}

.rc-toast__body { flex: 1 1 auto; min-width: 0; padding-top: 1px; }
.rc-toast__title { font-weight: 700; margin-bottom: 2px; }
.rc-toast__message { white-space: pre-line; overflow-wrap: anywhere; }
.rc-toast__trace { margin-top: 4px; font-size: .78rem; color: var(--rc-toast-muted); direction: rtl; user-select: all; }

.rc-toast__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: -10px 0 -10px -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--rc-toast-muted);
    font-size: 1.35rem;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.rc-toast__close:hover { background: rgba(127, 127, 127, .12); color: var(--rc-toast-fg); }
.rc-toast__close:focus-visible { outline: 2px solid var(--rc-toast-primary); outline-offset: -2px; }

.rc-toast__progress {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: var(--rc-toast-accent);
    opacity: .55;
    transform-origin: right center;
    animation: rc-toast-progress linear forwards;
    animation-play-state: paused;
}

.rc-toast--leaving { animation: rc-toast-out .2s ease forwards; }

@keyframes rc-toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes rc-toast-out { to { opacity: 0; transform: translateY(8px); } }
@keyframes rc-toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 575.98px) {
    .rc-toasts { bottom: 0; left: 0; right: 0; width: 100%; padding: 8px; gap: 8px; }
    .rc-toast { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .rc-toast, .rc-toast--leaving { animation: none; }
    .rc-toast__progress { animation: none; display: none; }
    .rc-toast__close { transition: none; }
}
