/* ============================================
   PRODUZENTENSTOLZ UI 2026 — Alerts & Toasts
   Single, self-contained source for flash message
   styling (.ui2026-alert) AND toast behaviour.
   No dependency on layout.css variables, so it works
   on the dashboard AND the standalone auth/login layout
   without pulling in forms.css (which would override and
   hide the auth form inputs).
   ============================================ */

/* --------------------------------------------
   ALERT APPEARANCE (base + variants)
   -------------------------------------------- */
.ui2026-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.ui2026-alert-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ui2026-alert-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ui2026-alert-text {
    flex: 1;
    min-width: 0;
}

.ui2026-alert-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.ui2026-alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.ui2026-alert-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Success */
.ui2026-alert-success {
    background: rgba(16, 185, 129, 0.08);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Info / Notice */
.ui2026-alert-info {
    background: rgba(59, 130, 246, 0.08);
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Warning */
.ui2026-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Error */
.ui2026-alert-error {
    background: rgba(239, 68, 68, 0.07);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --------------------------------------------
   TOAST CONTAINER + BEHAVIOUR
   -------------------------------------------- */
.ui2026-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10800;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 400px;
    pointer-events: none;
}

/* A flash rendered inside the toast container behaves as a toast.
   Solid white base keeps the (tinted) toast readable over any
   page content it floats above. */
.ui2026-toast-container .ui2026-alert {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    pointer-events: auto;
    background-color: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.32s ease, transform 0.32s ease;
}

/* Re-apply the variant tint on top of the solid white base */
.ui2026-toast-container .ui2026-alert-success {
    background-image: linear-gradient(rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.1));
}
.ui2026-toast-container .ui2026-alert-info {
    background-image: linear-gradient(rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.1));
}
.ui2026-toast-container .ui2026-alert-warning {
    background-image: linear-gradient(rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.12));
}
.ui2026-toast-container .ui2026-alert-error {
    background-image: linear-gradient(rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.1));
}

.ui2026-toast-container .ui2026-alert.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.ui2026-toast-container .ui2026-alert.is-leaving {
    opacity: 0;
    transform: translateX(24px);
}

/* Slim progress bar that visualises the remaining time */
.ui2026-toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: 0.35;
    transform-origin: left center;
    transform: scaleX(1);
}

.ui2026-toast-container .ui2026-alert.is-counting .ui2026-toast-progress {
    transform: scaleX(0);
    transition: transform linear;
}

@media (max-width: 575.98px) {
    .ui2026-toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}
