/* =====================================================================
   Helper — notificações (toasts)
   Usa as cores do tema moderno (--hp-*) quando disponível; sem ele,
   cai no padrão claro abaixo.
   ===================================================================== */

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

.hp-toast {
    --t-accent: #0c66e4;
    --t-soft: rgba(12, 102, 228, .12);

    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 16px 14px;
    border-radius: 10px;
    background: var(--hp-popover, #ffffff);
    color: var(--hp-text, #44546f);
    border: 1px solid var(--hp-border-strong, rgba(9, 30, 66, .14));
    box-shadow: 0 12px 28px rgba(9, 30, 66, .22), 0 2px 6px rgba(9, 30, 66, .12);
    overflow: hidden;
    pointer-events: auto;
    font-family: var(--hp-font, inherit);
    animation: hpToastEntra .32s cubic-bezier(.21, 1.02, .73, 1) both;
}

/* faixa lateral com a cor do tipo */
.hp-toast::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--t-accent);
}

/* flash antes do JS assumir: já aparece no lugar certo */
.hp-toast[data-hp-flash] {
    position: fixed;
    top: 72px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    z-index: 11000;
}

.hp-toast--success { --t-accent: var(--hp-success, #1f845a); --t-soft: rgba(31, 132, 90, .14); }
.hp-toast--danger  { --t-accent: var(--hp-danger, #c9372c);  --t-soft: rgba(201, 55, 44, .14); }
.hp-toast--warning { --t-accent: var(--hp-warning, #b38600); --t-soft: rgba(245, 180, 0, .16); }
.hp-toast--info    { --t-accent: var(--hp-primary, #0c66e4); --t-soft: rgba(12, 102, 228, .13); }

.hp-toast__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: 4px;
    border-radius: 50%;
    background: var(--t-soft);
    color: var(--t-accent);
    font-size: 20px;
}

.hp-toast__content {
    flex: 1 1 auto;
    min-width: 0;
    padding-top: 1px;
}

.hp-toast__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--hp-heading, #172b4d);
}

.hp-toast__msg {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--hp-muted, #626f86);
    overflow-wrap: anywhere;
}
.hp-toast__msg a { color: var(--t-accent); font-weight: 500; }

.hp-toast__close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--hp-muted, #626f86);
    font-size: 18px;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.hp-toast__close:hover { background: var(--hp-btn-subtle-hover, rgba(9, 30, 66, .08)); color: var(--hp-heading, #172b4d); }
.hp-toast__close:focus-visible { outline: 2px solid var(--t-accent); outline-offset: 1px; }

/* tempo restante */
.hp-toast__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--t-accent);
    opacity: .55;
    transform-origin: left center;
}

.hp-toast.is-saindo { animation: hpToastSai .26s ease-in both; }

@keyframes hpToastEntra {
    from { opacity: 0; transform: translateX(24px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
@keyframes hpToastSai {
    to { opacity: 0; transform: translateX(24px); }
}

@media (max-width: 575.98px) {
    .hp-toast-stack,
    .hp-toast[data-hp-flash] { top: 64px; right: 16px; left: 16px; width: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-toast, .hp-toast.is-saindo { animation-duration: .01ms; }
    .hp-toast__progress { display: none; }
}
