/**
 * Auth pill toasts — fixed top-center, red error / green success.
 */

.track-auth-toast {
    position: fixed;
    top: 1.35rem;
    left: 50%;
    z-index: 10050;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: min(92vw, 640px);
    max-width: min(92vw, 640px);
    margin: 0;
    padding: 0.8rem 1.35rem 0.8rem 0.95rem;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    transform: translateX(-50%) translateY(-12px);
    opacity: 0;
    pointer-events: none;
    box-sizing: border-box;
    animation: track-auth-toast-in 0.32s ease forwards;
}

.track-auth-toast.is-leaving {
    animation: track-auth-toast-out 0.24s ease forwards;
}

.track-auth-toast--error {
    background: var(--track-auth-coral, #ff4d5a);
}

.track-auth-toast--success {
    background: var(--track-auth-green, #04966a);
}

.track-auth-toast--info {
    background: #2563eb;
}

.track-auth-toast__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    font-size: 18px;
    line-height: 1;
}

.track-auth-toast--error .track-auth-toast__icon {
    color: var(--track-auth-coral, #ff4d5a);
}

.track-auth-toast--success .track-auth-toast__icon {
    color: var(--track-auth-green, #04966a);
}

.track-auth-toast--info .track-auth-toast__icon {
    color: #2563eb;
}

.track-auth-toast__text {
    min-width: 0;
    flex: 1;
    padding-right: 0.15rem;
    word-break: break-word;
}

@keyframes track-auth-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes track-auth-toast-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

body.portal-auth-shell:has(.track-auth-toast) .portal-auth-main__inner {
    padding-top: 4.25rem;
}

@media (max-width: 575.98px) {
    .track-auth-toast {
        top: calc(0.85rem + env(safe-area-inset-top, 0px));
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
        font-size: 13px;
        line-height: 1.4;
        padding: 0.72rem 1rem 0.72rem 0.85rem;
        border-radius: 18px;
    }

    body.portal-auth-shell:has(.track-auth-toast) .portal-auth-main__inner {
        padding-top: calc(4.75rem + env(safe-area-inset-top, 0px));
    }
}
