/* Кнопки и поля вынесены в sfpd-controls.css (единый компонент) */

.toast-container {
    position: fixed;
    left: 22px;
    bottom: 22px;
    z-index: 99999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    width: min(420px, calc(100vw - 24px));
    pointer-events: none;
}

/* ---------- БАЗОВЫЙ ТОСТ ---------- */
.toast-modern {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 18px 16px 20px;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03)),
    linear-gradient(135deg, #101e30, #0c1929);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .50),
    0 6px 18px rgba(0, 0, 0, .30);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity .28s ease, transform .28s ease;
    pointer-events: auto;
}

.toast-modern.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast-modern.hide {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
}

/* светящаяся полоса-акцент слева */
.toast-modern::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #14f1d9 0%, #10c9b4 50%, #0d8577 100%);
    box-shadow: 0 0 8px rgba(20, 241, 217, .75),
    0 0 18px rgba(20, 241, 217, .40);
}

/* ---------- ИКОНКА ---------- */
.toast-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #07131e;
    margin-top: 1px;
    background: linear-gradient(135deg, #0d8577, #14f1d9);
    box-shadow: 0 10px 20px rgba(20, 241, 217, .18);
}

/* ---------- КОНТЕНТ ---------- */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-header-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.toast-title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #14f1d9;
    margin: 0;
}

.toast-body-modern {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
    font-weight: 600;
    word-break: break-word;
    padding-right: 4px;
}

/* ---------- КНОПКА ЗАКРЫТИЯ ---------- */
.toast-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .70);
    border: 1px solid rgba(255, 255, 255, .10);
    backdrop-filter: blur(10px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .18s ease;
}

.toast-close:hover {
    background: rgba(20, 241, 217, .14);
    border-color: rgba(20, 241, 217, .30);
    color: #14f1d9;
    transform: scale(1.04);
}

/* ---------- ПРОГРЕСС ЖИЗНИ ТОСТА ---------- */
.toast-progress-wrap {
    margin-top: 12px;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}

.toast-progress {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    transition: width 8s linear;
    background: linear-gradient(90deg, #0d8577, #14f1d9);
}

/* ============================================================
   ТИПЫ УВЕДОМЛЕНИЙ
   Семантика сохранена (зелёный/красный/жёлтый/бирюзовый),
   но на тёмных стеклянных подложках.
   ============================================================ */

/* --- успех --- */
.toast-success::before {
    background: linear-gradient(180deg, #22c55e, #16a34a);
    box-shadow: 0 0 8px rgba(34, 197, 94, .70), 0 0 18px rgba(34, 197, 94, .35);
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #04160b;
    box-shadow: 0 10px 20px rgba(34, 197, 94, .18);
}

.toast-success .toast-title {
    color: #4ade80;
}

.toast-success .toast-progress {
    background: linear-gradient(90deg, #16a34a, #4ade80);
}

/* --- ошибка --- */
.toast-error::before {
    background: linear-gradient(180deg, #ef4444, #dc2626);
    box-shadow: 0 0 8px rgba(239, 68, 68, .70), 0 0 18px rgba(239, 68, 68, .35);
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(239, 68, 68, .20);
}

.toast-error .toast-title {
    color: #f87171;
}

.toast-error .toast-progress {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

/* --- предупреждение --- */
.toast-warning::before {
    background: linear-gradient(180deg, #fbbf24, #d97706);
    box-shadow: 0 0 8px rgba(251, 191, 36, .70), 0 0 18px rgba(251, 191, 36, .35);
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #d97706, #fbbf24);
    color: #1a1204;
    box-shadow: 0 10px 20px rgba(251, 191, 36, .18);
}

.toast-warning .toast-title {
    color: #fbbf24;
}

.toast-warning .toast-progress {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}

/* --- информация (фирменная бирюза) --- */
.toast-info::before {
    background: linear-gradient(180deg, #14f1d9, #0d8577);
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #0d8577, #14f1d9);
    color: #07131e;
}

.toast-info .toast-title {
    color: #14f1d9;
}

.toast-info .toast-progress {
    background: linear-gradient(90deg, #0d8577, #14f1d9);
}

/* ============================================================
   ТОСТ КОНТРАКТНОЙ СЛУЖБЫ (раскрывающийся)
   ============================================================ */
.contract-toast {
    position: relative;
    opacity: 1 !important;
    transform: none !important;
    order: 999;
    padding: 16px 18px 16px 20px;
    border-radius: 20px;
    border: 1px solid rgba(20, 241, 217, .20);
    background: linear-gradient(180deg, rgba(20, 241, 217, .07), rgba(255, 255, 255, .02)),
    linear-gradient(135deg, #101e30, #0c1929);
    overflow: hidden;
    transition: width .28s ease, transform .22s ease, border-color .22s ease;
}

.contract-toast::before {
    background: linear-gradient(180deg, #14f1d9 0%, #10c9b4 45%, #0d8577 100%);
    box-shadow: 0 0 10px rgba(20, 241, 217, .90),
    0 0 22px rgba(20, 241, 217, .55),
    0 0 34px rgba(20, 241, 217, .30);
    animation: neonPulse 2.2s ease-in-out infinite;
}

.contract-toast .toast-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px;
    font-size: 16px;
}

.contract-toast .toast-title {
    font-size: 12px;
}

.contract-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: rgba(255, 255, 255, .75);
}

.contract-arrow {
    transition: .25s;
    opacity: .75;
    color: #14f1d9;
}

.contract-full {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, .78);
    transition: max-height .25s ease,
    opacity .2s ease,
    margin-top .2s ease;
}

.contract-full b {
    color: #ffffff;
}

/* раскрытие по клику (тач) */
.contract-toast.expanded {
    width: 420px;
    border-color: rgba(20, 241, 217, .35);
}

.contract-toast.expanded .contract-arrow {
    transform: rotate(180deg);
}

.contract-toast.expanded .contract-full {
    max-height: 300px;
    opacity: 1;
    margin-top: 10px;
}

/* раскрытие по наведению (десктоп) */
@media (hover: hover) {
    .contract-toast:hover {
        width: 420px;
        border-color: rgba(20, 241, 217, .35);
    }

    .contract-toast:hover .contract-full {
        max-height: 300px;
        opacity: 1;
        margin-top: 10px;
    }

    .contract-toast:hover .contract-arrow {
        transform: rotate(180deg);
    }
}

@keyframes neonPulse {
    0% {
        opacity: .82;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.35);
    }
    100% {
        opacity: .82;
        filter: brightness(1);
    }
}

/* ---------- АДАПТИВ ---------- */
@media (max-width: 767px) {
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
    }

    .toast-modern {
        border-radius: 18px;
        padding: 14px 14px 14px 18px;
        gap: 12px;
    }

    .toast-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 12px;
        font-size: 14px;
    }

    .toast-body-modern {
        font-size: 13px;
    }

    .contract-toast {
        width: 100% !important;
    }

    .toast-title {
        flex: 1;
        min-width: 0;
        line-height: 1.4;
    }

    .contract-toast .toast-close {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 10;
    }

    .toast-header-modern {
        padding-right: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contract-toast::before {
        animation: none;
    }

    .toast-modern,
    .contract-toast,
    .contract-link,
    .toast-close {
        transition: none;
    }
}