/* 본향 집중력 셀프체크 */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-2: #55504a;
  --ink-3: #8a8279;
  --line: #e5e0d8;
  --accent: #1f6f5c;
  --on-accent: #ffffff;
  --accent-soft: #e6f0ec;
  --warn: #b4632a;
  --warn-soft: #fdf0e4;
  --a-color: #2f6f9e;
  --b-color: #8a5cc4;
  --radius: 16px;
  --maxw: 34rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --surface: #1e1c18;
    --ink: #f0ece5;
    --ink-2: #b8b1a7;
    --ink-3: #86807a;
    --line: #302d27;
    --accent: #5fbfa3;
    --on-accent: #10201b;
    --accent-soft: #1b2f2a;
    --warn: #e0a06a;
    --warn-soft: #2c2118;
    --a-color: #6fb0e0;
    --b-color: #b790e8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { line-height: 1.4; letter-spacing: -0.02em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }

.skip {
  position: absolute; left: -9999px;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; border-radius: 8px; }

#main { max-width: var(--maxw); margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.screen { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  * { transition: none !important; }
}

.eyebrow { font-size: .8rem; letter-spacing: .08em; color: var(--accent); font-weight: 700; margin-bottom: .5rem; }
.lede { font-size: 1.05rem; color: var(--ink-2); }
.muted { color: var(--ink-3); font-size: .95rem; }
.fineprint { color: var(--ink-3); font-size: .82rem; line-height: 1.6; }

/* ── 인트로 ── */
.screen--intro { padding-top: 12vh; }
.screen--intro h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); }

/* ── 버튼 ── */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 12px; border: 1px solid transparent;
  padding: .7rem 1.2rem; transition: background .15s, border-color .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--lg { display: block; width: 100%; padding: 1rem; font-size: 1.05rem; margin: 1.5rem 0 1rem; }
.btn--ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }

/* ── 진행바 ── */
.progress { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: .75rem 1.25rem .5rem; }
.progress__bar { max-width: var(--maxw); margin: 0 auto; height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.progress__meta {
  max-width: var(--maxw); margin: .35rem auto 0; display: flex; justify-content: space-between;
  font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

/* ── 문항 ── */
.qmeta { font-size: .8rem; color: var(--ink-3); margin-bottom: .75rem; }
.qtext { font-size: clamp(1.25rem, 4.8vw, 1.55rem); margin-bottom: 1.5rem; min-height: 3.4em; }
.options { display: flex; flex-direction: column; gap: .5rem; }
.opt {
  font: inherit; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
  padding: .9rem 1rem; display: flex; align-items: center; gap: .75rem;
  transition: border-color .15s, background .15s;
}
.opt:hover { border-color: var(--accent); }
.opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt__dot {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); transition: border-color .15s, box-shadow .15s;
}
.opt[aria-checked="true"] .opt__dot { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); }
.quiz-nav { margin-top: 1.5rem; }

/* ── 결과 ── */
.gauge { position: relative; margin: .5rem 0 0; }
.gauge__svg { width: 100%; height: auto; display: block; }
.gauge__track { stroke: var(--line); stroke-width: 14; }
.gauge__fill {
  stroke: var(--accent); stroke-width: 14;
  stroke-dasharray: 289; stroke-dashoffset: 289;
  transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1);
}
.gauge__readout { position: absolute; inset: auto 0 4px; text-align: center; }
.gauge__score { font-size: 2.8rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gauge__max { font-size: 1.1rem; color: var(--ink-3); }
.gauge__band { display: block; font-size: .95rem; font-weight: 700; color: var(--accent); margin-top: .1rem; }
.bandlead { font-size: 1.05rem; text-align: center; color: var(--ink-2); margin: 1rem 0 1.75rem; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
}
.card__title { font-size: .95rem; color: var(--ink-3); font-weight: 700; letter-spacing: .01em; margin-bottom: 1rem; }

.bars { display: flex; flex-direction: column; gap: .9rem; }
.bar__head { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: .35rem; }
.bar__val { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar__track { display: block; height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar__fill { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.bar__fill--a { background: var(--a-color); }
.bar__fill--b { background: var(--b-color); }
.sublabel {
  margin: 1rem 0 0; padding-top: .9rem; border-top: 1px dashed var(--line);
  font-size: .95rem; color: var(--ink-2);
}
.sublabel b { color: var(--ink); }

.card--type { background: var(--accent-soft); border-color: transparent; }
.type__head { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.type__icon { font-size: 2.2rem; line-height: 1; }
.type__name { font-size: 1.3rem; margin: 0; }
.type__tagline { margin: 0; font-size: .92rem; color: var(--ink-2); }
.type__body { margin-bottom: .8rem; }
.type__hint { margin: 0; font-size: .93rem; color: var(--ink-2); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip {
  font-size: .78rem; padding: .25rem .6rem; border-radius: 99px;
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.chip--on { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.actions li { margin: 0; }
.actions label { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; font-size: .98rem; }
.actions input { margin-top: .38rem; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.actions input:checked + span { color: var(--ink-3); text-decoration: line-through; }

.banner { border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1.25rem; }
.banner--warn { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.banner--info { background: var(--surface); border: 1px solid var(--line); }
.banner__title { display: block; margin-bottom: .35rem; font-size: .98rem; }
.banner--warn .banner__title { color: var(--warn); }
.banner__body { margin: 0; font-size: .92rem; color: var(--ink-2); }

.doctor {
  margin: 1.5rem 0; padding: 0 0 0 1rem; border-left: 3px solid var(--accent);
  color: var(--ink-2); font-size: .97rem;
}
.doctor footer { font-size: .85rem; color: var(--ink-3); }

.cta { display: flex; flex-direction: column; gap: .6rem; margin: 1.75rem 0 1rem; }
.cta a {
  display: block; text-align: center; text-decoration: none; font-weight: 700;
  padding: 1rem; border-radius: 12px; font-size: 1.02rem;
}
.cta a.cta--primary { background: var(--accent); color: var(--on-accent); }
.cta a.cta--secondary { background: transparent; color: var(--ink-2); border: 1px solid var(--line); }

.share { display: flex; gap: .6rem; margin-bottom: 1rem; }
.share .btn { flex: 1; }
.disclaimer {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line);
  font-size: .8rem; line-height: 1.65; color: var(--ink-3);
}

/* ── 리드 수집 ── */
.lead__title { font-size: 1.1rem; margin-bottom: .35rem; }
.lead__desc { font-size: .93rem; color: var(--ink-2); margin-bottom: 1.25rem; }
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .85rem; color: var(--ink-2); margin-bottom: .35rem; font-weight: 600; }
.field input {
  font: inherit; width: 100%; padding: .8rem .9rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--warn); }

.consents { margin: 1.1rem 0 .5rem; display: flex; flex-direction: column; gap: .55rem; }
.consent { font-size: .88rem; }
.consent__row { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; }
.consent__row input { margin-top: .3rem; accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.consent details { margin: .3rem 0 0 1.6rem; }
.consent summary { cursor: pointer; color: var(--ink-3); font-size: .8rem; }
.consent details p { margin: .5rem 0 0; font-size: .8rem; line-height: 1.6; color: var(--ink-3); }
.lead__error { color: var(--warn); font-size: .87rem; margin: .5rem 0 0; }
.lead__done { margin: 0; font-size: .95rem; color: var(--accent); font-weight: 600; text-align: center; padding: .5rem 0; }
.lead button[disabled] { opacity: .55; cursor: default; }

/* ── 결과 잠금 해제 화면 ── */
.screen--gate { padding-top: 4vh; }
.gate__title { font-size: clamp(1.45rem, 5.5vw, 1.9rem); margin-bottom: .5rem; }
.screen--gate .lede { margin-bottom: 1.75rem; }
.consent--optional { font-size: .8rem; color: var(--ink-3); }
.consent--optional .consent__row input { width: 15px; height: 15px; margin-top: .25rem; }
.consent--optional summary { font-size: .75rem; }
