/* ==================== SHARED DOCUMENTS MODAL ==================== */
.documents-modal {
    position: fixed;
    inset: 0;
    z-index: 1000010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.documents-modal.active {
    display: flex;
}

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

body.documents-modal-open > *:not(.documents-modal) {
    user-select: none;
    -webkit-user-select: none;
}

.documents-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: documentsModalFadeIn 0.28s ease-out;
}

.documents-modal__content {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 48px));
    max-height: min(720px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    animation: documentsModalSlideUp 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.documents-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff;
}

.documents-modal__title {
    margin: 0;
    font-size: clamp(1.4rem, 1.8vw, 1.9rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.documents-modal__close {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.documents-modal__close:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.36);
    transform: scale(1.04);
}

.documents-modal__close svg {
    width: 24px;
    height: 24px;
}

.documents-modal__body {
    padding: 20px 22px 24px;
    overflow-y: auto;
}

.documents-modal__body::-webkit-scrollbar {
    width: 10px;
}

.documents-modal__body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.documents-modal__body::-webkit-scrollbar-track {
    background: transparent;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 92px;
    padding: 18px 20px;
    border: 1px solid #dbe4ef;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    color: #0f172a;
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.document-item:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.34);
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.12);
}

.document-item:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.28);
    outline-offset: 2px;
}

.document-text {
    flex: 1;
    font-size: clamp(1rem, 1.1vw, 1.18rem);
    font-weight: 700;
    line-height: 1.35;
    color: #1e293b;
}

.document-download {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 16px;
    border: 1px solid #dbe4ef;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: #475569;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.document-item:hover .document-download {
    transform: scale(1.04);
    border-color: rgba(37, 99, 235, 0.34);
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
}

.document-download svg {
    width: 23px;
    height: 23px;
}

@keyframes documentsModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes documentsModalSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 991px) {
    .documents-modal {
        padding: 18px;
    }

    .documents-modal__content {
        width: min(680px, 100%);
        max-height: calc(100vh - 36px);
        border-radius: 24px;
    }
}

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

    .documents-modal__content {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 24px 24px 18px 18px;
    }

    .documents-modal__header {
        padding: 16px 18px;
    }

    .documents-modal__title {
        font-size: 1.22rem;
    }

    .documents-modal__close {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .documents-modal__body {
        padding: 16px;
    }

    .documents-list {
        gap: 12px;
    }

    .document-item {
        min-height: 78px;
        padding: 16px;
        border-radius: 18px;
        gap: 14px;
    }

    .document-text {
        font-size: 1rem;
    }

    .document-download {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }
}

.documents-modal__overlay {
    pointer-events: auto;
}

.documents-modal__content {
    pointer-events: auto;
}
