/* ===== 문의하기 모달 =====
   진입: backdrop blur + 스프링 스케일 업 + 콘텐츠 스태거(2025-26 트렌드)
   네이티브 <dialog> 사용 (top-layer, 포커스 트랩, ESC 기본 지원) */
#zing-inquiry {
  border: none;
  padding: 0;
  background: transparent;
  width: min(640px, calc(100vw - 32px));
  max-height: min(92vh, 940px);
  margin: auto;
  outline: none;
}
#zing-inquiry::backdrop {
  background: rgba(12, 10, 12, 0.5);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
#zing-inquiry[open] {
  animation: ziqPopIn 0.44s var(--ease-out-expo);
}
#zing-inquiry[open]::backdrop {
  animation: ziqFadeIn 0.32s ease;
}
#zing-inquiry.ziq-closing {
  animation: ziqPopOut 0.18s ease-in forwards;
}
#zing-inquiry.ziq-closing::backdrop {
  animation: ziqFadeOut 0.18s ease-in forwards;
}
@keyframes ziqPopIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.955);
  }
}
@keyframes ziqPopOut {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}
@keyframes ziqFadeIn {
  from {
    opacity: 0;
  }
}
@keyframes ziqFadeOut {
  to {
    opacity: 0;
  }
}
/* 콘텐츠 스태거: 필드가 45ms 간격으로 아래에서 떠오름 */
#zing-inquiry[open] .ziq-stagger > * {
  animation: ziqRise 0.5s var(--ease-out-expo) both;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(1) {
  animation-delay: 0.1s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(2) {
  animation-delay: 0.145s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(3) {
  animation-delay: 0.19s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(4) {
  animation-delay: 0.235s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(5) {
  animation-delay: 0.28s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(6) {
  animation-delay: 0.325s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(7) {
  animation-delay: 0.37s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(8) {
  animation-delay: 0.415s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(9) {
  animation-delay: 0.46s;
}
#zing-inquiry[open] .ziq-stagger > :nth-child(10) {
  animation-delay: 0.505s;
}
@keyframes ziqRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.ziq-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 940px);
  /* 메인 페이지와 동일한 커스텀 폰트 페이스 사용 (굵기는 페이스에 내장) */
  font-family: var(--font-kr-regular);
  font-weight: 400;
  color: var(--zing-ink);
}
.ziq-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.06);
  color: var(--zing-ink-soft);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
.ziq-close:hover {
  background: rgba(0, 0, 0, 0.14);
  transform: scale(1.06);
}
.ziq-scroll {
  overflow-y: auto;
  padding: 28px 32px 32px;
}
.ziq-title {
  font-family: var(--font-kr-bold);
  font-size: 28px;
  font-weight: 400;
  margin: 8px 0 4px;
}
.ziq-sub {
  font-size: 16px;
  color: var(--zing-gray);
  margin: 0 0 22px;
}
.ziq-field {
  margin-bottom: 17px;
}
.ziq-field label {
  display: block;
  font-family: var(--font-kr-semibold);
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 7px;
  color: var(--zing-ink-soft);
}
.ziq-field label .req {
  color: var(--zing-red);
}
.ziq-field input,
.ziq-field select,
.ziq-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 17px;
  font-family: inherit;
  font-weight: 400;
  border: 1px solid var(--zing-line);
  border-radius: var(--radius-field);
  padding: 13px 15px;
  background: #fff;
  color: var(--zing-ink);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.ziq-field input:focus,
.ziq-field select:focus,
.ziq-field textarea:focus {
  border-color: var(--zing-red);
  box-shadow: 0 0 0 3px var(--zing-red-focus-ring);
}
.ziq-field textarea {
  min-height: 150px;
  resize: vertical;
}
.ziq-count {
  font-size: 13px;
  color: var(--zing-gray-faint);
  text-align: right;
  margin-top: 5px;
}
.ziq-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
  color: var(--zing-ink-muted);
  margin: 4px 0 20px;
}
.ziq-agree input {
  width: 19px;
  height: 19px;
  margin-top: 1px;
  accent-color: var(--zing-red);
  flex: none;
}
.ziq-actions {
  display: flex;
  gap: 10px;
}
.ziq-btn {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 15px 0;
  font-family: var(--font-kr-semibold);
  font-size: 18px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    background 0.15s ease;
}
.ziq-btn:active {
  transform: scale(0.97);
}
.ziq-btn-cancel {
  background: var(--zing-surface-dim);
  color: var(--zing-ink-soft);
}
.ziq-btn-cancel:hover {
  background: var(--zing-line);
}
.ziq-btn-submit {
  background: var(--zing-red);
  color: #fff;
}
.ziq-btn-submit:hover {
  filter: brightness(1.08);
}
/* 접수 완료 뷰: 체크 스트로크 드로잉 */
.ziq-success {
  text-align: center;
  padding: 44px 32px 40px;
}
.ziq-success svg {
  width: 88px;
  height: 88px;
  display: block;
  margin: 0 auto 18px;
}
.ziq-success .ck-circle {
  fill: none;
  stroke: var(--zing-red);
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: ziqStroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.1s forwards;
}
.ziq-success .ck-check {
  fill: none;
  stroke: var(--zing-red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: ziqStroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.55s forwards;
}
@keyframes ziqStroke {
  to {
    stroke-dashoffset: 0;
  }
}
.ziq-success h3 {
  font-family: var(--font-kr-bold);
  font-size: 24px;
  font-weight: 400;
  margin: 0 0 8px;
}
.ziq-success p {
  font-size: 16px;
  color: var(--zing-gray);
  margin: 0 0 26px;
}
.ziq-success .ziq-btn {
  width: 220px;
  padding: 15px 32px;
}
@media (prefers-reduced-motion: reduce) {
  #zing-inquiry[open],
  #zing-inquiry[open]::backdrop,
  #zing-inquiry.ziq-closing,
  #zing-inquiry.ziq-closing::backdrop,
  #zing-inquiry[open] .ziq-stagger > *,
  .ziq-success .ck-circle,
  .ziq-success .ck-check {
    animation: none;
  }
  .ziq-success .ck-circle,
  .ziq-success .ck-check {
    stroke-dashoffset: 0;
  }
}

/* 서버 검증 에러 메시지 (Django Form errors) */
.ziq-err {
  color: var(--zing-red);
  font-size: 14px;
  margin-top: 5px;
}

/* CAPTCHA 행: 이미지 + 입력 + 새로고침 버튼 */
.ziq-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ziq-captcha-row img {
  height: 44px;
  border: 1px solid var(--zing-line);
  border-radius: 10px;
  flex: none;
}
.ziq-captcha-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.ziq-captcha-row input[type="hidden"] {
  display: none;
}
.ziq-captcha-refresh {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--zing-line);
  border-radius: 10px;
  background: #fff;
  color: var(--zing-gray);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease;
}
.ziq-captcha-refresh:hover {
  color: var(--zing-red);
  border-color: var(--zing-red);
}

/* 2열 필드 행 (성함/연락처, 상호명/업종, URL/예산) */
.ziq-row {
  display: flex;
  gap: 14px;
}
.ziq-row .ziq-field {
  flex: 1;
  min-width: 0;
}
.ziq-row .ziq-budget {
  flex: 0 0 170px;
}

/* 필수/선택 안내 */
.ziq-legend {
  font-size: 14px;
  color: var(--zing-gray-faint);
  margin: -12px 0 18px;
}
.ziq-field label .opt {
  color: var(--zing-gray-faint);
  font-family: var(--font-kr-regular);
  font-size: 14px;
  white-space: nowrap;
}

/* 모바일: 2열 행 세로 적층 + 스크롤 여백 축소 */
@media (max-width: 767px) {
  .ziq-row {
    flex-direction: column;
    gap: 0;
  }
  .ziq-scroll {
    padding: 24px 20px;
  }
}
