/* XonModal - wspólna powłoka okien (panel biura).
   Na końcu pliku jest też wygląd starych popupów Magnific (.popup-form), bez zmiany ich HTML. */

.xon-modal-host {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    pointer-events: none;
}

body.xon-modal-open {
    overflow: hidden;
}

.xon-modal-layer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    pointer-events: auto;
}

.xon-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 20, 0.5);
}

.xon-modal {
    position: relative;
    z-index: 1;
    width: 640px;
    max-width: 100%;
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    outline: none;
}

.xon-modal.xon-modal-size-small {
    width: 420px;
}

.xon-modal.xon-modal-size-medium {
    width: 640px;
}

.xon-modal.xon-modal-size-large {
    width: 860px;
}

.xon-modal.xon-modal-size-xlarge {
    width: 1080px;
}

.xon-modal-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100dvh - 32px);
    min-height: 0;
    background: #fff;
    color: #163028;
    border: 1px solid #e4e9e6;
    border-top: 3px solid #54b848;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 24, 20, 0.16);
    overflow: hidden;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

.xon-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f3faf2 0%, #ffffff 70%);
    border-bottom: 1px solid #e3eee1;
}

.xon-modal-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.xon-modal-icon svg {
    display: block;
}

.xon-modal-header .xon-modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    color: #163028;
}

.xon-modal-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    margin-left: auto;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #3d5248;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.xon-modal-close:hover {
    background: #eef6ec;
    color: #163028;
}

.xon-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
}

.xon-modal-footer {
    flex: 0 0 auto;
    background: #fff;
    border-top: 1px solid #e6ebe8;
    padding: 12px 16px;
}

.xon-modal-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.xon-modal-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #24362f;
    overflow-wrap: break-word;
}

.xon-modal-footer-inner.xon-modal-actions {
    justify-content: flex-end;
}

.xon-modal-actions .xon-btn-primary {
    min-width: 0;
    margin-left: 0;
}

.xon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 36px;
    padding: 8px 16px;
    border-radius: 6px;
    font-family: Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    box-sizing: border-box;
}

.xon-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.xon-btn-secondary {
    background: #fff;
    color: #223d32;
    border: 1px solid #cfd6d2;
}

.xon-btn-secondary:hover:not(:disabled) {
    background: #f6f8f7;
}

.xon-btn-primary {
    margin-left: auto;
    background: #54b848;
    color: #fff;
    border: 1px solid #54b848;
    min-width: 148px;
}

.xon-btn-primary:hover:not(:disabled) {
    background: #469c3c;
    border-color: #469c3c;
}

.xon-modal-layer button:focus-visible,
.xon-modal-layer input:focus-visible,
.xon-modal-layer textarea:focus-visible,
.xon-modal-layer select:focus-visible,
.xon-modal-layer a:focus-visible {
    outline: 2px solid #54b848 !important;
    outline-offset: 2px;
}

@media (max-width: 720px) {
    .xon-modal-layer {
        padding: 12px;
        align-items: flex-end;
    }

    .xon-modal,
    .xon-modal.xon-modal-size-small,
    .xon-modal.xon-modal-size-medium,
    .xon-modal.xon-modal-size-large,
    .xon-modal.xon-modal-size-xlarge {
        width: 100%;
        max-height: calc(100dvh - 24px);
    }

    .xon-modal-container {
        max-height: calc(100dvh - 24px);
    }

    .xon-modal-body {
        padding: 12px 14px;
    }

    .xon-modal-footer-inner {
        flex-wrap: wrap;
    }

    .xon-btn-primary {
        min-width: 0;
    }
}

/* Magnific (.popup-form): ta sama powłoka co XonModal. Szerokości pól zostają z Popup.css. */

.mfp-bg {
    background: #0f1714;
    opacity: 0.5;
}

.popup-form {
    border: 1px solid #e4e9e6;
    border-top: 3px solid #54b848;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 24, 20, 0.16);
}

.popup-form .popup-header {
    background: linear-gradient(180deg, #f3faf2 0%, #ffffff 70%);
    color: #163028;
    text-align: left;
    font-weight: 500;
    padding: 14px 48px 14px 16px;
    border-bottom: 1px solid #e3eee1;
    border-radius: 9px 9px 0 0;
}

.popup-form > .mfp-close,
.popup-form .mfp-close {
    color: #3d5248;
    width: 32px;
    height: 32px;
    line-height: 30px;
    right: 10px;
    top: 10px;
    padding: 0;
    font-size: 22px;
    border-radius: 6px;
    background: transparent;
    opacity: 1;
}

.popup-form > .mfp-close:hover,
.popup-form .mfp-close:hover {
    background: #eef6ec;
    color: #163028;
}

.popup-form > .mfp-close:active,
.popup-form .mfp-close:active {
    top: 10px;
}

.popup-form .popup-footer {
    height: auto;
    min-height: 52px;
    padding: 10px 16px;
    border-top: 1px solid #e6ebe8;
    border-radius: 0 0 10px 10px;
    box-sizing: border-box;
}

.popup-form .popup-footer > .btn.popup-footer-btn:not(.xdb-btn-secondary),
.popup-form .popup-footer > #popup-footer-btn-ok {
    background-color: #54b848;
    color: #fff;
    border-color: #54b848;
    border-radius: 6px;
}

.popup-form .popup-footer > .btn.popup-footer-btn:not(.xdb-btn-secondary):hover:not(:disabled),
.popup-form .popup-footer > #popup-footer-btn-ok:hover:not(:disabled) {
    background-color: #469c3c;
    border-color: #469c3c;
    color: #fff;
}

.popup-form .popup-footer > .btn.popup-footer-btn:disabled,
.popup-form .popup-footer > #popup-footer-btn-ok:disabled {
    background-color: #f8f9fa;
    color: #adb5bd;
    border-color: #e0e0e0;
}

.popup-form .popup-footer .pull-left .btn.popup-footer-btn,
.popup-form .popup-footer .dropdown > .btn.popup-footer-btn,
.popup-form .popup-footer .pull-left #popup-footer-btn-no {
    background: #fff;
    color: #223d32;
    border: 1px solid #cfd6d2;
    border-radius: 6px;
}

.popup-form .popup-footer .pull-left .btn.popup-footer-btn:hover:not(:disabled),
.popup-form .popup-footer .dropdown > .btn.popup-footer-btn:hover:not(:disabled),
.popup-form .popup-footer .pull-left #popup-footer-btn-no:hover {
    background: #f6f8f7;
    color: #223d32;
    border-color: #cfd6d2;
}

.popup-form .popup-footer .pull-left .btn.popup-footer-btn:disabled,
.popup-form .popup-footer .dropdown > .btn.popup-footer-btn:disabled {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e0e0e0;
}

@media (max-width: 992px) {
    .popup-form {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    .popup-form .popup-header,
    .popup-form .popup-footer {
        border-radius: 0;
    }
}
