/* ====================================
   CALLBACK КНОПКА И МОДАЛЬНОЕ ОКНО
   (Фиксированная кнопка телефона)
   ==================================== */

/* Кнопка callback в правом нижнем углу */
.callback-popup_container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50px;
    background: #313b57;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9997;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(49, 59, 87, 0.3);
}

.callback-popup_container:hover {
    background: #252e46;
    transform: scale(1.1);
}

/* Модальное окно callback-информации */
.callback-info_popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: none;
    z-index: 9996;
}

.callback-info_popup.show {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.callback-info_popup p {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
}

/* Кнопки в callback popup */
.callback-popup_buttons {
    margin-top: 10px;
}

.callback-popup_buttons svg {
    margin-right: 5px;
}

.callback-popup_buttons a {
    display: block;
    width: 100%;
    margin-bottom: 5px;
    padding: 10px;
    background-color: #313b57;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all .2s linear;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    border: 1px solid #313b57;
}

.callback-popup_buttons a:hover {
    background-color: #252e46;
}

/* ====================================
   ФОРМЫ ЗАПРОСОВ
   (Форма помощи и размещения компании)
   ==================================== */

/* Общие стили для модальных окон с формами */
.request-form_popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 500px;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: none;
    z-index: 9996;
}

.request-form_popup.show {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.request-form_popup p {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin: 0 0 15px 0;
}

/* Стили форм */
.request-form_popup form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form_2_rows {
    display: flex;
    gap: 10px;
}

.form_2_rows input {
    flex: 1;
}

.request-form_popup input,
.request-form_popup textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, sans-serif;
}

.request-form_popup input:focus,
.request-form_popup textarea:focus {
    outline: none;
    border-color: #313b57;
}

.request-form_popup textarea {
    min-height: 80px;
    resize: vertical;
}

.privacy-agreement {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.privacy-agreement input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
}

.privacy-agreement label {
    cursor: pointer;
    text-align: left;
}

.privacy-agreement a {
    color: #313b57;
    text-decoration: underline;
}

.privacy-agreement a:hover {
    color: #007cba;
}

.request-form_popup button[type="submit"] {
    padding: 12px;
    background-color: #313b57;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.request-form_popup button[type="submit"]:hover {
    background-color: #252e46;
}

/* Сообщения об успехе и ошибках */
#form-result,
#company-form-result {
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

#form-result.success,
#company-form-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

#form-result.error,
#company-form-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ====================================
   АДАПТИВНОСТЬ
   ==================================== */

/* ====================================
   ФОРМА ПЕРЕГОВОРОВ НА СТРАНИЦЕ ДЕТАЛИЗАЦИИ
   ==================================== */

/* Кнопка "Оставить заявку на переговоры" */
.details_contant-popup {
    display: flex;
    align-items: center;
    background-color: #313b57;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #313b57;
    justify-content: center;
}

.details_contant-popup:hover {
    background-color: #252e46;
    color: white;
    text-decoration: none;
}

.details_contant-popup svg {
    margin-right: 8px;
    fill: white;
}

/* Контейнер попапа формы переговоров */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.popup-container.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-container.show-popup {
    opacity: 1;
}

/* Контент попапа */
.popup-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.4s ease;
}

.popup-container.show-popup .popup-content {
    transform: scale(1);
}

/* Кнопка закрытия */
.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

/* Текст в попапе */
.popup-content p {
    text-align: center;
    font-size: 16px;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Форма в попапе */
.popup-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popup-content .form_2_rows {
    display: flex;
    gap: 15px;
}

.popup-content .form_2_rows input,
.popup-content .form_2_rows textarea {
    flex: 1;
}

.popup-content input:not(.privacy-agreement input[type="checkbox"]),
.popup-content textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    border: 2px solid #313b57;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Montserrat';
}

.popup-content input:focus,
.popup-content textarea:focus {
    outline: none;
    border-color: #313b57;
}

.popup-content textarea {
    min-height: 80px;
    resize: vertical;
}

.popup-content button[type="submit"] {
    padding: 15px;
    background-color: #313b57;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

.popup-content button[type="submit"]:hover {
    background-color: #252e46;
}

/* Состояние загрузки кнопки */
.popup-content button[type="submit"].is-loading {
    background-color: #6b7490;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
    padding-left: 40px;
}

.popup-content button[type="submit"].is-loading::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-loader 0.6s linear infinite;
}

@keyframes spin-loader {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Overlay на форму при отправке */
.form-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 5px;
    z-index: 10;
    pointer-events: all;
}

/* Результат отправки формы */
#details-form-result {
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
}

/* ====================================
   ТАБЫ ДЛЯ ФОРМЫ ПЕРЕГОВОРОВ
   ==================================== */

.details-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.details-tab {
    flex: 1;
    min-width: 200px;
    background-color: #FFFFFF !important;
    border: 2px solid #313b57 !important;
    color: #252e46 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    justify-content: center;
}

.details-tab:hover {
    background-color: #e8e8e8;
    border-color: #bbb;
}

#details-popup .details-tab.active {
    background-color: #313b57 !important;
    border-color: #313b57 !important;
    color: white !important;
}

.details-tab .tab-icon {
    font-size: 18px;
    transition: all 0.3s ease;
}

.details-tab.active .tab-icon {
    color: #4CAF50;
}

.details-tab .tab-text {
    line-height: 1.3;
}

/* Контент табов */
.popup-content .details-tab-content {
    display: none !important;
    flex-direction: column;
    gap: 15px;
}

.popup-content .details-tab-content.active {
    display: flex !important;
}

#details-popup textarea {
    margin-bottom: 0;
}

#details-popup .form-section-title {
    margin: 0;
    text-align: left;
}

#custom-request-form input:not(.privacy-agreement input[type="checkbox"]),
#custom-request-form textarea {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
    border: 2px solid #313b57;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Montserrat';
}

/* ====================================
   АДАПТИВНОСТЬ
   ==================================== */

@media (min-width: 768px) {
    #callback-info-popup .callback-popup_button {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Форма переговоров на мобильных */
    .popup-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }
    
    /* Табы на мобильных */
    .details-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .details-tab {
        min-width: 100%;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .details-tab .tab-text {
        font-size: 13px;
    }
    
    .popup-content .form_2_rows {
        flex-direction: column;
        gap: 10px;
    }
    
    .details_contant-popup {
        padding: 12px 15px;
        font-size: 13px;
    }
}

@media (max-width: 478px) {
    /* Callback кнопка */
    .callback-popup_container {
        bottom: 50px;
    }
    
    /* Callback и формы popup */
    .callback-info_popup,
    .request-form_popup {
        width: calc(100% - 20px);
        right: 0;
        bottom: 120px;
        margin: 0 10px;
    }
    
    .callback-info_popup p,
    .request-form_popup p {
        font-size: 12px;
    }
    
    .callback-popup_buttons {
        text-align: center;
    }
    
    .callback-popup_buttons a {
        font-size: 12px;
    }
    
    /* Формы на мобильных */
    .form_2_rows {
        flex-direction: column;
    }
    
    .request-form_popup input,
    .request-form_popup textarea,
    .request-form_popup button {
        font-size: 14px;
    }
    
    /* Форма переговоров на очень маленьких экранах */
    .popup-content {
        width: 98%;
        padding: 15px;
        max-height: 90vh;
    }
    
    .popup-content p {
        font-size: 14px;
    }
    
    .details_contant-popup {
        padding: 10px;
        font-size: 12px;
    }

    #details-popup .form_2_rows {
        flex-direction: column !important;
    }

    #details-popup .popup-content p{
        margin-top: 0 !important;
    }

    #details-popup input, #details-popup textarea {
        font-size: 12px;
        margin-bottom: 0;
    }
}