/* 2026-09-24 캡챠가 있는 영역에만 적용한다. 관리자·회원·게시판의 인증 검증은 변경하지 않는다. */
/* inline-block + 자식 width:100% 조합이 200px로 축소되어 compact를 선택하던 문제를 공통 해결한다.
   iframe을 강제 확대/축소하지 않는다. 실제 공간이 300px 미만이면 기존 JS의 compact를 유지한다. */
#captcha.cloudflare {
    display:block; position:relative; width:100%; max-width:360px; min-width:0;
    height:auto; margin:0; padding:0; border:0; box-sizing:border-box;
}
#captcha.cloudflare .cf-turnstile {
    display:block; width:100%; max-width:100%; min-width:0; box-sizing:border-box;
}
/* 환경설정의 숨겨진 확인 패널은 flex 축소 계산 전에도 위젯 폭을 확보한다. */
#config_captcha_wrap:has(.cloudflare) { width:350px; flex-shrink:0; box-sizing:border-box; }
.amina-login-captcha { margin:16px 0; min-width:0; }
/* 공통 #captcha의 inline-block이 폭을 200px로 축소해 정사각형 compact가 선택되지 않게 한다. */
.amina-login-captcha #captcha.cloudflare {
    display:block; width:100%; margin:0; padding:0; border:0;
}
.amina-login-captcha #captcha.cloudflare .cf-turnstile { display:block; width:100%; }
/* 320px 휴대폰에서도 가로형 위젯의 최소 300px를 확보한다. 로그인 페이지의 바깥 여백만 줄인다. */
@media (max-width:374px) {
    .content:has(#amina-login .cloudflare) { padding-left:0; padding-right:0; }
    #amina-login:has(.cloudflare) .form-body {
        padding-left:clamp(1px, calc((100vw - 320px) / 2), 15px);
        padding-right:clamp(1px, calc((100vw - 320px) / 2), 15px);
    }
}
.amina-login-captcha #captcha,
.signup-captcha #captcha,
.lost-captcha #captcha,
#memo_write #captcha { max-width:100%; min-width:0; box-sizing:border-box; }
.amina-login-captcha #captcha:not(.cloudflare):not(.recaptcha):not(.invisible_recaptcha) {
    display:flex; flex-wrap:wrap; align-items:center; gap:6px;
}
.amina-login-captcha #captcha_img { width:100px; height:50px; }
.amina-login-captcha #captcha_key { width:90px; height:44px; padding:8px; font-size:16px; }
.amina-login-captcha #captcha_info { flex-basis:100%; font-size:12px; }
/* 가입 폼의 중첩 여백만 줄인다. 360px 휴대폰에서 캡챠가 불필요하게 세로형이 되지 않는다. */
@media (max-width:480px) {
    /* 관리자 표의 제목 칸 때문에 좁아진 캡챠 행만 세로 배치한다. 다른 행은 유지한다. */
    .tbl_frm01 tr:has(> td #captcha.cloudflare),
    .tbl_frm01 tr:has(> td #captcha.cloudflare) > th,
    .tbl_frm01 tr:has(> td #captcha.cloudflare) > td { display:block; width:100%; }
    .btn_fixed_top.btn_confirm:has(#config_captcha_wrap .cloudflare) { flex-wrap:wrap; }
    #config_captcha_wrap:has(.cloudflare) { max-width:calc(100vw - 20px); }
    #fregisterform.amina-signup .signup-captcha:has(.cloudflare) {
        padding-left:0; padding-right:0; border-left:0; border-right:0;
    }
}
.captcha-status { margin:6px 0; color:#b42318; font-size:13px; overflow-wrap:anywhere; }
.captcha-status:empty { display:none; }
