/* Popup стили */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.popup-close:hover {
    color: #333;
}

.form-header {
    margin-bottom: 15px;
    text-align: center;
}

.form-head {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.form-head span {
    color: #007bff;
}

.form-desk {
    color: #666;
    font-size: 16px;
}

.bitrix-form-container {
    margin-top: 15px;
}

/* Стили для формы Bitrix24 */
.b24-form {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.b24-form * {
    box-sizing: border-box !important;
}

.b24-form .b24-form-control {
    padding: 8px 12px !important;
    font-size: 14px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    margin-bottom: 10px !important;
}

.b24-form .b24-form-control:focus {
    border-color: #007bff !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) !important;
}

.b24-form .b24-form-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-bottom: 5px !important;
    display: block !important;
}

.b24-form .b24-form-group {
    margin-bottom: 15px !important;
}

.b24-form .b24-form-button {
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    width: 100% !important;
    margin-top: 10px !important;
}

.b24-form .b24-form-button:hover {
    background-color: #0056b3 !important;
}

.b24-form .b24-form-textarea {
    min-height: 80px !important;
    resize: vertical !important;
}

.b24-form .b24-form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 8px center !important;
    background-repeat: no-repeat !important;
    background-size: 16px !important;
    padding-right: 32px !important;
}

/* Анимации */
.animate-top {
    animation: slideInTop 0.5s ease-out;
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .popup {
        align-items: flex-start;
        padding: 10px;
        overflow-y: auto;
    }
    
    .popup-content {
        margin: 0;
        padding: 15px;
        max-width: 100%;
        width: 100%;
        max-height: calc(100vh - 20px);
        margin-top: 0;
        box-sizing: border-box;
    }
    
    .form-head {
        font-size: 16px;
        line-height: 1.3;
    }
    
    .form-header {
        margin-bottom: 10px;
    }
    
    .bitrix-form-container {
        margin-top: 10px;
    }
    
    .popup-close {
        top: 10px;
        right: 15px;
        font-size: 24px;
    }
    
    /* Мобильные стили для формы Bitrix24 */
    .b24-form {
        font-size: 12px !important;
    }
    
    .b24-form .b24-form-control {
        padding: 6px 10px !important;
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
    
    .b24-form .b24-form-label {
        font-size: 11px !important;
        margin-bottom: 3px !important;
    }
    
    .b24-form .b24-form-group {
        margin-bottom: 10px !important;
    }
    
    .b24-form .b24-form-button {
        padding: 8px 16px !important;
        font-size: 12px !important;
        margin-top: 8px !important;
    }
    
    .b24-form .b24-form-textarea {
        min-height: 60px !important;
    }
}
