/**
 * Shared toast styles for auth + backend layouts.
 * Keep this as the single source of truth for .app-toast* rules.
 */
:root {
    --toast-font: "Plus Jakarta Sans", "Source Sans Pro", system-ui, sans-serif;
    --toast-border: #e2e8f0;
    --toast-radius: 14px;
    --toast-text: #0f172a;
    --toast-muted: #64748b;
}

.app-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: min(400px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 2.5rem 1rem 0.875rem;
    border: 1px solid var(--toast-border);
    border-radius: var(--toast-radius);
    background: #fff;
    font-family: var(--toast-font);
    color: var(--toast-text);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    pointer-events: auto;
    animation: appToastIn 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.app-toast--dismiss {
    opacity: 0;
    transform: translateX(12px);
}

.app-toast--success {
    border-left: 4px solid #059669;
}

.app-toast--error {
    border-left: 4px solid #dc2626;
}

.app-toast--warning {
    border-left: 4px solid #d97706;
}

.app-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    flex-shrink: 0;
    font-size: 0.8125rem;
}

.app-toast--success .app-toast__icon {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.app-toast--error .app-toast__icon {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.app-toast--warning .app-toast__icon {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 0.1rem;
}

.app-toast__label {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--toast-muted);
}

.app-toast__message {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--toast-text);
}

.app-toast__message p {
    margin: 0;
}

.app-toast__message p + p {
    margin-top: 0.25rem;
}

.app-toast__close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-toast__close:hover {
    background: #f1f5f9;
    color: #475569;
}

.app-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    animation: appToastProgress 4.5s linear forwards;
}

.app-toast--success .app-toast__progress {
    background: #059669;
}

.app-toast--error .app-toast__progress {
    background: #dc2626;
}

.app-toast--warning .app-toast__progress {
    background: #d97706;
}

@keyframes appToastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes appToastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 575.98px) {
    .app-toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}
