/* =========================================================
   HC Contact — Final Clean Styles (390 / 1024 / 1920)
   ========================================================= */

/* ---------- Tokens ---------- */
:root{
  --fs-xxl: clamp(24px, 2.0vw + 8px, 36px);
  --fs-xl:  clamp(18px, 1.2vw + 6px, 24px);
  --fs-lg:  clamp(16px, 0.9vw + 6px, 20px);
  --fs-md:  clamp(14px, 0.7vw + 5px, 18px);
  --fs-sm:  clamp(12px, 0.4vw + 4px, 14px);

  --gap-lg: clamp(20px, 4.5vw, 90px);
  --gap-md: clamp(16px, 2.0vw, 34px);
  --gap-sm: clamp(10px, 1.4vw, 20px);

  --r-lg: clamp(8px, .8vw, 13px);
  --r-sm: clamp(6px, .6vw, 8px);

  --pad-lg: clamp(20px, 2.5vw, 30px);
  --pad-md: clamp(14px, 1.6vw, 20px);
  --pad-textarea-y: clamp(20px, 3.2vw, 60px);
  --pad-textarea-x: clamp(14px, 2.2vw, 40px);

  --hc-gray-700:#7B7B7B;
  --hc-text:#000;
  --hc-req:#FF3B30;

  /* 액션 버튼(찾아보기/문의하기) 동일 폭 + 첨부 라인 높이 */
  --hc-action-w: clamp(180px, 20vw, 260px);
  --hc-attach-h: clamp(56px, 6vw, 72px);
}

/* ---------- Layout / Section ---------- */
.hc-contact{
  max-width:1296px;
  margin:0 auto;
  padding:0;
  display:grid;
  row-gap:var(--gap-lg);
  color:var(--hc-text);
  font-family:Pretendard,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}
.hc-contact, .hc-contact *{ box-sizing:border-box; }

.hc-contact__section{ display:grid; row-gap:var(--gap-md); }
.hc-contact__section-title{ font-weight:600; font-size:var(--fs-xxl); line-height:1.2; }

.hc-contact__grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(10px,1.5vw,24px);
}
@media (max-width:1024px){
  .hc-contact__grid-2{ grid-template-columns:1fr; gap:var(--gap-sm); }
}

/* ---------- Labels / Hints ---------- */
.hc-contact__label{
  font-size:var(--fs-xl); font-weight:600; color:#3B3B3B;
  display:inline-flex; align-items:center; gap:.35em;
  margin-bottom:20px; /* PC/Tablet */
}
@media (max-width:767.98px){
  .hc-contact__label{ margin-bottom:10px; } /* Mobile */
}

.hc-contact__hint{ font-size:var(--fs-sm); color:var(--hc-gray-700); margin:0; }
.hc-req{ color:var(--hc-req); margin-left:.25em; }

/* ---------- Field / Inputs ---------- */
.hc-contact__field{
  position:relative; display:flex; align-items:center; gap:10px;
  padding:var(--pad-lg) var(--pad-md);
  min-height:clamp(60px,6vw,84px);
  background:#EDEDED; border-radius:var(--r-lg);
  transition: box-shadow .18s ease;
}
.hc-contact__field:focus-within{ box-shadow: inset 0 0 0 2px #111; }

.hc-inlabel{
  flex:0 0 auto; white-space:nowrap;
  font-size:clamp(14px,.9vw + 7px,20px); line-height:24px; color:var(--hc-gray-700);
}

.hc-contact__input,
.hc-contact__select{
  flex:1; min-width:0; border:0; outline:0; background:transparent;
  font-size:var(--fs-md); color:#7B7B7B;
}
.hc-contact__input::placeholder{ color:transparent; }

/* ---------- Select chevron ---------- */
.hc-contact .hc-contact__chev{ display:none !important; }
.hc-contact .hc-contact__field::after{ content:none !important; }

.hc-contact select.hc-contact__select{
  appearance:none !important;
  -webkit-appearance:none !important;
  -moz-appearance:none !important;
  width:100% !important;
  max-width:100% !important;
  box-sizing:border-box !important;
  background-color:transparent !important;
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'><path d='M2 2l8 8 8-8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat !important;
  background-position:right 18px center !important;
  background-size:14px 8px !important;
  padding-right:52px !important;
  line-height:1.2;
}
.hc-contact select.hc-contact__select::-ms-expand{ display:none; }

/* ---------- Chips ---------- */
.hc-contact__chips{
  display:grid;
  gap:clamp(10px,1.5vw,24px);
  grid-template-columns:repeat(auto-fit, minmax(clamp(180px,16vw,306px),1fr));
}
.hc-chip{
  display:flex; justify-content:center; align-items:center; text-align:center;
  padding:var(--pad-lg) var(--pad-md);
  min-height:clamp(60px,6vw,84px);
  background:#EDEDED; border-radius:var(--r-lg);
  font-size:var(--fs-md); cursor:pointer; user-select:none;
  transition:transform .06s ease, background .2s ease, color .2s ease;
}
.hc-chip:hover{ transform:translateY(-1px); }
.hc-chip.is-active{ background:#111; color:#fff; }

@media (min-width:1025px){ .hc-contact__chips{ grid-template-columns:repeat(4,1fr); } }
@media (max-width:1024px){ .hc-contact__chips{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:600px){  .hc-contact__chips{ grid-template-columns:1fr; } }

/* ---------- Textarea ---------- */
.hc-contact__textarea{
  width:100%; min-height:clamp(220px,28vw,420px);
  padding:var(--pad-textarea-y) var(--pad-textarea-x);
  background:#EDEDED; border-radius:var(--r-lg); border:0; resize:vertical;
  font-size:var(--fs-md);
}
.hc-contact__textarea::placeholder{ color:var(--hc-gray-700); }
@media (max-width:767.98px){
  .hc-contact__textarea::placeholder{ font-size:10px; } /* 모바일 placeholder 10px */
}

/* ---------- Attach (hint + button 한 줄) ---------- */
.hc-attach{
  display:grid; grid-template-columns:1fr var(--hc-action-w);
  align-items:center; column-gap:0;
  background:none; padding:0;
}
/* PC/Tablet: 힌트 문구는 개인정보 본문보다 +2px */
.hc-attach .hc-contact__hint{
  display:flex; align-items:center;
  min-height:var(--hc-attach-h);
  padding:10px 20px;
  background:#EDEDED; border-radius:var(--r-lg);
  font-size: calc(var(--fs-sm) + 2px);
}

/* 첨부 안내 하단 설명문 */
.hc-attach ~ .hc-contact__hint:first-of-type{ margin-top:12px; }
.hc-attach ~ .hc-contact__hint{ margin-left:12px; }

/* “찾아보기” 버튼 */
.hc-contact .hc-attach__btn{
  justify-self:end;
  display:flex !important; align-items:center; justify-content:center;
  width:var(--hc-action-w) !important;
  height:var(--hc-attach-h) !important;
  background:#000 !important; color:#fff !important;
  border:0 !important; box-shadow:none !important;
  border-radius:clamp(10px,1vw,14px) !important;
  padding:0 !important; cursor:pointer;
}
.hc-contact .hc-attach__btn:hover{ filter:brightness(1.05); }
.hc-contact .hc-attach__btn:active{ transform:translateY(1px); }

/* ---------- Submit(Action) ---------- */
.hc-actions{ display:flex; justify-content:flex-end; gap:12px; }
.hc-contact .hc-submit{
  display:flex !important; align-items:center; justify-content:center;
  width:var(--hc-action-w) !important;
  height:var(--hc-attach-h) !important;
  margin-left:auto !important;
  background:#000 !important; color:#fff !important;
  border:0 !important; box-shadow:none !important;
  border-radius:clamp(10px,1vw,14px) !important;
}

/* 버튼 글자 크기 반응형 */
@media (min-width:768px){
  .hc-contact .hc-attach__btn,
  .hc-contact .hc-submit{ font-size:20px !important; }
}
@media (max-width:767.98px){
  .hc-contact .hc-attach__btn,
  .hc-contact .hc-submit{ font-size:12px !important; }
}

/* ---------- Privacy (동의 박스 + 체크박스) ---------- */
.hc-contact .hc-privacy{ display:grid; row-gap:clamp(12px,1.6vw,16px); }
.hc-contact .hc-privacy__box{
  background:#F4F4F4 !important;
  border-radius:var(--r-lg) !important;
  padding:clamp(14px,2.2vw,20px) clamp(16px,2.4vw,24px) !important;
}
.hc-contact .hc-privacy__title{ font-weight:600; font-size:var(--fs-lg); margin-bottom:.4em; color:#111; }
.hc-contact .hc-privacy__content{ font-size:var(--fs-sm); color:#555; line-height:1.6; }

.hc-contact .hc-privacy__agree{
  width:100%; display:flex; align-items:center; justify-content:flex-end; gap:.6em;
  font-size:var(--fs-md); color:#222;
}

/* 체크박스 아이콘 충돌 방지 */
.hc-contact .hc-privacy__agree input[type="checkbox"]::before,
.hc-contact .hc-privacy__agree input[type="checkbox"]::after{ content:none !important; }

/* 체크박스(잘림 없는 SVG 체크) */
.hc-contact .hc-privacy__agree input[type="checkbox"]{
  all:unset !important;
  appearance:none !important; -webkit-appearance:none !important;
  width:22px !important; height:22px !important;
  border:2px solid #111 !important; border-radius:5px !important;
  background:#fff !important;
  position:relative !important; display:inline-block !important;
  vertical-align:middle !important; margin:0 8px 0 0 !important;
  cursor:pointer !important; box-shadow:none !important;
  overflow:visible !important; box-sizing:border-box !important;
  background-repeat:no-repeat !important; background-position:center !important; background-size:68% 68% !important;
}
.hc-contact .hc-privacy__agree input[type="checkbox"]:checked{
  background-color:#111 !important; border-color:#111 !important;
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>\
    <path d='M5 13l4 4L19 7' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/>\
  </svg>") !important;
}

/* ---------- Error(유효성) 강조 ---------- */
.hc-contact__field.is-error{ box-shadow: inset 0 0 0 2px var(--hc-req) !important; }
.hc-label-error .hc-contact__label{ color: var(--hc-req); }

/* ---------- Mobile tuning (≤768px) ---------- */
@media (max-width:767.98px){

  /* 모바일 버튼 폭 더 줄이기 & 라인 높이 확정 */
  :root{
    --hc-action-w: clamp(92px, 38vw, 92px);
    --hc-attach-h: 46px;                      /* 버튼/힌트 동일 높이 */
  }

  /* 첨부 파일 행: 완전 밀착 + 오버랩로 seam 제거 */
  .hc-attach{
    display:grid !important;
    grid-template-columns: minmax(0,1fr) minmax(auto, var(--hc-action-w)) !important;
    gap:0 !important;
    align-items:stretch !important;
    padding:0 !important;
  }
  .hc-attach > *{
    margin:0 !important;
    min-width:0 !important;
    box-sizing:border-box !important;
  }

  /* 힌트 박스: 네 모서리 모두 둥글게 + 버튼 쪽으로 6px 겹치기 */
  .hc-attach .hc-contact__hint{
    height:var(--hc-attach-h) !important;
    min-height:var(--hc-attach-h) !important;
    border-radius:13px !important;           /* 맞물리는 쪽도 둥글게 */
    padding:0 16px !important;
    font-size:10px !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;

    margin-right:-6px !important;            /* 살짝 겹쳐서 틈 제거 */
    z-index:0 !important;
  }

  /* 찾아보기 버튼: 네 모서리 모두 둥글게 + 위 힌트 위로 살짝 덮기 */
  .hc-attach .hc-attach__btn{
    width:100% !important;
    height:var(--hc-attach-h) !important;
    border-radius:13px !important;           /* 맞물리는 쪽도 둥글게 */
    justify-self:stretch !important;
    align-self:stretch !important;
    z-index:1 !important;                     /* 겹침 처리 */
  }

  /* 아래 설명문 들여쓰기 제거(모바일은 좌측정렬) */
  .hc-attach ~ .hc-contact__hint{ margin-left:0 !important; }

  /* 문의하기 버튼: 같은 폭/높이감 */
  .hc-actions .hc-submit{
    width: var(--hc-action-w) !important;
    height: var(--hc-attach-h) !important;
    margin-left:auto !important;
    border-radius:13px !important;
  }

  /* 셀렉트/필드 안정화 */
  .hc-contact__field{
    min-width:0 !important;
    padding:clamp(14px,4.8vw,18px) clamp(12px,4vw,16px);
    border-radius:clamp(8px,2.5vw,10px);
  }
  select.hc-contact__select{
    width:100% !important;
    max-width:100% !important;
  }
  select.hc-contact__select:invalid{
    font-size:10px !important; color:var(--hc-gray-700);
  }

  /* 레이블 하단 간격(모바일 10px) */
  .hc-contact__label{ margin-bottom:10px !important; }
}

/* 데스크톱/태블릿 레이블 간격 유지 보강 */
@media (min-width:768px){
  .hc-contact__label{ margin-bottom:20px !important; }
}

/* 개인정보 동의 본문: 길면 내부만 스크롤 */
.hc-contact .hc-privacy__box{
  position: relative;
}

.hc-contact .hc-privacy__content{
  /* 박스 안에서만 스크롤 */
  max-height: clamp(180px, 28vh, 320px);
  overflow-y: auto;
  padding-right: 12px;           /* 스크롤바와 글자 간격 확보 */
  -webkit-overflow-scrolling: touch; /* iOS 부드러운 스크롤 */
}

/* 모바일: 화면이 좁으면 조금 더 낮게 */
@media (max-width: 767.98px){
  .hc-contact .hc-privacy__content{
    max-height: clamp(160px, 36vh, 240px);
  }
}

/* 스크롤바 미세 스타일(선택) */
.hc-contact .hc-privacy__content::-webkit-scrollbar{
  width: 6px;
}
.hc-contact .hc-privacy__content::-webkit-scrollbar-thumb{
  background: #D7D7D7;
  border-radius: 6px;
}
.hc-contact .hc-privacy__content:hover::-webkit-scrollbar-thumb{
  background: #BFBFBF;
}
/* Firefox */
.hc-contact .hc-privacy__content{
  scrollbar-width: thin;
  scrollbar-color: #D7D7D7 transparent;
}

/* 포커스 갔을 때 테두리(접근성) */
.hc-contact .hc-privacy__content:focus{
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* 에러 상태: 어떤 테마 규칙이 있어도 보이게 */
.hc-contact .hc-contact__field.is-error,
.hc-contact .hc-contact__field.hc-field--error{
  /* box-shadow만 쓰면 테마가 덮는 경우가 있어 outline을 함께 사용 */
  box-shadow: inset 0 0 0 2px var(--hc-req) !important;
  outline: 2px solid var(--hc-req) !important;
  outline-offset: -2px !important;
  transition: box-shadow .18s ease, outline-color .18s ease;
}

/* 살짝 펄스(선택) — 필요 없으면 주석 처리 */
@keyframes hcPulse {
  0%   { box-shadow: inset 0 0 0 2px rgba(255,59,48,1); }
  100% { box-shadow: inset 0 0 0 2px rgba(255,59,48,.6); }
}
.hc-contact .hc-contact__field.is-error{
  animation: hcPulse .9s ease-in-out 2;
}

/* 개인정보 체크박스 에러 */
.hc-contact .hc-privacy.is-error .hc-privacy__agree{
  color: var(--hc-req) !important;
}
.hc-contact .hc-privacy.is-error input[type="checkbox"]{
  border-color: var(--hc-req) !important;
  box-shadow: 0 0 0 2px var(--hc-req) inset !important;
}
/* 칩 기본 텍스트 색 */
.hc-contact .hc-chip{
  color:#7B7B7B !important;
}

/* 선택됨(활성)일 때는 기존처럼 반전 */
.hc-contact .hc-chip.is-active{
  background:#111 !important;
  color:#fff !important;
}

