/* Top-right toast stack — works without relying on Tailwind purge */

.ocm-flash-root {
    position: fixed;
    top: 1rem;
    inset-inline-end: 1rem;
    inset-inline-start: auto;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
    max-width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
    box-sizing: border-box;
}

.ocm-flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    padding: 0.85rem 2.35rem 0.85rem 0.95rem;
    border-radius: 0.65rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.06);
    font-size: 0.875rem;
    line-height: 1.4;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    overflow: hidden;
    pointer-events: auto;
    animation: ocm-flash-enter 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ocm-flash::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 42%,
        rgba(255, 255, 255, 0.85) 50%,
        transparent 58%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: ocm-flash-shine 0.75s ease-out 0.05s both;
    pointer-events: none;
}

.ocm-flash--success {
    border-inline-start: 4px solid #3d563f;
    background: linear-gradient(180deg, #f4faf4 0%, #fff 40%);
}

.ocm-flash--error {
    border-inline-start: 4px solid #b91c1c;
    background: linear-gradient(180deg, #fff5f5 0%, #fff 45%);
    color: #7f1d1d;
}

.ocm-flash__icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 1.15rem;
    line-height: 1;
}

.ocm-flash--success .ocm-flash__icon {
    color: #273e29;
}

.ocm-flash--error .ocm-flash__icon {
    color: #b91c1c;
}

.ocm-flash__msg {
    margin: 0;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
}

.ocm-flash__close {
    position: absolute;
    top: 0.4rem;
    right: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.35rem;
    background: transparent;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.ocm-flash__close:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
}

.ocm-flash__close:focus-visible {
    outline: 2px solid #365a7a;
    outline-offset: 1px;
}

.ocm-flash--leaving {
    animation: ocm-flash-leave 0.28s ease-in forwards;
}

@keyframes ocm-flash-enter {
    from {
        opacity: 0;
        transform: translateX(0.85rem) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes ocm-flash-shine {
    to {
        transform: translateX(100%);
    }
}

@keyframes ocm-flash-leave {
    to {
        opacity: 0;
        transform: translateX(0.5rem) scale(0.96);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ocm-flash {
        animation: none;
    }

    .ocm-flash::before {
        animation: none;
        display: none;
    }

    .ocm-flash--leaving {
        animation: none;
        opacity: 0;
    }
}
