.global-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(4px);
}

.global-loader.is-active {
    display: flex;
}

.loader-shell {
    min-width: 220px;
    padding: 1.25rem;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.22);
    text-align: center;
}

.loader-shell p {
    margin: 0;
    color: #1f2937;
    font-size: 0.95rem;
    font-weight: 600;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.8rem;
    border: 4px solid #e5e7eb;
    border-top-color: #991b1b;
    border-radius: 999px;
    animation: loader-spin 0.9s linear infinite;
}

.toast-stack {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1100;
    display: grid;
    gap: 0.75rem;
    width: min(100%, 320px);
}

.toast {
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    color: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    transform: translateY(12px);
    opacity: 0;
    animation: toast-in 0.2s ease forwards;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast--success { background: #166534; }
.toast--error { background: #991b1b; }

.flash-message {
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.flash-message__close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.flash-message__close:hover {
    opacity: 0.8;
}

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

.is-loading {
    pointer-events: none;
    opacity: 0.75;
}

.is-loading [type="submit"] {
    opacity: 0.75;
}

@keyframes loader-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
