/* =========================================
   社長の航路診断 — front2
   コンセプト：オーシャンブルー（KV：青い海とクルーズ船に準拠）
   参考カラー: Ocean #5195d7 / Sky #63b0e0 / Pale #a6d3ee / White #ffffff
   ★ デザイントークンは :root を編集
   ========================================= */
:root {
  /* ベース（淡い空と海のしぶき） */
  --paper:    #eef6fc;
  --paper-2:  #f7fbfe;
  --paper-3:  #dfeef9;

  /* インク（深い紺碧の墨） */
  --ink:      #14334e;
  --ink-soft: #56738c;

  /* 海の青＝メイン */
  --pine:      #2f6fb0;
  --pine-deep: #235b8f;
  --sage:      #9cc9e6;

  /* コーラル（夕陽・浮き輪）＝差し色アクセント */
  --clay:      #ef8354;
  --clay-deep: #d96a3d;
  --clay-soft: #f7d3bf;

  /* エラー（警告） */
  --error:      #c0492f;
  --error-deep: #a73d27;

  --line:      rgba(20, 51, 78, 0.12);
  --line-soft: rgba(20, 51, 78, 0.07);

  --font-sans:  'Noto Sans JP', sans-serif;
  --font-serif: 'Noto Serif JP', serif;
  --radius:     14px;
  --radius-sm:  11px;
  --max-width:  620px;
  --shadow:     0 16px 40px rgba(20, 51, 78, 0.14);
  --shadow-sm:  0 6px 18px rgba(20, 51, 78, 0.08);
}

/* =========================================
   リセット・ベース
   ========================================= */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  line-height: 1.85;
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 520px at 50% -6%, rgba(140, 194, 226, 0.28), transparent 60%),
    radial-gradient(760px 620px at 92% 16%, rgba(239, 131, 84, 0.10), transparent 58%),
    radial-gradient(820px 640px at 4% 100%, rgba(35, 91, 143, 0.10), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; }
::selection { background: rgba(35, 91, 143, 0.18); }

/* =========================================
   日本語の折り返し（2026-08-03・修正2「見え方」調整）
   ─ 行末に1〜2文字だけポツンと残る折り返しをなくすための土台。
     どれも対応ブラウザだけが効く指定で、非対応でも従来どおり表示される。
       line-break: strict    … 「ー」「っ」などが行頭に来るのを防ぐ
       word-break: auto-phrase … 文節（意味のかたまり）で折り返す
       text-wrap: pretty     … 最終行に1〜2文字だけ残る折り返しを避ける
     ★手で改行位置を決めている結果ページ本文は、これとは別に .ln で組んでいる。
   ========================================= */
body,
.q-text, .stage-instruction, .start-notice,
.types-catch, .result-description, .result-step-text,
.result-filter, .result-cta {
  line-break: strict;
  word-break: auto-phrase;
  text-wrap: pretty;
}

/* ★選択肢ボタンだけは、文節での折り返しを使わない。
   選択肢は1つ1つが独立した「かたまり」なので、途中で意味ごとに折ると
   文章のように見えて不自然になる（大高さんの指示は「設問文」までで、
   選択肢は対象外）。行を素直に埋める従来の折り返しに戻してある。 */
.btn-choice {
  line-break: strict;
  word-break: normal;
}

/* 手組みの1行（result.php の $lines が出力する）
   ─ 1要素＝1行。inline-block にすることで、画面が極端に狭いときも
     行のかたまりとして扱われ、中途半端な位置で切れにくくなる。 */
.ln { display: inline-block; }

/* 括弧の途中で折った行のぶら下げ字下げ。
   データ側の行頭「　」（全角スペース）がこのクラスに変換される。 */
.ln-indent { padding-left: 1em; }

/* =========================================
   共通レイアウト
   ========================================= */
.wrapper {
  max-width: var(--max-width);
  margin: 28px auto;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* =========================================
   ボタン 共通（メイン＝海の青）
   ========================================= */
.btn {
  display: block;
  width: 100%;
  padding: 16px 22px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--pine);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  letter-spacing: 0.06em;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: var(--pine-deep); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(35,91,143,0.22); }
.btn:active { transform: translateY(0); }

/* スタートボタン（コーラルで主役化＋光のスイープ） */
.btn-start {
  position: relative; overflow: hidden;
  background: var(--clay);
}
.btn-start:hover { background: var(--clay-deep); box-shadow: 0 12px 26px rgba(239,131,84,0.28); }
.btn-start::after {
  content: '';
  position: absolute; top: 0; left: -120%;
  width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  animation: sweep 4s ease-in-out infinite;
}
@keyframes sweep { 0%, 62% { left: -120%; } 100% { left: 165%; } }

/* サブボタン（戻るなど） */
.btn-sub {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: none;
  font-weight: 600;
}
.btn-sub:hover { background: rgba(20,51,78,0.04); color: var(--ink); transform: none; box-shadow: none; }

/* =========================================
   スタート画面
   ========================================= */
.start-kv { width: 100%; }
.start-kv img { width: 100%; }

/* 注意文：ボタン下の控えめな注記。囲まず、細い上罫線＋小さめ文字で「補足」の格に。 */
.start-notice {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  line-height: 1.85;
  color: var(--ink-soft);
  text-align: center;
}
.start-notice p { margin: 0; }

.start-inner { padding: 30px 24px 44px; }

.start-lead { margin-bottom: 24px; text-align: center; }
.start-lead-text {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 2;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 16px;
}
.start-lead-time {
  display: inline-block;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--pine);
  padding: 5px 16px;
  border: 1px solid var(--sage);
  border-radius: 999px;
}

/* ── 6タイプ一覧（導入ページ：先に6匹を見せてから診断へ） ── */
.types { margin: 0 0 30px; }
.types-title {
  font-family: var(--font-serif);
  font-size: 1rem; font-weight: 700;
  text-align: center; letter-spacing: 0.08em;
  margin: 0 0 20px; padding-bottom: 12px;
  position: relative; color: var(--ink);
}
.types-title::after {
  content: '';
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 48px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--clay), transparent);
}
.types-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.types-item {
  padding: 16px 12px 14px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.types-img { width: 84px; margin: 0 auto 10px; }
.types-name {
  font-family: var(--font-serif);
  font-size: 0.92rem; font-weight: 700;
  color: var(--pine); margin: 0 0 6px;
}
.types-catch {
  font-size: 0.74rem; line-height: 1.75;
  color: var(--ink-soft); margin: 0;
}

.start-btn { margin-bottom: 12px; }
.start-note { font-size: 0.76rem; color: var(--ink-soft); text-align: center; letter-spacing: 0.04em; }

.form-text {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-text::placeholder { color: #8aa3bb; }
.form-text:focus {
  border-color: var(--pine);
  outline: none;
  box-shadow: 0 0 0 3px rgba(35,91,143,0.12);
}
.form-text.is-error { border-color: var(--error); }

.error-message { color: var(--error-deep); font-size: 0.85rem; margin: 8px 0 0; }

/* =========================================
   設問エリア全体
   ========================================= */
.stage-wrapper { display: none; }
.stage-wrapper.active { display: block; }
.stage { display: none; }

/* ★仕様書 §3：設問の直前に必ず出す指示文（設問エリアの先頭） */
.stage-instruction {
  margin: 28px 24px 18px;
  padding: 16px 18px;
  background: var(--paper-3);
  border-radius: var(--radius);
  font-size: 0.88rem; line-height: 1.9;
  color: var(--ink); text-align: center;
}

/* =========================================
   設問1問（カード）
   ========================================= */
.question {
  margin: 0 20px 14px;
  padding: 26px 22px 10px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: floatUp 0.5s ease both;
}
.question.is-answered { border-color: var(--sage); }
.question.is-answered .q-text { color: var(--ink-soft); }
.question.is-missing  { border-color: var(--error); }
@keyframes floatUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.q { margin: 0 0 18px; display: flex; gap: 13px; align-items: flex-start; }
.q-num {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--sage);
  color: var(--pine);
  font-family: var(--font-serif);
  font-size: 0.82rem; font-weight: 700;
}
.q-text { font-size: 1.02rem; font-weight: 700; line-height: 1.7; padding-top: 6px; }
.q-note { font-size: 0.85rem; color: var(--ink-soft); margin: -8px 0 12px; padding-left: 51px; }

/* =========================================
   選択肢（4択ボタン）
   ========================================= */
.answer-4choice { display: flex; flex-direction: column; gap: 10px; padding-bottom: 22px; }
.btn-choice {
  position: relative;
  display: block; width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.94rem; text-align: left; line-height: 1.65;
  cursor: pointer; min-height: 54px;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.12s;
}
.btn-choice:hover {
  border-color: var(--sage);
  background: var(--paper-3);
  transform: translateX(3px);
}
.btn-choice.active {
  border-color: transparent;
  background: var(--pine);
  color: var(--paper);
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(35,91,143,0.22);
}
.btn-choice.active::before {
  content: '✓';
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: var(--clay-soft); font-weight: 900;
}

/* =========================================
   ステージフッター（次へ / 戻る）
   ========================================= */
.question-next { padding: 22px 22px 30px; display: flex; flex-direction: column; gap: 12px; }
.question-next-note { margin: 0; text-align: center; }
.unanswered-note { display: none; font-size: 0.82rem; color: var(--error-deep); }

/* =========================================
   ローディング
   ========================================= */
.loading {
  display: none; position: fixed; inset: 0;
  background: rgba(238,246,252,0.94);
  backdrop-filter: blur(3px);
  z-index: 999; align-items: center; justify-content: center;
}
.loading-inner { text-align: center; }
.loading-spin {
  display: block; width: 46px; height: 46px;
  border: 3px solid rgba(35,91,143,0.15);
  border-top-color: var(--pine);
  border-radius: 50%; margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 0.9rem; color: var(--pine); letter-spacing: 0.1em; margin: 0; }

/* =========================================
   結果ページ
   ========================================= */
.result {
  max-width: var(--max-width);
  margin: 28px auto;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.result-inner { max-width: var(--max-width); margin: 0 auto; padding: 8px 24px 48px; }

/* ★仕様書 §7-4：シェアから来た人を診断へ送る導線（結果ページ最上部） */
.result-tryme { padding: 22px 0 4px; }
.btn-tryme {
  display: block; text-align: center; text-decoration: none;
  padding: 13px 16px;
  border: 1px dashed var(--pine);
  border-radius: var(--radius-sm);
  background: rgba(35,91,143,0.05);
  color: var(--pine);
  font-size: 0.86rem; font-weight: 700; letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
}
.btn-tryme:hover { background: rgba(35,91,143,0.11); transform: translateY(-1px); }

.result-label {
  text-align: center; font-size: 0.8rem;
  letter-spacing: 0.16em; color: var(--ink-soft);
  margin: 30px 0 12px;
}

.result-title {
  font-family: var(--font-serif);
  font-size: 1.72rem; font-weight: 700;
  text-align: center; line-height: 1.45;
  margin: 0 0 16px;
  color: var(--ink);
}
.result-type-name { color: var(--clay); }

/* キャッチ（飾りのダッシュは廃止：折り返すとダッシュだけが行に残って不格好だった）
   ─ 改行位置は result.php の catch_lines で手組み。
     文字サイズは画面幅に追従させ、組んだ1行がスマホでも折り返さないようにする。 */
.result-subtitle {
  text-align: center;
  font-size: clamp(0.86rem, 3.9vw, 1rem);
  font-family: var(--font-serif);
  color: var(--pine); line-height: 1.95;
  margin: 0 auto 30px; max-width: 26em; padding: 0 4px;
}

/* キャラ画像自体に上下の余白があるので、枠側のmarginは付けず幅100%で見せる */
.result-illust { margin: 0; }
.result-illust img {
  width: 100%;
  margin: 0 auto;
}

/* 結果本文（見出しは付けず、キャラ画像から本文へ直接つなぐ）
   ─ 改行位置は result.php の body で手組み。文字サイズは画面幅に追従させ、
     組んだ1行（最長22字前後）がスマホでも折り返さないようにしている。
     ★ここのサイズを大きくすると手組みの行が折り返し始めるので注意。 */
.result-content { margin: 0 0 32px; }
.result-description {
  font-size: clamp(0.75rem, 3.75vw, 0.96rem);
  line-height: 2.05; color: var(--ink);
}

/* 今日の一歩
   ─ カード・グラデ・絵文字はやめ、細い罫線とラベルだけで「処方箋」の体裁にする。
     2026-08-03：ここは読んでほしい場所なので、見出しを本文より強くした
     （小さな薄いラベル → コーラルの太字＋下線）。 */
.result-step {
  margin: 0 0 44px; padding: 22px 0 0;
  border-top: 1px solid var(--ink);
}
.result-step-title {
  font-family: var(--font-serif);
  font-size: 1.16rem; font-weight: 700;
  margin: 0 0 16px; color: var(--clay-deep);
  letter-spacing: 0.16em; text-indent: 0.16em;
}
.result-step-title::after {
  content: ''; display: block;
  width: 2.4em; height: 2px; margin-top: 8px;
  background: var(--clay);
  border-radius: 2px;
}
.result-step-text {
  font-family: var(--font-serif);
  font-size: clamp(0.8rem, 4.05vw, 1.02rem);
  line-height: 2; color: var(--ink);
}

/* 全タイプ共通文
   ─ 塗りのボックスをやめ、上下のヘアラインで挟んだ静かな組版に。
     Kunyの文章はここが主役なので、背景色で囲わない。 */
.result-filter {
  margin: 0 0 44px; padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-serif);
  font-size: clamp(0.82rem, 3.7vw, 0.94rem);
  line-height: 2.15;
  color: var(--ink-soft);
  text-align: center;
}
.result-filter p { margin-bottom: 22px; }
.result-filter-sign {
  font-family: var(--font-serif);
  font-size: 0.88rem; letter-spacing: 0.1em;
  color: var(--ink); font-weight: 500;
  margin-top: 30px !important; margin-bottom: 0 !important;
}
.result-filter-sign::before {
  content: ''; display: block;
  width: 28px; height: 1px; margin: 0 auto 18px;
  background: var(--sage);
}

/* CTA（コーラル差し色。光沢アニメ・強い影は使わない＝手前の静かな組版と喧嘩するため）
   ─ 2026-08-03：「別物の差し出し」から「診断結果の延長線」に変更。
     見出し＋お届け内容＋継続配信の予告を、ボタンの上に静かに積む。 */
.result-cta { margin: 0 0 40px; }
.result-cta-lead {
  font-family: var(--font-serif);
  font-size: clamp(0.78rem, 3.95vw, 1rem);
  font-weight: 500; text-align: center;
  margin: 0 0 22px; color: var(--ink); line-height: 1.95;
}
.result-cta-listtitle {
  font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--ink-soft);
  margin: 0 0 10px;
}
.result-cta-list {
  margin: 0 0 22px; padding: 0; list-style: none;
}
/* お届け内容の2項目
   ─ いちばん長い「（ジンベエザメ社長がまず見るページの案内つき）」が
     狭い画面でも1行に収まるサイズにしてある。ここを大きくすると折り返す。 */
.result-cta-list li {
  position: relative;
  padding-left: 1.1em;
  font-size: clamp(0.68rem, 3.42vw, 0.9rem);
  line-height: 1.85; color: var(--ink);
  margin-bottom: 10px;
}
.result-cta-list li::before {
  content: '・'; position: absolute; left: 0; color: var(--clay);
}
/* 箇条書きの中は、行頭の「・」ぶんですでに字下げされているので、続きの行は浅めに */
.result-cta-list .ln-indent { padding-left: 0.5em; }
.result-cta-text {
  font-family: var(--font-serif);
  font-size: clamp(0.74rem, 3.7vw, 0.92rem);
  text-align: center;
  margin: 0 0 8px; color: var(--ink-soft); line-height: 1.9;
}
.result-cta-optout {
  font-size: clamp(0.7rem, 3.1vw, 0.78rem);
  text-align: center;
  margin: 0 0 18px; color: var(--ink-soft); line-height: 1.7;
}
/* CTAボタン
   ─ 文字は必ず2行（「【◯◯社長】の詳しいレポートを」＋「受け取る（無料）」）。
     行ごとに .btn-cta-line で括ってあるので「受け／取る」では切れない。
     タイプ名がいちばん長いジンベエザメ社長でも1行に収まるよう、
     文字サイズを画面幅に追従させ、左右の余白も狭い画面では詰める。 */
.btn-cta {
  display: block;
  padding: 17px 14px;
  background: var(--clay);
  color: #fff;
  text-align: center; text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: clamp(0.72rem, 3.6vw, 0.98rem);
  font-weight: 700; letter-spacing: 0.04em;
  line-height: 1.6;
  transition: background 0.2s;
}
.btn-cta-line { display: inline-block; }
.btn-cta:hover { background: var(--clay-deep); }

.result-cta-todo { font-size: 0.72rem; color: var(--error-deep); text-align: center; margin-top: 10px; }

/* シェア（X / Facebook / LINE） */
.result-share { margin: 0 0 26px; }
.result-share-title {
  font-size: 0.76rem; font-weight: 700; text-align: center;
  letter-spacing: 0.16em; color: var(--ink-soft); margin: 0 0 12px;
}
.result-share-list { display: flex; gap: 8px; }
.result-share-list li { flex: 1; }
.share-btn {
  display: block; text-align: center; text-decoration: none;
  padding: 13px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 700; color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, opacity 0.18s;
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.share-x    { background: #000000; }
.share-fb   { background: #1877f2; }
.share-line { background: #06c755; }

/* 印刷 */
.result-print { text-align: center; }
.btn-print {
  font-size: 0.8rem; color: var(--ink-soft);
  text-decoration: underline; cursor: pointer;
  background: none; border: none; font-family: var(--font-sans);
  transition: color 0.2s;
}
.btn-print:hover { color: var(--pine); }

/* =========================================
   フッター
   ========================================= */
footer { padding: 26px 20px; text-align: center; border-top: 1px solid var(--line-soft); }
.copyright { font-size: 0.72rem; color: var(--ink-soft); letter-spacing: 0.06em; }

/* =========================================
   PC（768px以上）
   ========================================= */
@media (min-width: 768px) {
  .wrapper, .result { margin: 44px auto; }

  .start-notice { padding: 24px 44px; }
  .start-inner  { padding: 44px 48px 60px; }
  .start-lead-text { font-size: 1.24rem; }

  .types-list { grid-template-columns: repeat(3, 1fr); }
  .types-img  { width: 96px; }

  .stage-instruction { margin: 30px 44px 20px; }

  .question { margin: 0 26px 16px; padding: 32px 34px 14px; }
  .q-num  { width: 42px; height: 42px; font-size: 0.86rem; }
  .q-text { font-size: 1.08rem; }
  .q-note { padding-left: 55px; }
  .answer-4choice { padding-bottom: 28px; }

  .question-next { padding: 30px 34px 36px; }

  .result-inner { padding: 8px 48px 60px; }
  .result-title { font-size: 1.95rem; }
}
