/* SIKY — In-app toast notifications (bukan browser notification) */

.siky-toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: min(22rem, calc(100vw - 1.5rem));
    pointer-events: none;
}

.siky-toast {
    --toast-accent: #6366f1;
    --toast-bg: #ffffff;
    --toast-icon-bg: rgba(99, 102, 241, 0.12);
    --toast-icon-color: #4f46e5;
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem 0.9rem 0.95rem;
    background: var(--toast-bg);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.32s ease;
}

.siky-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.siky-toast.is-leaving {
    transform: translateX(110%);
    opacity: 0;
    transition-duration: 0.28s;
}

.siky-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--toast-accent);
    border-radius: 14px 0 0 14px;
}

.siky-toast__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--toast-icon-bg);
    color: var(--toast-icon-color);
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.siky-toast__body {
    min-width: 0;
    padding-top: 0.1rem;
}

.siky-toast__title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.15rem;
}

.siky-toast__message {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #0f172a;
    word-break: break-word;
}

.siky-toast__close {
    border: none;
    background: transparent;
    color: #94a3b8;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.siky-toast__close:hover {
    background: #f1f5f9;
    color: #475569;
}

.siky-toast__progress {
    position: absolute;
    left: 4px;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(15, 23, 42, 0.06);
}

.siky-toast__progress-bar {
    height: 100%;
    width: 100%;
    background: var(--toast-accent);
    transform-origin: left center;
    transform: scaleX(1);
}

.siky-toast.is-paused .siky-toast__progress-bar {
    animation-play-state: paused !important;
}

/* Variants */
.siky-toast--success {
    --toast-accent: #10b981;
    --toast-icon-bg: rgba(16, 185, 129, 0.14);
    --toast-icon-color: #059669;
}

.siky-toast--error {
    --toast-accent: #ef4444;
    --toast-icon-bg: rgba(239, 68, 68, 0.12);
    --toast-icon-color: #dc2626;
}

.siky-toast--warning {
    --toast-accent: #f59e0b;
    --toast-icon-bg: rgba(245, 158, 11, 0.16);
    --toast-icon-color: #d97706;
}

.siky-toast--info {
    --toast-accent: #6366f1;
    --toast-icon-bg: rgba(99, 102, 241, 0.14);
    --toast-icon-color: #4f46e5;
}

@keyframes siky-toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Login page — toast di atas form */
.login-page .siky-toast-stack {
    top: 1.25rem;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(24rem, calc(100vw - 2rem));
}

.login-page .siky-toast {
    transform: translateY(-24px);
}

.login-page .siky-toast.is-visible {
    transform: translateY(0);
}

.login-page .siky-toast.is-leaving {
    transform: translateY(-16px);
}

@media (max-width: 575.98px) {
    .siky-toast-stack {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .content .siky-toast-stack {
        top: calc(var(--topbar-height, 64px) + 0.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .siky-toast,
    .siky-toast__progress-bar {
        transition: none !important;
        animation: none !important;
    }
}
