/* ──────────────────────────────────────────────────────────────
   blog-landing — 스크롤형 롱폼 랜딩
   기존 프로젝트 토큰(배경 #f4f5f7 · 흰 카드 · 레드 포인트)을 계승하고
   롱폼에 필요한 섹션 리듬과 스크롤 인터랙션을 더했다.
─────────────────────────────────────────────────────────────── */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-sub: #6b7280;
  --ink-faint: #9aa0a6;
  --line: #e4e6ea;
  --point: #e02424;
  --point-dark: #c31d1d;
  --navy: #101828;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 모바일에서만 줄바꿈하는 <br> */
.br-mo {
  display: none;
}

.inner {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.inner-narrow {
  max-width: 520px;
}

/* ── 공통: 버튼 ─────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 24px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: -0.01em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--point);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(224, 36, 36, 0.35);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-180%) skewX(-22deg);
  animation: cta-shine 3.6s ease-in-out infinite;
}

.btn-primary:hover {
  background: var(--point-dark);
  box-shadow: 0 8px 24px rgba(224, 36, 36, 0.45);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.995);
}

@keyframes cta-shine {
  0% { transform: translateX(-180%) skewX(-22deg); }
  24% { transform: translateX(320%) skewX(-22deg); }
  100% { transform: translateX(320%) skewX(-22deg); }
}

/* ── 1. 히어로 ──────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, #16203a 0%, #101828 55%, #0b111f 100%);
  color: #ffffff;
  padding: 56px 0 52px;
  text-align: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffd7d7;
  background: rgba(224, 36, 36, 0.18);
  border: 1px solid rgba(224, 36, 36, 0.4);
  padding: 6px 12px;
  border-radius: 999px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5a5a;
  animation: badge-pulse 1.6s infinite;
}

@keyframes badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0.6); }
  70% { box-shadow: 0 0 0 7px rgba(255, 90, 90, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 90, 90, 0); }
}

.hero h1 {
  margin-top: 18px;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.hero h1 em {
  font-style: normal;
  color: #ff6b6b;
}

.hero-sub {
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.65;
  color: #b8c0cf;
}

.hero .btn {
  max-width: 380px;
  margin: 26px auto 0;
}

.hero-note {
  margin-top: 12px;
  font-size: 13px;
  color: #8d97a8;
}

/* ── 공통: 섹션 ─────────────────────────────────────────────── */
.section {
  padding: 56px 0;
}

.section-alt {
  background: var(--surface);
}

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--point);
  text-align: center;
}

.section h2 {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-align: center;
}

.section-sub {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-sub);
  text-align: center;
}

/* ── 접근성: 화면에는 없지만 스크린리더는 읽는 라벨 ─────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 2. 종목 진단 위젯 ──────────────────────────────────────── */
.section-diag {
  background: var(--surface);
}

.diag-card {
  margin-top: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
}

.diag-search {
  display: flex;
  gap: 8px;
}

.diag-field {
  position: relative;
  flex: 1;
  min-width: 0;
}

#diagInput {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #d5d7dd;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#diagInput:focus {
  border-color: var(--point);
  box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.12);
}

.btn-diag {
  flex: 0 0 auto;
  min-height: 52px;
  padding: 0 20px;
  font-size: 16px;
  background: var(--navy);
  color: #ffffff;
}

.btn-diag:hover {
  background: #1d2740;
}

/* 자동완성 드롭다운 */
.diag-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 264px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.diag-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  font-size: 15px;
  cursor: pointer;
  border-top: 1px solid #f0f2f4;
}

.diag-opt:first-child {
  border-top: 0;
}

.diag-opt:hover,
.diag-opt.is-active {
  background: #f6f7f9;
}

.diag-opt-name {
  font-weight: 600;
}

.diag-opt-sector {
  font-size: 12px;
  color: var(--ink-sub);
}

.diag-hint {
  display: none;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--point);
}

.diag-hint.is-shown {
  display: block;
}

/* 진단 결과 */
.diag-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.diag-result.is-shown {
  animation: diag-in 0.35s ease both;
}

@keyframes diag-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.diag-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.diag-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.diag-title strong {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.diag-sector {
  font-size: 11.5px;
  color: var(--ink-sub);
  background: #eceef1;
  padding: 3px 7px;
  border-radius: 5px;
}

.diag-verdict {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}

.v-good {
  color: #1f9d55;
  background: #e6f6ed;
}

.v-mid {
  color: #b26a00;
  background: #fdf1de;
}

.v-low {
  color: var(--point);
  background: #fdecec;
}

.diag-score {
  flex: 0 0 auto;
  text-align: right;
  line-height: 1.15;
}

.diag-score span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.diag-score b {
  font-size: 30px;
  font-weight: 800;
  color: var(--point);
  font-variant-numeric: tabular-nums;
}

.diag-rows {
  list-style: none;
  margin-top: 16px;
}

.diag-rows li {
  display: grid;
  grid-template-columns: 46px auto 1fr;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 0;
  border-top: 1px solid #edeff2;
}

.diag-rows li:first-child {
  border-top: 0;
}

.diag-row-label {
  font-size: 13.5px;
  font-weight: 700;
}

.diag-row-level {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-sub);
}

.diag-row-note {
  grid-column: 2 / -1;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-sub);
}

.diag-gauge {
  display: inline-flex;
  gap: 3px;
}

.diag-gauge i {
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: #dfe2e7;
}

.diag-gauge i.on {
  background: var(--point);
}

/* 잠금 영역 — 값 자체를 만들지 않고 자리만 보여준다 */
.diag-lock {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px dashed #d5d9df;
  border-radius: 10px;
}

.diag-lock-rows {
  filter: blur(2.5px);
  user-select: none;
  pointer-events: none;
}

.diag-lock-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13.5px;
}

.diag-lock-rows span {
  color: var(--ink-sub);
}

.diag-cta {
  margin-top: 12px;
}

.diag-disclaimer {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-sub);
  text-align: center;
}

/* 신청 폼 위에 표시되는 "진단한 종목" 배너 */
.diag-picked {
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #1d2740;
  background: #eef2f8;
  border-radius: 8px;
  text-align: center;
}

/* ── 3. 문제 제기 ───────────────────────────────────────────── */
.problem-list {
  list-style: none;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problem-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.problem-mark {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  color: var(--point);
  background: #fdecec;
  padding: 4px 8px;
  border-radius: 7px;
  line-height: 1.2;
}

.problem-list strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.problem-list p {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-sub);
}

/* ── 4·5. 카드 그리드 ───────────────────────────────────────── */
.grid {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
}

.section-alt .card {
  background: var(--bg);
}

.card-icon {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.card h3 {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-sub);
}

.card-benefit {
  background: var(--surface);
  text-align: left;
}

.card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  background: var(--point);
  border-radius: 50%;
}

/* ── 6. 진행 절차 ───────────────────────────────────────────── */
.steps {
  list-style: none;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  counter-reset: step;
}

.steps li {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 800;
  color: var(--point);
  background: #fdecec;
  border-radius: 50%;
  margin-bottom: 10px;
}

.steps strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.steps p {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-sub);
}

/* ── 7. 신청 폼 ─────────────────────────────────────────────── */
/* 페이지의 마지막 섹션.
   하단 고정 CTA가 폼을 가리지 않도록 여백을 body가 아닌 이 섹션 안에 둔다.
   (body에 두면 배경색이 드러나 네이비 섹션 아래 회색 띠가 생긴다) */
.section-apply {
  background: linear-gradient(160deg, #16203a 0%, #101828 100%);
  color: #ffffff;
  scroll-margin-top: 20px;
  padding-bottom: 140px;
}

.eyebrow-light {
  color: #ff8b8b;
}

.section-sub-light {
  color: #b8c0cf;
}

.form-card {
  margin-top: 26px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
  padding: 26px 22px;
}

#leadForm {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 13px;
  font-weight: 700;
  margin-top: 10px;
}

input[type="text"],
input[type="tel"] {
  height: 52px;
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid #d5d7dd;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="tel"]:focus {
  border-color: var(--point);
  box-shadow: 0 0 0 3px rgba(224, 36, 36, 0.12);
}

input.invalid {
  border-color: var(--point);
  background: #fffafa;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: #3f4754;
  cursor: pointer;
}

.check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--point);
  cursor: pointer;
}

.check.invalid span {
  color: var(--point);
}

.check b {
  font-weight: 800;
}

/* 고지 문구는 실제로 읽혀야 하므로 명암비를 확보한다 (WCAG AA 기준) */
.privacy-note {
  margin-top: 14px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-sub);
}

.btn-submit {
  margin-top: 18px;
  background: var(--point);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(224, 36, 36, 0.3);
}

.btn-submit:hover {
  background: var(--point-dark);
}

.btn-submit:disabled {
  background: #c9ccd2;
  box-shadow: none;
  cursor: not-allowed;
}

.message {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  min-height: 18px;
}

.message.success {
  color: #1f9d55;
}

.message.error {
  color: var(--point);
}

/* 제출 완료 화면 */
.form-done {
  text-align: center;
  padding: 12px 0 6px;
}

.done-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  background: #1f9d55;
  border-radius: 50%;
  margin-bottom: 14px;
}

.form-done strong {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.form-done p {
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-sub);
}

/* ── 하단 고정 CTA ──────────────────────────────────────────── */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.sticky-cta .btn {
  max-width: 480px;
  margin: 0 auto;
}

/* 폼이 화면에 들어오면 아래로 숨김 */
.sticky-cta.is-hidden {
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
}

/* ── 스크롤 등장 효과 ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── 실시간 피드 위젯 여백 (live-feed.js가 주입하는 .lf-wrap) ── */
#liveFeedMount {
  margin-top: 26px;
}

#liveFeedMount .lf-wrap {
  margin: 0;
  background: var(--bg);
}

/* ── 모바일 ─────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .br-mo {
    display: inline;
  }

  .grid-4,
  .grid-3,
  .steps {
    grid-template-columns: 1fr;
  }

  /* 세로 배치에서는 아이콘을 왼쪽에 두고 제목·본문을 오른쪽에 쌓는다 */
  .card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 4px 14px;
    text-align: left;
    padding: 18px;
  }

  .card-icon,
  .card-num {
    grid-row: span 2;
    align-self: center;
  }

  .card h3,
  .card p {
    margin-top: 0;
  }

  .steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    text-align: left;
    align-items: center;
  }

  .step-num {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .steps p {
    margin-top: 0;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 40px 0 40px;
  }

  .hero h1 {
    font-size: 27px;
    margin-top: 16px;
  }

  .hero-sub {
    font-size: 15px;
  }

  .section {
    padding: 44px 0;
  }

  /* shorthand로 덮이므로 마지막 섹션 여백을 다시 지정 */
  .section-apply {
    padding-bottom: 132px;
  }

  .section h2 {
    font-size: 22px;
  }

  .section-sub {
    font-size: 14.5px;
  }

  .form-card {
    padding: 22px 18px;
  }

  .btn {
    min-height: 52px;
    font-size: 16px;
  }

  /* 좁은 화면에서는 입력창과 버튼을 세로로 쌓는다 */
  .diag-card {
    padding: 16px 14px;
  }

  .diag-search {
    flex-direction: column;
  }

  .btn-diag {
    width: 100%;
  }

  .diag-score b {
    font-size: 26px;
  }
}

/* 데스크톱에서는 히어로 CTA가 충분히 크므로 고정 바를 감춘다 */
@media (min-width: 900px) {
  .sticky-cta {
    display: none;
  }

  /* 고정 바가 없으니 마지막 섹션 여백도 평소대로 되돌린다 */
  .section-apply {
    padding-bottom: 56px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn-primary::before,
  .badge-dot {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .diag-result.is-shown {
    animation: none;
  }
}
