/* ═══════════════════════════════════════════════════════════
   toast.css
   Aviso flutuante de sucesso (cadastro / login concluído).
   Aparece no topo, some sozinho depois de alguns segundos.
   ═══════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    top: 92px;
    left: 50%;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(440px, calc(100% - 32px));
    padding: 16px 18px;
    overflow: hidden;
    background: #fff;
    color: #1f2937;
    border-radius: 16px;
    border-left: 6px solid #10b981;
    box-shadow: 0 18px 45px rgba(30, 10, 60, 0.28);
    font-family: 'Poppins', sans-serif;
    opacity: 0;
    transform: translate(-50%, -24px);
    animation: toast-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.2s forwards;
}

.toast.saindo {
    animation: toast-out 0.35s ease forwards;
}

.toast-icone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #d1fae5;
    color: #059669;
}

.toast-texto {
    flex: 1;
    min-width: 0;
}

.toast-titulo {
    display: block;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
}

.toast-msg {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #6b7280;
    overflow-wrap: anywhere;
}

.toast-fechar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.toast-fechar:hover {
    background: #f3f4f6;
    color: #374151;
}

.toast-barra {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: #10b981;
    transform-origin: left;
    animation: toast-barra 5s linear 0.65s forwards;
}

@keyframes toast-in {
    to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translate(-50%, 0); }
    to   { opacity: 0; transform: translate(-50%, -24px); }
}

@keyframes toast-barra {
    to { transform: scaleX(0); }
}

[data-theme="dark"] .toast {
    background: #3a2550;
    color: #e8e8f0;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .toast-icone { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
[data-theme="dark"] .toast-msg { color: #b0a8c0; }
[data-theme="dark"] .toast-fechar:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

@media (prefers-reduced-motion: reduce) {
    .toast { animation-duration: 0.01s; animation-delay: 0s; }
    .toast-barra { animation: none; display: none; }
}
