/* ===================================
   survey.css - 수요조사 참여(U01) / 감사 화면(U02)
   - 디자인가이드.md 및 style.css 토큰 기반
   - style.css 의 overline / sub-layout 컴포넌트를 사용하고,
     이 파일은 설문 프레임(survey-*)과 문항 유형 6종
     (단일/복수/드랍다운/별점/단답/서술형)만 담당
   - 기준: 스낵 퍼블리싱 요청_260914 publish/04~06
   - 설문 플랫폼 위 커스텀 산출물 — 적용 방식은 개발사 안내를 따름
   =================================== */

/* -----------------------------------
   프레임
   ----------------------------------- */
.survey {
  width: 100%;
  max-width: 936px;
  margin: 0 auto;
  padding: 0 48px;
  box-sizing: border-box;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* 타이틀 블록 (plan-hero 와 동일 위계 — SURVEY 오버라인 + 44/700 + 22/300) */
.survey-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 0 60px;
  text-align: center;
}

.survey-hero__overline {
  margin-bottom: 4px;
}

.survey-hero__title {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.04em;
  color: var(--neutral-900);
}

.survey-hero__desc {
  margin: 0;
  font-size: 22px;
  font-weight: 300;
  line-height: 1.4;
  letter-spacing: -0.04em;
  color: var(--neutral-500);
}

/* -----------------------------------
   문항 블록
   ----------------------------------- */
.survey-q {
  display: flow-root;
  margin: 0 0 36px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.survey-q__legend {
  display: block;
  /* 레거시 head CSS(common.css)의 legend 숨김 리셋 중화 */
  position: static;
  width: 100%;
  height: auto;
  overflow: visible;
  text-indent: 0;
  white-space: normal;
  margin: 0 0 16px;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -0.025em;
  color: var(--neutral-900);
}

.survey-q__legend small {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--neutral-400);
  white-space: nowrap;
}

.survey-q__req {
  color: var(--color-error);
  font-weight: 700;
}

/* -----------------------------------
   선택형 (단일 / 복수) — 카드형 옵션
   - 260917: AI 컨시어지 select-card(concierge.css) 와 동일 UI
     · 인디케이터 28px 원형 → 선택 시 다크 채움 + 흰 체크
     · 카드 hover 부상 · 선택 시 brand-50 배경
   ----------------------------------- */
.survey-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.survey-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 17px 20px;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius-lg);
  background: #ffffff;
  color: var(--neutral-700);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.04em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms ease, box-shadow 200ms ease;
}

.survey-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04);
  border-color: var(--brand-600);
}

.survey-option input[type="radio"],
.survey-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  border: 2px solid var(--neutral-200);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}

.survey-option input:checked {
  border-color: var(--neutral-900);
  background: var(--neutral-900) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'><path d='M2.5 7.5l3 3 6-6' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 14px 14px no-repeat;
}

.survey-option:has(input:checked) {
  border-color: var(--brand-700);
  background: var(--brand-50);
}

.survey-option:has(input:focus-visible) {
  border-color: var(--brand-700);
  box-shadow: 0 0 0 3px rgba(7, 250, 216, 0.35);
}

/* -----------------------------------
   드랍다운 / 단답 / 서술형
   ----------------------------------- */
.survey-q select,
.survey-q input[type="text"] {
  width: 100%;
  height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: #ffffff;
  color: var(--neutral-700);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -0.04em;
  box-sizing: border-box;
}

.survey-q textarea {
  width: 100%;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid var(--neutral-200);
  border-radius: 8px;
  background: #ffffff;
  color: var(--neutral-700);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1.6;
  box-sizing: border-box;
  resize: vertical;
}

.survey-q select:focus-visible,
.survey-q input[type="text"]:focus-visible,
.survey-q textarea:focus-visible {
  outline: 2px solid var(--brand-700);
  outline-offset: 2px;
}

/* -----------------------------------
   별점 (5점)
   ----------------------------------- */
.survey-stars {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.survey-star {
  padding: 2px 4px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 38px;
  line-height: 1;
  color: #dedede;
  cursor: pointer;
  transition: color 120ms ease;
}

.survey-star.is-on {
  color: var(--brand-700);
}

.survey-stars__value {
  margin-left: 12px;
  min-width: 44px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-700);
}

/* -----------------------------------
   이전 / 'N / M' / 다음 내비게이션
   ----------------------------------- */
.survey-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--neutral-100);
}

.survey-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 36px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.survey-nav__btn--prev {
  background: #ffffff;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-700);
}

.survey-nav__btn--prev:hover {
  background: var(--neutral-50);
}

.survey-nav__btn--prev.is-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.survey-nav__btn--next {
  background: var(--neutral-900);
  border: 1px solid var(--neutral-900);
  color: #ffffff;
}

.survey-nav__btn--next:hover {
  background: #000000;
}

.survey-nav__page {
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-300);
}

/* -----------------------------------
   감사 화면 (U02) — 체크마크 + 감사 문구
   - 디자인가이드 5-4 Success 컴포넌트 기준
   ----------------------------------- */
.survey-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 40px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  background: #ffffff;
  text-align: center;
}

.survey-done__icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
  border: 2px solid var(--brand-500);
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-700);
}

.survey-done__icon::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid var(--brand-500);
  border-radius: 50%;
  animation: surveyDoneRipple 2.4s ease-out infinite;
}

@keyframes surveyDoneRipple {
  0%   { transform: scale(1); opacity: 0.6; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.survey-done__icon svg {
  display: block;
  width: 40px;
  height: 40px;
}

.survey-done__title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--neutral-900);
}

.survey-done__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: -0.04em;
  color: var(--neutral-500);
}

.survey-done__actions {
  margin-top: 32px;
}

/* -----------------------------------
   반응형
   ----------------------------------- */
@media (max-width: 768px) {
  .survey {
    padding: 0 20px;
  }
}

@media (max-width: 600px) {
  .survey-hero {
    margin-bottom: 32px;
  }

  .survey-hero__title {
    font-size: 28px;
  }

  .survey-hero__desc {
    font-size: 15px;
  }

  .survey-q {
    margin-bottom: 28px;
  }

  .survey-q__legend {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .survey-q__legend small {
    display: block;
    margin: 4px 0 0;
  }

  .survey-choices {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .survey-option {
    min-height: 58px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .survey-done {
    padding: 48px 20px;
  }

  .survey-done__title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .survey-option {
    transition: none;
  }

  .survey-done__icon::after {
    animation: none;
  }
}
