/* =========================================================
   FANCY MODAL – CSS PRODUKCYJNY
   ========================================================= */

/* Overlay */
.fancy-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal box */
.fancy-modal {
    background: #ffffff;
    width: min(900px, 95%);
    height: 90vh;

    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;

    animation: fancyIn 0.28s ease;
}

/* Close button */
.fancy-close {
    position: absolute;
    top: 14px;
    right: 16px;

    background: transparent;
    border: none;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;

    color: #333;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.fancy-close:hover {
    opacity: 1;
}
.fancy-footer {
    padding: 14px 18px;
    border-top: 1px solid #eee;
    background: #fff;

    position: sticky;
    bottom: 0;
}

.fancy-close-bottom {
    width: 100%;
    height: 44px;

    border-radius: 10px;
    border: none;

    background: #222;
    color: #fff;
    font-size: 16px;
    font-weight: 500;

    cursor: pointer;
}

/* Loader */
.fancy-loader {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;

    font-size: 15px;
    color: #444;
}

/* Spinner */
.spinner {
    width: 42px;
    height: 42px;

    border: 4px solid #ddd;
    border-top-color: #222;
    border-radius: 50%;

    animation: spin 0.9s linear infinite;
}

/* Content */
.fancy-content {
    flex: 1;
    overflow-y: auto;
    padding: 26px;

    font-size: 16px;
    line-height: 1.65;
    color: #222;
    text-align:initial;
    margin-top:20px;
    display: none;
}

/* Blur background */
body.modal-open {
    overflow: hidden;
}

body.modal-open #pageWrapper {
    filter: blur(6px);
    transition: filter 0.25s ease;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fancyIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .fancy-modal {
        width: 90%;
        height: 90vh;
        border-radius: 8px;
    }

    .fancy-content {
        padding: 18px;
        font-size: 15px;
      
    }
}
