/* ==========================================================
   「あなたの指示、伝わってません」診断 — JOL Design System 踏襲
   tokens: JOL UI (orange #ff6b1a / Noto Sans JP + DM Sans)
   ベースは育成就労シミュレーターと共通。診断/クイズ/結果を追加。
   ========================================================== */
:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e8e8f0;
  --border-2: #dde6ef;
  --primary: #ff6b1a;
  --primary-btn: #ff7020;
  --primary-soft: #ffece2;
  --primary-soft-border: rgba(255, 107, 26, 0.22);
  --ok: #00db6b;
  --ok-soft: #e5f9ed;
  --danger: #f6182f;
  --danger-soft: #ffe9e9;
  --warn: #f59e0b;
  --warn-soft: #fff5e6;
  --info: #2f6df6;
  --info-soft: #eaf1ff;
  --text: #1b1b1b;
  --text-dark: #1a1a2e;
  --text-muted: #8a8a99;
  --text-soft: #5b5b6b;
  --track: rgba(0, 0, 0, 0.07);
  --orange-shadow: 0 6px 20px 0 rgba(255, 107, 26, 0.3);
  --card-shadow: 0 2px 14px rgba(20, 20, 50, 0.05);

  --font-ja: "Noto Sans JP", sans-serif;
  --font-en: "DM Sans", "Noto Sans JP", sans-serif;

  --r-card: 16px;
  --r-option: 12px;
  --r-badge: 8px;
  --r-button: 9px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.en { font-family: var(--font-en); }

.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  position: relative;
  z-index: 1;
}

/* PC: 左右をブランド背景 + JOLウォーターマークで埋める */
@media (min-width: 960px) {
  body {
    background: url("assets/bg-desktop.jpg") center top / cover no-repeat fixed #ff6b1a;
  }
  .app { box-shadow: 0 0 48px rgba(0, 0, 0, 0.18); }
  body::before, body::after {
    content: "";
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(200px, 40vw - 260px, 560px);
    aspect-ratio: 599 / 220;
    background: url("assets/watermark.svg") center / contain no-repeat;
    z-index: 0;
    pointer-events: none;
  }
  body::before { left: 2vw; }
  body::after { right: 2vw; }
}

/* ---------- ヘッダー ---------- */
.top-header {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 40px; margin-bottom: 20px;
}
.header-logo { height: 22px; width: auto; }
.header-basis { font-size: 10.5px; color: var(--text-muted); text-align: right; line-height: 1.4; }
.header-basis b { color: var(--primary); font-weight: 700; }

/* ---------- screen 共通 ---------- */
.screen { display: flex; flex-direction: column; flex: 1; animation: fadeIn 0.35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: var(--font-en); font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; color: var(--primary); text-transform: uppercase;
}
.h1 { font-size: 25px; font-weight: 700; line-height: 1.4; margin: 8px 0 12px; color: var(--text-dark); }
.h1 .accent { color: var(--primary); }
.lead { font-size: 14px; line-height: 1.85; color: var(--text-soft); }
.lead b { color: var(--text); }

/* ---------- intro ---------- */
.intro-hero {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 24px 22px; box-shadow: var(--card-shadow); margin: 18px 0 16px;
}
.intro-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.ibadge {
  font-size: 11.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); border: 1px solid var(--primary-soft-border);
  border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 5px;
}
.ibadge .en { font-size: 11px; }

/* サンプル問題チラ見せ (F-101) */
.sample-q {
  background: var(--surface-2); border: 1px dashed var(--border-2);
  border-radius: var(--r-option); padding: 16px 16px 14px; margin-top: 4px;
}
.sample-q .sq-tag {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-en);
}
.sample-q .sq-text { font-size: 14px; font-weight: 700; line-height: 1.6; color: var(--text-dark); margin: 6px 0 12px; }
.sample-q .sq-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.sample-q .sq-opt {
  font-size: 12.5px; font-weight: 600; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-badge); padding: 9px 8px; text-align: center;
}

.counter {
  text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 14px;
}
.counter b { font-family: var(--font-en); font-weight: 700; color: var(--primary); font-size: 15px; }

/* ---------- buttons ---------- */
.btn-primary {
  display: block; width: 100%; min-height: 56px; border: none;
  border-radius: var(--r-button); background: var(--primary-btn); color: #fff;
  font-weight: 700; font-size: 16px; box-shadow: var(--orange-shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:active { transform: scale(0.985); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; cursor: default; }
.btn-primary .btn-sub { display: block; font-size: 11px; font-weight: 400; opacity: 0.9; font-family: var(--font-en); margin-top: 2px; }

.btn-secondary {
  display: block; width: 100%; min-height: 52px;
  border: 1.5px solid var(--primary); border-radius: var(--r-button);
  background: #fff; color: var(--primary); font-weight: 700; font-size: 15px;
  transition: transform 0.15s ease;
}
.btn-secondary:active { transform: scale(0.985); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none; color: var(--text-muted);
  font-size: 13px; font-weight: 500; padding: 10px 4px; width: 100%;
}
.btn-ghost:hover { color: var(--primary); }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ---------- 進捗バー (F-303) ---------- */
.progress { margin: 2px 0 18px; }
.progress-top {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px;
}
.progress-count { font-family: var(--font-en); font-size: 13px; font-weight: 700; color: var(--text-dark); }
.progress-count .cur { color: var(--primary); font-size: 17px; }
.progress-axis { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.progress-track { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width 0.4s var(--ease-out); }

/* ---------- クイズ (S-03) ---------- */
.q-badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.q-badge.quiz { background: var(--info-soft); color: var(--info); }
.q-badge.self { background: var(--primary-soft); color: var(--primary); }
.q-text {
  font-size: 19px; font-weight: 700; line-height: 1.55; color: var(--text-dark);
  margin-bottom: 20px;
}
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1.5px solid var(--border); border-radius: var(--r-option);
  background: var(--surface); padding: 16px 16px; font-size: 15px; font-weight: 600;
  color: var(--text); line-height: 1.5; box-shadow: var(--card-shadow);
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.option:active { transform: scale(0.99); }
.option:hover { border-color: var(--primary-soft-border); }
.option .mark {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border-2); display: grid; place-items: center;
  font-family: var(--font-en); font-weight: 700; font-size: 13px; color: var(--text-muted);
}
/* 回答後の色分け (N-04: 色のみに依存しない=記号併記) */
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); color: #067a41; }
.option.is-correct .mark { border-color: var(--ok); background: var(--ok); color: #fff; }
.option.is-chosen-wrong { border-color: var(--danger); background: var(--danger-soft); color: #a30d1c; }
.option.is-chosen-wrong .mark { border-color: var(--danger); background: var(--danger); color: #fff; }
.option.is-chosen { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.option.is-chosen .mark { border-color: var(--primary); background: var(--primary); color: #fff; }
.option.dim { opacity: 0.55; }
.option:disabled { cursor: default; }

/* ---------- 解説カード (S-04) ---------- */
.reveal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--card-shadow); overflow: hidden; margin-top: 16px;
  animation: fadeIn 0.35s ease both;
}
.reveal-head {
  padding: 14px 18px; display: flex; align-items: center; gap: 10px;
  font-weight: 700; color: #fff;
}
.reveal-head.correct { background: linear-gradient(135deg, #22d67e 0%, var(--ok) 100%); }
.reveal-head.wrong   { background: linear-gradient(135deg, #ff9a3d 0%, var(--primary) 100%); }
.reveal-head.self    { background: linear-gradient(135deg, #ff9a3d 0%, var(--primary) 100%); }
.reveal-head .rh-icon { font-size: 18px; }
.reveal-head .rh-text { font-size: 15px; }
.reveal-body { padding: 16px 18px 4px; display: flex; flex-direction: column; gap: 14px; }
.rev-block { display: flex; gap: 11px; }
.rev-block .ri {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: var(--r-badge);
  display: grid; place-items: center; font-size: 13px;
  background: var(--primary-soft);
}
.rev-block .rc { flex: 1; }
.rev-block .rlabel { font-size: 10.5px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em; margin-bottom: 3px; }
.rev-block .rval { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.rev-block .rval b { color: var(--primary); }
.rev-block.answer .rval { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.rev-block.point { background: var(--primary-soft); border-radius: var(--r-option); padding: 12px 13px; margin: 2px 0 0; }
.rev-block.point .ri { background: #fff; }
.rev-note {
  font-size: 10.5px; color: var(--text-muted); line-height: 1.6;
  border-top: 1px dashed var(--border); margin: 4px 18px 0; padding: 10px 0 14px;
}
.reveal-actions { padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 9px; }
.mini-share {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: none; border: none; padding: 6px;
}
.mini-share:hover { color: var(--primary); }

/* ---------- 診断中演出 (S-05) ---------- */
.loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; }
.loading .spin {
  width: 62px; height: 62px; border-radius: 50%;
  border: 5px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin 0.85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading .l-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.loading .bubbles { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.bubble {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 11px 15px; font-size: 13px; color: var(--text-soft); line-height: 1.5;
  box-shadow: var(--card-shadow); text-align: left; opacity: 0;
  animation: bubbleIn 0.5s var(--ease-out) forwards;
}
.bubble b { color: var(--primary); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- 結果 (S-06) ---------- */
.result-head {
  background: linear-gradient(135deg, #ff8a3d 0%, var(--primary) 100%);
  color: #fff; border-radius: var(--r-card); padding: 26px 22px 24px;
  box-shadow: var(--orange-shadow); text-align: center; position: relative; overflow: hidden;
}
.result-head::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% -10%, rgba(255,255,255,0.35), transparent 55%);
  pointer-events: none;
}
.result-head .r-eyebrow { font-size: 11.5px; font-weight: 700; opacity: 0.92; letter-spacing: 0.06em; }
.result-head .r-emoji { font-size: 52px; line-height: 1; margin: 8px 0 6px; }
.result-head .r-type { font-size: 24px; font-weight: 700; letter-spacing: 0.01em; }
.result-head .r-score {
  font-family: var(--font-en); font-weight: 700; margin: 14px 0 2px; line-height: 1;
}
.result-head .r-score .num { font-size: 66px; }
.result-head .r-score .pct { font-size: 26px; }
.result-head .r-score-label { font-size: 12px; opacity: 0.92; }
.result-head .r-catch {
  font-size: 14px; font-weight: 700; line-height: 1.6; margin-top: 14px;
  background: rgba(255,255,255,0.18); border-radius: var(--r-option); padding: 11px 14px;
  backdrop-filter: blur(4px);
}

/* レーダーチャート */
.radar-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--card-shadow); padding: 18px; margin-top: 16px;
}
.radar-card .rc-title { font-size: 13px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.radar-card .rc-title::before { content: ""; width: 3px; height: 14px; background: var(--primary); border-radius: 2px; }
.radar-wrap { display: flex; justify-content: center; }
.radar-wrap canvas { width: 260px; height: 260px; max-width: 100%; }
.axis-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 8px; }
.axis-row { font-size: 12px; }
.axis-row .ax-top { display: flex; justify-content: space-between; margin-bottom: 4px; }
.axis-row .ax-name { font-weight: 700; color: var(--text-dark); }
.axis-row .ax-val { font-family: var(--font-en); font-weight: 700; color: var(--primary); }
.axis-row .ax-bar { height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.axis-row .ax-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.6s var(--ease-out); }

.type-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--card-shadow); padding: 18px 20px; margin-top: 16px;
  font-size: 13.5px; line-height: 1.85; color: var(--text-soft);
}

/* セクションラベル */
.section-label {
  font-size: 13px; font-weight: 700; color: var(--text-dark);
  margin: 24px 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-label::before { content: ""; width: 3px; height: 15px; background: var(--primary); border-radius: 2px; }

/* シェアブロック (F-5xx) */
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border-radius: var(--r-button); border: 1.5px solid var(--border);
  background: var(--surface); font-size: 14px; font-weight: 700; color: var(--text-dark);
  box-shadow: var(--card-shadow); transition: transform 0.15s ease;
}
.share-btn:active { transform: scale(0.985); }
.share-btn .sicon { width: 20px; height: 20px; display: grid; place-items: center; }
.share-btn.x { background: #000; color: #fff; border-color: #000; }
.share-btn.line { background: #06c755; color: #fff; border-color: #06c755; }
.share-btn.save { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.share-btn.copy { color: var(--text-soft); }
.share-btn.full { grid-column: 1 / -1; }
.share-canvas { display: none; }

/* ---------- CTA / gate (F-6xx / F-7xx) ---------- */
.gate {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 22px; margin-top: 16px; box-shadow: var(--card-shadow);
}
.gate .g-eyebrow { font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: 0.06em; }
.gate h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin: 4px 0 8px; line-height: 1.5; }
.gate .g-lead { font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin-bottom: 16px; }
.report-teaser { list-style: none; display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.report-teaser li { font-size: 12.5px; line-height: 1.6; color: var(--text-soft); padding-left: 22px; position: relative; }
.report-teaser li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 700;
  font-size: 12px; width: 16px; height: 16px;
}
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--text-dark); display: flex; align-items: center; gap: 8px; }
.req { font-size: 10px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 4px; padding: 1px 6px; }
.opt { font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--track); border-radius: 4px; padding: 1px 6px; }
.input {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-option);
  background: var(--surface); font-size: 15px; color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease; -webkit-appearance: none; appearance: none;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.error .input { border-color: var(--danger); }
.field-err { font-size: 11.5px; color: var(--danger); font-weight: 500; display: none; }
.field.error .field-err { display: block; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--text-soft); line-height: 1.6; margin-top: 2px; }
.consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.consent a { color: var(--primary); text-decoration: underline; }

.cta-card {
  background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%);
  border: 1px solid var(--primary-soft-border); border-radius: var(--r-card);
  padding: 22px; margin-top: 16px; text-align: center;
}
.cta-card .c-icon { font-size: 30px; }
.cta-card h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin: 6px 0; line-height: 1.5; }
.cta-card p { font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin-bottom: 16px; }

/* 詳細レポート本文 (S-08) */
.report-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--card-shadow); padding: 18px 20px; margin-top: 14px;
}
.report-block h4 { font-size: 15px; font-weight: 700; color: var(--text-dark); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.report-block h4 .rn { font-family: var(--font-en); color: var(--primary); }
.report-block p { font-size: 13px; line-height: 1.85; color: var(--text-soft); }
.tmpl { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tmpl-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.6; }
.tmpl-row .tk { flex: 0 0 84px; font-weight: 700; color: var(--primary); }
.tmpl-row .tv { flex: 1; color: var(--text-soft); }
.yasashii { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 4px; }
.yasashii th, .yasashii td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; line-height: 1.5; }
.yasashii th { background: var(--surface-2); font-weight: 700; color: var(--text-dark); font-size: 11px; }
.yasashii td.ng { color: var(--danger); }
.yasashii td.ok { color: #067a41; font-weight: 600; }
.qa-item { border-top: 1px solid var(--border); padding: 12px 0; }
.qa-item:first-of-type { border-top: none; padding-top: 0; }
.qa-item .qa-q { font-size: 13px; font-weight: 700; color: var(--text-dark); line-height: 1.6; margin-bottom: 5px; }
.qa-item .qa-a { font-size: 12.5px; line-height: 1.7; color: var(--text-soft); }
.qa-item .qa-a b { color: var(--primary); }

/* サンクス (S-09) */
.thanks { text-align: center; padding-top: 8px; }
.thanks .t-check {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--ok-soft); display: grid; place-items: center; font-size: 32px;
  animation: pop 0.5s var(--ease-spring) both;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ---------- disclaimer / footer ---------- */
.disclaimer {
  font-size: 10.5px; line-height: 1.7; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 14px; margin-top: 24px;
}
.disclaimer b { color: var(--text-soft); }
.logo-footer { margin-top: 22px; padding-top: 8px; display: flex; justify-content: center; }
.logo-footer img { height: 24px; width: auto; opacity: 0.85; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--text-dark); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
