/**
 * [자동등록방지]
 * - 역할: kcaptcha(#captcha) PC/모바일 동일 레이아웃. 네이티브 audio UI 숨김
 * - 작성/수정일: 2026-09-14
 */

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-inline-size: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border-color, #eee);
  border-radius: 12px;
  background: var(--white-color, #fff);
  box-sizing: border-box;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) legend {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  font-size: 0;
  line-height: 0;
  text-indent: -9999em;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_info {
  display: none;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_img {
  display: block;
  flex: 0 0 auto;
  height: 50px;
  width: auto;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--border-color, #eee);
  border-radius: var(--radius-sm, 5px);
  background: var(--section-bg-color, #f9f9f9);
  vertical-align: top;
  object-fit: contain;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_key {
  flex: 1 1 132px;
  min-width: 112px;
  max-width: 200px;
  width: auto;
  height: 50px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border-color, #eee);
  border-radius: var(--radius-sm, 5px);
  background: var(--white-color, #fff);
  color: var(--title-color, #171717);
  font-size: var(--fs-label, 14px);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-align: center;
  vertical-align: top;
  box-sizing: border-box;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_key:focus {
  border-color: var(--primary-color, #171717);
  outline: none;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_mp3,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_reload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  height: 50px;
  margin: 0;
  padding: 0 14px;
  overflow: visible;
  border: 1px solid var(--border-color, #eee);
  border-radius: var(--radius-sm, 5px);
  background: var(--white-color, #fff);
  background-image: none;
  color: var(--title-color, #171717);
  font-size: var(--fs-caption, 13px);
  font-weight: 600;
  line-height: 1;
  text-indent: 0;
  white-space: nowrap;
  cursor: pointer;
  vertical-align: middle;
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_mp3:hover,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_reload:hover {
  border-color: var(--title-color, #171717);
}

#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_mp3 span,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_reload span {
  display: none;
}

/* [자동등록방지]
 * - 역할: iOS 네이티브 플레이어·JS 삽입 audio를 화면에서 제거 (재생은 유지)
 * - 작성/수정일: 2026-09-14
 */
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) audio,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #mp3_audio,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #mp3_object,
#captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_audio {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

/* [다크모드] kcaptcha
 * - 역할: 흰 배경 PNG를 반전해 다크 면에 맞춤 (코어 이미지 생성은 그대로)
 * - 작성/수정일: 2026-08-15
 */
html.dark #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_img,
body.dark #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_img {
  filter: invert(1);
  background: transparent;
  border-color: var(--border-color);
}

/* [자동등록방지]
 * - 역할: 모바일에서 이미지·입력 / 음성·새로고침 2×2 그리드
 * - 작성/수정일: 2026-09-14
 */
@media (max-width: 767.98px) {
  #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
  }

  #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_img {
    width: 100%;
    max-width: none;
    height: 50px;
    object-fit: contain;
  }

  #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_key,
  #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_mp3,
  #captcha.captcha:not(.recaptcha):not(.invisible_recaptcha) #captcha_reload {
    flex: none;
    width: 100%;
    max-width: none;
    min-width: 0;
  }
}
