/* ================================================================= */
/* Site messages — floating toasts + inline form alerts               */
/* ================================================================= */

.site-toasts {
    position: fixed;
    top: 88px;
    right: 26px;
    z-index: 4200;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: min(370px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    --msg: #60a5fa;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 42px 17px 16px;
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, .09);
    border-left: 4px solid var(--msg);
    border-radius: 10px;
    box-shadow: 0 26px 50px -26px rgba(0, 0, 0, .95);
    color: #e9e9e9;
    font-size: 14px;
    line-height: 1.55;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(34px);
    animation: toast-in .38s cubic-bezier(.21, 1.02, .73, 1) forwards;
}

.toast--success { --msg: #4ade80; }
.toast--error { --msg: #f87171; }
.toast--warning { --msg: #fbbf24; }
.toast--info { --msg: #60a5fa; }

.toast__icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: var(--msg);
    color: #101010;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast__body {
    flex: 1 1 auto;
    word-break: break-word;
}

.toast__body strong {
    color: #fff;
}

.toast__close {
    position: absolute;
    top: 9px;
    right: 8px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9a9a9a;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: .2s;
}

.toast__close:hover {
    background-color: rgba(255, 255, 255, .09);
    color: #fff;
}

.toast__timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background-color: var(--msg);
    transform-origin: left center;
    animation: toast-timer 6s linear forwards;
}

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

.toast--out {
    animation: toast-out .3s ease forwards;
}

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

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(34px);
    }
}

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

/* ---------------- Inline alerts (forms) ---------------- */

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 18px;
    margin-bottom: 22px;
    background-color: #1c1c1c;
    border: 1px solid rgba(255, 255, 255, .09);
    border-left: 4px solid var(--msg, #60a5fa);
    border-radius: 10px;
    color: #e9e9e9;
    font-size: 14px;
    line-height: 1.6;
}

.form-alert--success { --msg: #4ade80; }
.form-alert--error { --msg: #f87171; }
.form-alert--warning { --msg: #fbbf24; }
.form-alert--info { --msg: #60a5fa; }

.form-alert .form-alert__icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    background-color: var(--msg);
    color: #101010;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-alert ul {
    margin: 0;
    padding-left: 18px;
}

.form-alert li + li {
    margin-top: 4px;
}

.form-alert a {
    color: #fff;
    text-decoration: underline;
}

@media (max-width: 767px) {
    .site-toasts {
        top: auto;
        bottom: 20px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}

/* ---------------- Light theme ---------------- */

body.light .toast,
body.light .form-alert {
    background-color: #fff;
    border-color: #e7e7e7;
    color: #333;
    box-shadow: 0 22px 40px -30px rgba(0, 0, 0, .55);
}

body.light .toast__body strong,
body.light .form-alert a {
    color: #111;
}

body.light .toast__close {
    color: #999;
}

body.light .toast__close:hover {
    background-color: #f0f0f0;
    color: #333;
}
