/* Modais do backoffice no padrão do prd-orquestrador (modal-form.css): topo com degradê e ícone, corpo com campos 40px, rodapé fixo.
   Os modais antigos (Cuba: .modal-header/.modal-body/.modal-footer) ganham o visual só por CSS. */
.modal {
    --mf-blue: #6366f1; --mf-blue-rgb: 99, 102, 241; --mf-green: #22c55e; --mf-red-rgb: 239, 68, 68;
    --mf-t-blue: #4338ca; --mf-t-red: #991b1b;
    --mf-card: #ffffff; --mf-card-2: #f4f6fb; --mf-line: var(--motryz-border, #e5e7eb);
    --mf-strong: var(--motryz-text-strong, #111827); --mf-sub: var(--motryz-text-subtle, #6b7280); --mf-muted: #5b6779;
}
body.dark-only .modal { --mf-strong: #e8ecf7; --mf-sub: #a6aec1; --mf-line: #3b465b; --mf-card: #262b38; --mf-card-2: #1d2230; --mf-t-blue: #a5b4fc; --mf-t-red: #f87171; --mf-muted: #98a6ad; }

.modal .modal-dialog.modal-xl, .modal .modal-dialog.modal-lg { max-width: 760px; }
.modal .modal-content { max-height: calc(100vh - 3.5rem); border: 1px solid var(--mf-line); border-radius: 16px; overflow: hidden; background: var(--mf-card); color: var(--mf-strong); box-shadow: 0 24px 60px rgba(15, 23, 42, .28); text-align: left; }
.modal .modal-header {
    position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--mf-line);
    background: linear-gradient(135deg, rgba(var(--mf-blue-rgb), .14), rgba(var(--mf-blue-rgb), .03));
}
.modal .modal-header .modal-title { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--mf-strong); }
.modal .modal-header .modal-title::before {
    content: "\f044"; font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", FontAwesome; font-weight: 900;
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--mf-blue); color: #fff; font-size: 16px; box-shadow: 0 4px 10px rgba(var(--mf-blue-rgb), .35);
}
.modal[id*="adastro"] .modal-header .modal-title::before, .modal[id*="Cadastro"] .modal-header .modal-title::before { content: "\2b"; }
.modal .modal-header .btn-close { flex: 0 0 auto; width: 34px; height: 34px; margin: 0; padding: 0; border: 1px solid var(--mf-line); border-radius: 10px; background-color: var(--mf-card); background-size: 12px; opacity: .8; }
.modal .modal-header .btn-close:hover { border-color: rgba(var(--mf-red-rgb), .5); opacity: 1; }
body.dark-only .modal .modal-header .btn-close { filter: invert(1) grayscale(1); }

.modal .modal-body { padding: 18px 20px; overflow-y: auto; }
.modal .modal-body .card { margin: 0; border: 0; box-shadow: none; background: transparent; }
.modal .modal-body .card-body { padding: 0; }
.modal .modal-body .row > [class*="col-"] { padding-left: 7px; padding-right: 7px; }
.modal .modal-body .mb-3 { margin-bottom: 14px !important; }
.modal .modal-body label { margin-bottom: 5px; font-size: .75rem; font-weight: 600; color: var(--mf-strong); }
.modal .modal-body .form-control, .modal .modal-body .form-select {
    min-height: 40px; border-radius: 10px; border: 1px solid var(--mf-line); background-color: var(--mf-card-2); color: var(--mf-strong); font-size: .8125rem;
}
.modal .modal-body textarea.form-control { min-height: 84px; }
.modal .modal-body .form-control:focus, .modal .modal-body .form-select:focus { border-color: var(--mf-blue); box-shadow: 0 0 0 3px rgba(var(--mf-blue-rgb), .25); background-color: var(--mf-card); }
.modal .modal-body .form-control:disabled, .modal .modal-body .form-control[readonly] { color: var(--mf-sub); opacity: 1; cursor: not-allowed; }

.modal .modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: var(--mf-card); border-top: 1px solid var(--mf-line); }
.modal .modal-footer .btn { margin: 0; border-radius: 10px; font-weight: 700; min-height: 38px; }
.modal .modal-footer .btn-success, .modal .modal-footer .btn-primary { min-width: 130px; }
.modal .modal-footer .btn-secondary, .modal .modal-footer .btn-light, .modal .modal-footer .btn-outline-secondary { border: 1px solid var(--mf-line); background: var(--mf-card-2); color: var(--mf-sub); font-weight: 600; }
.modal .modal-footer .btn-secondary:hover, .modal .modal-footer .btn-light:hover { color: var(--mf-strong); border-color: rgba(var(--mf-blue-rgb), .5); }

@media (max-width: 575px) { .modal .modal-dialog { margin: .5rem; } .modal .modal-footer .btn { flex: 1 1 auto; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
