/* =========================================================
   Reusable Toast Notification system (safer.travel)
   Used by: public/website_assets/js/toast.js
   Any form on the site can trigger a toast via:
     SaferToast.success('message');
     SaferToast.error('message');
   ========================================================= */

#safer-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none; /* clicks pass through the gaps between toasts */
}

.safer-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    overflow: hidden;
    padding: 14px 40px 14px 14px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(17, 24, 39, .12), 0 2px 6px rgba(17, 24, 39, .08);
    border-inline-start: 4px solid transparent;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity .28s ease, transform .28s ease;
}

.safer-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.safer-toast.is-leaving {
    opacity: 0;
    transform: translateY(-10px);
}

.safer-toast--success {
    border-inline-start-color: #25d366;
    background: #f2fbf5;
}

.safer-toast--error {
    border-inline-start-color: #e53935;
    background: #fdf2f2;
}

.safer-toast__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-top: 1px;
}

.safer-toast--success .safer-toast__icon {
    background: #25d366;
}

.safer-toast--error .safer-toast__icon {
    background: #e53935;
}

.safer-toast__icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.safer-toast__message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
    padding-top: 2px;
}

.safer-toast__close {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
}

.safer-toast__close:hover,
.safer-toast__close:focus-visible {
    background: rgba(0, 0, 0, .06);
    color: #1f2937;
}

/* auto-dismiss countdown bar */
.safer-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: currentColor;
    opacity: .35;
    transform-origin: left;
    animation: safer-toast-countdown linear forwards;
}

.safer-toast--success .safer-toast__progress {
    color: #25d366;
}

.safer-toast--error .safer-toast__progress {
    color: #e53935;
}

@keyframes safer-toast-countdown {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .safer-toast {
        transition: none;
    }

    .safer-toast__progress {
        animation: none;
    }
}

/* mobile: center near the top, full readable width */
@media (max-width: 576px) {
    #safer-toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
    }
}
