/* 질문 영역 고정 높이 및 스크롤 */
.question-upper {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  transform-origin: center top;
  will-change: transform, height, max-height;
}

/* 서비스 선택 후 질문 영역 확장 스타일 (서비스 영역 유지) */
.question-upper.expanded {
  padding: 40px;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 서비스 선택 후 질문 영역 전체 화면 스타일 */
.question-upper.full-screen {
  height: 100% !important;
  max-height: 100% !important;
  padding: 40px;
  transform: scale(1);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

#questionInput {
  flex: 1;
  padding: 0;
  width: 100%;
  overflow-y: auto;
}

#questionInput h3 {
  color: #131416;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

#questionInput h3 span {
  color: #0283FD;
}

#questionInput p {
  color: #333;
  font-size: 16px;
  margin-bottom: 20px;
  line-height: 1.4;
}

/* 입력 필드 스타일 개선 */
#questionInput input[type="text"],
#questionInput textarea,
#questionInput select {
  width: 100%;
  padding: 16px 24px;
  border: 2px solid #E9ECEF;
  border-radius: 8px;
  font-size: 18px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
  background: #FFFFFF;
  color: #22272B;
}

#questionInput input[type="text"]:focus,
#questionInput textarea:focus,
#questionInput select:focus {
  outline: none;
  border-color: #0283FD;
}

#questionInput input[type="text"]:invalid,
#questionInput textarea:invalid {
  border-color: #FF5050;
}

#questionInput textarea {
  min-height: 150px;
  resize: vertical;
}

/* 라디오 버튼 스타일 개선 */
#questionInput .radio-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

#questionInput .radio-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #E9ECEF;
  border-radius: 8px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex: 0 0 auto;
  min-width: 200px;
}

#questionInput .radio-option:hover {
  border-color: #1B64DA;
  background: #F8F9FA;
}

#questionInput .radio-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

#questionInput .radio-option input[type="radio"]:checked + .radio-label {
  color: #1B64DA;
  font-weight: 600;
}

#questionInput .radio-option input[type="radio"]:checked {
  border-color: #1B64DA;
  background: #F0F7FF;
}

#questionInput .radio-option:has(input[type="radio"]:checked),
#questionInput .radio-option input[type="radio"]:checked ~ .radio-label {
  border-color: #1B64DA;
  background: #F0F7FF;
}

/* JavaScript로 체크된 상태 스타일 적용 */
#questionInput .radio-option.checked {
  border-color: #1B64DA;
  background: #F0F7FF;
}

#questionInput .radio-label {
  flex: 1;
  font-size: 14px;
  color: #333333;
  cursor: pointer;
  margin-left: 0;
}

/* 체크박스 스타일 개선 */
#questionInput .checkbox-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

#questionInput .checkbox-option {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #E9ECEF;
  border-radius: 8px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
  min-width: 200px;
}

#questionInput .checkbox-option:hover {
  border-color: #1B64DA;
  background: #F8F9FA;
}

#questionInput .checkbox-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

#questionInput .checkbox-option input[type="checkbox"]:checked + .checkbox-label {
  color: #1B64DA;
  font-weight: 600;
}

#questionInput .checkbox-option:has(input[type="checkbox"]:checked),
#questionInput .checkbox-option input[type="checkbox"]:checked ~ .checkbox-label {
  border-color: #1B64DA;
  background: #F0F7FF;
}

/* JavaScript로 체크된 상태 스타일 적용 */
#questionInput .checkbox-option.checked {
  border-color: #1B64DA;
  background: #F0F7FF;
}

#questionInput .checkbox-label {
  flex: 1;
  font-size: 14px;
  color: #333333;
  cursor: pointer;
  margin-left: 0;
}

/* 의뢰인정보 동기화 체크박스는 기존 스타일 유지 */
#questionInput label:has(input[type="checkbox"][id^="sync_client"]) {
  display: block;
  padding: 10px 0;
  font-size: 14px;
  cursor: pointer;
}

#questionInput label:has(input[type="checkbox"][id^="sync_client"]) input[type="checkbox"] {
  margin-right: 8px;
  width: auto;
}

/* 네비게이션 버튼 고정 */
#questionNavigation {
  position: sticky;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 0;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 0;
  width: 100%;
}

#prevQuestion, #nextQuestion, #submitQuestions {
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 120px;
}

#prevQuestion {
  background: #F8F9FA;
  color: #6C757D;
  border: 1px solid #E9ECEF;
}

#prevQuestion:hover {
  background: #E9ECEF;
}

#nextQuestion, #submitQuestions {
  background: #1B64DA;
  color: white;
}

#nextQuestion:hover, #submitQuestions:hover {
  background: #1557B8;
}

#nextQuestion:disabled, #submitQuestions:disabled {
  background: #CED4DA;
  color: #6C757D;
  cursor: not-allowed;
}

/* 스크롤바 스타일 */
.question-upper::-webkit-scrollbar,
#questionInput::-webkit-scrollbar {
  width: 6px;
}

.question-upper::-webkit-scrollbar-track,
#questionInput::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.question-upper::-webkit-scrollbar-thumb,
#questionInput::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.question-upper::-webkit-scrollbar-thumb:hover,
#questionInput::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 성공 팝업 스타일 */
#successPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.success-popup-content {
  background: white;
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  position: relative;
  animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.success-popup-icon {
  width: 60px;
  height: 60px;
  background: #28a745;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 30px;
}

.success-popup-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.success-popup-subtitle {
  font-size: 16px;
  color: #666;
  margin-bottom: 20px;
}

.success-popup-phone {
  font-size: 24px;
  font-weight: 700;
  color: #1B64DA;
  margin-bottom: 8px;
}

.success-popup-message {
  font-size: 14px;
  color: #888;
  line-height: 1.4;
}

.success-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-popup-close:hover {
  color: #333;
}

/* 서비스 선택 영역 애니메이션 */
.question-lower {
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform-origin: center bottom;
  will-change: transform, opacity;
}

.question-lower.hidden {
  opacity: 0;
  transform: translateY(-10px) scale(0.95);
  pointer-events: none;
}

/* 답변 요약 페이지 그리드 스타일 */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.summary-card {
  background: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.question-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 8px;
}

.answer-text {
  color: #666;
  font-size: 14px;
  max-height: 300px;
  overflow-y: auto;
  word-break: break-all;
  white-space: normal;
}

.additional-info {
  font-size: 12px;
  margin-top: 4px;
  word-break: break-all;
  white-space: normal;
}

/* 반응형 */
@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .question-upper {
    max-height: 70vh;
    padding: 16px;
  }
  
  .question-upper.full-screen {
    padding: 20px 16px;
  }

  #questionInput h3 {
    font-size: 16px;
  }

  #questionInput p {
    font-size: 14px;
  }

  #prevQuestion, #nextQuestion, #submitQuestions {
    padding: 10px 16px;
    font-size: 13px;
  }
  
  /* 모바일에서 라디오/체크박스 세로 배치 */
  #questionInput .radio-group,
  #questionInput .checkbox-group {
    flex-direction: column;
  }
  
  #questionInput .radio-option,
  #questionInput .checkbox-option {
    min-width: auto;
  }
  
  /* 모바일에서 답변 요약 그리드 1열로 변경 */
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  /* 모바일에서 답변 요약 카드 스타일 */
  #questionInput .summary-card {
    padding: 12px;
  }
  
  #questionInput .summary-card .question-title {
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  #questionInput .summary-card .answer-text {
    font-size: 13px;
  }
  
  #questionInput .summary-card .additional-info {
    font-size: 11px;
    margin-top: 3px;
  }
} 


@media (max-width: 1440px) {
  #questionInput h3 {
    font-size: 16px;
  }
  #questionInput .radio-option, #questionInput .checkbox-option {
    min-width: 140px;
  }
  #questionInput textarea {
    min-height: 100px;
  }

  .question-title {
    font-size: 14px !important;
  }
  .answer-text {
    font-size: 12px !important;
  }
  .agreement-text, .agreement-sub-text, .agreement-sub-list {
    font-size: 14px !important;
  }
  .agreement-item {
    margin-bottom: 0;
  }
}

@media (max-width: 1000px) {
  .wrap.full .main{
    margin-top: 0 !important;
  }
  .question-upper {
    flex: 1 !important;
  }
}

@media (max-width: 480px) {

}


.floating-question-box {
  z-index: 4 !important;
}