/* ════════════════════════════════════════
   contact-modal.css  –  문의하기 모달
   ════════════════════════════════════════ */

/* ── 오버레이 ── */
.contact-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.contact-overlay.open { display: flex; }

/* ── 카드 ── 기본 사이즈 588 × 720 (원본 시안), 화면 작으면 90vh */
.contact-card {
    width: 100%;
    max-width: 588px;
    max-height: min(720px, 90vh);
    background: #0E0E1E;
    border: 1px solid rgba(227, 227, 229, 0.40);
    border-radius: 30px;
    padding: 22px 32px 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    overflow-y: auto;
}
.contact-card::-webkit-scrollbar { width: 4px; }
.contact-card::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

/* ── 닫기 버튼 ── */
.contact-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    line-height: 0;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.contact-close img { display: block; }
.contact-close:hover { opacity: 1; }

/* ── 제목 ── */
.contact-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-align: center;
    margin-bottom: 10px;
    font-family: 'Paperlogy', sans-serif;
}

/* ── 필드 그룹 ── */
.cm-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
}
.cm-field:last-of-type { margin-bottom: 0; }

.cm-label {
    font-size: 14px;
    font-weight: 300;
    color: white;
    font-family: 'Paperlogy', sans-serif;
}
.cm-label .req { color: #FF1D58; margin-left: 2px; }

/* ── 입력 공통 ── */
.cm-input,
.cm-textarea {
    width: 100%;
    background: rgba(33, 33, 48, 0.5);
    border: 1px solid rgba(227, 227, 229, 0.4);
    border-radius: 6px;
    color: white;
    font-family: 'Paperlogy', sans-serif;
    font-size: 15px;
    font-weight: 300;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.cm-input { height: 38px; padding: 0 14px; }
.cm-textarea {
    height: 72px;
    padding: 8px 14px;
    resize: none;
    line-height: 1.5;
}
.cm-input::placeholder,
.cm-textarea::placeholder { color: rgba(255,255,255,0.4); }
.cm-input:focus,
.cm-textarea:focus { border-color: #708DFF; }
.cm-input.error,
.cm-textarea.error { border-color: #ff5c5c; }

/* ── 에러 메시지 ── */
.cm-err {
    font-size: 12px;
    font-weight: 300;
    color: #ff5c5c;
    min-height: 0;
    margin-top: 2px;
    font-family: 'Paperlogy', sans-serif;
}
.cm-err:empty { display: none; }

/* ════════════════════════════════════════
   커스텀 드롭다운
   ════════════════════════════════════════ */
.cm-dropdown {
    position: relative;
    font-family: 'Paperlogy', sans-serif;
    user-select: none;
}

/* 트리거 버튼 */
.cm-dd-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 38px;
    padding: 0 16px;
    background: rgba(33, 33, 48, 0.8);
    border: 1px solid rgba(227, 227, 229, 0.40);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.cm-dd-trigger:hover,
.cm-dd-trigger.active { border-color: rgba(227, 227, 229, 0.55); }

.cm-dd-value {
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
}
.cm-dd-value.selected { color: white; }

/* 화살표 아이콘 */
.cm-dd-arrow {
    width: 18px;
    height: 18px;
    position: relative;
    flex-shrink: 0;
}
.cm-dd-arrow::before,
.cm-dd-arrow::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 1.5px;
    background: rgba(227, 227, 229, 0.55);
    top: 50%;
    transition: transform 0.2s;
}
.cm-dd-arrow::before { right: 9px; transform: translateY(-50%) rotate(45deg); }
.cm-dd-arrow::after  { right: 4px; transform: translateY(-50%) rotate(-45deg); }
.cm-dd-trigger.active .cm-dd-arrow::before { transform: translateY(-50%) rotate(-45deg); }
.cm-dd-trigger.active .cm-dd-arrow::after  { transform: translateY(-50%) rotate(45deg); }

/* 드롭다운 목록 */
.cm-dd-list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 8px 0;
    background: rgba(33, 33, 48, 0.95);
    border: 1px solid rgba(227, 227, 229, 0.40);
    border-radius: 8px;
    z-index: 10;
    overflow: hidden;
    backdrop-filter: blur(8px);
}
.cm-dd-list.open { display: block; }

.cm-dd-item {
    padding: 11px 18px;
    font-size: 15px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-bottom: 1px solid rgba(227, 227, 229, 0.08);
}
.cm-dd-item:last-child { border-bottom: none; }
.cm-dd-item:hover { background: rgba(112, 141, 255, 0.15); color: white; }
.cm-dd-item.chosen { color: white; }

/* ── 제출 버튼 ── */
.cm-submit {
    width: 100%;
    height: 40px;
    background: #708DFF;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Paperlogy', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
}
.cm-submit:hover { opacity: 0.85; }
.cm-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ════════════════════════════════════════
   완료 모달 (새 디자인)
   ════════════════════════════════════════ */
.cm-done {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 16px 20px;
    text-align: center;
    min-height: 140px;
}

/* "알림" 타이틀 */
.cm-done-title {
    font-size: 20px;
    font-weight: 500;
    color: white;
    font-family: 'Paperlogy', sans-serif;
    margin-bottom: 4px;
}

/* "문의가 정상적으로 접수 되었습니다." */
.cm-done-msg {
    font-size: 20px;
    font-weight: 300;
    color: white;
    font-family: 'Paperlogy', sans-serif;
}

/* "문의코드 : AC151236" */
.cm-done-code {
    font-size: 16px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
    font-family: 'Paperlogy', sans-serif;
    margin-top: 2px;
}

/* "확인" 버튼 */
.cm-done-btn {
    margin-top: 16px;
    width: 120px;
    height: 40px;
    background: #708DFF;
    color: white;
    border: none;
    border-radius: 6px;
    font-family: 'Paperlogy', sans-serif;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}
.cm-done-btn:hover { opacity: 0.85; }

/* ── 반응형 ── */
@media (max-width: 640px) {
    .contact-card { padding: 28px 20px 24px; border-radius: 20px; }
    .contact-title { font-size: 22px; margin-bottom: 20px; }
    .cm-input { height: 40px; font-size: 14px; }
    .cm-textarea { height: 100px; font-size: 14px; }
    .cm-submit { height: 40px; font-size: 14px; }
    .cm-dd-trigger { height: 40px; }
    .cm-dd-value,
    .cm-dd-item { font-size: 14px; }
    .cm-done-msg { font-size: 16px; }
}

/* ── 모바일·태블릿 (≤1024): 한 화면에 다 보이도록 간격 압축 ── */
@media (max-width: 1024px) {
    .contact-overlay { padding: 12px; }
    .contact-card {
        padding: 22px 18px 18px;
        border-radius: 16px;
        max-height: 92vh;
    }
    .contact-close { top: 14px; right: 14px; padding: 4px; }

    .contact-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* 필드 간격 + 라벨-박스 사이 1px */
    .cm-field {
        gap: 1px;
        margin-bottom: 14px;
    }
    .cm-label { font-size: 13px; }

    .cm-input {
        height: 36px;
        font-size: 13px;
        padding: 0 12px;
    }
    .cm-textarea {
        height: 72px;
        font-size: 13px;
        padding: 8px 12px;
        line-height: 1.45;
    }
    .cm-input::placeholder,
    .cm-textarea::placeholder { font-size: 13px; }

    .cm-dd-trigger { height: 36px; padding: 0 12px; }
    .cm-dd-value { font-size: 13px; }
    .cm-dd-list { padding: 4px 0; }
    .cm-dd-item { padding: 9px 14px; font-size: 13px; }

    .cm-err { font-size: 11px; min-height: 0; }

    .cm-submit {
        height: 38px;
        font-size: 14px;
        margin-top: 22px;
    }

    /* 완료 화면 압축 */
    .cm-done { padding: 18px 12px 12px; min-height: 0; gap: 6px; }
    .cm-done-title { font-size: 16px; margin-bottom: 2px; }
    .cm-done-msg { font-size: 14px; }
    .cm-done-code { font-size: 12px; }
    .cm-done-btn { margin-top: 10px; width: 100px; height: 36px; font-size: 14px; }
}
