/* /consult/ — 상담 신청 팝업 */
:root {
    --consult-primary: #2563EB;
    --consult-primary-soft: #93C5FD;
    --consult-text: #111827;
    --consult-muted: #6B7280;
    --consult-line: #E5E7EB;
    --consult-sheet-radius: 20px;
}

html.consult-lock,
body.consult-lock {
    overflow: hidden !important;
}

.consult-root {
    position: absolute;
    width: 0;
    height: 0;
    overflow: visible;
}

/* dim + blur */
.consult-dim {
    position: fixed;
    inset: 0;
    z-index: 200000;
    background: rgba(15, 23, 42, 0.42);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.consult-dim.is-open {
    opacity: 1;
    visibility: visible;
}

/* popup sheet — 1번 스텝 높이로 JS 고정, 넘치면 body 스크롤 */
.consult-sheet {
    position: fixed;
    z-index: 200010;
    left: 50%;
    top: 50%;
    width: min(440px, calc(100vw - 24px));
    height: auto;
    max-height: min(680px, calc(100vh - 48px));
    box-sizing: border-box;
    transform: translate(-50%, -46%) scale(0.98);
    opacity: 0;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--consult-sheet-radius);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

.consult-sheet.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.consult-progress {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    padding: 14px 20px 0;
}

.consult-progress__seg {
    flex: 1 1 0;
    height: 3px;
    border-radius: 999px;
    background: #E5E7EB;
}

.consult-progress__seg.is-on {
    background: var(--consult-primary);
}

.consult-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 20px 24px 20px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #C4C4C4 transparent;
}

.consult-sheet__body::-webkit-scrollbar {
    width: 4px;
}

.consult-sheet__body::-webkit-scrollbar-track {
    background: transparent;
}

.consult-sheet__body::-webkit-scrollbar-thumb {
    background: #C4C4C4;
    border-radius: 999px;
}

.consult-step-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.consult-step-label {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--consult-primary);
    letter-spacing: normal;
}

.consult-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.consult-steps__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 600;
    color: #60A5FA;
    background: #EFF6FF;
    line-height: 1;
}

.consult-steps__item.is-current {
    color: #fff;
    background: var(--consult-primary);
}

.consult-steps__item.is-done {
    color: #fff;
    background: var(--consult-primary);
}

.consult-heading {
    margin: 0 0 36px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: normal;
    color: var(--consult-text);
    word-break: keep-all;
}

.consult-panel[hidden] {
    display: none !important;
}

.consult-fields {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.consult-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.consult-field__label {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--consult-text);
    letter-spacing: normal;
}

.consult-field__input {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    background: #fff;
    color: var(--consult-text);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: normal;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.consult-field__input::placeholder {
    color: #9CA3AF;
}

.consult-field__input:focus {
    border-color: var(--consult-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.consult-field[hidden] {
    display: none !important;
}

/* 커스텀 드롭다운 — 시트 안 스크롤 */
.consult-dd {
    position: relative;
}

.consult-dd__trigger {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 40px 14px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    background: #fff;
    color: var(--consult-text);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: normal;
    text-align: left;
    outline: none;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

.consult-dd__trigger.is-placeholder {
    color: #9CA3AF;
}

.consult-dd__trigger::after {
    content: "";
    position: absolute;
    top: 26px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #9CA3AF;
    border-bottom: 2px solid #9CA3AF;
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    transition: transform 0.15s ease;
}

.consult-dd.is-open .consult-dd__trigger {
    border-color: var(--consult-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.consult-dd.is-open .consult-dd__trigger::after {
    transform: translateY(-20%) rotate(-135deg);
}

.consult-dd__list {
    /* absolute 대신 문서 흐름 — 시트 밖으로 안 나감, 목록만 내부 스크롤 */
    position: relative;
    z-index: 2;
    margin: 6px 0 0;
    padding: 6px 0;
    list-style: none;
    max-height: 200px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    scrollbar-width: thin;
    scrollbar-color: #C4C4C4 transparent;
}

.consult-dd__list[hidden] {
    display: none !important;
}

.consult-dd__list::-webkit-scrollbar {
    width: 4px;
}

.consult-dd__list::-webkit-scrollbar-thumb {
    background: #C4C4C4;
    border-radius: 999px;
}

.consult-dd__option {
    padding: 12px 16px;
    color: var(--consult-text);
    font-size: 15px;
    letter-spacing: normal;
    cursor: pointer;
}

.consult-dd__option:hover,
.consult-dd__option:focus {
    background: #F3F4F6;
    outline: none;
}

.consult-dd__option.is-active {
    background: #EFF6FF;
    color: var(--consult-primary);
    font-weight: 600;
}

.consult-field__textarea {
    width: 100%;
    min-height: 220px;
    padding: 16px 18px;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    background: #F3F4F6;
    color: var(--consult-text);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: normal;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.consult-field__textarea::placeholder {
    color: #9CA3AF;
    white-space: pre-line;
}

.consult-field__textarea:focus {
    border-color: var(--consult-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}


/* 개인정보처리방침 동의 — fields gap과 분리, 자체 간격 */
.consult-panel .custom-chk-inp-wrap {
    display: inline-block;
    margin: 16px 0 0;
    padding-bottom: 12px;
}

.consult-panel .custom-chk-inp-wrap .chk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.consult-panel .custom-chk-inp-wrap input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.consult-panel .custom-chk-inp-wrap .box {
    width: 20px;
    height: 20px;
    border: 1.5px solid #888;
    border-radius: 4px;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    opacity: 0.3;
    flex-shrink: 0;
}

.consult-panel .custom-chk-inp-wrap .txt {
    font-size: 14px;
    color: #111;
    letter-spacing: normal;
}

.consult-panel .custom-chk-inp-wrap .txt .privacy-link {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    cursor: pointer;
    text-decoration: underline;
    color: #111;
}

.consult-panel .custom-chk-inp-wrap input:checked + .box {
    background-color: var(--primary, #0C8D77);
    border-color: var(--primary, #0C8D77);
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}

.consult-vehicle {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.consult-choice {
    display: flex;
    flex-direction: column;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.consult-choice__item {
    display: block;
    margin: 0;
    cursor: pointer;
}

.consult-choice__item + .consult-choice__item {
    border-top: 1px solid #E5E7EB;
}

.consult-choice__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.consult-choice__btn {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 16px 18px;
    color: var(--consult-text);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: normal;
    background: #fff;
    transition: background 0.15s ease, color 0.15s ease;
}

.consult-choice__item:hover .consult-choice__btn {
    background: #F9FAFB;
}

.consult-choice__input:checked + .consult-choice__btn {
    background: #EFF6FF;
    color: var(--consult-primary);
    font-weight: 600;
}

.consult-choice__input:focus-visible + .consult-choice__btn {
    box-shadow: inset 0 0 0 2px var(--consult-primary);
}

.consult-vehicle__own {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.consult-vehicle__own[hidden] {
    display: none !important;
}

.consult-sheet__footer {
    flex-shrink: 0;
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #F3F4F6;
}

.consult-close-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    width: 88px;
    min-height: 54px;
    padding: 0 14px;
    border: 0;
    border-radius: 16px;
    background: #F3F4F6;
    color: #9CA3AF;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.consult-close-btn:hover {
    background: #E5E7EB;
    color: #6B7280;
}

.consult-close-btn:active {
    background: #D1D5DB;
    color: #6B7280;
}

.consult-next {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 54px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    background: var(--consult-primary);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: normal;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.consult-next:hover {
    background: #1D4ED8;
}

.consult-next:active {
    background: #1E40AF;
}

.consult-sheet.is-complete .consult-progress,
.consult-sheet.is-complete .consult-step-row,
.consult-sheet.is-complete .consult-heading {
    display: none !important;
}

.consult-sheet.is-complete .consult-sheet__body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.consult-sheet__footer.is-complete .consult-close-btn {
    display: none !important;
}

.consult-sheet__footer.is-complete .consult-next {
    width: 100%;
}

.consult-complete {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 8px 8px;
    width: 100%;
}

.consult-complete__icon {
    margin-bottom: 28px;
}

.consult-complete__title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: normal;
    color: var(--consult-text);
    word-break: keep-all;
}

.consult-check {
    width: 72px;
    height: 72px;
    display: block;
    color: var(--consult-primary);
    border-radius: 50%;
    overflow: hidden;
}

.consult-check__bg {
    transform-origin: 50% 50%;
    transform: scale(0);
    opacity: 0;
}

.consult-check__mark {
    stroke: #fff;
    stroke-width: 3.5;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.consult-check.is-animate .consult-check__bg {
    animation: consult-check-bg 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.consult-check.is-animate .consult-check__mark {
    animation: consult-check-mark 0.35s ease-out 0.28s forwards;
}

@keyframes consult-check-bg {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes consult-check-mark {
    to {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .consult-check.is-animate .consult-check__bg {
        animation: none;
        transform: scale(1);
        opacity: 1;
    }

    .consult-check.is-animate .consult-check__mark {
        animation: none;
        stroke-dashoffset: 0;
    }
}

@media (max-width: 560px) {
    .consult-sheet {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: auto;
        max-height: min(680px, 88vh);
        border-radius: var(--consult-sheet-radius) var(--consult-sheet-radius) 0 0;
        transform: translateY(16px);
    }

    .consult-sheet.is-open {
        transform: translateY(0);
    }

    .consult-progress {
        padding: 12px 16px 0;
    }

    .consult-sheet__body {
        padding: 18px 20px 20px;
    }

    .consult-step-row {
        margin-bottom: 28px;
    }

    .consult-heading {
        font-size: 26px;
        margin-bottom: 32px;
    }
}

/* 상담 시트(200010) 위에 개인정보 팝업이 오도록 */
.ft-policy-dim {
    z-index: 200100;
}

.ft-policy-modal {
    z-index: 200110;
}

@media (prefers-reduced-motion: reduce) {
    .consult-dim,
    .consult-sheet {
        transition: none;
    }
}
