/* Modal-only presentation; the full-page overlay remains separately owned. */
/* Opening a dialog by pointer must not paint an automatic close-button ring. */
:root[data-modal-focus-origin="pointer"] :is(.modal, dialog, [role="dialog"]) :is(button, a, [role="button"]):focus {
    outline: none !important;
    box-shadow: none !important;
}
:root[data-modal-focus-origin="keyboard"] :is(.modal, dialog, [role="dialog"]) :is(button, a, [role="button"]):focus-visible {
    outline: 2px solid var(--color-focus, #0d6efd) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}
.erp-modal-loader[hidden], .erp-modal-loader svg[hidden], .erp-modal-loader button[hidden] { display: none !important; }
.erp-modal-loader {
    position: absolute;
    inset: var(--modal-loader-top, 0px) 0 0;
    z-index: 1;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 1rem;
    background: var(--color-surface, #fff);
    color: var(--color-text, #212529);
    border-radius: 0 0 var(--bs-modal-border-radius, .5rem) var(--bs-modal-border-radius, .5rem);
}
.erp-modal-loading > .modal-dialog > .modal-content { min-height: min(20rem, 90dvh); }
.erp-modal-loading > .modal-dialog > .modal-content > :is(.modal-body,.modal-footer),
.erp-modal-loading > .modal-dialog > .modal-content > form > :is(.modal-body,.modal-footer) { visibility: hidden; pointer-events: none; }
.erp-modal-loading .modal.show { visibility: visible; pointer-events: auto; }
[data-modal-loading-covered] { visibility: hidden; pointer-events: none; }
.erp-modal-loading [role="dialog"][aria-modal="true"]:not(.is-hidden):not([aria-hidden="true"]):not([hidden]) { visibility: visible; pointer-events: auto; }
.erp-modal-loader-stage { display: grid; justify-items: center; gap: .65rem; max-width: 24rem; margin: auto; text-align: center; }
.erp-modal-orbit { width: 4.5rem; height: 4.5rem; max-width: 96px; max-height: 96px; color: var(--color-primary, #0d6efd); overflow: visible; }
.erp-modal-orbit-track { fill: none; stroke: currentColor; stroke-width: 1; opacity: .14; }
.erp-modal-orbit-lights { fill: currentColor; transform-origin: 48px 48px; animation: erp-modal-orbit-turn 2.4s linear infinite; }
.erp-modal-orbit-lights circle:nth-child(even) { opacity: .5; }
.erp-modal-orbit-core { fill: currentColor; transform-origin: 48px 48px; animation: erp-modal-orbit-breathe 1.6s ease-in-out infinite alternate; }
.erp-modal-loader[data-state="error"] :is(.erp-modal-orbit-lights,.erp-modal-orbit-core) { animation: none; }
.erp-modal-loader-message { margin: 0; font-size: calc(14px * var(--font-scale, 1)); font-weight: 600; }
.erp-modal-loader-hint { margin: 0; color: var(--color-text-muted, #64748b); font-size: calc(12px * var(--font-scale, 1)); }
.erp-modal-loader button {
    --bs-btn-color: var(--color-text, #212529);
    --bs-btn-border-color: var(--color-text-muted, #64748b);
    min-width: 44px;
    min-height: 44px;
}
@keyframes erp-modal-orbit-turn { from { transform: rotate(0deg) scale(.78); } 30%,70% { transform: rotate(180deg) scale(1); } to { transform: rotate(360deg) scale(.78); } }
@keyframes erp-modal-orbit-breathe { to { opacity: .55; transform: scale(.8); } }
@media(prefers-reduced-motion:reduce) { .erp-modal-orbit-lights,.erp-modal-orbit-core { animation: none; } }
