/* Avisos (toasts) da Cherryfy — os de sucesso/erro que aparecem no canto da tela.
   Substituem o toast do SweetAlert. Usam as cores do tail.css (claro e escuro) e
   tem valor reserva pra pagina que nao carrega o tail.css. */
.avisos {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}
@media (max-width: 575.98px) {
    .avisos { left: 16px; right: 16px; width: auto; }
}

.aviso {
    --aviso-cor: hsl(var(--brand-accent, 206 88% 36%));
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 12px;
    padding: 14px 14px 16px;
    border-radius: var(--radius-md, 12px);
    border: 1px solid hsl(var(--border, 214 24% 89%));
    background: hsl(var(--card, 0 0% 100%));
    color: hsl(var(--foreground, 222 47% 11%));
    box-shadow: var(--shadow-3, 0 24px 48px -16px hsl(220 40% 20% / .30));
    overflow: hidden;
    pointer-events: auto;
    font-family: inherit;
    animation: aviso-entra .22s cubic-bezier(.2, .8, .2, 1);
}
.aviso.saindo { animation: aviso-sai .18s ease-in forwards; }

.aviso--ok    { --aviso-cor: hsl(var(--success, 158 64% 26%)); }
.aviso--erro  { --aviso-cor: hsl(var(--destructive, 4 66% 42%)); }
.aviso--alerta{ --aviso-cor: hsl(var(--warning, 38 85% 27%)); }

.aviso__icone {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    color: var(--aviso-cor);
    background: color-mix(in srgb, var(--aviso-cor) 14%, transparent);
    flex-shrink: 0;
}
.aviso__icone svg { width: 18px; height: 18px; }

.aviso__texto { min-width: 0; padding-top: 1px; }
.aviso__titulo {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}
.aviso__msg {
    font-size: 13.5px;
    line-height: 1.45;
    margin: 2px 0 0;
    color: hsl(var(--muted-foreground, 215 18% 38%));
    overflow-wrap: anywhere;
}

.aviso__fechar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: -4px -4px 0 0;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: transparent;
    color: hsl(var(--muted-foreground, 215 18% 38%));
    cursor: pointer;
}
.aviso__fechar:hover { background: hsl(var(--muted, 214 30% 93.5%)); color: hsl(var(--foreground, 222 47% 11%)); }
.aviso__fechar:focus-visible { outline: 2px solid hsl(var(--ring, 206 88% 36%)); outline-offset: 1px; }
.aviso__fechar svg { width: 16px; height: 16px; }

/* barra do tempo: some da esquerda pra direita; para com o mouse em cima */
.aviso__tempo {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--aviso-cor);
    opacity: .55;
    transform-origin: left;
    animation: aviso-tempo linear forwards;
    animation-duration: var(--aviso-dur, 5s);
}
.aviso:hover .aviso__tempo,
.aviso:focus-within .aviso__tempo { animation-play-state: paused; }

@keyframes aviso-entra { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes aviso-sai   { to { opacity: 0; transform: translateX(16px); } }
@keyframes aviso-tempo { from { transform: scaleX(1); } to { transform: scaleX(0); } }

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