.ugf-toast-region {
    position: fixed;
    z-index: 10950;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.ugf-toast-region[data-position*="top"] {
    top: 22px;
}

.ugf-toast-region[data-position*="bottom"] {
    bottom: 22px;
}

.ugf-toast-region[data-position*="right"] {
    right: 22px;
}

.ugf-toast-region[data-position*="left"] {
    left: 22px;
}

.ugf-toast-region[data-position*="center"] {
    left: 50%;
    transform: translateX(-50%);
}

.ugf-toast {
    --ugf-accent: #2563eb;
    --ugf-accent-soft: #eff6ff;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 32px;
    align-items: start;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border: 1px solid #e4e9f2;
    border-left: 4px solid var(--ugf-accent);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    color: #1f2937;
    pointer-events: auto;
    transform: translateY(-8px);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease, margin 180ms ease;
    overflow: hidden;
}

.ugf-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

.ugf-toast.is-hiding {
    transform: translateY(-8px);
    opacity: 0;
}

.ugf-toast--success {
    --ugf-accent: #16a34a;
    --ugf-accent-soft: #ecfdf3;
}

.ugf-toast--error {
    --ugf-accent: #dc2626;
    --ugf-accent-soft: #fef2f2;
}

.ugf-toast--warning {
    --ugf-accent: #d97706;
    --ugf-accent-soft: #fffbeb;
}

.ugf-toast--info {
    --ugf-accent: #2563eb;
    --ugf-accent-soft: #eff6ff;
}

.ugf-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--ugf-accent-soft);
    color: var(--ugf-accent);
    font-size: 18px;
}

.ugf-toast__title {
    margin: 1px 0 3px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    color: #111827;
}

.ugf-toast__message {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    color: #4b5563;
    overflow-wrap: anywhere;
}

.ugf-toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7b8495;
    cursor: pointer;
}

.ugf-toast__close:hover,
.ugf-toast__close:focus {
    background: #f1f5f9;
    color: #1f2937;
}

.ugf-toast__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--ugf-accent);
    opacity: 0.72;
    transform-origin: left center;
    animation: ugf-toast-timeout var(--ugf-timeout, 5200ms) linear forwards;
}

.ugf-toast:hover .ugf-toast__bar {
    animation-play-state: paused;
}

.ugf-toast--maxi {
    grid-template-columns: 44px minmax(0, 1fr) 32px;
    padding: 16px;
}

.ugf-toast--maxi .ugf-toast__icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
}

.ugf-toast--maxi .ugf-toast__message {
    font-size: 14px;
}

@keyframes ugf-toast-timeout {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.alert {
    border-radius: 8px;
    border-width: 1px;
    border-left-width: 4px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.alert-success {
    border-left-color: #16a34a;
}

.alert-danger {
    border-left-color: #dc2626;
}

.alert-warning {
    border-left-color: #d97706;
}

.alert-info,
.alert-primary {
    border-left-color: #2563eb;
}

.portal-form-notice {
    border-radius: 8px;
    border: 1px solid #e4e9f2;
    border-left: 4px solid #2563eb;
    background: #f8fafc;
    color: #334155;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.portal-form-notice-success {
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.portal-form-notice-error,
.portal-form-notice-danger {
    border-left-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.portal-form-notice-warning {
    border-left-color: #d97706;
    background: #fffbeb;
    color: #92400e;
}

.swal2-popup {
    border-radius: 8px !important;
}

@media (max-width: 575.98px) {
    .ugf-toast-region {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        transform: none;
    }

    .ugf-toast {
        grid-template-columns: 34px minmax(0, 1fr) 30px;
    }

    .ugf-toast__icon {
        width: 34px;
        height: 34px;
    }
}
