/*=========================================================
    FLASH TOAST — mensagens de sessão (laracasts/flash)
    Substitui os alerts empilhados no topo da página por
    notificações flutuantes com ícone, cor por nível e
    fechamento automático.
===========================================================*/

#flash-toasts {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.flash-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 40px 14px 14px;
    border-radius: 12px;
    background: #ffffff;
    color: #1e293b;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(120%);
    transition: transform .35s cubic-bezier(.2, .85, .3, 1), opacity .35s, margin .25s;
}

.flash-toast.show { opacity: 1; transform: translateX(0); }

.flash-toast.hide {
    opacity: 0;
    transform: translateX(120%);
    margin-top: -6px;
}

/* faixa colorida na lateral esquerda */
.flash-toast:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--flash-accent, #64748b);
}

.flash-toast .flash-toast-icon {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    margin-left: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    background: var(--flash-accent, #64748b);
}

.flash-toast .flash-toast-content { flex: 1 1 auto; min-width: 0; padding-top: 2px; }

.flash-toast .flash-toast-title {
    display: block;
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--flash-accent, #334155);
}

.flash-toast .flash-toast-msg { display: block; word-wrap: break-word; }
.flash-toast .flash-toast-msg a { color: inherit; text-decoration: underline; }

.flash-toast .flash-toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: 1;
    transition: color .2s;
}
.flash-toast .flash-toast-close:hover { color: #1e293b; }

/* barra de progresso do tempo restante */
.flash-toast .flash-toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--flash-accent, #64748b);
    opacity: .35;
    transform-origin: left center;
}
.flash-toast.running .flash-toast-bar { animation: flashToastBar linear forwards; }
.flash-toast:hover .flash-toast-bar { animation-play-state: paused; }

@keyframes flashToastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* níveis */
.flash-toast.flash-success { --flash-accent: #16a34a; }
.flash-toast.flash-danger  { --flash-accent: #dc2626; }
.flash-toast.flash-warning { --flash-accent: #d97706; }
.flash-toast.flash-info    { --flash-accent: #2563eb; }

/*------------------------------------------------------
    Mobile: toasts no topo, largura total
------------------------------------------------------*/
@media only screen and (max-width: 767px) {
    #flash-toasts {
        top: auto;
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
    }
    .flash-toast { transform: translateY(140%); }
    .flash-toast.show { transform: translateY(0); }
    .flash-toast.hide { transform: translateY(140%); }
}

/* respeita quem pediu menos animação */
@media (prefers-reduced-motion: reduce) {
    .flash-toast { transition: opacity .2s; transform: none; }
    .flash-toast.show { transform: none; }
    .flash-toast.hide { transform: none; }
    .flash-toast.running .flash-toast-bar { animation: none; }
}
