/* ── Modern Toast Notifications ─────────────────────────────
   Centered top, card-style with colored accent bar.
   Auto-stacks above any centered content (login, auth card).
   ───────────────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    z-index: var(--z-toast);
    pointer-events: none;
    top: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    width: min(420px, calc(100vw - var(--space-8)));
}

#toast-container > .toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) var(--space-3) calc(var(--space-4) + 4px);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow:
        0 10px 32px rgba(15, 23, 42, 0.10),
        0 2px 6px rgba(15, 23, 42, 0.04);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.5;
    overflow: hidden;
    cursor: pointer;
    animation: toastSlideIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

#toast-container > .toast:hover {
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.14),
        0 2px 6px rgba(15, 23, 42, 0.04);
}

/* Accent bar */
#toast-container > .toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--color-text-muted);
}
.toast-success::before { background: var(--color-success); }
.toast-error::before   { background: var(--color-danger); }
.toast-info::before    { background: var(--color-info); }
.toast-warning::before { background: var(--color-warning); }

/* Icon dot (pseudo-element via ::after on toast) */
#toast-container > .toast > .toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    margin-top: 1px;
    color: var(--color-white);
    font-size: var(--font-size-sm);
    line-height: 1;
}
.toast-success > .toast-icon { background: var(--color-success); }
.toast-error   > .toast-icon { background: var(--color-danger); }
.toast-info    > .toast-icon { background: var(--color-info); }
.toast-warning > .toast-icon { background: var(--color-warning); color: var(--color-white); }

/* Body */
#toast-container > .toast > .toast-body {
    flex: 1;
    min-width: 0;
}
.toast-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 2px;
}
.toast-message {
    color: var(--color-text-secondary);
    word-wrap: break-word;
}

/* Animations */
@keyframes toastSlideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Reduced motion: no slide */
@media (prefers-reduced-motion: reduce) {
    #toast-container > .toast {
        animation: none;
        will-change: auto;
    }
}

/* Mobile: edge-padded full width */
@media (max-width: 480px) {
    #toast-container {
        top: var(--space-3);
        left: var(--space-3);
        right: var(--space-3);
        transform: none;
        width: auto;
    }
}

/* Legacy position classes kept as no-ops so old options don't break layout */
.toast-top-center, .toast-top-right, .toast-top-left,
.toast-bottom-center, .toast-bottom-right, .toast-bottom-left { /* handled by #toast-container */ }
