.section-consulting {
    width: 100%;
    /* height: 100vh;  <-- 이게 겹침의 주범 */
    height: auto;                               /* 내용 높이만큼 늘어나게 */
    min-height: 100%;                           /* 페이지 최소 높이 보장 */
    min-height: 100dvh;                         /* 모바일 주소창 변화 대응 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;                /* 중앙정렬 → 상단부터 배치 */
    text-align: center;
    background: #f9f9f9;
    /* footer + 플로팅버튼만큼 하단 버퍼 추가 (겹침 방지) */
    --footer-h: 110px;
    --fab-h: 64px;
    padding-bottom: calc(var(--footer-h) + var(--fab-h) + 24px);
}

.section-consulting h2 {
    font-size: 28px;
    color: #31b1b3;
    margin: 32px 0 20px;
}

.section-consulting p {
    font-size: 16px;
    color: #555;
    margin-bottom: 30px;
}

/* 개인정보 동의 박스 */
.privacy-agreement {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    text-align: left;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}
.privacy-agreement h3 {
    color: #31b1b3;
    font-size: 20px;
    margin-bottom: 10px;
}
.privacy-agreement ul { list-style: none; padding-left: 0; margin-bottom: 10px; }
.privacy-agreement ul ul { list-style: disc; padding-left: 20px; margin-top: 5px; }

.agreement-check {
    display: flex; justify-content: center; align-items: center;
    gap: 10px; margin-top: 20px;
}

/* 전송 버튼이 플로팅 버튼/푸터에 가려지지 않게 약간 여백 추가 */
.consult-btn {
    background-color: #31b1b3;
    color: #fff;
    padding: 12px 25px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    opacity: 0.5;
    pointer-events: none;
    margin-bottom: 16px; /* 추가 */
}
.consult-btn.active { opacity: 1; pointer-events: auto; }
.consult-btn:hover { background-color: #286a6b; }

/* 팝업: 기본은 숨김, 필요 시 .is-open으로 보여주기 */
.popup-bg {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.popup-bg.is-open { display: flex; }           /* <-- 이 한 줄로 토글 */

.popup {
    background: #fff; border-radius: 10px;
    width: 90%; max-width: 600px; padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center; position: relative;
    animation: popupFadeIn 0.3s ease-in-out;
}
.popup-close {
    position: absolute; top: 10px; right: 15px;
    background: none; border: none; font-size: 24px;
    cursor: pointer; color: #888; transition: color 0.3s;
}
.popup-close:hover { color: #333; }
.popup h3 { font-size: 22px; margin-bottom: 20px; color: #333; text-align: left; }

.input-group { margin-bottom: 15px; text-align: left; width: 100%; }
.input-group label { display: block; margin-bottom: 5px; font-size: 14px; color: #555; font-weight: bold; }
.input-group input,
.input-group textarea {
    width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 14px; box-sizing: border-box; background-color: #f9f9f9;
}

.popup-row { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; } /* wrap 추가 */
.popup-row .input-group { flex: 1; }
.input-group textarea { height: 120px; resize: none; }

.popup-send {
    background: #31b1b3; color: white; padding: 10px 20px; border: none;
    border-radius: 6px; font-size: 16px; cursor: pointer; width: 100%;
    margin-top: 10px; transition: background 0.3s;
}
.popup-send:hover { background: #185253; }

@keyframes popupFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* === 레이아웃: sticky footer 패턴 === */
html, body { height: 100%; }
.page {
    min-height: 100%;
    min-height: 100dvh;
    display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
footer { flex-shrink: 0; }

/* 모바일에서는 footer 고정 금지 */
@media (max-width: 768px) {
    footer { position: static !important; }
}

/* Contact 본문 하단 버퍼: footer가 덮지 않도록 (보조적으로 유지) */
.contact-content,
.contact-wrapper,
.contact-page main {
    --footer-h: 110px;
    --fab-h: 64px;
    padding-bottom: calc(var(--footer-h) + var(--fab-h) + 24px) !important;
}

/* 지도/배경이 위로 덮는 경우(iframe z-index 버그 방지) */
footer { position: relative; z-index: 2; }

/* 플로팅 '위로가기' 버튼이 footer와 겹치지 않게 조금 더 위로 */
.back-to-top, .fab, .scroll-top {
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom) + 88px); /* 16px → 더 위로 올림 */
    z-index: 3;
}
