/* ========== СТИЛИ ДЛЯ ВКЛАДКИ 11 (ЗАГРУЗКА ФАЙЛОВ) ========== */
/* ===== CSS-переменные для согласованных значений ===== */
:root {
    --file-item-height: 45px;
    --file-item-height-mobile: 50px;
    --border-dash-color: rgba(187, 187, 187, 0.5);
    --border-radius-md: 15px;
    --border-radius-sm: 10px;
    --border-radius-xs: 5px;
    --transition-speed: 0.3s;
}

/* ===== ОСНОВНЫЕ КОНТЕЙНЕРЫ ===== */
.file-upload-container {
    width: 100%;
    padding: 0;
}

/* ===== ОБЛАСТЬ ПЕРЕТАСКИВАНИЯ (ПК) ===== */
.drop-area {
    border: 2px dashed var(--border-dash-color);
    border-radius: var(--border-radius-md);
    padding: 20px 0;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    background-color: var(--bs-body-color);
    color: var(--bs-body-bg);
}

.drop-area:hover,
.drop-area.dragover {
    border-color: var(--bs-body-bg);
    background-color: rgba(187, 187, 187, 0.1);
}

.drop-area svg {
    margin-bottom: 15px;
    color: var(--bs-body-bg);
    opacity: 0.7;
}

.drop-area p {
    margin: 5px 0;
    color: var(--bs-body-bg);
    line-height: 1;
}

.drop-hint {
    font-size: 14px;
    opacity: 0.7;
    margin: 10px 0;
}

/* Кнопка выбора файлов */
.browse-btn {
    display: inline-block;
    line-height: 1;
    padding: 12px 24px;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: none;
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    font-size: 18px;
    font-weight: 300;
    transition: opacity var(--transition-speed) ease;
    margin-top: 10px;
    margin-bottom: 30px;
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 rgba(33, 37, 41, 0.8);
}

.browse-btn:hover {
    opacity: 0.8;
}

/* Информация о форматах внутри drop-area */
.pc-format-info {
    padding-top: 40px;
    border-top: 1px solid rgba(187, 187, 187, 0.3);
    text-align: center;
    width: 100%;
}

.pc-format-info p {
    margin: 8px 0;
    font-size: 18px;
    color: var(--bs-body-bg);
    line-height: 1.5;
    width: 250px;
    margin: 0 auto;
}

@media screen and (max-width:1200px) {
    .pc-format-info p {
        font-size: 14px;
        width: 200px;
    }
}

.pc-format-info strong {
    color: var(--bs-body-bg);
    font-weight: 400;
}

/* ===== СТРУКТУРА ДЛЯ МОБИЛЬНЫХ ===== */
.mobile-upload-structure {
    display: none; /* По умолчанию скрыт */
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    max-height: 800px;
    width: 100%;
}

/* Информационный блок */
.mobile-info-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 20px;
}

.mobile-info-content {
    background-color: var(--bs-body-color);
    border-radius: var(--border-radius-sm);
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mobile-format-info {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.mobile-format-info p {
    margin: 6px 0;
    font-size: 18px;
    line-height: 1.4;
    color: var(--bs-body-bg);
    text-align: center;
    position: relative;
}

.mobile-format-info svg {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bs-body-color);
    border-radius: 12px;
}

/* Блок списка файлов */
.mobile-files-block {
    flex: 0 0 720px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.mobile-files-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bs-body-color);
    border-radius: var(--border-radius-sm);
    padding: 0;
    width: 100%;
    height: 100%;
}

.mobile-files-content h4 {
    margin: 0;
    color: var(--bs-body-bg);
    font-size: 20px;
    text-align: center;
    font-weight: 400;
    padding: 20px;
    border-bottom: 1px solid rgba(187, 187, 187, 0.3);
}

.mobile-files-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Блок кнопки загрузки */
.mobile-buttons-block {
    padding: 20px;
}

.mobile-buttons-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.mobile-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    height: 150px;
    padding: 20px;
    border: dashed 2px #fff;
    color: var(--bs-body-bg);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 28px;
    font-weight: 400;
    transition: 0.3s ease;
    background: rgba(100, 100, 100, 0.5);
}

.mobile-upload-btn:hover,
.mobile-upload-btn:active {
    background: rgba(100, 100, 100, 1);
}

.mobile-upload-btn svg {
    width: 50px;
    height: 50px;
}

/* ===== СПИСОК ФАЙЛОВ ===== */
#uploadedFiles {
    list-style: none;
    padding: 20px;
    margin: 0;
    flex: 1;
    max-height: 250px; /* 5 файлов × 50px = 250px */
    overflow-y: auto;
}

#uploadedFiles li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius-xs);
    margin-bottom: 8px;
    height: var(--file-item-height);
    min-height: var(--file-item-height);
    max-height: var(--file-item-height);
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

/* Информация о файле */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.file-icon {
    margin-right: 10px;
    font-size: 18px;
    flex-shrink: 0;
}

.file-name {
    font-weight: 400;
    max-width: 200px;
    color: var(--bs-body-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-size: 18px;
}

.file-size {
    font-size: 14px;
    font-weight: 400;
    margin-left: 8px;
    flex-shrink: 0;
    padding: 3px 10px;
    background-color: var(--bs-body-color);
    color: var(--bs-body-bg);
    border: none;
    border-radius: var(--border-radius-xs);
    min-width: 80px;
    text-align: center;
}

/* Кнопка удаления */
.remove-btn {
    background: none;
    border: none;
    color: #ff4444;
    cursor: pointer;
    font-size: 30px;
    font-weight: 400;
    padding: 5px;
    transition: opacity var(--transition-speed) ease;
    flex-shrink: 0;
    margin-left: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-btn:hover {
    background-color: rgba(255, 68, 68, 0.1);
    opacity: 0.9;
}

/* Пустое сообщение */
.mobile-empty-message {
    text-align: center;
    color: grey;
    opacity: 0.5;
    font-style: italic;
    padding: 30px 20px;
    font-size: 22px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center !important;
}

/* ===== КНОПКА ПРОПУСКА ===== */
.skip-section {
    text-align: center;
    margin-top: 20px;
}

.skip-btn {
    padding: 12px 30px;
    background: none;
    border: 1px solid var(--bs-body-bg);
    color: var(--bs-body-bg);
    border-radius: var(--border-radius-xs);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-speed) ease;
}

.skip-btn:hover {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* ===== СТИЛИ ДЛЯ РАЗНЫХ ТИПОВ ФАЙЛОВ ===== */
.file-icon[data-type="pdf"]::before {
    content: "PDF";
    color: white;
    padding: 3px 10px;
    background-color: red;
    border-radius: var(--border-radius-xs);
    font-size: 14px;
    font-weight: 400;
    display: block;
}

.file-icon[data-type="image"]::before {
    content: "IMG";
    color: white;
    padding: 3px 10px;
    background-color: #0066ff;
    border-radius: var(--border-radius-xs);
    font-size: 14px;
    font-weight: 400;
    display: block;
}

.file-icon[data-type="dwg"]::before,
.file-icon[data-type="dxf"]::before {
    content: "";
    background-image: url("assets/img/icons/paperclip.svg");
    background-repeat: no-repeat;
    display: block;
    height: 20px;
    width: 20px;
}

.file-icon[data-type="other"]::before {
    content: "";
    background-image: url("assets/img/icons/paperclip.svg");
    background-repeat: no-repeat;
    display: block;
    height: 20px;
    width: 20px;
}

/* ===== АНИМАЦИИ ===== */
@keyframes pulse {
    0% { border-color: var(--border-dash-color); }
    50% { border-color: var(--bs-body-bg); }
    100% { border-color: var(--border-dash-color); }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.drop-area.dragover {
    animation: pulse 1s infinite;
    background-color: rgba(187, 187, 187, 0.15);
}

/* ===== СТИЛИ ДЛЯ СКРОЛЛБАРА ===== */
#uploadedFiles::-webkit-scrollbar {
    width: 6px;
}

#uploadedFiles::-webkit-scrollbar-track {
    background: rgba(187, 187, 187, 0.1);
    border-radius: 3px;
}

#uploadedFiles::-webkit-scrollbar-thumb {
    background: rgba(187, 187, 187, 0.3);
    border-radius: 3px;
}

#uploadedFiles::-webkit-scrollbar-thumb:hover {
    background: rgba(187, 187, 187, 0.5);
}

/* ===== СТИЛИ ДЛЯ ПК (min-width: 993px) ===== */
@media screen and (min-width: 993px) {
    /* Контейнер для двух колонок */
    .upload-main-container {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 30px;
        padding: 10px 0 20px 0;
        justify-content: space-between;
    }
    
    /* Два одинаковых поля */
    .file-upload-container,
    .mobile-upload-structure {
        display: flex;
        width: 48%;
        min-width: 48%;
        max-width: 48%;
        height: 360px;
        min-height: 360px;
        max-height: 360px;
    }
    
    /* Стили для поля загрузки */
    .drop-area {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        padding: 0;
        height: 100%;
        min-height: 360px;
    }
    
    /* Стили для поля со списком файлов */
    .mobile-upload-structure {
        margin-left: 0;
    }
    
    /* Скрываем лишние блоки на ПК */
    .mobile-upload-structure .mobile-info-block,
    .mobile-upload-structure .mobile-buttons-block {
        display: none;
    }
    
    /* Блок с файлами занимает всю высоту */
    .mobile-upload-structure .mobile-files-block {
        flex: 1;
        min-height: 100%;
        padding: 0;
        height: 100%;
    }
    
    .mobile-upload-structure .mobile-files-content {
        height: 100%;
        min-height: 100%;
        border: 2px dashed var(--border-dash-color);
        border-radius: var(--border-radius-md);
        display: flex;
        flex-direction: column;
    }
    
    .mobile-upload-structure .mobile-files-content h4 {
        font-size: 18px;
    }
    
    .mobile-upload-structure .mobile-files-container {
        flex: 1;
    }
    
    /* Список файлов на всю высоту */
    #uploadedFiles {
        max-height: none;
        flex: 1;
        padding: 5px 20px;
    }
    
    .mobile-empty-message {
        color: var(--bs-body-bg);
        opacity: 0.8;
        padding: 0;
        margin-bottom: 70px;
        font-size: 20px;
    }
    
    /* Цвета для ПК */
    #uploadedFiles li {
        background-color: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
    
    .file-name {
        color: var(--bs-body-color);
    }
    
    .file-size {
        color: var(--bs-body-bg);
        background-color: var(--bs-body-color);
    }
    
    .file-icon {
        color: var(--bs-body-bg);
    }
    
    /* Стили для текста внутри drop-area */
    .drop-area p,
    .drop-hint,
    .pc-format-info p,
    .pc-format-info strong {
        color: var(--bs-body-bg);
    }
    
    .browse-btn {
        background-color: #ff00dd !important;
        color: #fff !important;
        transition: 0.3s;
    }
    
    .browse-btn:hover {
        background-color: #52ceff !important;
        color: #fff !important;
    }
}

/* ===== СТИЛИ ДЛЯ МОБИЛЬНЫХ (max-width: 992px) ===== */
@media screen and (max-width: 992px) {
    /* Общие сбросы */
    .container, .container-lg, .container-md, .container-sm {
        max-width: unset;
        padding: 0;
        margin: 0;
    }
    
    .row {
        margin: 0;
        padding: 0;
    }
    
    html, body, .tabs {
        overflow-x: hidden;
    }
    
    .range-marker {
        display: none;
    }
    
    /* Адаптация обертки */
    .mrqz-wrapper {
        min-height: 100dvh;
    }
    
    .form-wrapper {
        padding: 0;
        margin: 0;
        border-radius: 0;
        background: none;
    }
    
    h1, h2, h3, h4, h5, h6, p {
        margin: 0;
        padding: 10px 5px;
    }
    
    /* Сетка элементов */
    .ul-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 20px 20px;
        margin-bottom: 150px;
    }
    
    .ul-grid li {
        font-size: 18px;
        border: 1px solid rgba(187, 187, 187, 0.5);
    }
    
    .ul-grid li:hover {
        border-color: var(--bs-body-color);
    }
    
    .ul-grid li label {
        display: flex;
        width: 100%;
        cursor: pointer;
        border-radius: var(--border-radius-sm);
        padding: 10px 20px;
        background-color: var(--bs-body-bg);
    }
    
    .ul-grid li span {
        font-size: 18px;
    }
    
    /* Вкладки */
    .tabs {
        height: unset;
    }
    
    .body-section {
        color: var(--bs-body-color);
        height: auto;
        min-height: calc(100dvh - 150px);
        padding-top: 30px;
    }
    
    .body-section p {
        text-align: center;
        color: var(--bs-body-color);
    }
    
    .begunok {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        height: auto;
        min-height: calc(100dvh - 70px);
    }
    
    /* Ползунки */
    #begunok-ploshad, 
    #begunok-etazh {
        border: none;
        width: 100%;
        text-align: center;
        display: block;
    }
    
    input[type="range"] {
        width: 63%;
        transform: scale(1.5);
        margin: 50px auto;
        padding: 20px;
        height: 24px;
        background-color: var(--bs-body-color);
        border-radius: var(--border-radius-sm);
    }
    
    .range-undefined {
        color: var(--bs-body-color);
        font-size: 20px;
        pointer-events: none;
        height: 50px;
    }
    
    #ploshad_doma_value,
    #kolichestvo_etazhey_value {
        color: var(--bs-body-color);
        font-size: 30px;
        height: 50px;
    }
    
    /* Блок кнопок */
    .tabs_control {
        padding: 0 20px;
        background-color: var(--bs-body-bg);
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        position: fixed;
        bottom: 88px;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1;
        transition: opacity var(--transition-speed) ease;
    }
    
    /* Кнопки */
    .button_confirm,
    .button_back {
        height: 50px;
        color: var(--bs-body-bg);
        background-color: var(--bs-body-color);
        border: 1px solid var(--bs-body-color);
        border-radius: var(--border-radius-xs);
        transition: opacity var(--transition-speed) ease;
    }
    
    .button_confirm {
        width: 120px;
        margin: 0 0 0 5px;
    }
    
    .button_back {
        width: 50px;
        margin: 0 5px 0 0;
        font-size: 20px;
        transform: rotate(180deg);
        line-height: 1;
    }
    
    .button_confirm:disabled,
    .button_back.disabled {
        color: var(--bs-body-bg);
        opacity: 0.6;
    }
    
    .button_back.disabled {
        pointer-events: none;
    }
    
    /* Контакты */
    .ul-contacts {
        width: 80%;
        margin: 0 auto;
        position: static;
        transform: none;
        padding-top: 0;
    }
    
    .ul-contacts li {
        border: none;
    }
    
    .ul-contacts #send_email,
    .ul-contacts #send_telefon {
        border: 1px solid var(--bs-body-color);
        background-color: var(--bs-body-bg);
        color: var(--bs-body-color);
    }
    
    /* Группа телефона */
    .phone-input-group {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
    }
    
    .phone-input-group .country-code-container {
        display: flex;
        align-items: center;
        border: 1px solid var(--bs-body-color);
        border-radius: var(--border-radius-xs);
        padding: 10px 12px;
        background: var(--bs-body-bg);
        width: 80px;
        height: 62px;
    }
    
    .phone-input-group .country-code-container span {
        font-size: 20px;
        color: var(--bs-body-color);
    }
    
    .phone-input-group #send_telefon {
        flex: 1;
    }
    
    /* Форма отправки */
    #send_form {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto) 1fr;
        min-height: calc(100dvh - 200px);
        padding-bottom: 120px;
    }
    
    .mrqz_confirm {
        display: none;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 62px;
        padding: 10px 12px;
        transition: var(--transition-speed);
        cursor: pointer;
        font-size: 20px;
        border-radius: var(--border-radius-xs);
        background-color: var(--bs-body-color);
        color: var(--bs-body-bg);
        border: none;
    }
    
    .mrqz_confirm:hover {
        opacity: 0.5;
    }
    
    /* Политика конфиденциальности */
    .mrqz_politika_konfidencialnosti {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 20px;
    }
    
    .data_warning {
        text-align: center;
        margin: 0;
        font-size: 14px;
        color: var(--bs-body-color);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .data_warning input {
        vertical-align: middle;
        margin: 0;
    }
    
    .data_warning span {
        text-align: left;
        margin-left: 20px;
    }
    
    #politika_konfidencialnosti_checkbox {
        transform: scale(2);
        margin-left: 10px;
    }
    
    /* Страница успеха */
    #mrqz_success {
        display: grid;
        justify-items: center;
        align-items: center;
        padding-top: 30%;
        padding-bottom: 0;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, auto) 1fr;
        min-height: calc(100dvh - 200px);
    }
    
    .success_button {
        padding: 10px 20px;
        background-color: var(--bs-body-color);
        color: var(--bs-body-bg);
        border-radius: var(--border-radius-xs);
        border: none;
        transition: var(--transition-speed);
        width: 250px;
    }
    
    .success_button:hover {
        opacity: 0.5;
    }
    
    .success_button a {
        color: var(--bs-body-bg);
    }
    
    /* Прогресс-бар */
    .progress {
        margin-bottom: 10px;
        background-color: rgba(160, 160, 160, 0.5);
        --bs-progress-bar-bg: var(--bs-body-bg);
        width: 100%;
        margin-right: 20px;
    }
    
    .progress-bar {
        transition: width var(--transition-speed) ease;
        background-color: var(--bs-body-color);
    }
    
    /* Скрытие на определенных вкладках */
    .form-wrapper:has(#tab_13.current) .tabs_control,
    .form-wrapper:has(#tab_14.current) .tabs_control {
        display: none;
    }
    
    .form-wrapper:has(#tab_13.current) .progress,
    .form-wrapper:has(#tab_14.current) .progress {
        display: none;
    }
    
    .form-wrapper:has(#tab_13.current) .mrqz_confirm,
    .form-wrapper:has(#tab_14.current) .mrqz_confirm {
        display: flex;
    }
    
    .form-wrapper:has(:is(#tab_13.current, #tab_14.current)) #calc_form {
        margin-bottom: 0;
        height: 100dvh;
    }
    
    .form-wrapper:has(:is(#tab_13.current, #tab_14.current)) #send_form {
        min-height: 100dvh;
        padding-bottom: 0;
    }
    
    /* Вкладка 11 на мобильных */
    .file-upload-container {
        max-width: 600px;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .drop-area,
    .skip-section {
        display: none;
    }
    
    .mobile-upload-structure {
        display: flex;
        height: calc(100vh - 200px);
    }
    
    .mobile-upload-structure .mobile-info-block,
    .mobile-upload-structure .mobile-buttons-block {
        display: flex;
    }
    
    .mobile-files-container {
        padding: 0 20px;
    }
    
    #uploadedFiles {
        padding: 0;
    }
    
    #uploadedFiles li {
        height: var(--file-item-height-mobile);
        min-height: var(--file-item-height-mobile);
        max-height: var(--file-item-height-mobile);
    }
    
    #mobileEmptyMessage {
        font-size: 22px;
        color: var(--bs-body-bg);
    }
    
    .mobile-format-info p {
        border: solid 2px var(--bs-body-bg);
        border-radius: var(--border-radius-xs);
        margin: 0;
        padding-top: 12px;
    }
}

/* ===== АДАПТАЦИЯ ДЛЯ РАЗНЫХ УСТРОЙСТВ ===== */

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .ul-contacts {
        width: 100%;
    }
    
    .mobile-info-block {
        min-height: 110px;
    }
    
    .mobile-format-info p {
        font-size: 16px;
        margin: 5px 0;
    }
    
    .mobile-files-block {
        min-height: 180px;
    }
    
    #uploadedFiles li {
        padding: 6px 10px;
    }
    
    .file-name {
        font-size: 16px;
    }
    
    .mobile-upload-btn {
        padding: 18px;
        font-size: 20px;
    }
}

/* Планшеты в альбомной ориентации */
@media (min-width: 768px) and (max-width: 992px) and (orientation: landscape) {
    .mobile-upload-structure {
        height: calc(100vh - 150px);
    }
    
    .mobile-files-block {
        flex: 0 0 720px;
    }
    
    #uploadedFiles li {
        height: var(--file-item-height-mobile);
        min-height: var(--file-item-height-mobile);
        max-height: var(--file-item-height-mobile);
    }
}

/* Очень высокие экраны */
@media (min-height: 800px) {
    .mobile-files-block {
        flex: 0 0 720px;
    }
    
    #uploadedFiles {
        max-height: 300px;
        padding: 5px 20px;
    }
    
    #uploadedFiles li {
        height: var(--file-item-height);
        min-height: var(--file-item-height);
        max-height: var(--file-item-height);
    }
}

/* Низкие экраны */
@media (max-height: 700px) {
    .mobile-upload-structure {
        height: calc(100vh - 180px);
    }
    
    .mobile-info-block {
        min-height: 100px;
    }
    
    .mobile-files-block {
        flex: 0 0 720px;
        min-height: 180px;
    }
    
    #uploadedFiles li {
        height: var(--file-item-height);
        min-height: var(--file-item-height);
        max-height: var(--file-item-height);
    }
}