/* ==========================================================================
   پیام‌های شناور (Flash Toast) — مشترک بین همه قالب‌ها
   - با position: fixed نمایش داده می‌شوند تا بقیه صفحه جابه‌جا نشود
   - پس از ۳ ثانیه خودکار بسته می‌شوند (به‌همراه نوار پیشرفت)
   ========================================================================== */

.flash-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(460px, calc(100vw - 24px));
    pointer-events: none;
}

.flash-toast {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fff;
    border-radius: 14px;
    padding: 13px 15px 14px;
    box-shadow: 0 12px 34px rgba(15, 23, 32, .18), 0 2px 6px rgba(15, 23, 32, .06);
    border-right: 4px solid #27ae60;
    font-size: .88rem;
    color: #2c3e50;
    overflow: hidden;
    animation: flashIn .28s cubic-bezier(.22, 1, .36, 1) both;
}

.flash-toast.is-success { border-right-color: #27ae60; }
.flash-toast.is-error   { border-right-color: #e74c3c; }
.flash-toast.is-warning { border-right-color: #d68910; }
.flash-toast.is-info    { border-right-color: #2980b9; }

.flash-toast.is-leaving {
    animation: flashOut .3s ease both;
}

.flash-icon {
    font-size: 1.05rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.flash-toast.is-success .flash-icon { color: #27ae60; }
.flash-toast.is-error   .flash-icon { color: #e74c3c; }
.flash-toast.is-warning .flash-icon { color: #d68910; }
.flash-toast.is-info    .flash-icon { color: #2980b9; }

.flash-body {
    flex: 1;
    line-height: 1.85;
    word-break: break-word;
    min-width: 0;
}

.flash-close {
    border: 0;
    background: transparent;
    color: #95a5a6;
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color .18s;
}

.flash-close:hover { color: #2c3e50; }

/* نوار پیشرفت ۳ ثانیه‌ای */
.flash-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    width: 100%;
    transform-origin: right center;
    background: currentColor;
    opacity: .3;
    animation: flashBar 3s linear both;
}

.flash-toast.is-success .flash-progress { color: #27ae60; }
.flash-toast.is-error   .flash-progress { color: #e74c3c; }
.flash-toast.is-warning .flash-progress { color: #d68910; }
.flash-toast.is-info    .flash-progress { color: #2980b9; }

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes flashOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(-12px) scale(.97); }
}

@keyframes flashBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .flash-toast,
    .flash-toast.is-leaving { animation: none; }
    .flash-progress { animation: none; opacity: 0; }
}

@media (max-width: 575px) {
    .flash-container { top: 10px; width: calc(100vw - 16px); }
    .flash-toast { font-size: .84rem; padding: 11px 12px 12px; }
}
