/* Flash / Toast — Consumer; Token-Definitionen nur in css/main.css (:root / body.dark) */

.vcp-flash-stack,
.vcp-flash-stack--toast {
    position: fixed;
    top: var(--vcp-flash-offset-top);
    right: var(--vcp-flash-offset-right);
    left: auto;
    z-index: var(--vcp-flash-z);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(var(--vcp-flash-width), calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.vcp-flash-stack--compact {
    gap: 0.55rem;
}

.vcp-flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.95rem 1.15rem;
    border: 1px solid var(--vcp-flash-border);
    border-radius: var(--vcp-flash-radius);
    background: var(--vcp-flash-bg);
    box-shadow: var(--vcp-flash-shadow);
    overflow: hidden;
    pointer-events: auto;
}

.vcp-flash--animate {
    animation: vcp-flash-enter var(--vcp-flash-enter-ms) cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vcp-flash-enter {
    from {
        opacity: 0;
        transform: translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.vcp-flash--dismissing {
    animation: vcp-flash-exit var(--vcp-flash-exit-ms) ease forwards;
    pointer-events: none;
}

@keyframes vcp-flash-exit {
    to {
        opacity: 0;
        transform: translateX(12px);
        max-height: 0;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
    }
}

.vcp-flash__accent {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--vcp-flash-radius) 0 0 var(--vcp-flash-radius);
    background: var(--vcp-flash-accent);
}

.vcp-flash__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-top: 0.05rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--vcp-flash-accent) 12%, transparent);
    color: var(--vcp-flash-accent);
    font-size: 1.05rem;
}

.vcp-flash__body {
    flex: 1;
    min-width: 0;
    padding-top: 0.2rem;
}

.vcp-flash__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--vcp-flash-text);
    word-break: break-word;
}

.vcp-flash__dismiss {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: -0.15rem -0.15rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--vcp-flash-dismiss);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.vcp-flash__dismiss:hover,
.vcp-flash__dismiss:focus {
    background: var(--vcp-flash-dismiss-hover-bg);
    color: var(--vcp-flash-dismiss-hover);
    outline: none;
}

.vcp-flash__dismiss:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--vcp-flash-accent) 35%, transparent);
}

.vcp-flash--error {
    --vcp-flash-accent: var(--vcp-flash-accent-error);
    background: linear-gradient(135deg, color-mix(in srgb, var(--vcp-flash-accent-error) 6%, transparent) 0%, var(--vcp-flash-bg) 55%);
}

.vcp-flash--warning {
    --vcp-flash-accent: var(--vcp-flash-accent-warning);
    background: linear-gradient(135deg, color-mix(in srgb, var(--vcp-flash-accent-warning) 8%, transparent) 0%, var(--vcp-flash-bg) 55%);
}

.vcp-flash--success {
    --vcp-flash-accent: var(--vcp-flash-accent-success);
    background: linear-gradient(135deg, color-mix(in srgb, var(--vcp-flash-accent-success) 7%, transparent) 0%, var(--vcp-flash-bg) 55%);
}

.vcp-flash__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--vcp-flash-progress-track);
    overflow: hidden;
}

.vcp-flash__progress-bar {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--vcp-flash-accent);
    transform-origin: left center;
    animation-name: vcp-flash-progress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.vcp-flash.is-paused .vcp-flash__progress-bar {
    animation-play-state: paused;
}

@keyframes vcp-flash-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 575.98px) {
    .vcp-flash-stack,
    .vcp-flash-stack--toast {
        top: 0.75rem;
        right: 0.75rem;
        width: calc(100vw - 1.5rem);
    }

    .vcp-flash {
        gap: 0.7rem;
        padding: 0.85rem 0.85rem 0.85rem 1rem;
    }

    .vcp-flash__icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.95rem;
    }

    .vcp-flash__text {
        font-size: 0.875rem;
    }
}
