/* ════════════════════════════════════════════════
   TOAST — notifikasi pop-up global (pengganti alert())
   Dipakai lewat window.toast(pesan, tipe) — lihat assets/js/toast.js
════════════════════════════════════════════════ */

#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 380px;
    max-width: calc(100% - 40px);
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 36px rgba(15,23,42,.16), 0 3px 10px rgba(15,23,42,.07);
    padding: 14px 34px 16px 14px;
    overflow: hidden;
    pointer-events: auto;
    animation: toast-in .3s cubic-bezier(.21,1.02,.73,1);
}
.toast.toast-out { animation: toast-out .18s ease-in forwards; }

/* Accent bar tipis nempel di tepi kiri, di dalam radius card. */
.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
.toast-success::before { background: var(--success); }
.toast-error::before   { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before    { background: var(--primary); }

/* Ikon dalam chip bulat ber-tint — bukan ikon polos ngambang lagi. */
.toast-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 2px;
}
.toast-success .toast-icon-wrap { background: rgba(22,163,74,.12); }
.toast-error   .toast-icon-wrap { background: rgba(220,38,38,.12); }
.toast-warning .toast-icon-wrap { background: rgba(217,119,6,.12); }
.toast-info    .toast-icon-wrap { background: rgba(37,99,235,.12); }

.toast-icon { font-size: 18px; line-height: 1; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--primary); }

.toast-msg { flex: 1; min-width: 0; padding-top: 6px; font-size: 13.3px; line-height: 1.48; font-weight: 500; color: var(--text); word-break: break-word; white-space: pre-line; }

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.toast-close:hover { background: var(--surface-2); color: var(--text); }

.toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: .35;
    transform-origin: left;
    animation: toast-shrink linear forwards;
}
.toast-success .toast-bar { color: var(--success); }
.toast-error   .toast-bar { color: var(--danger); }
.toast-warning .toast-bar { color: var(--warning); }
.toast-info    .toast-bar { color: var(--primary); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(28px) scale(.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to   { opacity: 0; transform: translateX(24px) scale(.97); }
}
@keyframes toast-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (max-width: 480px) {
    #toast-container { left: 12px; right: 12px; top: 12px; width: auto; max-width: none; max-height: calc(100vh - 24px); overflow-y: auto; }
}
