/* HXFX client portal: toast notifications (see assets/abc/js/hx-toast.js) */

/* Messages after an action are shown as toasts, so hide their inline copy.
   .hx-toast-ready is only set when hx-toast.js has run. */
.hx-toast-ready .showmessage_jscbf {
    display: none !important;
}

.hx-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 380px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.hx-toast {
    --hx-toast-bg: linear-gradient(135deg, #10594B 0%, #1c7a62 100%);
    --hx-toast-shadow: rgba(16, 89, 75, 0.35);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 42px 17px 15px;
    overflow: hidden;
    background: var(--hx-toast-bg);
    border: 0;
    border-radius: 12px;
    box-shadow: 0 12px 28px var(--hx-toast-shadow), 0 2px 6px rgba(16, 24, 40, 0.12);
    color: #fff;
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.45;
    pointer-events: auto;
    animation: hx-toast-in 0.25s ease-out;
}

/* Success: the portal green */
.hx-toast--success {
    --hx-toast-bg: linear-gradient(135deg, #10594B 0%, #1c7a62 100%);
    --hx-toast-shadow: rgba(16, 89, 75, 0.35);
}

.hx-toast--error {
    --hx-toast-bg: linear-gradient(135deg, #b42318 0%, #d92d20 100%);
    --hx-toast-shadow: rgba(180, 35, 24, 0.32);
}

.hx-toast--warning {
    --hx-toast-bg: linear-gradient(135deg, #a8650a 0%, #cf8410 100%);
    --hx-toast-shadow: rgba(168, 101, 10, 0.32);
}

.hx-toast--info {
    --hx-toast-bg: linear-gradient(135deg, #155e75 0%, #1d7a8c 100%);
    --hx-toast-shadow: rgba(21, 94, 117, 0.32);
}

.hx-toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.hx-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 5px;
    overflow-wrap: anywhere;
}

/* Server messages can carry their own markup; keep it white on the colour */
.hx-toast__body p,
.hx-toast__body h6,
.hx-toast__body div,
.hx-toast__body span,
.hx-toast__body strong {
    margin: 0;
    font-size: inherit;
    color: #fff !important;
}

.hx-toast__body a {
    color: #fff !important;
    font-weight: 700;
    text-decoration: underline;
}

.hx-toast__close {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.hx-toast__close:hover,
.hx-toast__close:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    outline: none;
}

/* Time left before it closes; pauses while hovered */
.hx-toast__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #fff;
    opacity: 0.55;
    transform-origin: left center;
    animation: hx-toast-timer linear forwards;
}

.hx-toast.is-paused .hx-toast__bar {
    animation-play-state: paused;
}

.hx-toast.is-leaving {
    animation: hx-toast-out 0.25s ease-in forwards;
}

@keyframes hx-toast-in {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: none; }
}

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

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

/* Phones: full width along the top */
@media (max-width: 575.98px) {
    .hx-toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }

    .hx-toast {
        animation-name: hx-toast-in-down;
    }

    .hx-toast.is-leaving {
        animation-name: hx-toast-out-up;
    }

    @keyframes hx-toast-in-down {
        from { opacity: 0; transform: translateY(-16px); }
        to { opacity: 1; transform: none; }
    }

    @keyframes hx-toast-out-up {
        to { opacity: 0; transform: translateY(-16px); }
    }
}

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

    .hx-toast__bar {
        display: none;
    }
}
