/* 단계형 상담 폼 (/contact).
 *
 * 랜딩 스택에는 Tailwind 가 없다. 부트스트랩도 불러오지 않는다 — 이 페이지는
 * 전체 화면 플로우라 그리드가 필요 없고, 232KB 를 아낀다.
 * 글꼴 굵기는 font.css 의 pr-* 클래스를 쓴다 (디자인 시스템 규칙).
 *
 * 주의: StaticCacheMiddleware 가 CSS 에 max-age=604800 을 건다.
 *       이 파일을 고치면 템플릿의 ?v= 토큰을 반드시 올릴 것.
 */

:root {
    --lf-primary: #00aaff;
    --lf-primary-dark: #0d8ecf;
    --lf-primary-soft: #eef8ff;
    --lf-navy: #1a1a2e;
    --lf-text: #2c3e50;
    --lf-muted: #64748b;
    --lf-faint: #94a3b8;
    --lf-line: #e2e8f0;
    --lf-bg: #ffffff;
    --lf-danger: #f04452;

    --lf-radius-card: 16px;
    --lf-radius-cta: 14px;
    --lf-max: 520px;
    --lf-cta-h: 58px;
    --lf-safe: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

.lf-body {
    font-family: "Pretendard-Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--lf-text);
    background: var(--lf-bg);
    word-break: keep-all;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

button { font-family: inherit; cursor: pointer; }

/* 폴백 / 실패 처리 -------------------------------------------------------- */

.lf-app[hidden] { display: none; }
.lf-fallback { display: none; }

html.lf-broken .lf-app { display: none !important; }
html.lf-broken .lf-fallback { display: block !important; }

/* 허니팟 — 화면·스크린리더 양쪽에서 감춘다 */
.lf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 레이아웃 ---------------------------------------------------------------- */

.lf-app {
    flex: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.lf-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lf-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: -8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--lf-muted);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.lf-back:hover { background: #f1f5f9; color: var(--lf-navy); }
.lf-back i { width: 20px; height: 20px; }
.lf-back[hidden] { display: none; }

.lf-main {
    flex: 1;
    width: 100%;
    max-width: var(--lf-max);
    margin: 0 auto;
    padding: 8px 20px calc(var(--lf-cta-h) + 48px + var(--lf-safe));
}

/* 진행 표시 --------------------------------------------------------------- */

.lf-progress {
    display: flex;
    align-items: center;
    gap: 7px;
}

.lf-progress[hidden] { display: none; }

.lf-progress__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--lf-line);
    transition: background 0.25s ease, width 0.25s ease;
}

.lf-progress__dot.is-done { background: #bae4fb; }

.lf-progress__dot.is-current {
    width: 22px;
    border-radius: 4px;
    background: var(--lf-primary);
}

.lf-progress__last {
    font-size: 0.8rem;
    color: var(--lf-muted);
    letter-spacing: -0.01em;
}

.lf-restored {
    max-width: var(--lf-max);
    margin: 0 auto 4px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--lf-muted);
}

/* 스텝 -------------------------------------------------------------------- */

.lf-step[hidden] { display: none; }

.lf-step {
    animation: lf-enter 0.24s ease both;
}

@keyframes lf-enter {
    from { opacity: 0; transform: translateX(14px); }
    to   { opacity: 1; transform: translateX(0); }
}

.lf-step__title {
    font-size: 1.5rem;
    line-height: 1.4;
    color: var(--lf-navy);
    margin: 20px 0 8px;
    letter-spacing: -0.02em;
}

.lf-step__desc {
    font-size: 0.95rem;
    color: var(--lf-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.lf-step__title + .lf-options,
.lf-step__title + .lf-grid { margin-top: 24px; }

/* 선택 카드 --------------------------------------------------------------- */

.lf-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lf-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lf-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 64px;
    padding: 16px 18px;
    text-align: left;
    background: #fff;
    border: 1.5px solid var(--lf-line);
    border-radius: var(--lf-radius-card);
    color: var(--lf-navy);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.lf-card:hover { border-color: #cbd5e1; }
.lf-card:active { transform: scale(0.985); }

.lf-card:focus-visible {
    outline: 2px solid var(--lf-primary);
    outline-offset: 2px;
}

.lf-card.is-selected {
    border-color: var(--lf-primary);
    background: var(--lf-primary-soft);
}

.lf-card.is-selected .lf-card__title { color: var(--lf-primary-dark); }
.lf-card.is-selected .lf-card__check { opacity: 1; transform: scale(1); }

.lf-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #f1f5f9;
    color: var(--lf-muted);
    transition: background 0.15s ease, color 0.15s ease;
}

.lf-card__icon i { width: 19px; height: 19px; }
.lf-card.is-selected .lf-card__icon { background: #d7eefd; color: var(--lf-primary-dark); }

.lf-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.lf-card__title {
    font-size: 1rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.lf-card__desc {
    font-size: 0.83rem;
    color: var(--lf-muted);
    line-height: 1.5;
}

.lf-card__check {
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--lf-primary);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.lf-card__check i { width: 20px; height: 20px; }

/* 진료과 그리드는 카드가 짧다 */
.lf-step--specialty .lf-card {
    min-height: 56px;
    padding: 14px 16px;
    gap: 8px;
}

.lf-step--specialty .lf-card__check { flex-basis: 16px; }
.lf-step--specialty .lf-card__check i { width: 16px; height: 16px; }

.lf-card--extra { display: none; }
.lf-grid.is-expanded .lf-card--extra { display: flex; }

.lf-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 12px;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--lf-muted);
    font-size: 0.9rem;
}

.lf-more:hover { color: var(--lf-navy); background: #f8fafc; }
.lf-more i { width: 16px; height: 16px; transition: transform 0.2s ease; }
.lf-more[aria-expanded="true"] i { transform: rotate(180deg); }
.lf-more[hidden] { display: none; }

.lf-hint {
    margin-top: 14px;
    font-size: 0.83rem;
    color: var(--lf-faint);
    line-height: 1.6;
}

.lf-hint[hidden] { display: none; }

/* 진입 화면 --------------------------------------------------------------- */

.lf-step--intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100vh - 220px);
    text-align: left;
}

.lf-logo { width: 150px; margin-bottom: 28px; }

.lf-intro__title {
    font-size: 1.7rem;
    line-height: 1.42;
    color: var(--lf-navy);
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}

.lf-intro__desc {
    font-size: 0.98rem;
    line-height: 1.75;
    color: var(--lf-muted);
    margin-bottom: 24px;
}

.lf-intro__note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 50px;
    background: var(--lf-primary-soft);
    color: var(--lf-primary-dark);
    font-size: 0.85rem;
}

.lf-intro__note i { width: 15px; height: 15px; }


/* 연락처 스텝 ------------------------------------------------------------- */

.lf-field { margin-bottom: 18px; }

.lf-field__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--lf-navy);
}

.lf-req { color: var(--lf-primary); font-style: normal; }

.lf-optional {
    margin-left: 4px;
    font-size: 0.78rem;
    color: var(--lf-faint);
}

/* '제안서 발송' 처럼 라벨 옆에서 눈에 띄어야 하는 안내 — 브랜드 하늘색 */
.lf-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--lf-primary-soft);
    color: var(--lf-primary);
    font-size: 0.73rem;
    vertical-align: 1px;
    letter-spacing: -0.01em;
}

.lf-input {
    width: 100%;
    padding: 15px 16px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--lf-navy);
    background: #fff;
    border: 1.5px solid var(--lf-line);
    border-radius: 12px;
    transition: border-color 0.15s ease;
    -webkit-appearance: none;
}

.lf-input::placeholder { color: #cbd5e1; }
.lf-input:focus { outline: none; border-color: var(--lf-primary); }
.lf-input.is-invalid { border-color: var(--lf-danger); }

.lf-textarea { resize: vertical; min-height: 92px; line-height: 1.6; }

.lf-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.lf-chip {
    padding: 11px 16px;
    font-size: 0.9rem;
    color: var(--lf-muted);
    background: #fff;
    border: 1.5px solid var(--lf-line);
    border-radius: 50px;
    transition: all 0.15s ease;
}

.lf-chip:hover { border-color: #cbd5e1; }

.lf-chip.is-selected {
    border-color: var(--lf-primary);
    background: var(--lf-primary-soft);
    color: var(--lf-primary-dark);
}

.lf-chips.is-invalid .lf-chip { border-color: #fbc4c9; }

/* 선택 내용 요약 ---------------------------------------------------------- */

.lf-review {
    margin: 0 0 26px;
    padding: 16px 18px;
    background: #f8fafc;
    border-radius: 14px;
}

.lf-review[hidden] { display: none; }

.lf-review__title {
    font-size: 0.85rem;
    color: var(--lf-muted);
    margin-bottom: 10px;
}

.lf-review__list { list-style: none; display: flex; flex-direction: column; gap: 7px; }

.lf-review__row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.88rem;
}

.lf-review__key { flex: 0 0 82px; color: var(--lf-faint); }
.lf-review__val { flex: 1; color: var(--lf-navy); line-height: 1.5; }

.lf-review__edit {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--lf-primary);
    font-size: 0.8rem;
    padding: 2px 4px;
}

.lf-review__edit:hover { text-decoration: underline; }

/* 동의 -------------------------------------------------------------------- */

/* 동의 3개(전체 동의 + 개별 2개)를 한 박스로 묶는다 */
.lf-consents {
    margin: 24px 0 20px;
    border: 1.5px solid var(--lf-line);
    border-radius: 14px;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.lf-consents.is-checked {
    border-color: var(--lf-primary);
    background: var(--lf-primary-soft);
}

.lf-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--lf-muted);
    cursor: pointer;
}

.lf-consent input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--lf-primary);
}

.lf-consent.is-invalid { color: var(--lf-danger); }

/* 전체 동의 — 박스 맨 위, 개별 항목보다 크게. 기본은 해제 상태다. */
.lf-consent--all {
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--lf-line);
}

.lf-consents.is-checked .lf-consent--all { border-bottom-color: #bae4fb; }

.lf-consent--all input {
    flex-basis: 21px;
    width: 21px;
    height: 21px;
    margin-top: 0;
}

.lf-consent__all {
    font-size: 0.97rem;
    color: var(--lf-navy);
}

.lf-consents.is-checked .lf-consent__all { color: var(--lf-primary-dark); }

/* 개별 항목 — 같은 박스 안, 전체 동의 아래 */
.lf-consent-items {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 14px 16px 15px;
}

.lf-link,
.lf-consent a {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    color: var(--lf-primary-dark);
    text-decoration: underline;
}

.lf-trust {
    display: flex;
    align-items: center;
    gap: 7px;
    padding-top: 6px;
    font-size: 0.83rem;
    color: var(--lf-faint);
}

.lf-trust i { width: 15px; height: 15px; flex: 0 0 15px; }

/* 하단 고정 CTA ----------------------------------------------------------- */

.lf-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: 12px 20px calc(12px + var(--lf-safe));
    background: linear-gradient(to top, #fff 62%, rgba(255, 255, 255, 0));
}

.lf-cta-bar > * {
    max-width: var(--lf-max);
    margin: 0 auto;
}

.lf-cta-bar[hidden] { display: none; }

.lf-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: var(--lf-cta-h);
    border: 0;
    border-radius: var(--lf-radius-cta);
    background: var(--lf-navy);
    color: #fff;
    font-size: 1.02rem;
    text-decoration: none;
    letter-spacing: -0.01em;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.lf-cta:hover:not(:disabled) { background: #0f1629; }

.lf-cta:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* 보조 버튼. :hover 규칙은 .lf-cta:hover:not(:disabled) 보다 명시도가 높아야 한다 —
   안 그러면 호버 시 네이비 배경이 덮여 회색 글자가 안 보인다. */
.lf-cta--ghost {
    background: transparent;
    color: var(--lf-muted);
    height: 48px;
}

.lf-cta--ghost:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--lf-navy);
}

.lf-cta-error {
    margin-bottom: 8px;
    font-size: 0.83rem;
    color: var(--lf-danger);
    text-align: center;
}

.lf-cta-error[hidden] { display: none; }

/* 완료 화면 --------------------------------------------------------------- */

.lf-done {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.lf-done__inner { width: 100%; max-width: var(--lf-max); text-align: center; }

.lf-done__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    border-radius: 50%;
    background: var(--lf-primary-soft);
    color: var(--lf-primary);
}

.lf-done__icon i { width: 30px; height: 30px; stroke-width: 2.5; }

.lf-done h1 {
    font-size: 1.5rem;
    color: var(--lf-navy);
    letter-spacing: -0.02em;
    margin-bottom: 14px;
}

.lf-done p { font-size: 0.97rem; line-height: 1.75; color: var(--lf-muted); }

.lf-done__eta {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.87rem !important;
    color: var(--lf-muted);
}

.lf-done__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
}

/* 모달 -------------------------------------------------------------------- */

.lf-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 22, 41, 0.55);
}

.lf-modal[hidden] { display: none; }

.lf-modal__box {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    max-height: 84vh;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.lf-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #eef2f6;
}

.lf-modal__head h3 { font-size: 1.15rem; color: var(--lf-navy); }

.lf-modal__close {
    border: 0;
    background: none;
    font-size: 1.7rem;
    line-height: 1;
    color: var(--lf-faint);
}

.lf-modal__close:hover { color: var(--lf-navy); }

.lf-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
    font-size: 0.9rem;
    line-height: 1.75;
    color: #475569;
}

.lf-modal__body h4 {
    margin: 22px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f6;
    font-size: 0.97rem;
    color: var(--lf-navy);
}

.lf-modal__body p { margin: 9px 0; }
.lf-modal__body ol { margin: 9px 0 9px 20px; }
.lf-modal__body strong { color: var(--lf-navy); }
.lf-modal__more { margin-top: 18px !important; font-size: 0.85rem; color: var(--lf-faint); }
.lf-modal__more a { color: var(--lf-primary-dark); }

.lf-modal__foot { padding: 16px 24px; border-top: 1px solid #eef2f6; }

/* 폴백 폼 ----------------------------------------------------------------- */

.lf-fallback__inner {
    width: 100%;
    max-width: var(--lf-max);
    margin: 0 auto;
    padding: 48px 20px 64px;
}

.lf-fallback h1 { font-size: 1.5rem; color: var(--lf-navy); margin-bottom: 8px; }

.lf-fallback > .lf-fallback__inner > p {
    margin-bottom: 28px;
    color: var(--lf-muted);
    font-size: 0.95rem;
}

.lf-fallback .lf-cta { position: static; margin-top: 8px; }

/* 데스크톱 ---------------------------------------------------------------- */

@media (min-width: 768px) {
    .lf-header { padding: 20px 32px; }

    .lf-main { padding: 16px 32px calc(var(--lf-cta-h) + 56px); }

    .lf-step__title { font-size: 1.7rem; }

    .lf-intro__title { font-size: 2rem; }

    .lf-step--intro { min-height: calc(100vh - 260px); }

    .lf-cta-bar {
        position: sticky;
        padding: 16px 32px 32px;
        background: linear-gradient(to top, #fff 70%, rgba(255, 255, 255, 0));
    }
}

/* PC — 컬럼 폭(480px)에 맞춰 안쪽 여백을 다시 좁힌다 (768px 규칙 되돌리기).
   셸·히어로 레이아웃 자체는 split_hero.css 가 담당한다. */
@media (min-width: 1024px) {
    .lf-main,
    .lf-cta-bar,
    .lf-header { padding-left: 24px; padding-right: 24px; }

    .lf-intro__title { font-size: 1.75rem; }
}

/* 접근성 ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
