/* =========================================================
 * 단계형 견적문의 (contact-step) v2
 * Icons : Phosphor Icons Light/Thin (MIT License, phosphoricons.com) - 사용 아이콘만 서브셋
 * ========================================================= */
@font-face {
    font-family: 'cs-icons';
    src: url('./fonts/cs-icons.woff2') format('woff2'),
         url('./fonts/cs-icons.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
/* STEP01·필요기능 카드 아이콘 : Thin (더 얇은 선) */
@font-face {
    font-family: 'cs-icons-thin';
    src: url('./fonts/cs-icons-thin.woff2') format('woff2'),
         url('./fonts/cs-icons-thin.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}
.csi {
    display: inline-block;
    font-family: 'cs-icons' !important;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    speak: never;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.csi-buildings::before { content: "\e102"; }
.csi-storefront::before { content: "\e470"; }
.csi-browser::before { content: "\e0f4"; }
.csi-stethoscope::before { content: "\e7ea"; }
.csi-scales::before { content: "\e750"; }
.csi-graduation-cap::before { content: "\e62c"; }
.csi-palette::before { content: "\e6c8"; }
.csi-arrows-clockwise::before { content: "\e094"; }
.csi-dots-three::before { content: "\e1fe"; }
.csi-user-circle::before { content: "\e4c4"; }
.csi-squares-four::before { content: "\e464"; }
.csi-calendar-check::before { content: "\e712"; }
.csi-credit-card::before { content: "\e1d2"; }
.csi-globe-simple::before { content: "\e28e"; }
.csi-sparkle::before { content: "\e6a2"; }
.csi-magnifying-glass::before { content: "\e30c"; }
.csi-wrench::before { content: "\e5d4"; }
.csi-paperclip::before { content: "\e39a"; }
.csi-pencil-simple::before { content: "\e3b4"; }
.csi-warning-circle::before { content: "\e4e2"; }
.csi-paper-plane-tilt::before { content: "\e398"; }
.csi-check::before { content: "\e182"; }

/* ---------- 토큰 ---------- */
.cs-wrap {
    --cs-fg: #111;
    --cs-sub: #8c8c8c;
    --cs-line: #e3e3e3;
    --cs-soft: #f3f3f3;
    --cs-point: var(--main-color, #3a8afd);   /* 포인트 컬러 */
    --cs-fill: var(--cs-point);                /* 선택 시 채워지는 색 */
    --cs-on-fill: #fff;
    --cs-err: #e5484d;
    --cs-ease: cubic-bezier(.4, 0, 0, 1);
    --cs-ease-out: cubic-bezier(.22, .8, .24, 1);
}

.cs-survey {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 720px;
    padding: 0 0 96px;
    font-family: 'Pretendard', sans-serif;
    color: var(--cs-fg);
    letter-spacing: -0.02em;
}
.cs-steps {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ---------- 단계 전환 ---------- */
.cs-step { display: none; }
.cs-step.is-active { display: block; }

.cs-survey.is-ready .cs-step.is-active .cs-step-head,
.cs-survey.is-ready .cs-step.is-active .cs-narrow {
    animation: csUp .7s var(--cs-ease-out) both;
}
.cs-survey.is-ready .cs-step.is-active .cs-narrow { animation-delay: .12s; }
.cs-survey.is-ready .cs-step.is-active .cs-card {
    animation: csUp .7s var(--cs-ease-out) both;
    animation-delay: calc(var(--i, 0) * 45ms + 120ms);
}
.cs-survey.is-ready .cs-step.is-active.from-prev .cs-step-head,
.cs-survey.is-ready .cs-step.is-active.from-prev .cs-narrow,
.cs-survey.is-ready .cs-step.is-active.from-prev .cs-card {
    animation-name: csDown;
}
@keyframes csUp {
    from { opacity: 0; transform: translate3d(0, 36px, 0); }
    to   { opacity: 1; transform: none; }
}
@keyframes csDown {
    from { opacity: 0; transform: translate3d(0, -28px, 0); }
    to   { opacity: 1; transform: none; }
}

/* ---------- 질문 ---------- */
.cs-step-head { text-align: center; }
.cs-label {
    margin: 0 0 22px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--cs-point);
}
.cs-q {
    margin: 0;
    font-size: 52px;
    font-weight: 300;
    line-height: 1.28;
    letter-spacing: -0.045em;
    word-break: keep-all;
    color: var(--cs-fg);
}
.cs-q b { font-weight: 700; }
.cs-desc {
    margin: 22px 0 0;
    font-size: 19px;
    line-height: 1.6;
    color: var(--cs-sub);
    word-break: keep-all;
}
.cs-body { margin-top: 64px; }
.cs-narrow { max-width: 880px; margin-left: auto; margin-right: auto; }

/* ---------- 카드 ---------- */
.cs-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    max-width: 1076px;
    margin-left: auto;
    margin-right: auto;
}
.cs-cards-icon .cs-card { width: calc((100% - 48px) / 5); }
.cs-cards-4 { max-width: 868px; }
.cs-cards-4 .cs-card { width: calc((100% - 36px) / 4); }
.cs-cards-text { flex-wrap: nowrap; max-width: 1076px; }
.cs-cards-text .cs-card { flex: 1 1 0; min-width: 0; max-width: 200px; }

.cs-card { position: relative; display: block; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cs-card input {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    pointer-events: none;
}
.cs-card-in {
    position: relative;
    display: block;
    height: 204px;
    padding: 22px 22px;
    border: 1px solid var(--cs-line);
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    isolation: isolate;
    transition: border-color .3s, transform .45s var(--cs-ease);
}
.cs-cards-text .cs-card-in { height: 128px; padding: 20px 18px; }
.cs-cards-text .cs-card-in em { font-size: 17px; white-space: nowrap; }

/* 아래에서 차오르는 원형 채움 */
.cs-card-in::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--cs-fill);
    clip-path: circle(0% at 50% 110%);
    transition: clip-path .6s var(--cs-ease);
}
.cs-card-in em {
    display: block;
    font-style: normal;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -0.03em;
    color: var(--cs-fg);
    word-break: keep-all;
    transition: color .3s;
}
.cs-card-in .csi {
    position: absolute;
    right: 18px;
    bottom: 16px;
    font-size: 56px;
    color: #b9b9b9;
    transition: color .3s, transform .5s var(--cs-ease);
}
.cs-cards-icon .cs-card-in .csi { font-family: 'cs-icons-thin' !important; }
.cs-cards-text .cs-card-in .csi {
    right: 18px;
    bottom: 16px;
    font-size: 26px;
    color: var(--cs-on-fill);
    opacity: 0;
    transform: scale(.5);
}

@media (hover: hover) {
    .cs-card:hover .cs-card-in { border-color: var(--cs-point); }
    .cs-card:hover .cs-card-in .csi { color: var(--cs-point); transform: translateY(-4px); }
    .cs-cards-text .cs-card:hover .cs-card-in .csi { transform: scale(.5); }
}
.cs-card input:focus-visible + .cs-card-in { outline: 2px solid var(--cs-fg); outline-offset: 3px; }
.cs-card:active .cs-card-in { transform: scale(.98); }

.cs-card input:checked + .cs-card-in { border-color: var(--cs-fill); }
.cs-card input:checked + .cs-card-in::before { clip-path: circle(150% at 50% 110%); }
.cs-card input:checked + .cs-card-in em { color: var(--cs-on-fill); }
.cs-card input:checked + .cs-card-in .csi,
.cs-card:hover input:checked + .cs-card-in .csi { color: var(--cs-on-fill); }
.cs-cards-text .cs-card input:checked + .cs-card-in .csi {
    opacity: 1;
    transform: none;
    transition: opacity .3s .15s, transform .5s .15s var(--cs-ease);
}

/* ---------- 입력 ---------- */
.cs-sub + .cs-sub,
.cs-row + .cs-sub,
.cs-sub + .cs-row,
.cs-row + .cs-row { margin-top: 36px; }
.cs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cs-row > .cs-sub { margin-top: 0 !important; }
.cs-sub > label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}
.cs-sub > label small {
    padding: 2px 7px;
    border-radius: 4px;
    background: var(--cs-soft);
    font-size: 11px;
    font-weight: 500;
    color: #999;
}

#bo_w.cs-wrap .cs-line {
    display: block;
    width: 100%;
    height: 60px;
    padding: 0;
    border: 0 !important;
    border-bottom: 2px solid var(--cs-line) !important;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cs-fg);
    box-shadow: none;
    outline: none;
    transition: border-color .3s;
}
#bo_w.cs-wrap .cs-line-lg { height: 76px; font-size: 26px; }
#bo_w.cs-wrap .cs-line::placeholder { color: #c4c4c4; font-weight: 400; }
#bo_w.cs-wrap .cs-line:focus { border-bottom-color: var(--cs-point) !important; }
#bo_w.cs-wrap .cs-line.is-invalid { border-bottom-color: var(--cs-err) !important; }

#bo_w.cs-wrap .cs-select {
    width: 100%;
    height: 64px;
    padding: 0 20px;
    border: 1px solid var(--cs-line);
    border-radius: 14px;
    font-family: inherit;
    font-size: 18px;
}

.cs-sub.wr_content { position: relative; }
#bo_w.cs-wrap .cs-area {
    display: block;
    width: 100%;
    height: 200px;
    margin-top: 10px;
    padding: 20px 22px 44px;
    border: 1px solid var(--cs-line) !important;
    border-radius: 16px;
    background: #fafafa;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.7;
    color: var(--cs-fg);
    resize: none;
    outline: none;
    transition: border-color .3s, background-color .3s;
}
#bo_w.cs-wrap .cs-area:focus { border-color: var(--cs-point) !important; background: #fff; }
#bo_w.cs-wrap .cs-area.is-invalid { border-color: var(--cs-err) !important; }
#bo_w.cs-wrap .cs-area::placeholder { color: #b5b5b5; }
.cs-sub.wr_content .textLengthWrap {
    position: absolute;
    right: 20px; bottom: 14px;
    display: flex;
    gap: 3px;
    margin: 0;
    font-size: 13px;
    color: #aaa;
}
.cs-sub.wr_content .textLengthWrap p { margin: 0; }

/* 첨부 */
.cs-file {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 16px;
}
.cs-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px 0 14px;
    border: 1px solid var(--cs-line);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: border-color .3s, background-color .3s, color .3s;
}
.cs-file-btn .csi { font-size: 20px; }
.cs-file-btn:hover { border-color: var(--cs-point); background: var(--cs-point); color: #fff; }
.cs-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cs-file-name { font-size: 13px; color: #999; word-break: break-all; letter-spacing: 0;}
.cs-file.has-file .cs-file-name { color: var(--cs-fg); font-weight: 600; }
.cs-file .cs-line { flex-basis: 100%; height: 48px !important; font-size: 15px !important; }

/* ---------- 에러 ---------- */
.cs-err {
    min-height: 22px;
    margin: 24px 0 0;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    color: var(--cs-err);
}
.cs-err.on { animation: csShake .4s ease; }
@keyframes csShake {
    0%, 100% { transform: none; }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* ---------- 요약 ---------- */
.cs-summary {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 2px solid var(--cs-fg);
}
.cs-summary li { border-bottom: 1px solid var(--cs-line); }
.cs-summary button {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    padding: 18px 4px;
    border: 0;
    background: none;
    font-family: inherit;
    letter-spacing: -0.02em;
    text-align: left;
    cursor: pointer;
}
.cs-sum-k { flex: 0 0 120px; font-size: 15px; font-weight: 500; color: var(--cs-sub); line-height: 1.6; }
.cs-sum-v { flex: 1; font-size: 16px; font-weight: 600; color: var(--cs-fg); line-height: 1.6; word-break: break-all; }
.cs-sum-v.is-empty { color: #c4c4c4; font-weight: 400; }
.cs-summary button > .csi { font-size: 18px; line-height: 1.45; color: #c4c4c4; transition: color .2s, transform .3s var(--cs-ease); }
@media (hover: hover) {
    .cs-summary button:hover > .csi { color: var(--cs-point); transform: rotate(-12deg); }
    .cs-summary button:hover .cs-sum-v { text-decoration: underline; text-underline-offset: 4px; }
}

.cs-captcha { margin-top: 28px; }

/* 동의 */
.cs-agree {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    cursor: pointer;
    font-size: 15px;
    color: #444;
}
.cs-agree input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cs-agree-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px; height: 24px;
    border: 1px solid #ccc;
    border-radius: 50%;
    font-size: 14px;
    color: transparent;
    transition: all .25s;
}
.cs-agree input:checked + .cs-agree-box { border-color: var(--cs-point); background: var(--cs-point); color: #fff; }
.cs-agree input:focus-visible + .cs-agree-box { outline: 2px solid var(--cs-fg); outline-offset: 2px; }
.cs-agree-txt a { color: var(--cs-fg); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* 전송 */
.cs-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 300px;
    max-width: 100%;
    height: 68px;
    margin: 12px auto 0;
    border: 0;
    border-radius: 999px;
    background: var(--cs-fill);
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    color: var(--cs-on-fill);
    cursor: pointer;
    transition: transform .4s var(--cs-ease), filter .3s, opacity .3s;
}
.cs-submit .csi { font-size: 22px; transition: transform .4s var(--cs-ease); }
@media (hover: hover) {
    .cs-submit:hover { filter: brightness(.9); }
    .cs-submit:hover .csi { transform: translate(3px, -3px); }
}
.cs-submit:disabled { opacity: .5; cursor: default; }
.cs-survey.is-sending .cs-submit span::after { content: '...'; }

/* ---------- 내비게이션 (PC : 좌우 화살표 + 하단 카운트) ---------- */
.cs-nav { position: absolute; inset: 0; pointer-events: none; }
.cs-arrow {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    margin-top: -80px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--cs-fg);
    cursor: pointer;
    pointer-events: auto;
    transition: opacity .3s, transform .4s var(--cs-ease);
}
.cs-arrow svg { width: 64px; height: 64px; }
.cs-prev { left: 0; }
.cs-prev svg { transform: scaleX(-1); }
.cs-next { right: 0; }
@media (hover: hover) {
    .cs-prev:hover { transform: translateX(-8px); }
    .cs-next:hover { transform: translateX(8px); }
}
.cs-prev:disabled { opacity: 0; pointer-events: none; }
.cs-survey.is-last .cs-next { opacity: 0; pointer-events: none; }
.cs-next-txt {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .3s;
}
.cs-survey.is-editing .cs-next-txt { opacity: 1; }

.cs-count {
    position: absolute;
    left: 50%;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--cs-soft);
    font-size: 15px;
    font-weight: 500;
    color: #999;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
}
.cs-count .cs-cur { font-weight: 700; color: var(--cs-point); }

/* 최상단 진행바 (JS 가 body 로 이동 → 부모 transform 영향 없음) */
.cs-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 4px;
    background: rgba(0, 0, 0, .06);
    pointer-events: none;
}
.cs-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--main-color, #3a8afd);
    transition: width .6s cubic-bezier(.4, 0, 0, 1);
}

/* ---------- 반응형 ---------- */
@media (max-width: 1400px) {
    .cs-q { font-size: 46px; }
    .cs-cards-text .cs-card-in em { font-size: 16px; }
}

/* 태블릿 이하 : 화살표/카운트 하단 배치 */
@media (max-width: 1100px) {
    .cs-survey { min-height: 0; padding-bottom: 0; }
    .cs-nav {
        position: static;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 40px;
        pointer-events: auto;
    }
    .cs-arrow {
        position: relative;
        top: auto; left: auto; right: auto;
        width: 56px; height: 56px;
        margin: 0;
        border-radius: 50%;
        background: var(--cs-soft);
    }
    .cs-arrow svg { width: 40px; height: 40px; }
    .cs-next { background: var(--cs-fill); color: var(--cs-on-fill); }
    .cs-prev:disabled { opacity: .35; }
    .cs-count { position: static; transform: none; }
    .cs-survey.is-last .cs-next { opacity: .2; }
    .cs-next-txt { top: auto; bottom: 100%; margin-bottom: 6px; color: var(--cs-fg); }
    .cs-cards-icon .cs-card { width: calc((100% - 24px) / 3); }
    .cs-cards-4 .cs-card { width: calc((100% - 24px) / 3); }
    .cs-cards-text { flex-wrap: wrap; }
    .cs-cards-text .cs-card { flex: 0 0 auto; width: calc((100% - 24px) / 3); max-width: none; }
}

/* 모바일 : 박스 테두리 유지 */
@media (max-width: 768px) {
    .cs-label { margin-bottom: 14px; font-size: 13px; }
    .cs-q { font-size: 27px; line-height: 1.35; }
    .cs-desc { margin-top: 12px; font-size: 14px; }
    .cs-body { margin-top: 32px; }
    .cs-cards { gap: 8px; }
    .cs-cards-icon .cs-card,
    .cs-cards-4 .cs-card,
    .cs-cards-text .cs-card { width: calc((100% - 8px) / 2); }
    .cs-card-in { height: 132px; padding: 16px; border-radius: 16px; }
    .cs-cards-text .cs-card-in { height: 76px; }
    .cs-card-in em { font-size: 15px; }
    .cs-cards-text .cs-card-in { padding: 16px; }
    .cs-cards-text .cs-card-in em { font-size: 15px; }
    .cs-card-in .csi { right: 12px; bottom: 10px; font-size: 40px; }
    .cs-cards-text .cs-card-in .csi { right: 12px; bottom: 10px; font-size: 20px; }
    .cs-row { grid-template-columns: 1fr; gap: 28px; }
    .cs-sub + .cs-sub, .cs-row + .cs-sub, .cs-sub + .cs-row { margin-top: 28px; }
    #bo_w.cs-wrap .cs-line { height: 52px; font-size: 17px; }
    #bo_w.cs-wrap .cs-line-lg { height: 60px; font-size: 20px; }
    #bo_w.cs-wrap .cs-area { height: 180px; font-size: 15px; }
    .cs-err { margin-top: 16px; font-size: 14px; }
    .cs-summary button { gap: 12px; padding: 15px 2px; }
    .cs-sum-k { flex-basis: 76px; font-size: 13px; }
    .cs-sum-v { font-size: 14px; }
    .cs-submit { width: 100%; height: 60px; font-size: 16px; }
    .cs-nav { margin-top: 28px; }
    .cs-arrow { width: 52px; height: 52px; }
    .cs-count { height: 40px; padding: 0 18px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .cs-survey.is-ready .cs-step.is-active *,
    .cs-survey.is-ready .cs-step.is-active .cs-step-head { animation: none !important; }
    .cs-card-in::before, .cs-progress-fill { transition: none; }
}
