/*
 * Popup layout safety net for every dialog in Platform Admin (AppModal, .modal-card, Bootstrap .modal).
 *
 * 1. Many dialogs wrap head/body/footer in an <EditForm>. The form became the flex child of the
 *    height-capped card, so the body could not scroll and the bottom of the form was unreachable.
 *    The form now continues the card's flex column, so the body scrolls between a fixed head and foot.
 * 2. Dialog bodies are flex columns; their children (cards, grids, tables) were allowed to shrink
 *    and got clipped instead of the body scrolling. Children now keep their natural height.
 */
.modal-card > form,
.modal-card > .et-form,
.modal-content > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: inherit;
    margin: 0;
}

.modal-card .modal-head,
.modal-card .modal-foot,
.modal-content .modal-header,
.modal-content .modal-footer {
    flex-shrink: 0;
}

.modal-card .modal-body,
.modal-content .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-card .modal-body > *,
.modal-content .modal-body > * {
    flex-shrink: 0;
}

/* Field that the validation helper scrolled to: brief highlight so the eye finds it. */
.popup-error-focus {
    animation: popup-error-pulse 1.2s ease-out 1;
}

@keyframes popup-error-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.55); }
    100% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .popup-error-focus { animation: none; }
}
