/* ==========================================================================
   Modal: popup for create/edit forms (Components/Widgets/Modal.razor)
   ========================================================================== */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 900;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 6vh 16px 24px; box-sizing: border-box; overflow-y: auto;
    background: rgba(15, 29, 62, .55);
    animation: modalFade .14s ease-out;
}
.modal {
    width: 100%; max-width: var(--modal-w, 640px); max-height: calc(100vh - 6vh - 24px);
    display: flex; flex-direction: column;
    background: #FFFFFF; color: #141B26;
    border-radius: 12px; border-top: 4px solid #F2A900;
    box-shadow: 0 24px 60px -12px rgba(15, 29, 62, .45);
    animation: modalRise .16s ease-out;
}
.modal:focus { outline: none; }

.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid #E6EAF0; }
.modal-title { flex: 1; min-width: 0; }
.modal-title h2 { margin: 2px 0 0; font-size: 18px; }
.modal-kicker { font-family: "SF Mono", Consolas, monospace; font-size: 12px; color: #5B6779; }
.modal-close {
    flex: none; width: 36px; height: 36px; margin: -4px -8px 0 0;
    border: 0; border-radius: 8px; background: transparent;
    font-size: 24px; line-height: 1; color: #5B6779; cursor: pointer;
}
.modal-close:hover:not(:disabled) { background: #F1F4F9; color: #141B26; }
.modal-close:disabled { opacity: .4; cursor: not-allowed; }

.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-error { font-size: 13.5px; padding: 10px 14px; border-radius: 8px; border: 1px solid #F4C6CE; background: #FCE9EC; color: #A01D2E; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid #E6EAF0; }

@keyframes modalFade { from { opacity: 0; } }
@keyframes modalRise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 700px) {
    .modal-backdrop { padding: 0; }
    .modal { max-width: none; min-height: 100vh; max-height: none; border-radius: 0; }
}
