/* PASコンパス — 回答UI スタイル（ビジネス／プレミアム）
   紺(ネイビー)×ゴールドの落ち着いた高級感。多数の設問をストレスなく、
   1画面1問・大きなタップ領域・広い行間・読みやすい改行を基本方針とする。 */

:root {
  --bg: #eef1f6;
  --bg-2: #e6eaf1;
  --ink: #0b2545;
  --ink-soft: #566277;
  --ink-mute: #8a94a6;
  --line: #dde3ec;
  --line-soft: #e9edf3;
  --navy: #16324f;
  --navy-2: #204a70;
  --navy-soft: #eaf0f6;
  --gold: #a9853f;
  --gold-2: #c6a35c;
  --gold-soft: #f5efe2;
  --most: #1a6b57;
  --most-soft: #e6f1ed;
  --least: #9c5738;
  --least-soft: #f4ebe4;
  --danger: #b3402f;
  --card: #ffffff;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.05);
  --shadow: 0 2px 6px rgba(11, 37, 69, 0.06), 0 18px 40px rgba(11, 37, 69, 0.10);
  --maxw: 680px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(1200px 480px at 50% -160px, #ffffff 0%, rgba(255,255,255,0) 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.9;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 150px; min-height: 100vh; }
.loading { text-align: center; color: var(--ink-soft); padding: 90px 0; }

/* ---- 見出し・テキスト ---- */
h1 { font-size: 1.55rem; line-height: 1.5; margin: 0 0 10px; letter-spacing: .01em; font-weight: 800; }
h2 { font-size: 1.28rem; margin: 0 0 14px; letter-spacing: .01em; font-weight: 700; }
h3 { line-height: 1.7; }
p { text-wrap: pretty; }
.muted { color: var(--ink-soft); }
.small { font-size: .86rem; line-height: 1.8; }
.center { text-align: center; }

/* ブランド */
.brandmark { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; color: var(--navy);
  letter-spacing: .06em; font-size: 1.18rem; }
.brandmark .dot {
  position: relative; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #24446a, #12293f);
  box-shadow: 0 0 0 2px var(--gold-2), 0 2px 6px rgba(11,37,69,.25); flex: 0 0 auto;
}
.brandmark .dot::before { /* コンパスの針(ダイヤ) */
  content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px;
  background: linear-gradient(135deg, var(--gold-2), var(--gold)); transform: rotate(45deg);
  border-radius: 1px;
}
.eyebrow { font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: var(--gold);
  font-weight: 700; margin: 0 0 10px; }

/* ---- カード ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 24px; margin: 0 0 18px;
}
.card.pad-lg { padding: 34px 30px; }
.card.accent-top { border-top: 3px solid var(--gold); }

/* ---- イントロ ---- */
.intro-hero { text-align: center; padding: 18px 0 10px; }
.intro-hero .brandmark { font-size: 1.9rem; }
.intro-hero .brandmark .dot { width: 34px; height: 34px; }
.intro-hero .brandmark .dot::before { width: 11px; height: 11px; }
.intro-hero .lead { color: var(--ink-soft); margin-top: 12px; font-size: 1rem; max-width: 30em;
  margin-left: auto; margin-right: auto; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); margin: 22px 0; }

.notice-list { margin: 14px 0 0; padding: 0; list-style: none; }
.notice-list li { position: relative; padding: 13px 0 13px 30px; border-top: 1px solid var(--line-soft); line-height: 1.85; }
.notice-list li:first-child { border-top: 0; }
.notice-list li::before {
  content: ""; position: absolute; left: 3px; top: 20px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold-soft); box-shadow: inset 0 0 0 2px var(--gold);
}
.notice-list li b { color: var(--navy); font-weight: 700; }

.meta-pill { display: inline-block; font-size: .72rem; letter-spacing: .04em; color: var(--navy);
  background: var(--navy-soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin: 2px 4px 2px 0; }

/* ---- フォーム(プロフィール) ---- */
.field { margin: 0 0 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--navy); letter-spacing: .01em; }
.field .req { color: var(--gold); font-size: .72rem; font-weight: 700; margin-left: 8px; letter-spacing: .08em; }
.field input {
  width: 100%; padding: 14px 15px; font-size: 1rem; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 11px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(32,74,112,.12); }
.field .err-msg { color: var(--danger); font-size: .82rem; margin-top: 6px; display: none; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .err-msg { display: block; }

/* ---- ボタン ---- */
.btn {
  appearance: none; cursor: pointer; font: inherit; font-weight: 700; letter-spacing: .02em;
  border-radius: 12px; padding: 15px 24px; border: 1.5px solid transparent;
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--navy-2), var(--navy)); color: #fff;
  box-shadow: 0 6px 18px rgba(22,50,79,.28), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { box-shadow: 0 9px 24px rgba(22,50,79,.34), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:disabled { background: #aab4c2; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy-2); background: #fbfcfe; }
.btn-block { display: block; width: 100%; }
.btn-lg { padding: 17px 26px; font-size: 1.05rem; }

.btn-row { display: flex; gap: 12px; margin-top: 22px; }
.btn-row .btn { flex: 1; }
.btn-row .btn-back { flex: 0 0 auto; }

/* ---- 質問カード共通 ---- */
.q-kicker { font-size: .74rem; color: var(--gold); font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.q-scene { color: var(--ink-mute); font-size: .92rem; margin: 4px 0 0; }
.q-title { font-size: 1.28rem; line-height: 1.75; margin: 12px 0 24px; font-weight: 700; color: var(--navy); text-wrap: pretty; }

/* ---- 尺度(1-5 / 0-5) ---- */
.scale-labels { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.scale-labels .lab { flex: 1; font-size: .92rem; line-height: 1.7; color: var(--ink); background: var(--navy-soft);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; }
.scale-labels .lab.right { text-align: right; }
.scale-labels .lab b { color: var(--navy); font-weight: 800; }

.scale-opts { display: grid; gap: 11px; }
.scale-opts.n5 { grid-template-columns: repeat(5, 1fr); }
.scale-opts.n6 { grid-template-columns: repeat(3, 1fr); }
.opt {
  cursor: pointer; text-align: center; border: 1.5px solid var(--line); background: #fff; border-radius: 13px;
  padding: 16px 6px; user-select: none; transition: border-color .12s, background .12s, transform .06s, box-shadow .12s;
}
.opt:hover { border-color: var(--navy-2); }
.opt:active { transform: translateY(1px); }
.opt .num { display: block; font-size: 1.4rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.opt .lbl { display: block; font-size: .72rem; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.opt.selected { border-color: var(--navy); background: linear-gradient(180deg, var(--navy-2), var(--navy));
  box-shadow: 0 6px 16px rgba(22,50,79,.26); }
.opt.selected .num { color: #fff; }
.opt.selected .lbl { color: rgba(255,255,255,.82); }
.scale-hint { text-align: center; color: var(--ink-mute); font-size: .82rem; margin-top: 14px; }

/* ---- 性質(2ステップ: 最も当てはまる → 最も当てはまらない) ---- */
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.q-count { font-size: .82rem; color: var(--ink-mute); font-weight: 700; letter-spacing: .04em; }
.step-badge { display: inline-flex; align-items: center; gap: 9px; font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  border-radius: 999px; padding: 6px 14px; }
.step-badge .step-mode { font-size: .74rem; letter-spacing: .02em; font-weight: 800; padding-left: 9px; }
.step-badge.most { color: var(--most); background: var(--most-soft); border: 1px solid #cfe6dd; }
.step-badge.most .step-mode { border-left: 1px solid #bcdccf; }
.step-badge.least { color: var(--least); background: var(--least-soft); border: 1px solid #ecdccf; }
.step-badge.least .step-mode { border-left: 1px solid #e2ccbb; }

/* モード（当てはまる/当てはまらない）で枠内の背景色を切り替え、切替を明示 */
.card.mode-most { background: linear-gradient(180deg, #eaf5f0 0%, #ffffff 42%); border-color: #cfe6dd; }
.card.mode-least { background: linear-gradient(180deg, #f8ede6 0%, #ffffff 42%); border-color: #ecdccf; }

.step-title { font-size: 1.34rem; line-height: 1.6; margin: 15px 0 6px; }
.q-sub { color: var(--ink-soft); font-size: .92rem; line-height: 1.75; margin: 0 0 18px; }

.opt-list { display: flex; flex-direction: column; gap: 11px; }
.trait-choice {
  display: flex; align-items: center; gap: 15px; border: 1.5px solid var(--line); border-radius: 13px;
  padding: 16px 16px; background: #fff; cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s, transform .06s;
}
.trait-choice:hover { border-color: var(--navy-2); }
.trait-choice:active { transform: translateY(1px); }
.trait-choice .letter { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; background: var(--navy-soft);
  color: var(--navy); font-weight: 800; font-size: 1.08rem; display: flex; align-items: center; justify-content: center; }
.trait-choice .ctext { flex: 1; line-height: 1.7; font-size: 1.02rem; color: var(--ink); }
.trait-choice.sel-most { border-color: var(--most); background: var(--most-soft); box-shadow: 0 4px 14px rgba(26,107,87,.14); }
.trait-choice.sel-most .letter { background: var(--most); color: #fff; }
.trait-choice.sel-least { border-color: var(--least); background: var(--least-soft); box-shadow: 0 4px 14px rgba(156,87,56,.14); }
.trait-choice.sel-least .letter { background: var(--least); color: #fff; }
.trait-choice.least-choice:hover { border-color: var(--least); }
.trait-choice.locked { cursor: default; }
.trait-choice.locked:active { transform: none; }

.locked-wrap { margin-bottom: 16px; }
.locked-label { font-size: .82rem; font-weight: 700; color: var(--most); margin-bottom: 8px; }
.mk-most { color: var(--most); font-weight: 800; }
.mk-least { color: var(--least); font-weight: 800; }

.sel-status { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.85); padding: 14px 16px; }
.sel-title { font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .04em; }
.sel-item { padding: 9px 0; border-top: 1px dashed var(--line); }
.sel-item:first-of-type { border-top: 0; }
.sel-k { font-size: .8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 3px; }
.sel-v { font-size: .95rem; line-height: 1.65; color: var(--ink); }
.sel-v b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 6px; font-weight: 800; font-size: .82rem; margin-right: 8px; color: #fff; vertical-align: middle; }
.sel-v b.mk-most { background: var(--most); }
.sel-v b.mk-least { background: var(--least); }
.sel-v .unsel { color: var(--ink-mute); font-weight: 600; }

/* ---- 進捗バー ---- */
.progress-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  padding: 12px 0 max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(11,37,69,.05);
}
.progress-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.progress-meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); margin-bottom: 8px; letter-spacing: .02em; }
.progress-track { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), var(--gold-2)); transition: width .3s ease; }

/* ---- 確認・完了 ---- */
.review-line { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.review-line:first-child { border-top: 0; }
.review-line .k { color: var(--ink-soft); }
.review-line .v { font-weight: 700; color: var(--navy); text-align: right; }

.done-mark { width: 84px; height: 84px; border-radius: 50%; margin: 8px auto 18px;
  background: var(--most-soft); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #cfe6dd; }
.done-mark svg { width: 42px; height: 42px; stroke: var(--most); }

.status-msg { text-align: center; margin-top: 16px; font-weight: 600; }
.status-msg.err { color: var(--danger); }

.spinner { width: 22px; height: 22px; border: 3px solid var(--navy-soft); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- レスポンシブ ---- */
@media (max-width: 480px) {
  #app { padding: 22px 15px 160px; }
  h1 { font-size: 1.38rem; }
  .q-title { font-size: 1.16rem; }
  .card.pad-lg { padding: 26px 20px; }
  .opt .num { font-size: 1.22rem; }
  .scale-labels { flex-direction: column; gap: 9px; }
  .scale-labels .lab.right { text-align: left; }
  .step-title { font-size: 1.18rem; }
  .trait-choice { padding: 14px 13px; gap: 12px; }
  .trait-choice .letter { width: 34px; height: 34px; font-size: 1rem; }
  .trait-choice .ctext { font-size: .98rem; }
}
