/* 물건의뢰 폼 / QR 생성기 전용 스타일.
   styles.css 의 :root 토큰(딥 네이비 + 본 + 골드)을 그대로 사용합니다. */

/* ---------- 서브 페이지 공통 ---------- */
.sub-main { padding-top: 72px; } /* 고정 네비 높이만큼 확보 */

.subhead {
  position: relative;
  padding: clamp(3.5rem, 9vh, 6rem) 0 clamp(2.5rem, 6vh, 4rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.subhead__bg {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: saturate(0.7) brightness(0.4);
}
.subhead::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,18,32,0.6), rgba(11,18,32,0.95));
}
.subhead .wrap { position: relative; z-index: 1; }
.subhead h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1.05;
}
.subhead p { color: var(--sage); font-size: 1.05rem; margin-top: 1rem; max-width: 52ch; }

/* ---------- 의뢰 페이지 레이아웃 ---------- */
.request { padding: clamp(3rem, 7vh, 5rem) 0 clamp(5rem, 10vh, 8rem); }
.request__grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

/* 좌측 안내 레일 */
.aside h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.2rem; }
.aside__steps { list-style: none; display: grid; gap: 18px; margin-bottom: 2.4rem; }
.aside__steps li { display: flex; gap: 14px; }
.aside__num {
  flex: 0 0 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.85rem; font-weight: 700;
  font-family: var(--font-serif);
}
.aside__steps strong { display: block; font-size: 0.98rem; font-weight: 600; }
.aside__steps span { color: var(--sage); font-size: 0.88rem; }
.aside__note {
  border-left: 2px solid var(--accent);
  padding: 4px 0 4px 16px;
  color: var(--sage); font-size: 0.9rem; line-height: 1.7;
}

/* ---------- 폼 ---------- */
.form {
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(1.6rem, 3vw, 2.6rem);
}
.field { display: grid; gap: 8px; margin-bottom: 22px; }
.field > label { font-size: 0.92rem; font-weight: 600; color: var(--bone); }
.field .req { color: var(--accent); margin-left: 3px; }
.field .help { font-size: 0.82rem; color: var(--sage-dim); }
.field .err { font-size: 0.82rem; color: #e58a7b; min-height: 0; display: none; }
.field.is-invalid .err { display: block; }
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea { border-color: #c0604f; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--bone);
  background: var(--ink-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-tag);
  padding: 0.8rem 0.95rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--sage-dim); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a5aebc' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.4rem;
}

/* 행 배치 (상단 정렬 → 두 필드의 입력칸 높이가 어긋나지 않음) */
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* 숨김 필드: .field { display:grid } 가 [hidden] 을 덮어써서 강제 지정 */
.field[hidden] { display: none; }

/* 라디오/체크 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  position: relative; cursor: pointer;
  padding: 0.6rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--sage);
  font-size: 0.9rem; transition: all .18s ease; user-select: none;
}
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip:has(input:checked) {
  background: var(--accent); border-color: var(--accent);
  color: #1c1408; font-weight: 600;
}

/* 중개 진행 방식 (직접 중개 선택) */
.handling {
  border: 1px solid rgba(201,165,94,0.3);
  background: var(--accent-soft);
  border-radius: var(--r-tag);
  padding: 16px 18px; margin-bottom: 22px;
}
.handling__head {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.92rem; font-weight: 600; color: var(--bone); margin-bottom: 12px;
}
.handling__head i { color: var(--accent); font-size: 1.2rem; }
.handling__opt {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  padding: 12px 14px; margin-top: 10px;
  background: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--r-tag);
  transition: border-color .2s ease, background .2s ease;
}
.handling__opt input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.handling__opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.handling__text { font-size: 0.88rem; color: var(--sage); line-height: 1.6; }
.handling__text strong { display: block; color: var(--bone); font-size: 0.96rem; margin-bottom: 2px; }
.handling__text b { color: var(--accent); font-weight: 600; }

/* 동의 */
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r-tag); padding: 16px; margin-bottom: 22px;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.consent label { font-size: 0.9rem; color: var(--sage); line-height: 1.6; }
.consent a { color: var(--accent); text-decoration: underline; }

/* 제출 버튼 (styles.css 의 .btn 재사용) */
.form .btn--solid { width: 100%; padding: 1rem; font-size: 1rem; }
.form .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn__spin {
  width: 16px; height: 16px; margin-right: 8px;
  border: 2px solid rgba(28,20,8,0.35); border-top-color: #1c1408;
  border-radius: 50%; display: none; animation: spin 0.7s linear infinite;
}
.is-sending .btn__spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 상태: 성공 / 오류 */
.form__alert {
  display: none; gap: 10px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-tag); margin-bottom: 18px;
  font-size: 0.92rem; line-height: 1.6;
}
.form__alert.is-show { display: flex; }
.form__alert--error { background: rgba(192,96,79,0.12); border: 1px solid rgba(192,96,79,0.4); color: #e9a99c; }
.form__alert i { font-size: 1.2rem; flex: 0 0 auto; }

.form__success { display: none; text-align: center; padding: 1rem; }
.form__success.is-show { display: block; }
.form__success .ph { font-size: 3rem; color: var(--accent); }
.form__success h2 { font-size: 1.6rem; font-weight: 600; margin: 1rem 0 0.6rem; }
.form__success p { color: var(--sage); max-width: 40ch; margin: 0 auto 1.6rem; }
.form__success .ref { font-family: var(--font-serif); color: var(--accent); font-size: 1.1rem; }

/* 데모 모드 안내 */
.demo-banner {
  display: none; gap: 10px; align-items: center;
  background: var(--accent-soft); border: 1px solid rgba(201,165,94,0.3);
  border-radius: var(--r-tag); padding: 12px 16px; margin-bottom: 20px;
  font-size: 0.88rem; color: var(--bone);
}
.demo-banner.is-show { display: flex; }
.demo-banner i { color: var(--accent); font-size: 1.1rem; }

/* ---------- 법적 고지(개인정보처리방침 등) ---------- */
.legal { padding: clamp(2.5rem, 6vh, 4rem) 0 clamp(5rem, 10vh, 8rem); }
.legal__wrap { max-width: 780px; }
.legal__note {
  background: var(--accent-soft); border: 1px solid rgba(201,165,94,0.3);
  border-radius: var(--r-tag); padding: 14px 16px; margin-bottom: 2.4rem;
  font-size: 0.88rem; color: var(--bone); line-height: 1.6;
}
.legal h2 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; margin: 2.2rem 0 0.8rem; }
.legal p { color: var(--sage); line-height: 1.75; margin-bottom: 0.9rem; }
.legal ul { color: var(--sage); line-height: 1.75; margin: 0 0 0.9rem 1.1rem; }
.legal li { margin-bottom: 0.4rem; }
.legal strong { color: var(--bone); font-weight: 600; }
.legal__date { color: var(--sage-dim); font-size: 0.88rem; margin-top: 2rem; }

/* ---------- 상담 예약 모달 ---------- */
.booking {
  border: none; padding: 0; background: transparent;
  max-width: 460px; width: calc(100% - 32px);
  margin: auto; inset: 0;   /* 뷰포트 정중앙 정렬 */
  color: var(--bone);
}
.booking::backdrop { background: rgba(6, 10, 18, 0.72); backdrop-filter: blur(4px); }
.booking__panel {
  position: relative;
  background: var(--ink-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-card);
  padding: clamp(1.6rem, 3.5vw, 2.4rem);
  max-height: 90vh; overflow-y: auto;
}
.booking__close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(243, 239, 230, 0.05);
  border: 1px solid var(--line);
  color: var(--sage); font-size: 1.15rem;
  transition: color .2s ease, border-color .2s ease;
}
.booking__close:hover { color: var(--bone); border-color: var(--line-2); }
.booking__title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
  margin: 0.5rem 0 1.4rem;
}
.booking__form .eyebrow { font-size: 0.7rem; }
.booking__lead { color: var(--sage); font-size: 0.9rem; line-height: 1.6; margin: -0.6rem 0 1.4rem; }
.booking__call {
  margin-top: 1rem; text-align: center;
  font-size: 0.88rem; color: var(--sage);
}
.booking__call a { color: var(--accent); font-weight: 600; }
.booking .btn--solid { width: 100%; padding: 0.95rem; font-size: 1rem; margin-top: 0.2rem; }
.booking__success { padding: 1.5rem 0.5rem; }

/* 다이얼로그 미지원 브라우저 폴백 */
dialog:not([open]) { display: none; }

/* ---------- QR 생성기 페이지 ---------- */
.qrtool { padding: clamp(3rem, 7vh, 5rem) 0 clamp(5rem, 10vh, 8rem); }
.qrtool__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.qrcard {
  background: var(--ink-3); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: clamp(1.6rem, 3vw, 2.4rem);
}
.qrcard h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: 1.2rem; }
.qr-preset { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.qr-preset button {
  font: inherit; font-size: 0.82rem; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--ink-2); border: 1px solid var(--line-2); color: var(--sage);
  transition: all .18s ease;
}
.qr-preset button:hover { border-color: var(--accent); color: var(--accent); }

.qrstage {
  display: grid; place-items: center; gap: 18px;
  background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 2rem; min-height: 320px;
}
.qrstage__frame {
  background: #fff; padding: 18px; border-radius: 14px;
  display: grid; place-items: center;
}
.qrstage__frame img, .qrstage__frame canvas { display: block; }
.qrstage__empty { color: var(--sage-dim); font-size: 0.9rem; text-align: center; }
.qrstage__url { color: var(--sage); font-size: 0.84rem; word-break: break-all; text-align: center; max-width: 90%; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .request__grid { grid-template-columns: 1fr; }
  .aside { order: 2; }
  .qrtool__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .row-2 { grid-template-columns: 1fr; }
}
