/* =====================================================================
   자가진단 랜딩 — 베이지/골드 (차분·깔끔)
   · PC(≥860px): 메인 2단 히어로(좌 카피 / 우 혜택패널 무한롤링)
   · 모바일(<860px): 세로 스택
   · 질문/로딩/DB: 가운데 카드 (공통)
   ===================================================================== */
:root {
    --cream-1:   #faf6ef;
    --cream-2:   #ece0ca;
    --surface:   #ffffff;
    --ink:       #2c2a27;
    --ink-soft:  #6f6a62;
    --muted:     #a39b8f;
    --line:      #ece3d4;
    --gold:      #b9914a;
    --gold-deep: #c57908;
    --gold-soft: #f6efe1;
    --dark:      #34302a;
    --plum:      #463c52;
    --radius:    18px;
    --shadow:    0 18px 50px rgba(120, 98, 56, 0.15);
    --shadow-sm: 0 4px 14px rgba(120, 98, 56, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; }
body {
    min-height: 100dvh;
    font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    color: var(--ink);
    /* 단색 → 따뜻한 베이지 + 부드러운 골드 블롭 (입체감) */
    background: #f7ecd8;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.app { width: 100%; }

/* ── 스크린 전환 (공통: 화면 가운데 정렬) ───────────── */
.screen {
    display: none;
    min-height: 100dvh;
    padding: 32px 18px;
    align-items: center;
    justify-content: center;
    background: #f7ecd8 url(../imges/main-bg.png) center / cover no-repeat;
}
.screen.is-active { display: flex; animation: fadeUp .45s ease both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* CTA 공통 ─────────────────────────────────────────── */
.cta {
    position: relative; width: 100%;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    padding: 19px 54px; border: 0; border-radius: 16px; cursor: pointer;
    font-size: 19px; font-weight: 800; color: #fff;
    background: linear-gradient(180deg, #eab64a 0%, #d8952a 48%, #c57908 100%);
    box-shadow: 0 14px 28px rgba(180, 112, 20, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.55);
    text-shadow: 0 1px 2px rgba(120, 78, 20, 0.28);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.cta:hover  { transform: translateY(-1px); filter: brightness(1.04); }
.cta:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(154,118,55,.30); }
.cta__icon  { font-size: 21px; }
.cta__arrow {
    position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
    font-size: 1.3em;
}
.cta__hl    { color: #fbf18d; }
.cta--submit { margin-top: 18px; }

/* =====================================================================
   ① 메인 히어로
   ===================================================================== */
/* 메인: 배경 이미지가 뷰포트를 꽉 채움 (full-bleed) */
#screen-main { padding: 0; }
.hero-card {
    position: relative;
    width: 100%; max-width: 1120px;
    min-width: 0;
    padding: 48px 32px;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.06fr 0.94fr;
    gap: 52px;
    align-items: center;
}
.hero-left, .hero-right { min-width: 0; }
.hero-right { display: flex; flex-direction: column; gap: 14px; }
.hero-deco { align-self: flex-end; width: 54px; height: 54px; }
.hero-deco svg { width: 100%; height: 100%; }

.eyebrow { color: var(--ink); font-size: clamp(15px, 1.5vw, 22px); font-weight: 700; }

/* 에이브로 하단 별똥별 그라데이션 라인 */
.kicker-line {
    position: relative; width: 100%; max-width: 330px; height: 3px;
    margin-top: 16px; border-radius: 4px; overflow: hidden;
    background: linear-gradient(90deg, rgba(185,145,74,.10), rgba(185,145,74,.30), rgba(185,145,74,.10));
}
.kicker-line::before {
    content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 44%;
    border-radius: 4px;
    background: linear-gradient(90deg, transparent 0%, rgba(233,188,86,.55) 55%, #fff7e2 88%, #ffffff 100%);
    animation: shootingStar 2.8s ease-in infinite;
}
@keyframes shootingStar {
    0%   { transform: translateX(-110%); opacity: 0; }
    14%  { opacity: 1; }
    50%  { transform: translateX(286%); opacity: 1; }
    62%  { transform: translateX(286%); opacity: 0; }
    100% { transform: translateX(286%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .kicker-line::before { animation: none; left: 0; width: 100%; opacity: .4; }
}

.title {
    margin-top: 12px;
    font-size: clamp(32px, 5.2vw, 78px); font-weight: 800;
    letter-spacing: -2px; line-height: 1.1;
}
.title b { color: var(--gold-deep); }
.sub { margin-top: 10px; font-size: clamp(17px, 2.1vw, 30px); font-weight: 700; color: var(--ink-soft); }

.badges { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.badge {
    background: rgba(255,255,255,0.92); border: 1px solid var(--line);
    border-radius: 14px; padding: 18px 10px; text-align: center; box-shadow: var(--shadow-sm);
}
.badge__icon { display: block; font-size: 23px; color: var(--gold-deep); margin-bottom: 9px; }
.badge__top { display: block; font-size: 19px; font-weight: 800; color: var(--ink); }
.badge__bottom { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-soft); }

/* 혜택 패널 (무한 세로 롤링) */
.benefits {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.benefits__head {
    background: linear-gradient(135deg, #3d362c, #2c2823);
    color: #f3ead6; text-align: center; padding: 14px;
    font-size: 15px; font-weight: 800; letter-spacing: 2px;
}
.benefits__viewport { height: 264px; overflow: hidden; position: relative; padding: 0 16px; }
/* 위/아래 페이드 */
.benefits__viewport::before,
.benefits__viewport::after {
    content: ""; position: absolute; left: 0; right: 0; height: 26px; z-index: 2; pointer-events: none;
}
.benefits__viewport::before { top: 0;    background: linear-gradient(#fff, rgba(255,255,255,0)); }
.benefits__viewport::after  { bottom: 0; background: linear-gradient(rgba(255,255,255,0), #fff); }

.benefits__track { list-style: none; animation: rollUp 20s linear infinite; }
.benefits:hover .benefits__track { animation-play-state: paused; }
@keyframes rollUp { from { transform: translateY(0); } to { transform: translateY(-50%); } }

.benefits__track li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 2px; border-bottom: 1px solid #f3eddf;
    font-size: 16px; font-weight: 600; color: var(--ink);
}
.benefits__ic {
    width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
    border-radius: 50%; background: var(--gold-soft); color: var(--gold-deep); font-size: 15px;
}
.benefits__tx b { color: var(--gold-deep); }

@media (prefers-reduced-motion: reduce) {
    .benefits__track { animation: none; }
}

/* 큰 화면: 배경을 꽉 채운 만큼 요소도 함께 키워 균형 */
@media (min-width: 861px) {
    .hero-card { max-width: 1340px; padding: 54px 50px; }
    .hero-grid { grid-template-columns: 1.32fr 1fr; gap: 58px; }
    .badges { gap: 18px; margin: 34px 0; }
    .badge { padding: 30px 16px; border-radius: 18px; }
    .badge__icon { font-size: 40px; margin-bottom: 14px; }
    .badge__top { font-size: 30px; }
    .badge__bottom { font-size: 16px; }
    .cta { font-size: 21px; padding: 20px 54px; border-radius: 16px; }
    #screen-main .cta { font-size: clamp(28px, 3.4vw, 43px); padding: 28px 74px; border-radius: 22px; gap: 18px; }
    #screen-main .cta__icon { font-size: clamp(34px, 3.9vw, 50px); }
    #screen-main .cta__arrow { right: 30px; }
    .hero-deco { width: 76px; height: 76px; }
    .benefits__head { font-size: 19px; padding: 18px; letter-spacing: 3px; }
    .benefits__viewport { height: 400px; padding: 0 24px; }
    .benefits__track li { padding: 18px 6px; gap: 16px; font-size: 21px; }
    .benefits__ic { width: 52px; height: 52px; font-size: 21px; }
}

/* 모바일 스택 */
@media (max-width: 860px) {
    #screen-main { padding: 22px 14px; }
    .hero-card { max-width: 480px; margin: 0 auto; padding: 30px 20px 32px; }
    .hero-grid { grid-template-columns: 1fr; gap: 20px; }
    .hero-left { text-align: left; }              /* 사진처럼 좌측 정렬 */
    .hero-deco {                                   /* 로고 상단 우측 노출 */
        display: block; position: absolute; top: 22px; right: 20px;
        width: 46px; height: 46px;
    }
    .benefits { width: 100%; }
    .benefits__viewport { height: 256px; }
}

/* =====================================================================
   공용 카드 (② 질문 / ③ 로딩 / ④ DB)
   ===================================================================== */
.card {
    width: 100%; max-width: 520px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: 22px; box-shadow: var(--shadow);
    padding: 38px 32px; text-align: center;
}
.card__title { font-size: clamp(22px, 5.2vw, 28px); font-weight: 800; letter-spacing: -.5px; }
.card__title b { color: var(--gold-deep); }
.card__note { margin-top: 12px; color: var(--ink-soft); font-size: 14px; }
/* 자물쇠 아이콘 — 2줄 텍스트 좌측에 세로 중앙 정렬, 그룹은 가운데 */
.secure-note { display: flex; align-items: center; justify-content: center; gap: 9px; text-align: left; }
.secure-note .fa-lock { color: var(--gold-deep); font-size: 1.1em; flex: 0 0 auto; }
.card__fineprint { margin-top: 14px; color: var(--muted); font-size: 11px; }

/* ② 질문 보기 */
.choices {
    margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line);
    display: grid; grid-template-columns: 1fr 1fr; gap: 13px;
}
.choice {
    padding: 24px 8px; border: 1px solid #f1e6da; border-radius: 12px;
    background: #fbf2ed; color: #5e5a51; cursor: pointer;
    font-size: 16px; font-weight: 700; transition: all .12s ease;
}
.choice:hover { border-color: #c57908; background: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.choice:active { transform: translateY(0); }

/* 큰 화면: ② 질문 카드 풀페이지 스케일업 */
@media (min-width: 861px) {
    #screen-question .card { max-width: 800px; padding: 58px 64px; border-radius: 28px; }
    #screen-question .card__title { font-size: clamp(32px, 3.3vw, 45px); }
    #screen-question .card__note { font-size: clamp(15px, 1.35vw, 18px); margin-top: 20px; }
    #screen-question .secure-note { gap: 12px; }
    #screen-question .secure-note .fa-lock { font-size: 1.35em; }
    #screen-question .choices { margin-top: 36px; padding-top: 36px; gap: 22px; }
    #screen-question .choice { padding: 34px 14px; font-size: clamp(19px, 1.7vw, 24px); border-radius: 14px; }
}

/* ④ DB 카드 — 로고 + 구분선 */
.db-logo { width: clamp(46px, 5vw, 58px); height: clamp(46px, 5vw, 58px); margin: 0 auto 14px; }
.db-logo svg { width: 100%; height: 100%; }
.card__line { height: 1px; background: var(--line); margin: 22px 0 4px; }

/* 큰 화면: ④ DB 카드 풀페이지 스케일업 */
@media (min-width: 861px) {
    #screen-db .card { max-width: 720px; padding: 48px 56px; border-radius: 28px; }
    #screen-db .db-logo { width: 62px; height: 62px; margin-bottom: 16px; }
    #screen-db .result-chip { font-size: 14px; padding: 9px 20px; margin-bottom: 14px; }
    #screen-db .card__title { font-size: clamp(28px, 2.9vw, 38px); }
    #screen-db .card__note { font-size: clamp(15px, 1.3vw, 17px); margin-top: 14px; }
    #screen-db .card__line { margin: 28px 0 6px; }
    #screen-db .field { margin-top: 22px; }
    #screen-db .field__label { font-size: clamp(14px, 1.2vw, 16px); margin-bottom: 9px; }
    #screen-db .field input,
    #screen-db .phone select, #screen-db .phone input { padding: 17px 16px; font-size: 16px; border-radius: 12px; }
    #screen-db .phone select { width: 112px; }
    #screen-db .agrees { margin-top: 24px; gap: 14px; }
    #screen-db .agree { font-size: 14.5px; }
    #screen-db .agree input { width: 20px; height: 20px; }
    #screen-db .agree-more { font-size: 13px; }
    #screen-db .cta--submit { font-size: clamp(18px, 1.8vw, 23px); padding: 22px 58px; border-radius: 18px; margin-top: 26px; gap: 12px; }
    #screen-db .cta--submit .cta__arrow { right: 24px; }
    #screen-db .card__fineprint { font-size: 12.5px; margin-top: 16px; }
}

/* ③ 로딩 / 분석 (엠블럼·제목은 배경 위, 분석목록은 흰 패널) */
.loading { width: 100%; max-width: 600px; text-align: center; }
.loader { width: clamp(58px, 6.5vw, 76px); height: clamp(58px, 6.5vw, 76px); margin: 0 auto 16px; animation: bob 1.8s ease-in-out infinite; }
.loader svg { width: 100%; height: 100%; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.loading__title { font-size: clamp(30px, 4.3vw, 50px); font-weight: 800; letter-spacing: -.8px; line-height: 1.2; }
.loading__title b { color: var(--gold-deep); }

.loading__wait {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-top: 16px; color: var(--muted); font-weight: 600; font-size: clamp(14px, 1.4vw, 18px);
}
.loading__wait::before, .loading__wait::after { content: ""; width: clamp(40px, 6vw, 72px); height: 1px; }
.loading__wait::before { background: linear-gradient(90deg, transparent, #ccc0a7); }
.loading__wait::after  { background: linear-gradient(90deg, #ccc0a7, transparent); }

.analysis {
    list-style: none; margin-top: clamp(28px, 3.2vw, 44px);
    background: var(--surface); border: 1px solid var(--line);
    border-radius: clamp(18px, 2vw, 24px); box-shadow: var(--shadow);
    padding: clamp(4px, 0.6vw, 10px) clamp(20px, 3vw, 38px); text-align: left;
}
.analysis__item {
    position: relative; display: flex; align-items: center;
    gap: clamp(13px, 1.6vw, 20px); padding: clamp(15px, 1.85vw, 22px) 0;
    border-bottom: 1px solid #e7e1d5;
}
.analysis__item:last-child { border-bottom: 0; }
.analysis__ic {
    position: relative; flex: 0 0 auto;
    width: clamp(44px, 4.6vw, 54px); height: clamp(44px, 4.6vw, 54px);
    display: grid; place-items: center; border-radius: 13px;
    background: var(--gold-soft); color: var(--gold-deep);
    font-size: clamp(18px, 1.9vw, 22px); opacity: .45; transition: opacity .35s ease;
}
.analysis__ic svg { width: 56%; height: 56%; }
.analysis__item.is-done .analysis__ic { opacity: 1; }
.analysis__item:not(:last-child) .analysis__ic::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    top: calc(100% + 6px); height: clamp(16px, 2vw, 24px);
    border-left: 2px dotted #dccfb6;
}
.analysis__tx { flex: 1; font-size: clamp(15px, 1.5vw, 19px); font-weight: 600; color: var(--muted); transition: color .35s ease; }
.analysis__item.is-done .analysis__tx { color: var(--ink); }
.analysis__check {
    flex: 0 0 auto; width: clamp(28px, 3vw, 34px); height: clamp(28px, 3vw, 34px);
    display: grid; place-items: center; border-radius: 50%;
    background: #e7decd; color: #fff; font-size: clamp(12px, 1.2vw, 15px);
    transition: background .35s ease;
}
.analysis__item.is-done .analysis__check { background: var(--gold-deep); }

/* ④ DB 입력 폼 */
.result-chip {
    display: inline-flex; align-items: center; gap: 6px;
    margin-bottom: 12px; padding: 8px 18px;
    border-radius: 999px; background: #fffdf9; border: 1px solid #ecd9af;
    color: var(--gold-deep); font-size: 13px; font-weight: 700;
}
.result-chip i { font-size: 0.92em; }
.field { display: block; text-align: left; margin-top: 16px; }
.field__label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 7px; }
.field input,
.phone select, .phone input {
    width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 11px;
    font-size: 15px; font-family: inherit; color: var(--ink);
    background: #fff; outline: none; transition: border-color .12s ease, box-shadow .12s ease;
}
.field input:focus,
.phone select:focus, .phone input:focus {
    border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185,145,74,.15);
}
.phone { display: flex; align-items: center; gap: 8px; }
.phone select { width: 86px; flex: 0 0 auto; }
.phone input { text-align: center; }
.phone__dash { color: var(--muted); }

.agrees { margin-top: 18px; display: grid; gap: 10px; text-align: left; }
.agree-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agree { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-soft); cursor: pointer; min-width: 0; }
.agree input { width: 18px; height: 18px; accent-color: var(--gold); flex: 0 0 auto; }
.agree em { color: var(--muted); font-style: normal; }
.agree-more {
    flex: 0 0 auto; background: none; border: 0; cursor: pointer; white-space: nowrap;
    color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 0;
}
.agree-more:hover { color: var(--gold-deep); text-decoration: underline; }

.form-error {
    margin-top: 14px; padding: 11px 13px; border-radius: 10px;
    background: #fdeceb; color: #c0392b; font-size: 13px; font-weight: 600; text-align: left;
}

/* =====================================================================
   ⑤ 완료 팝업
   ===================================================================== */
.popup {
    position: fixed; inset: 0; z-index: 50;
    display: grid; place-items: center; padding: 24px;
    background: rgba(40, 36, 30, .55); animation: fadeUp .25s ease both;
}
.popup[hidden] { display: none; }
.popup__panel {
    width: 100%; max-width: 360px; background: var(--surface);
    border-radius: 22px; padding: 32px 26px 24px; text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,.30);
}
.popup__check {
    position: relative; width: 66px; height: 66px; margin: 6px auto 18px;
    display: grid; place-items: center; border-radius: 50%;
    border: 3px solid #d3a94e; color: var(--gold-deep); font-size: 30px;
}
.popup__spark { position: absolute; color: #d8b15c; line-height: 1; pointer-events: none; }
.popup__spark.s1 { top: 26%; left: -16px; font-size: 15px; }
.popup__spark.s2 { top: 15%; right: -18px; font-size: 18px; }
.popup__spark.s3 { top: 66%; left: -4px; font-size: 9px; }
.popup__title { font-size: 21px; font-weight: 800; line-height: 1.35; }
.popup__title b { color: var(--gold-deep); }
.popup__desc { margin-top: 14px; color: var(--ink-soft); font-size: 14px; }
.popup__note { margin-top: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.popup__btn {
    width: 100%; margin-top: 22px; padding: 16px; border: 0; border-radius: 12px;
    background: #55396c; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    transition: opacity .12s ease;
}
.popup__btn:hover { opacity: .92; }
.popup__btn--gold { background: linear-gradient(180deg, #d8952a, #c57908); }

/* 약관 자세히 보기 팝업 */
.terms-panel { max-width: 420px; text-align: left; }
.terms-title { font-size: 17px; font-weight: 800; text-align: center; color: var(--ink); margin-bottom: 14px; }
.terms-body {
    max-height: 52vh; overflow-y: auto; padding-right: 4px;
    font-size: 13px; color: var(--ink-soft); line-height: 1.75;
}
.terms-body b { color: var(--ink); }

/* ⑤ 신청 완료 — 팝업이 아니라 화면 전환(카드) */
#screen-done .card { max-width: 560px; background: var(--surface); }
.done-note {
    display: flex; align-items: flex-start; gap: 11px; text-align: left;
    margin-top: 20px; padding: 16px 18px; border-radius: 14px;
    background: #f3f1f6; color: var(--muted); font-size: 13px; line-height: 1.65;
}
.done-note__ic { width: 19px; height: 19px; margin-top: 1px; flex: 0 0 auto; }

@media (min-width: 861px) {
    #screen-done .card { max-width: 600px; padding: 56px 54px; border-radius: 30px; }
    #screen-done .popup__check { width: 92px; height: 92px; font-size: 42px; margin-bottom: 24px; border-width: 4px; }
    #screen-done .popup__title { font-size: clamp(28px, 3vw, 36px); }
    #screen-done .popup__desc { font-size: clamp(14px, 1.3vw, 16px); margin-top: 16px; }
    #screen-done .done-note { font-size: 14px; padding: 18px 20px; margin-top: 24px; }
    #screen-done .popup__btn { font-size: 17px; padding: 18px; margin-top: 26px; }
}
