/* 구매문의 Short Form (#303, 배치·글자 #322). 시안: 3단 입력, 문의 내용 오른쪽에 경로·첨부·버튼, 문의 내용 아래 동의.
   글자 크기와 필수 표시 색은 일반 문의 폼(sub.css .form-container)과 같다. 입력 칸 색·모서리는 사이트 기본값(base.css)을 그대로 쓴다. */
.isf .form-container { width: 100%; }
.isf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 2px solid #151515; }
.isf-head h3 { font-size: 22px; font-weight: 700; color: #151515; line-height: 1.3; }
.isf .form-container .required { margin: 0; white-space: nowrap; }

.isf-grid,
.isf-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 28px; }
.isf-detail {
    margin-top: 20px;
    /* 문의 내용이 경로·첨부 두 줄에 걸치고, 남는 높이는 첨부 줄이 받는다 */
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "message message source"
        "message message file"
        "consents consents actions";
}
.isf-field { min-width: 0; }
.isf-label { display: block; margin-bottom: 8px; font-size: 18px; font-weight: 400; color: #151515; line-height: 1.2; }
.isf input[type="text"], .isf select { width: 100%; height: 52px; line-height: 52px; font-size: 16px; }
.isf input::placeholder, .isf textarea::placeholder { font-size: 16px; color: #999; }

/* country-select.css 가 !important 로 60px 를 주므로 같은 방식으로 덮는다 */
.isf .select2-container--default .select2-selection--single { height: 52px !important; font-size: 16px !important; }
.isf .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 52px !important; }
.isf .select2-container--default .select2-selection--single .select2-selection__arrow { height: 52px !important; background-size: auto !important; }

.isf-field--source { grid-area: source; }
.isf-source { display: flex; flex-direction: column; gap: 8px; }

.isf-field--message { grid-area: message; display: flex; flex-direction: column; }
.isf-message { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; }
.isf-message > textarea { display: block; flex: 1 1 auto; width: 100%; min-height: 220px; padding: 12px 14px 26px; font-size: 16px; line-height: 1.6; background: #f1f1f1; border-radius: 4px; resize: vertical; }
/* 챗봇에서 넘어오면 요약 상자(chatbot-inquiry.js)가 위에 붙고, 이 칸은 덧붙일 말만 받으니 낮춘다 */
.isf-message:has(#chatbot-summary-box) > textarea { min-height: 120px; }
.isf-counter { position: absolute; right: 14px; bottom: 6px; font-size: 14px; color: #999; pointer-events: none; }

.isf-field--file { grid-area: file; }
.isf-upload { position: relative; display: flex; height: 52px; font-size: 16px; }
.isf-filename { flex: 1 1 0; min-width: 0; padding: 0 14px; line-height: 52px; color: #999; background: #f1f1f1; border-radius: 4px 0 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.isf-browse { flex: none; padding: 0 20px; line-height: 50px; color: #151515; background: #fff; border: 1px solid #ddd; border-radius: 0 4px 4px 0; white-space: nowrap; }
.isf-upload input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.isf-upload:hover .isf-browse { color: #fff; background: #151515; border-color: #151515; }
.isf-upload:focus-within { outline: 2px solid #005EB8; outline-offset: 2px; }
.isf-filehelp { margin-top: 6px; font-size: 15px; color: #999; }

/* 체크박스 옆 문구와 더보기를 한 흐름으로 이어 쓴다(좁은 칸에서 문구가 단어 중간에서 끊기지 않게) */
.isf-consents { grid-area: consents; align-self: end; display: flex; flex-wrap: wrap; gap: 8px 40px; }
.isf-consent { position: relative; min-width: 0; padding-left: 28px; font-size: 16px; line-height: 1.5; color: #333; }
.isf-consent input[type="checkbox"] { position: absolute; left: 0; top: 3px; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: #005EB8; }
.isf-consent label { cursor: pointer; }
.isf-more { margin-left: 6px; padding: 0; font-size: 16px; line-height: 1.5; color: #005EB8; background: none; border: 0; border-bottom: 1px solid #005EB8; cursor: pointer; vertical-align: baseline; }

/* 칸 이름은 좁은 화면에서 .isf-detail > * 가 풀 수 있게 낮은 우선순위로 둔다(없는 칸 이름이 남으면 열이 늘어난다) */
.isf-actions { grid-area: actions; }
.isf .form-container .isf-actions { align-self: end; display: flex; gap: 8px; margin-top: 0; }
.isf .form-container .isf-actions .btn { flex: 1 1 auto; width: auto; max-width: none; }
.isf .form-container .isf-actions .btn:first-child { flex: 0 0 88px; padding-left: 0; padding-right: 0; }

/* 입력 오류: 칸 아래 문구 + 빨간 테두리 */
.isf-error { margin-top: 6px; font-size: 15px; line-height: 1.4; color: #ce4c40; }
.isf-consents .isf-error { flex: 0 0 100%; margin-top: 0; }
.isf .isf-invalid:not([type="checkbox"]),
.isf .isf-invalid + .select2 .select2-selection--single { box-shadow: inset 0 0 0 1px #d93025 !important; }
.isf-consent input.isf-invalid { outline: 1px solid #d93025; outline-offset: 1px; }

.isf-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 28px; color: #333; background: #fff; border: 0; border-radius: 8px; }
.isf-dialog::backdrop { background: rgba(0, 0, 0, .5); }
.isf-dialog h4 { margin-bottom: 16px; font-size: 18px; font-weight: 700; color: #151515; line-height: 1.4; }
.isf-dialog-body { max-height: calc(100vh - 240px); overflow-y: auto; font-size: 14px; line-height: 1.6; }
.isf-dialog-close { display: block; min-width: 100px; height: 44px; margin: 20px auto 0; padding: 0 20px; font-size: 14px; color: #fff; background: #151515; border: 0; border-radius: 4px; cursor: pointer; }

/* 태블릿: 입력은 2단, 경로부터는 한 줄씩 */
@media (max-width: 1024px) {
    .isf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
    .isf--en .isf-field--category { grid-column: 1 / -1; }
    .isf-detail { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: none; gap: 20px; }
    .isf-detail > * { grid-area: auto; }
    .isf-message > textarea { min-height: 160px; }
}

/* 모바일: 1열 */
@media (max-width: 640px) {
    .isf-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .isf--en .isf-field--category { grid-column: auto; }
    .isf-detail { margin-top: 16px; gap: 16px; }
    .isf-head h3 { font-size: 20px; }
    .isf .form-container .required { font-size: 14px; }
    .isf-label { font-size: 16px; }
    .isf-consents { flex-direction: column; gap: 12px; }
    .isf-consent, .isf-more { font-size: 15px; }
    .isf .form-container .isf-actions .btn:first-child { flex-basis: 32%; }
    .isf-dialog { padding: 20px; }
}
