/* Flash-Nachrichten (Fehler, Erfolg, Warnung) */

.vcp-flash-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    padding: 0 0.15rem;
}

.vcp-flash-stack--compact {
    margin-bottom: 1rem;
}

.vcp-flash {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem 0.95rem 1.15rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

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

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

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

.vcp-flash--dismissing {
    animation: vcp-flash-exit 0.3s ease forwards;
}

@keyframes vcp-flash-exit {
    to {
        opacity: 0;
        transform: translateY(-8px);
        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: 16px 0 0 16px;
    background: var(--vcp-flash-accent, #1E2DC0);
}

.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, #1E2DC0) 12%, transparent);
    color: var(--vcp-flash-accent, #1E2DC0);
    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: #334155;
    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: #94a3b8;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.vcp-flash__dismiss:hover,
.vcp-flash__dismiss:focus {
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    outline: none;
}

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

/* Varianten */
.vcp-flash--error {
    --vcp-flash-accent: #dc2626;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.04) 0%, #fff 55%);
}

.vcp-flash--warning {
    --vcp-flash-accent: #d97706;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.06) 0%, #fff 55%);
}

.vcp-flash--success {
    --vcp-flash-accent: #059669;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, #fff 55%);
}

.vcp-flash--success .vcp-flash__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(5, 150, 105, 0.12);
    overflow: hidden;
}

.vcp-flash--success .vcp-flash__progress-bar {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--vcp-flash-accent);
    transform-origin: left center;
    animation: vcp-flash-progress 6s linear forwards;
}

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

    to {
        transform: scaleX(0);
    }
}

/* Auth-Karten (Login etc.) */
.form-side .vcp-flash-stack {
    margin-bottom: 1.25rem;
}

.form-side .vcp-flash {
    padding: 0.85rem 0.9rem 0.85rem 1rem;
}

/* Dark Mode */
body.dark .vcp-flash {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

body.dark .vcp-flash--error {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.08) 0%, rgba(15, 23, 42, 0.72) 55%);
}

body.dark .vcp-flash--warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(15, 23, 42, 0.72) 55%);
}

body.dark .vcp-flash--success {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.08) 0%, rgba(15, 23, 42, 0.72) 55%);
}

body.dark .vcp-flash--error {
    --vcp-flash-accent: #f87171;
}

body.dark .vcp-flash--warning {
    --vcp-flash-accent: #fbbf24;
}

body.dark .vcp-flash--success {
    --vcp-flash-accent: #34d399;
}

body.dark .vcp-flash__text {
    color: #e2e8f0;
}

body.dark .vcp-flash__dismiss {
    color: #64748b;
}

body.dark .vcp-flash__dismiss:hover,
body.dark .vcp-flash__dismiss:focus {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

@media (max-width: 575.98px) {
    .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;
    }
}
