/* ====================================
   МОДАЛЬНОЕ ОКНО С ИНСТРУКЦИЕЙ
   (Автопоказ при первом посещении)
   ==================================== */

/* Кнопка инструкции в правом верхнем углу */
.popup-trigger {
    position: fixed;
    top: 70px;
    right: 10px;
    width: 150px;
    height: 45px;
    background-color: #313b57;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
    transition: all 0.3s ease;
    font-size: 14px;
}

.popup-trigger:hover {
    background: #252e46;
    transform: scale(1.1);
}

.popup-trigger span {
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.popup-trigger svg {
    margin-right: 5px;;
}

.popup-trigger svg path {
    fill: #FFFFFF !important;
}

/* Overlay для всплывающего окна инструкции */
.popup-overlay_inst {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-overlay_inst.active {
    display: flex;
    opacity: 1;
}

/* Контент всплывающего окна инструкции */
.popup-content_inst {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 620px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.popup-overlay_inst.active .popup-content_inst {
    transform: scale(1);
}

/* Заголовок popup инструкции */
.popup-header_inst {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.popup-header_inst h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.popup-close_inst {
    cursor: pointer;
    font-size: 28px;
    color: #999;
    line-height: 1;
    transition: color 0.3s ease;
}

.popup-close_inst:hover {
    color: #333;
}

/* Тело popup инструкции */
.popup-body_inst {
    padding: 20px;
}

.popup_text_inst {
    padding: 0 20px;
}

.popup_text_inst p {
    color: #313b57;
    font-size: 16px;
    line-height: 18px;
    margin: 15px 0 15px 0;
}

.popup_text_inst h4,
.popup_text_inst h5 {
    color: #313b57;
    font-size: 16px;
    margin: 15px 0 10px 0;
}

.popup-body_inst img {
    margin-bottom: 15px;
}

.popup_text_inst p strong {
    font-weight: 600;
}

.popup_text_inst ul {
    padding-left: 20px;
}

.popup_text_inst ul li {
    margin: 5px 0;
    color: #313b57;
}

.instruction_photo {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

/* ====================================
   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;
}

.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;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    margin-top: 10px;
}

/* ====================================
   АДАПТИВНОСТЬ
   ==================================== */

@media (max-width: 768px) {
    /* Кнопка инструкции */
    .popup-trigger {
        top: 50px;
        right: 10px;
        height: 36px;
        padding: 0 15px;
        z-index: 0;
    }
    
    .popup-trigger span {
        font-size: 12px;
    }
    
    .computer-text {
        display: none;
    }
    
    /* Popup инструкции */
    .popup-content_inst {
        width: 95%;
        margin: 20px;
    }
    
    .popup-header_inst,
    .popup-body_inst {
        padding: 15px;
    }
    
    .popup_text_inst p {
        font-size: 14px;
    }
}

@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;
    }
}

/* Скрыть текст на мобильных */
@media (max-width: 600px) {
    .computer-text {
        display: none;
    }
}