/* Alertas estilo Windows + campos obrigatórios — padrão de todos os formulários */

.win-toast-host {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 10050;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    width: min(380px, calc(100vw - 24px));
    pointer-events: none;
}

.win-toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 4px 40px 1fr 28px;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 0 10px;
    padding: 12px 8px 12px 0;
    background: #f3f3f3;
    color: #1a1a1a;
    border-radius: 8px;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.06);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    animation: win-toast-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.win-toast.is-leaving {
    animation: win-toast-out 0.2s ease forwards;
}

.win-toast-accent {
    grid-row: 1 / span 2;
    align-self: stretch;
    background: #0078d4;
}

.win-toast--success .win-toast-accent { background: #107c10; }
.win-toast--error .win-toast-accent { background: #c42b1c; }
.win-toast--warning .win-toast-accent { background: #c19c00; }
.win-toast--info .win-toast-accent { background: #0078d4; }

.win-toast-icon {
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #0078d4;
    line-height: 1;
}

.win-toast--success .win-toast-icon { background: #107c10; }
.win-toast--error .win-toast-icon { background: #c42b1c; }
.win-toast--warning .win-toast-icon { background: #c19c00; }

.win-toast-body {
    min-width: 0;
    padding-top: 1px;
}

.win-toast-app {
    font-size: 11px;
    color: #616161;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.win-toast-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #111;
}

.win-toast-msg {
    font-size: 12.5px;
    line-height: 1.45;
    color: #333;
    margin-top: 4px;
    white-space: pre-wrap;
    max-height: 9.5em;
    overflow: auto;
}

.win-toast-close {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #444;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}

.win-toast-close:hover {
    background: rgba(0, 0, 0, 0.08);
}

.win-toast-progress {
    grid-column: 1 / -1;
    height: 3px;
    margin: 8px 8px 0 0;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.win-toast-progress > span {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    background: currentColor;
    animation: win-toast-bar linear forwards;
}

.win-toast--success .win-toast-progress { color: #107c10; }
.win-toast--error .win-toast-progress { color: #c42b1c; }
.win-toast--warning .win-toast-progress { color: #c19c00; }
.win-toast--info .win-toast-progress { color: #0078d4; }

@keyframes win-toast-in {
    from { opacity: 0; transform: translateX(28px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes win-toast-out {
    to { opacity: 0; transform: translateX(28px); }
}

@keyframes win-toast-bar {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .win-toast-host {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
    }
}

html.js-ready [data-flash-inline] {
    display: none !important;
}

/* Marcação de obrigatório e estado inválido */
.req-mark {
    color: #c42b1c;
    font-weight: 700;
    margin-left: 2px;
}

input.is-invalid:not([type='checkbox']):not([type='radio']):not([type='hidden']),
select.is-invalid,
textarea.is-invalid {
    border-color: #c42b1c !important;
    box-shadow: 0 0 0 3px rgba(196, 43, 28, 0.14) !important;
}

.field:has(.is-invalid) > label,
label:has(.is-invalid) {
    color: #9b1c1c;
}
