/* fv-alert.css — estilo dos modais customizados FV */

.fv-alert-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 9, 14, 0.75);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 180ms ease;
}
/* O display:flex acima vence o [hidden] do navegador e deixaria um véu
   invisível bloqueando a página inteira após fechar o modal. Nas telas com
   _Layout o Bootstrap ([hidden]{display:none!important}) mascarava isso;
   páginas standalone (ex.: Catálogo) precisam destas regras explícitas. */
.fv-alert-overlay[hidden] { display: none !important; }
.fv-alert-overlay:not(.open) { pointer-events: none; }
.fv-alert-overlay.open { opacity: 1; }

.fv-alert-card {
    background: linear-gradient(180deg, #1a1b22 0%, #15161c 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, sans-serif;
    transform: translateY(8px) scale(0.98);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.fv-alert-overlay.open .fv-alert-card { transform: translateY(0) scale(1); }

.fv-alert-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fv-alert-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
}
.fv-alert-title-wrap { flex: 1; min-width: 0; }
.fv-alert-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f3f4f6;
    line-height: 1.2;
}
.fv-alert-close {
    background: transparent;
    border: 0;
    color: #9ca3af;
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 120ms, color 120ms;
}
.fv-alert-close:hover { background: rgba(255,255,255,0.06); color: #fff; }

.fv-alert-body {
    padding: 16px 18px;
    color: #e5e7eb;
    font-size: 0.94rem;
    line-height: 1.5;
    overflow-y: auto;
    flex: 1;
}
.fv-alert-body code { background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 4px; color: #fbbf24; }

.fv-alert-details {
    margin: 0 18px 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    overflow: hidden;
}
.fv-alert-details > summary {
    padding: 8px 12px;
    cursor: pointer;
    color: #9ca3af;
    font-size: 0.82rem;
    user-select: none;
    background: rgba(255,255,255,0.02);
}
.fv-alert-details[open] > summary { border-bottom: 1px solid rgba(255,255,255,0.06); }
.fv-alert-details pre {
    margin: 0;
    padding: 10px 12px;
    color: #cbd5e1;
    background: #0e0f13;
    font-size: 0.78rem;
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.fv-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px 18px;
    background: rgba(255,255,255,0.015);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.fv-btn {
    border: 0;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 120ms, filter 120ms, background 120ms;
    font-family: inherit;
}
.fv-btn:active { transform: translateY(1px); }
.fv-btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #e5e7eb;
}
.fv-btn-secondary:hover { background: rgba(255,255,255,0.1); }
.fv-btn-primary {
    background: #fa0016;
    color: #fff;
}
.fv-btn-primary:hover { filter: brightness(1.1); }
.fv-btn-danger {
    background: #ef4444;
    color: #fff;
}
.fv-btn-danger:hover { filter: brightness(1.1); }
.fv-btn-success {
    background: #22c55e;
    color: #fff;
}
.fv-btn-success:hover { filter: brightness(1.1); }

/* Cores por tipo */
.fv-alert-card.fv-info    .fv-alert-icon { background: rgba(59,130,246,0.15); color: #93c5fd; }
.fv-alert-card.fv-success .fv-alert-icon { background: rgba(34,197,94,0.15);  color: #86efac; }
.fv-alert-card.fv-warn    .fv-alert-icon { background: rgba(245,158,11,0.15); color: #fcd34d; }
.fv-alert-card.fv-error   .fv-alert-icon { background: rgba(239,68,68,0.15);  color: #f87171; }
.fv-alert-card.fv-confirm .fv-alert-icon { background: rgba(167,139,250,0.15); color: #c4b5fd; }

.fv-alert-card.fv-error .fv-btn-primary { background: #ef4444; }
.fv-alert-card.fv-success .fv-btn-primary { background: #22c55e; }
.fv-alert-card.fv-warn .fv-btn-primary { background: #f59e0b; color: #111; }
.fv-alert-card.fv-confirm .fv-btn-primary { background: #8b5cf6; }

/* ============ Loading modal ============ */
.fv-alert-card.fv-loading .fv-alert-icon {
    background: transparent;
    border: 0;
    padding: 0;
}
.fv-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(250, 0, 22, 0.15);
    border-top-color: #fa0016;
    border-radius: 50%;
    animation: fv-spin 0.9s linear infinite;
}
@keyframes fv-spin {
    to { transform: rotate(360deg); }
}
.fv-alert-card.fv-loading .fv-alert-body {
    text-align: center;
    padding: 8px 18px 22px;
}
.fv-alert-card.fv-loading .fv-alert-head {
    border-bottom: 0;
    padding-bottom: 6px;
}
.fv-alert-card.fv-loading .fv-alert-actions {
    display: none;
}
.fv-loading-dots {
    color: #cbd5e1;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: baseline;
}
.fv-loading-dots .fv-dot {
    opacity: 0;
    margin-left: 1px;
    animation: fv-dots-blink 1.4s infinite;
}
.fv-loading-dots .fv-dot:nth-child(2) { animation-delay: 0.2s; }
.fv-loading-dots .fv-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes fv-dots-blink {
    0%, 100% { opacity: 0; }
    40%, 70% { opacity: 1; }
}
