/* 팜시크릿 — 매물 등록 / 매수 등록 전용 (lsf-*)
 * listings.css 다음 순서로 로드. 두 페이지의 신규/오버라이드 스타일 전담.
 * 위저드(직방식), 시세 가이드, 등급별 공개 미리보기, 매칭 카운트, 완료 모달
 */

/* 폼 컨트롤 box-sizing 보정 — 전역 리셋에 box-sizing이 없어
   width:100% 입력이 그리드 컬럼을 넘치는 문제 방지 (폼 페이지 한정) */
.ls-form-shell input,
.ls-form-shell select,
.ls-form-shell textarea,
.ls-form-shell button {
  box-sizing: border-box;
}

/* ═════════════════════════════════════════════
   인라인 아이콘 (이모지 대체)
   ═════════════════════════════════════════════ */
.lsf-i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.ls-choice-title .lsf-i,
.ls-help-card-title .lsf-i,
.ls-match-preview-title .lsf-i {
  color: var(--color-brand);
}
.ls-toggle-chip .lsf-i {
  width: 13px;
  height: 13px;
  margin-right: 6px;
}

/* ═════════════════════════════════════════════
   멀티스텝 위저드 — 패널 전환
   ═════════════════════════════════════════════ */
.lsf-panel { display: none; }
.lsf-panel.is-current { display: block; }

/* 스텝 인디케이터 클릭 영역 (완료 스텝만 활성) */
.lsf-step-hit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.lsf-step-hit:disabled { cursor: default; }
.lsf-step-hit:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 4px;
  border-radius: 9999px;
}

/* 위저드 내비게이션 */
.lsf-wizard-nav {
  justify-content: space-between;
  align-items: center;
}
.lsf-wizard-nav[hidden],
.lsf-wizard-nav .ls-cta-btn[hidden],
.lsf-form-alert[hidden] { display: none; }
.lsf-nav-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .lsf-nav-right { width: 100%; }
  .lsf-nav-right .ls-cta-btn { flex: 1; min-width: 0; }
}

/* 필수값 안내 */
.lsf-form-alert {
  margin-top: 14px;
  padding: 12px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}
.lsf-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

/* ═════════════════════════════════════════════
   주소 입력 — 우편번호 검색 + 지역 노출 수준
   ═════════════════════════════════════════════ */
.lsf-addr-row {
  display: flex;
  gap: 8px;
}
.lsf-addr-row .ls-input { flex: 1; min-width: 0; }
.lsf-addr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  min-height: 44px;
  background: #1f2937;
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.lsf-addr-btn:hover { background: #111827; }
.lsf-addr-btn svg { width: 15px; height: 15px; }

/* 지역 노출 수준 세그먼트 */
.lsf-seg {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.lsf-seg label {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.lsf-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.lsf-seg small {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
}
.lsf-seg label:has(input:checked) {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.lsf-seg label:has(input:checked) small { color: var(--color-brand); }
.lsf-seg label:has(input:focus-visible) {
  outline: 2px solid var(--color-brand);
  outline-offset: 1px;
}
@media (max-width: 480px) {
  .lsf-seg { width: 100%; }
  .lsf-seg label { flex: 1; padding: 8px 6px; }
}

/* ═════════════════════════════════════════════
   적정 권리금 가이드 (실시간 시세 카드)
   ═════════════════════════════════════════════ */
.lsf-guide {
  background: linear-gradient(160deg, #fff7ed 0%, #fff 72%);
  border-color: #fed7aa;
}
.lsf-guide-empty {
  font-size: 12.5px;
  color: #9a3412;
  line-height: 1.6;
}
.lsf-guide-region {
  margin: 0 0 6px;
  font-size: 12px;
  color: #9a3412;
}
.lsf-guide-region b { color: #7c2d12; }
.lsf-guide-range {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--color-brand-dark);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.lsf-guide-verdict {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}
.lsf-guide-verdict[data-state="ok"]   { background: #ecfdf5; color: #047857; }
.lsf-guide-verdict[data-state="high"] { background: #fffbeb; color: #b45309; }
.lsf-guide-verdict[data-state="low"]  { background: #eff6ff; color: #1d4ed8; }
.lsf-guide-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.55;
}
/* 모바일에서는 3단계 패널 안의 인라인 가이드만 노출 (사이드 중복 방지) */
.lsf-guide--inline { margin-top: 18px; }
@media (min-width: 1024px) {
  .lsf-guide--inline { display: none; }
}
@media (max-width: 1023px) {
  .ls-form-side .lsf-guide { display: none; }
}

/* ═════════════════════════════════════════════
   등급별 공개 미리보기 — 미니 매물카드 3종
   ═════════════════════════════════════════════ */
.lsf-preview-intro {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.6;
}
.lsf-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 860px) {
  .lsf-preview-grid { grid-template-columns: 1fr; }
}
.lsf-preview-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
}
.lsf-preview-card[data-tier="verified"] {
  background: #fff;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--color-brand-soft);
}
.lsf-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.lsf-preview-tier {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 9999px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
}
.lsf-preview-card[data-tier="member"] .lsf-preview-tier { background: #dbeafe; color: #1d4ed8; }
.lsf-preview-card[data-tier="verified"] .lsf-preview-tier { background: var(--color-brand); color: #fff; }
.lsf-preview-scope {
  font-size: 10.5px;
  color: #9ca3af;
}
.lsf-pv-region {
  margin: 0;
  font-size: 11.5px;
  color: #6b7280;
}
.lsf-pv-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  line-height: 1.45;
  word-break: keep-all;
  min-height: 2.9em;
}
.lsf-pv-price {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-height: 38px;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--color-brand-dark);
  font-variant-numeric: tabular-nums;
}
.lsf-preview-card[data-tier="guest"] .lsf-pv-price {
  color: #9ca3af;
  font-size: 12.5px;
  font-weight: 600;
}
.lsf-preview-card[data-tier="verified"] .lsf-pv-price { background: #fffaf6; }
.lsf-pv-price svg { width: 14px; height: 14px; flex-shrink: 0; }
.lsf-pv-price-blur {
  filter: blur(5px);
  user-select: none;
}
.lsf-pv-price em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: #4b5563;
}
.lsf-pv-meta {
  margin: 0;
  font-size: 11.5px;
  color: #9ca3af;
}
.lsf-pv-meta b {
  color: #1f2937;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* 공개 정책 불릿 (인라인 스타일 대체) */
.lsf-policy-list { font-size: 13.5px; }

/* 스위치 묶음 정돈 (인라인 margin 대체) */
.lsf-switch-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* ═════════════════════════════════════════════
   5단계 — 입력 요약 확인
   ═════════════════════════════════════════════ */
.lsf-summary-group {
  border: 1px solid #eef0f3;
  border-radius: 10px;
  overflow: hidden;
}
.lsf-summary-group + .lsf-summary-group { margin-top: 12px; }
.lsf-summary-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.lsf-summary-edit {
  background: none;
  border: 0;
  padding: 2px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-brand);
  cursor: pointer;
}
.lsf-summary-edit:hover { text-decoration: underline; }
.lsf-summary-rows { margin: 0; }
.lsf-summary-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
  padding: 9px 14px;
  border-top: 1px solid #f3f4f6;
  font-size: 13px;
}
.lsf-summary-row dt { color: #6b7280; }
.lsf-summary-row dd {
  margin: 0;
  color: #111827;
  font-weight: 600;
  word-break: keep-all;
}
@media (max-width: 480px) {
  .lsf-summary-row { grid-template-columns: 96px 1fr; }
}
.lsf-submit-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.65;
}

/* 제출 완료 (인라인) */
.lsf-submit-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 36px 20px;
  text-align: center;
}
.lsf-submit-done[hidden] { display: none; }
.lsf-submit-done svg {
  width: 48px;
  height: 48px;
  color: #15803d;
}
.lsf-submit-done h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: #111827;
}
.lsf-submit-done p {
  margin: 0;
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.7;
  word-break: keep-all;
}
.lsf-submit-done .ls-cta-btn { min-width: 200px; margin-top: 6px; }

/* ═════════════════════════════════════════════
   매수 등록 — 매칭 카운트 + 예시 카드
   ═════════════════════════════════════════════ */
.ls-match-preview-num.is-bump {
  display: inline-block;
  animation: lsfBump 0.45s ease;
}
@keyframes lsfBump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); color: var(--color-brand); }
  100% { transform: scale(1); }
}

.lsf-match-cards {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #fed7aa;
}
.lsf-match-cards-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}
.lsf-match-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 560px) {
  .lsf-match-card-grid { grid-template-columns: 1fr; }
}
.lsf-match-card-grid .lsf-preview-card { background: #fff; }
.lsf-match-card-grid .lsf-pv-title { min-height: 0; }

/* ═════════════════════════════════════════════
   매수 등록 — 완료 모달
   ═════════════════════════════════════════════ */
.lsf-done {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lsf-done[hidden] { display: none; }
.lsf-done-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.lsf-done-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  padding: 36px 28px 28px;
  background: #fff;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}
.lsf-done-icon {
  width: 56px;
  height: 56px;
  color: #15803d;
}
.lsf-done-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}
.lsf-done-text {
  margin: 0;
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.7;
  word-break: keep-all;
}
.lsf-done-text b { color: var(--color-brand-dark); }
.lsf-done-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}
.lsf-done-actions b {
  font-family: var(--font-mono);
  margin: 0 2px;
}
