/**
 * Стили модального окна B2B-заявки со спецификацией (#popupB2BOrder).
 * Поставка: Postavichok_RFQ (RFQ_DEV_02).
 * Спецификация: ops_rfq/specs/b2b_rfq_modal_spec.md
 */

/* ==========================================================================
   1. Контейнер модального окна (#popupB2BOrder)
   ========================================================================== */
.popupForm_b2b {
    position: relative;
    margin: 20px auto;
    max-width: 520px;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 36px 36px 40px;
    box-sizing: border-box;
    text-align: left;
}

.popupForm_b2b * {
    box-sizing: border-box;
}

/* Крестик закрытия */
.popupForm_b2b .popupForm__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.popupForm_b2b .popupForm__close:hover {
    opacity: 0.8;
    transform: rotate(90deg);
}

.popupForm_b2b .popupForm__close svg {
    width: 18px;
    height: 18px;
}

/* Заголовок и подзаголовок */
.popupForm_b2b .popupForm__title {
    font-family: 'FuturaPT', 'Futura PT', 'Roboto', sans-serif;
    font-weight: 600;
    font-size: 26px;
    line-height: 1.25;
    text-align: center;
    color: #222222;
    margin-bottom: 8px;
}

.popupForm_b2b .popupForm__text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
    color: #64748b;
    margin-bottom: 20px;
}

/* ==========================================================================
   2. Поля ввода и подсказки валидации
   ========================================================================== */
.popupForm_b2b .popupForm__list {
    display: flex;
    flex-direction: column;
}

.popupForm_b2b .popupForm__input {
    position: relative;
    margin-bottom: 12px;
}

.popupForm_b2b .popupForm__input input[type="text"],
.popupForm_b2b .popupForm__input input[type="tel"],
.popupForm_b2b .popupForm__input input[type="email"] {
    width: 100%;
    height: 42px;
    background: #ffffff;
    border: 1px solid #c7ced8;
    border-radius: 4px;
    padding: 0 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.popupForm_b2b .popupForm__input input:focus,
.popupForm_b2b .popupForm__textarea:focus {
    border-color: #e15501;
    box-shadow: 0 0 0 3px rgba(225, 85, 1, 0.12);
}

.popupForm_b2b .popupForm__textarea {
    width: 100%;
    height: 64px;
    background: #ffffff;
    border: 1px solid #c7ced8;
    border-radius: 4px;
    padding: 10px 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Ошибки валидации */
.popupForm_b2b .popupForm__input.error input,
.popupForm_b2b .popupForm__input.error textarea {
    border-color: #e11d48 !important;
    background-color: #fffbfa;
}

.popupForm_b2b .popupForm__hint {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    left: 8px;
    background: #ffcdae;
    color: #8a2400;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    z-index: 20;
    pointer-events: none;
}

.popupForm_b2b .popupForm__hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 14px;
    border: 5px solid transparent;
    border-top-color: #ffcdae;
}

.popupForm_b2b .popupForm__input.error .popupForm__hint {
    display: block;
    animation: b2bHintFade 0.2s ease;
}

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

/* ==========================================================================
   3. Drag & Drop зона (#b2bDropzone)
   ========================================================================== */
.b2bDropzone {
    position: relative;
    border: 2px dashed #c7ced8;
    border-radius: 6px;
    padding: 18px 16px;
    text-align: center;
    background: #fafbfc;
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}

.b2bDropzone:hover {
    border-color: #e15501;
    background: #fffdfb;
}

.b2bDropzone.dragover {
    border-color: #e15501;
    background: #fff6ee;
    border-style: solid;
    transform: scale(1.01);
}

.b2bDropzone__input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.b2bDropzone__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.b2bDropzone__icon {
    display: inline-flex;
    margin-bottom: 6px;
    transition: transform 0.2s ease;
}

.b2bDropzone.dragover .b2bDropzone__icon {
    transform: translateY(-3px);
}

.b2bDropzone__text {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.35;
}

.b2bDropzone__text strong {
    font-weight: 600;
}

.b2bDropzone__text u {
    color: #e15501;
    text-decoration: underline;
    font-weight: 500;
}

.b2bDropzone__sub {
    font-size: 11px;
    color: #8892a0;
    margin-top: 5px;
}

/* Ошибка загрузки файлов */
.b2bFilesError_js {
    padding: 7px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    line-height: 1.35;
}

/* ==========================================================================
   4. Список прикрепленных файлов (.b2bFileList)
   ========================================================================== */
.b2bFileList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.b2bFileItem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 13px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.b2bFileItem:hover {
    background: #e9eef5;
    border-color: #cbd5e1;
}

.b2bFileItem__info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    min-width: 0;
}

.b2bFileItem__thumb {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
    background: #fff;
}

.b2bFileItem__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 6px;
    border-radius: 3px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Цвета бейджей типов */
.b2bFileItem__badge_pdf { background: #dc2626; }
.b2bFileItem__badge_xls { background: #16a34a; }
.b2bFileItem__badge_doc { background: #2563eb; }
.b2bFileItem__badge_txt { background: #64748b; }
.b2bFileItem__badge_img { background: #e15501; }

.b2bFileItem__details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.b2bFileItem__name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #1e293b;
    font-weight: 500;
    font-size: 13px;
}

.b2bFileItem__size {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}

.b2bFileItem__remove {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
    margin-left: 8px;
}

.b2bFileItem__remove:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* ==========================================================================
   5. Чекбокс согласия 152-ФЗ
   ========================================================================== */
.popupForm_b2b .popupForm__privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
    margin-bottom: 16px;
    font-size: 12px;
    line-height: 1.4;
    color: #64748b;
}

.popupForm_b2b .popupForm__privacy a {
    color: #e15501;
    text-decoration: underline;
}

.popupForm_b2b .popupForm__privacy a:hover {
    text-decoration: none;
}

.popupForm_b2b .popupForm__privacy input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

/* ==========================================================================
   6. Кнопка отправки и индикатор загрузки
   ========================================================================== */
.popupForm_b2b .popupForm__btns {
    margin-top: 10px;
    text-align: center;
}

.popupForm_b2b .popupForm__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    background: #e15501;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(225, 85, 1, 0.3);
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.popupForm_b2b .popupForm__btn:hover:not(:disabled) {
    background: #c94a00;
    box-shadow: 0 6px 18px rgba(225, 85, 1, 0.4);
}

.popupForm_b2b .popupForm__btn:active:not(:disabled) {
    transform: translateY(1px);
}

.popupForm_b2b .popupForm__btn:disabled {
    background: #f08b50 !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* Спиннер загрузки */
.b2bSpinner {
    animation: b2bSpin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
}

@keyframes b2bSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Общее сообщение об ошибке */
.b2bGeneralError_js {
    padding: 9px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 13px;
    border-radius: 4px;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.4;
}

/* ==========================================================================
   7. Экран успеха (.popupB2B__success-view)
   ========================================================================== */
.popupB2B__success-view {
    text-align: center;
    padding: 16px 10px;
}

.popupB2B__success-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.15);
}

.popupB2B__success-order {
    display: inline-block;
    margin: 14px 0 6px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 15px;
    color: #1e293b;
}

.popupB2B__success-order strong {
    color: #e15501;
}

/* ==========================================================================
   8. Адаптивность для мобильных экранов
   ========================================================================== */
@media (max-width: 540px) {
    .popupForm_b2b {
        max-width: calc(100% - 24px);
        margin: 15px auto;
        padding: 28px 18px 24px;
        border-radius: 8px;
    }

    .popupForm_b2b .popupForm__close {
        top: 10px;
        right: 10px;
    }

    .popupForm_b2b .popupForm__title {
        font-size: 22px;
    }

    .popupForm_b2b .popupForm__text {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .b2bDropzone {
        padding: 14px 10px;
    }

    .b2bDropzone__text {
        font-size: 13px;
    }

    .b2bDropzone__sub {
        font-size: 10px;
    }

    .b2bFileItem {
        padding: 6px 10px;
    }

    .b2bFileItem__name {
        max-width: 170px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    .popupForm_b2b {
        padding: 24px 12px 20px;
    }

    .popupForm_b2b .popupForm__title {
        font-size: 20px;
    }

    .b2bFileItem__name {
        max-width: 130px;
    }
}
