/* =============================================================================
 * consult_modal.css — 도입문의(상담신청) 모달
 * Figma: 2026 홈페이지 · 상담신청 모달창 - default (node 1:4858)
 *
 * 사용: <link rel="stylesheet" href="/static/css/consult_modal.css?v=3" />
 *       {% include 'partials/consult_modal.html' %}
 * home.css 의 .modal / .modal-content / .f-input 보다 뒤에 로드할 것.
 * =============================================================================
 */

/* body scroll lock (modal-open is toggled by consult_modal.html script) */
html.modal-open,
body.modal-open {
    overflow: hidden;
}

/* --------------------------- 오버레이 -------------------------------------- */
.modal.modal--v2 {
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

/* --------------------------- 모달 컨테이너 (Figma 28r, shadow) ---------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.modal--v2 .modal-content {
    position: relative;
    left: auto !important;
    top: auto !important;
    right: auto;
    bottom: auto;
    width: 818px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 40px);
    min-height: 0;
    margin: 0;
    padding: 55px 45px 40px 43px;
    background: #ffffff;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow:
        0 2px 5px rgba(0, 0, 0, 0.25),
        0 10px 25px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE, legacy Edge */
    box-sizing: border-box;
}

.modal--v2 .modal-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Chromium Edge */
}

/* --------------------------- 닫기 (40×40 히트, 24px 아이콘) ----------------- */
.modal--v2 .modal--v2__close-wrap {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    height: 0;
    z-index: 2;
    pointer-events: none;
}

.modal--v2 .modal--v2__close {
    position: absolute;
    top: 19px;
    right: 21px;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    pointer-events: auto;
}

.modal--v2 .modal--v2__close-icon {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    object-fit: contain;
    max-width: none;
}

/* --------------------------- 모바일 전용 상단 타이틀 ------------------------ */
.modal--v2 .modal--v2__mobile-title {
    display: none;
}

/* --------------------------- 2-컬럼 본문 (구분선 356) ------------------------ */
.modal--v2 .modal--v2__body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 356px;
    min-width: 0;
    gap: 0;
}

/* 좌측 */
.modal--v2 .modal--v2__left {
    flex: 0 0 292px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.modal--v2 .modal--v2__logo {
    width: 78px;
    height: auto;
    object-fit: contain;
    display: block;
    max-width: none;
}

.modal--v2 .modal--v2__title {
    margin: 14px 0 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.5px;
    color: #222222;
}

/* 개인정보 (Body/M: 14, #3A3A3A) */
.modal--v2 .modal--v2__left .modal--v2__privacy--desktop {
    margin-top: auto;
    width: 100%;
    max-width: 257px;
}

.modal--v2 .modal--v2__privacy {
    border: none;
    padding: 0;
}

.modal--v2 .modal--v2__privacy-summary {
    list-style: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 4px;
    user-select: none;
    width: 100%;
}

.modal--v2 .modal--v2__privacy-summary::-webkit-details-marker {
    display: none;
}

.modal--v2 .modal--v2__privacy-summary .modal-privacy {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.35px;
    color: #3a3a3a;
    background: none;
    padding: 0;
}

.modal--v2 .modal--v2__chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
    max-width: none;
    transition: transform 0.2s ease;
}

.modal--v2 .modal--v2__privacy[open] .modal--v2__chevron {
    transform: rotate(180deg);
}

.modal--v2 .modal--v2__privacy-body {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
    color: #666666;
    letter-spacing: -0.35px;
}

.modal--v2 .modal--v2__privacy-more {
    color: #222222;
    text-decoration: underline;
    text-decoration-skip-ink: auto;
    margin-left: 0.2em;
}

/* 구분선 Figma #E3E3E3, 1px × 356, 28px 뒤로 폼 */
.modal--v2 .modal--v2__divider {
    width: 1px;
    flex: 0 0 1px;
    min-height: 356px;
    align-self: flex-start;
    background: #e3e3e3;
    margin: 0 28px 0 0;
}

/* 우측 폼 */
.modal--v2 .modal--v2__right {
    flex: 0 0 408px;
    max-width: 408px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.modal--v2 .modal-box {
    padding: 0;
    width: 100%;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.modal--v2 .modal-form {
    padding: 0;
    margin: 0;
    width: 100%;
}

.modal--v2 .modal-form-input-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 0;
}

/* 필드: label 16 Regular · 8px gap */
.modal--v2 .modal--v2__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal--v2 .modal--v2__label {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.4px;
    color: #222222;
    margin: 0;
    padding: 0;
    background: none;
    min-height: auto;
}

.modal--v2 .modal--v2__label .modal--v2__req {
    color: #e8442a;
    margin-left: 2px;
    display: inline;
}

/* 기존 .main-color 유지 (다른 마크업과의 호환) */
.modal--v2 .modal--v2__label .main-color {
    color: #e8442a;
    display: inline;
    margin-left: 2px;
}

/* Input: 43px, 12r, #E3E3E3, white, 16 / #666 placeholder */
.modal--v2 .modal--v2__input {
    width: 100%;
    height: 43px;
    padding: 10px 16px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: -0.4px;
    color: #222222;
    background: #ffffff;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    margin: 0;
}

.modal--v2 .modal--v2__input::placeholder {
    color: #666666;
}

.modal--v2 .modal--v2__input:focus {
    /* border-color: #e8442a; */
    background: #ffffff;
}

/* --------------------------- 푸터 & 제출 (52, 18 Bold, #FFA496) ------------ */
.modal--v2 .modal--v2__footer {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
    width: 100%;
    padding: 0;
}

.modal--v2 .modal--v2__privacy--mobile {
    display: none;
}

.modal--v2 .modal--v2__submit {
    width: 100%;
    height: 52px;
    padding: 0 20px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.45px;
    color: #ffffff;
    background: #ff4c30;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.05s ease;
    -webkit-appearance: none;
    appearance: none;
}

.modal--v2 .modal--v2__submit:hover {
    background: #ff8a78;
}

.modal--v2 .modal--v2__submit:active {
    transform: scale(0.995);
}

.modal--v2 .modal--v2__submit:disabled {
    background: #ffa496;
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}


/* ------------------------------------------------------------------------- */
/* 태블릿/중간: 1열 (900px 이하) */
/* ------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .modal--v2 .modal--v2__body {
        flex-direction: column;
        min-height: 0;
    }

    .modal--v2 .modal--v2__divider {
        display: none;
    }

    .modal--v2 .modal--v2__left {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .modal--v2 .modal--v2__right {
        flex: none;
        width: 100%;
        max-width: none;
    }

    .modal--v2 .modal--v2__left .modal--v2__privacy--desktop {
        margin-top: 24px;
        max-width: none;
    }
}

/* ------------------------------------------------------------------------- */
/* 모바일 (767) */
/* ------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .modal.modal--v2.show-modal .modal--v2__footer {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .modal.modal--v2 {
        padding: 0;
        align-items: flex-end;
    }

    .modal--v2 .modal-content {
        width: 100% !important;
        max-width: 100%;
        height: 80dvh;
        max-height: 80dvh;
        min-height: 0;
        padding: 52px 16px 0px !important;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.11);
        border: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .modal--v2 .modal--v2__close {
        top: 12px;
        right: 12px;
    }

    .modal--v2 .modal--v2__mobile-title {
        display: block;
        margin: 0 0 12px;
        font-size: 24px;
        font-weight: 700;
        line-height: 1.25;
        letter-spacing: -0.6px;
        color: #222222;
        padding: 0;
    }

    .modal--v2 .modal--v2__body {
        min-height: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .modal--v2 .modal--v2__left {
        padding: 0;
        gap: 0;
        width: 100%;
        max-width: none;
        flex: none;
    }

    .modal--v2 .modal--v2__logo,
    .modal--v2 .modal--v2__left .modal--v2__privacy--desktop {
        display: none;
    }

    .modal--v2 .modal--v2__left .modal--v2__title {
        display: block;
        margin: 0 0 16px;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.4;
        letter-spacing: -0.375px;
        color: #3a3a3a;
    }

    .modal--v2 .modal--v2__left .modal--v2__title br {
        display: block;
    }

    .modal--v2 .modal--v2__right {
        width: 100%;
        flex: 1 1 auto;
        min-height: 0;
        max-width: none;
    }

    .modal--v2 .modal-box,
    .modal--v2 .modal-form {
        height: 100%;
        min-height: 0;
    }

    .modal--v2 .modal-form-input-box {
        height: auto;
        min-height: 0;
        overflow-y: visible;
        overflow-x: hidden;
        padding-bottom: 20px;
        margin-bottom: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .modal--v2 .modal-form-input-box::-webkit-scrollbar {
        display: none;
    }

    .modal--v2 .modal--v2__input {
        height: 52px;
        font-size: 16px;
    }

    .modal--v2 .modal--v2__privacy--mobile {
        display: block;
    }

    .modal--v2 .modal--v2__footer {
        position: relative;
        /* sticky 제거 */
        left: unset;
        right: unset;
        bottom: unset;
        width: 100%;
        z-index: 1201;
        gap: 8px;
        padding: 12px 16px;
        margin: 0 -16px;
        /* ← padding 상쇄 */
        width: calc(100% + 32px);
        /* ← 좌우 padding 16px씩 보정 */
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        /* 안드로이드 제스처 대응 */
        min-height: 80px;
        background: #ffffff;
        box-shadow: 0 -4px 5px rgba(0, 0, 0, 0.06);
        flex-shrink: 0;
        /* 이게 있으면 footer가 절대 안 줄어듦 */
    }

    .modal--v2 .modal--v2__submit {
        height: 56px;
        font-size: 17px;
        letter-spacing: -0.425px;
        background: #ff4c30;
    }

    .modal--v2 .modal--v2__submit:hover {
        background: #e8442a;
    }
}

/* ------------------------------------------------------------------------- */
/* JS / home.css 충돌 방지 */
/* ------------------------------------------------------------------------- */
.modal--v2 #go_free.modal--v2__submit {
    position: static;
    width: 100%;
    height: 56px;
    margin: 0;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
}

@media (max-width: 767px) {
    .modal--v2 #go_free.modal--v2__submit {
        font-size: 17px;
        letter-spacing: -0.425px;
    }
}

.modal--v2 .form-text {
    background: none;
    padding: 0;
    min-height: auto;
    min-width: auto;
}

.modal--v2 .main-color {
    display: inline;
    color: #e8442a;
}