/* ==========================================================================
   KURA HP Lab「活動導線タイプ診断 v1.2」スタイルシート
   Theme: 暖かみのある洗練されたグレージュ・ニュートラルパレット
   Palette: グレージュ ＋ 暖かいオフホワイト ＋ 控えめなくすみローズブラウン
   ========================================================================== */

/* --- デザイントークン --- */
:root {
  /* 背景 */
  --bg-page: #FAF8F5;          /* 暖かいオフホワイト */
  --bg-card: #FFFFFF;          /* メインサーフェス（白） */
  --bg-subtle: #F4F0EB;        /* 補助背景（薄いグレージュ） */
  --bg-hover: #FDFBF9;         /* 選択肢ホバー */
  --bg-selected: #F3ECE9;      /* 選択肢アクティブ（アクセント淡色） */

  /* テキスト（チャコール〜ウォームグレー） */
  --text-primary: #302D2B;     /* 本文（深みのあるウォームチャコール） */
  --text-secondary: #544E4A;   /* サブテキスト */
  --text-tertiary: #77716C;    /* 補助文字（ミディアムグレー） */
  --text-muted: #9E9892;       /* 極めて控えめな文字 */

  /* 罫線（薄いグレージュ系） */
  --border-default: #E6E0D9;   /* 基本境界線 */
  --border-subtle: #EFEBE5;    /* より薄い区切り線 */
  --border-hover: #D6CEC7;     /* ホバー時境界線 */

  /* アクセント（控えめなくすみローズブラウン / モカグレージュ） */
  --accent-primary: #A58E86;   /* アクセントカラー */
  --accent-light: #F3ECE9;     /* アクセント淡色 */

  /* メインCTA */
  --btn-primary-bg: #383330;   /* 柔らかいチャコール */
  --btn-primary-hover: #262220;/* ホバー時チャコール */
  --btn-primary-text: #FFFFFF;

  /* エラー */
  --color-error: #991B1B;

  /* タイポグラフィ */
  --font-base: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic", Meiryo, sans-serif;

  /* レイアウト */
  --content-max-width: 680px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
}

/* --- リセット --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-page);
}

body {
  font-family: var(--font-base);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.8;
  letter-spacing: 0.02em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* スクリーンリーダー支援 */
.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;
}

/* フォーカス可視化 */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
}

/* --- ヘッダー --- */
.site-header {
  background-color: var(--bg-page);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.site-brand {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

/* --- メインコンテナ --- */
.main-content {
  flex: 1;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
  padding: 32px 18px 64px;
}

@media (min-width: 640px) {
  .main-content {
    padding: 48px 24px 80px;
  }
}

/* コンテンツカード（自然で柔らかな面構成） */
.content-container {
  background-color: var(--bg-card);
  border: 1px solid rgba(230, 224, 217, 0.7);
  border-radius: var(--radius-lg);
  padding: 30px 22px;
  box-shadow: 0 4px 20px -2px rgba(48, 45, 43, 0.02);
}

@media (min-width: 640px) {
  .content-container {
    padding: 44px 40px;
  }
}

/* --- 1. 開始画面 --- */
.intro-container {
  text-align: left;
}

.intro-title {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) {
  .intro-title {
    font-size: 2rem;
    margin-bottom: 20px;
  }
}

.intro-subcopy {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 28px;
}

@media (min-width: 640px) {
  .intro-subcopy {
    font-size: 1.05rem;
  }
}

.br-sp {
  display: none;
}

@media (max-width: 480px) {
  .br-sp {
    display: inline;
  }
}

.intro-description {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.intro-description p + p {
  margin-top: 16px;
}

.intro-note {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 18px;
  line-height: 1.75;
}

.intro-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 8px;
}

/* --- ボタン共通 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 46px;
  touch-action: manipulation;
  box-sizing: border-box;
}

.btn-primary {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-bg);
}

.btn-primary:hover {
  background-color: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-tertiary);
  border-color: transparent;
  padding: 10px 14px;
  gap: 6px;
  font-size: 0.9rem;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.btn-arrow {
  font-size: 0.95rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.btn-ghost:hover .btn-arrow {
  transform: translateX(-2px);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: var(--border-default);
  padding: 12px 24px;
}

.btn-outline:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
  border-color: var(--border-hover);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ボタンサイズの適正化 (PC: max-width 280px) */
.btn-action {
  width: 100%;
  max-width: 280px;
}

@media (max-width: 480px) {
  .btn-action {
    max-width: 100%;
  }
}

/* --- 2. 質問画面 --- */
.progress-wrapper {
  margin-bottom: 24px;
}

.progress-meta {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  margin-bottom: 8px;
}

.progress-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.progress-track {
  width: 100%;
  height: 2px;
  background-color: var(--border-subtle);
  overflow: hidden;
  border-radius: var(--radius-pill);
}

.progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  transition: width 0.25s ease-out;
  border-radius: var(--radius-pill);
}

.question-header {
  margin-bottom: 24px;
}

.question-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 8px;
}

@media (min-width: 640px) {
  .question-title {
    font-size: 1.4rem;
  }
}

.question-desc {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  line-height: 1.6;
}

.options-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 選択肢行（薄いグレージュ枠、上品なアクセント選択） */
.option-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  min-height: 50px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.option-row:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
}

.option-row.is-selected {
  border-color: var(--accent-primary);
  background-color: var(--bg-selected);
}

.option-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* インジケーター（アクセントカラーによる上品な表示） */
.option-indicator {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1px solid var(--border-hover);
  background-color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.radio-dot {
  border-radius: 50%;
}

.checkbox-mark {
  border-radius: var(--radius-sm);
}

.option-row.is-selected .radio-dot {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary);
  box-shadow: inset 0 0 0 3px #FFFFFF;
}

.option-row.is-selected .checkbox-mark {
  border-color: var(--accent-primary);
  background-color: var(--accent-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 12px 12px;
  background-position: center;
  background-repeat: no-repeat;
}

.option-label-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 400;
}

.option-row.is-selected .option-label-text {
  font-weight: 500;
  color: var(--text-primary);
}

/* バリデーション */
.validation-message {
  color: var(--color-error);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 14px;
  min-height: 20px;
}

/* ナビゲーション操作エリア */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
}

.quiz-nav .btn-primary {
  flex-shrink: 0;
  min-width: 130px;
  max-width: 220px;
}

/* 「結果を見る」ボタンの改行完全防止 */
.btn-text {
  white-space: nowrap !important;
}

/* --- 3. 結果画面（Web記事・レポートスタイル） --- */
.result-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.result-pretitle {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-type-name {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

@media (min-width: 640px) {
  .result-type-name {
    font-size: 1.95rem;
  }
}

.result-catchphrase {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.65;
}

@media (min-width: 640px) {
  .result-catchphrase {
    font-size: 1.05rem;
  }
}

.result-section {
  margin-bottom: 32px;
}

.result-body-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.85;
}

.result-paragraph + .result-paragraph {
  margin-top: 16px;
}

/* HPとの相性（軽やかなインライン表示） */
.compatibility-section {
  margin-bottom: 28px;
}

.compatibility-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.compatibility-label {
  color: var(--text-tertiary);
}

.compatibility-divider {
  color: var(--border-default);
}

.compatibility-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* セクション見出し */
.section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.005em;
}

/* 今回の回答から見えたポイント（暖かみのあるグレージュ背景） */
.insights-section {
  background-color: var(--bg-subtle);
  border: 1px solid rgba(230, 224, 217, 0.6);
  border-radius: var(--radius-md);
  padding: 22px 20px;
}

@media (min-width: 640px) {
  .insights-section {
    padding: 26px 24px;
  }
}

.insights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.insight-item {
  position: relative;
  padding-left: 18px;
  font-size: 0.925rem;
  color: var(--text-primary);
  line-height: 1.75;
}

.insight-item::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-primary);
}

/* まずやること */
.actions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
}

.action-number {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.action-text {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.55;
}

/* 自然なテキストリンクCTA (TYPE F / 詳細診断) */
.cta-link-wrapper {
  margin-bottom: 26px;
  padding-top: 8px;
}

.text-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 12px 18px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  transition: all 0.15s ease;
}

.text-cta-link:hover {
  background-color: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--btn-primary-hover);
}

.cta-arrow {
  font-size: 1rem;
  color: var(--accent-primary);
  transition: transform 0.15s ease;
}

.text-cta-link:hover .cta-arrow {
  transform: translateX(3px);
}

/* 注意書き */
.result-disclaimer {
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 28px;
}

.disclaimer-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.disclaimer-text {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* 再診断ボタン */
.restart-wrapper {
  display: flex;
  justify-content: flex-start;
}

.restart-wrapper .btn {
  max-width: 200px;
}

/* 開発用デバッグパネル (?debug=1) */
.debug-panel {
  margin-top: 36px;
  padding: 16px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.debug-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.debug-row {
  margin-bottom: 6px;
  word-break: break-all;
}

.debug-pre {
  background: var(--bg-subtle);
  padding: 8px;
  border-radius: 4px;
  margin-top: 4px;
  overflow-x: auto;
}

/* --- フッター --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-page);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 20px;
  text-align: center;
}

.copyright {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

/* --- アクセシビリティ & モーション --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
