/* avisos padronizados empilham os toasts no canto superior direito abaixo do menu */
.aviso-area {
    position: fixed;
    top: 92px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.aviso {
    --aviso-cor: #10b981;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    overflow: hidden;
    border: 1px solid var(--rd-borda, #e1e7f0);
    border-left: 5px solid var(--aviso-cor);
    border-radius: 14px;
    background: #ffffff;
    color: var(--rd-navy, #11183f);
    box-shadow: 0 18px 40px -22px rgba(17, 24, 63, 0.55);
    pointer-events: auto;
    animation: aviso-entrar 0.25s ease-out;
}

.aviso-erro { --aviso-cor: #dc3545; }
.aviso-alerta { --aviso-cor: #f59e0b; }

.aviso-icone {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--aviso-cor) 14%, #ffffff);
    color: var(--aviso-cor);
}

.aviso-icone svg { width: 16px; height: 16px; }

.aviso-texto {
    flex: 1;
    margin: 3px 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.aviso-fechar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8a94a6;
    font-size: 1.3rem;
    line-height: 1;
}

.aviso-fechar:hover,
.aviso-fechar:focus-visible {
    background: #f2f4f8;
    color: var(--rd-navy, #11183f);
    outline: none;
}

/* barra de tempo mostra quanto falta para o aviso de sucesso sumir */
.aviso-temporario::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--aviso-cor);
    opacity: 0.35;
    transform-origin: left;
    animation: aviso-tempo var(--aviso-tempo, 5s) linear forwards;
}

.aviso-pausado::after { animation-play-state: paused; }

.aviso-saindo { animation: aviso-sair 0.25s ease-in forwards; }

@keyframes aviso-entrar { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes aviso-sair { to { opacity: 0; transform: translateX(16px); } }
@keyframes aviso-tempo { to { transform: scaleX(0); } }

@media (max-width: 600px) {
    .aviso-area { top: auto; right: 16px; bottom: 16px; left: 16px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .aviso, .aviso-saindo, .aviso-temporario::after { animation: none; }
}
