/* =============================================
   style.css — 就活Webテスト練習場 v2
   ============================================= */

/* ---- CSS変数 ---- */
:root {
  --primary:        #1d4ed8;
  --primary-light:  #3b82f6;
  --primary-pale:   #eff6ff;
  --primary-dark:   #1e3a8a;
  --accent:         #2563eb;
  --text:           #1e293b;
  --text-muted:     #64748b;
  --border:         #e2e8f0;
  --bg:             #f1f5f9;
  --white:          #ffffff;
  --correct:        #15803d;
  --correct-bg:     #f0fdf4;
  --correct-border: #86efac;
  --incorrect:      #b91c1c;
  --incorrect-bg:   #fef2f2;
  --incorrect-border:#fca5a5;
  --warn:           #d97706;
  --warn-bg:        #fffbeb;
  --radius:         8px;
  --radius-lg:      12px;
  --shadow:         0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
}

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

/* ---- 基本 ---- */
body {
  font-family: -apple-system, BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo,
    "Yu Gothic", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 15px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* =============================================
   レイアウト
   ============================================= */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================
   ヘッダー
   ============================================= */
.site-header {
  background: var(--primary-dark);
  color: var(--white);
  padding: 0 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.site-header .inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.site-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
}
.site-logo:hover { text-decoration: none; opacity: 0.9; }

.header-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  margin-left: 24px;
}
.header-nav a:hover { color: var(--white); text-decoration: none; }

/* =============================================
   フッター（拡張版）
   ============================================= */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 36px 20px 28px;
  font-size: 0.8rem;
  margin-top: 60px;
}

.footer-inner {
  max-width: 820px;
  margin: 0 auto;
}

.footer-logo {
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin-bottom: 16px;
}

.footer-nav a {
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
}
.footer-nav a:hover { color: var(--white); text-decoration: none; }

.footer-notice {
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.footer-copy {
  opacity: 0.45;
  font-size: 0.75rem;
}

/* =============================================
   ヒーローセクション（index.html）
   ============================================= */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 64px 20px 56px;
  text-align: center;
}

.hero-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  line-height: 1.4;
}

.hero-subtitle {
  font-size: 1rem;
  opacity: 0.88;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* =============================================
   ボタン
   ============================================= */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
  transition: all 0.18s ease;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

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

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

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

.btn-large {
  padding: 14px 36px;
  font-size: 1.05rem;
}

/* =============================================
   セクション共通
   ============================================= */
.section {
  padding: 48px 20px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--primary-light);
  display: inline-block;
}

.section-lead {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

/* =============================================
   カードグリッド（形式一覧）
   ============================================= */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.type-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.type-card.active:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.type-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.type-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.type-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  min-height: 2.5em;
}

.badge-ready {
  display: inline-block;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-soon {
  display: inline-block;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* =============================================
   使い方ステップ
   ============================================= */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.step-num {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 10px;
}

.step-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* =============================================
   注意書きボックス
   ============================================= */
.notice-box {
  background: var(--warn-bg);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.82rem;
  color: #78350f;
  margin-top: 24px;
}

.notice-box p { margin: 0; }

/* =============================================
   ページタイトル（内部ページ）
   ============================================= */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--white);
  padding: 40px 20px;
}

.page-hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-bottom: 8px;
}
.breadcrumb a { color: rgba(255,255,255,0.8); }
.breadcrumb a:hover { color: var(--white); }

.page-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.page-hero-desc {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* =============================================
   問題セット一覧カード（spi-like.html）
   ============================================= */
.set-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
}

.set-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
  gap: 16px;
}

.set-card.active:hover { box-shadow: var(--shadow-md); }

.set-card-info { flex: 1; }

.set-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.set-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.set-card-action { flex-shrink: 0; }

/* =============================================
   問題ページ（spi-set1.html 等）
   ============================================= */
.quiz-info-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  font-size: 0.87rem;
  color: var(--text-muted);
}

.quiz-info-item strong { color: var(--text); }

/* 問題カード */
.question-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}

.question-card.unanswered {
  border-color: var(--incorrect);
  background: var(--incorrect-bg);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.question-number {
  background: var(--primary);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.question-category {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}

.question-text {
  font-size: 0.97rem;
  line-height: 1.8;
  margin-bottom: 18px;
  color: var(--text);
}

/* 選択肢 */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: background 0.12s, border-color 0.12s;
  font-size: 0.93rem;
}

.option-label:hover {
  background: var(--primary-pale);
  border-color: var(--primary-light);
}

.option-radio {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.option-radio:checked + .option-text {
  color: var(--primary-dark);
  font-weight: 600;
}

.option-label:has(.option-radio:checked) {
  background: var(--primary-pale);
  border-color: var(--primary-light);
}

/* 未回答警告 */
.unanswered-msg {
  display: none;
  background: var(--incorrect-bg);
  border: 1px solid var(--incorrect-border);
  border-left: 4px solid var(--incorrect);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--incorrect);
  margin-bottom: 20px;
  font-weight: 600;
}

/* 送信エリア */
.submit-area {
  text-align: center;
  padding: 24px 0 8px;
}

.submit-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* =============================================
   結果ページ（result.html）
   ============================================= */
.score-summary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}

.score-big {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.score-denom {
  font-size: 1.4rem;
  opacity: 0.75;
}

.score-rate {
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.9;
  margin-bottom: 10px;
}

.score-message {
  font-size: 0.95rem;
  opacity: 0.85;
}

.score-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.stat-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  min-width: 110px;
  box-shadow: var(--shadow);
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.stat-value.correct  { color: var(--correct); }
.stat-value.incorrect { color: var(--incorrect); }

.detail-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* 結果カード */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.result-card.correct-card {
  border-left: 4px solid var(--correct);
  background: var(--correct-bg);
}

.result-card.incorrect-card {
  border-left: 4px solid var(--incorrect);
  background: var(--incorrect-bg);
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.result-number {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.result-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
}

.badge-correct  { background: var(--correct); color: var(--white); }
.badge-incorrect { background: var(--incorrect); color: var(--white); }

.result-category {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 20px;
}

.result-question-text {
  font-size: 0.92rem;
  margin-bottom: 14px;
  color: var(--text);
  line-height: 1.7;
}

.result-answers {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-answer-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.result-label  { color: var(--text-muted); flex-shrink: 0; }
.result-val    { font-weight: 600; }
.your-correct  { color: var(--correct); }
.your-wrong    { color: var(--incorrect); }
.correct-ans   { color: var(--correct); }

.result-explanation {
  background: var(--primary-pale);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.87rem;
  line-height: 1.7;
}

.explanation-label {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

/* ナビゲーションボタン群 */
.result-nav {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 28px 0 8px;
}

/* 戻るリンク */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
  padding: 6px 0;
}
.back-link:hover { color: var(--primary); text-decoration: none; }

/* エラーボックス */
.error-box {
  background: var(--warn-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  font-size: 0.95rem;
  color: #78350f;
  margin: 20px 0;
}

/* =============================================
   カテゴリ別分析（result.html）
   ============================================= */
.category-analysis {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.analysis-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.cat-row {
  display: grid;
  grid-template-columns: 110px 1fr 90px;
  align-items: center;
  gap: 12px;
  font-size: 0.87rem;
}

.cat-name {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-bar-wrap {
  background: var(--border);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}

.cat-bar {
  height: 100%;
  border-radius: 20px;
  transition: width 0.5s ease;
}

.cat-perfect { background: var(--correct); }
.cat-ok      { background: var(--primary-light); }
.cat-weak    { background: var(--incorrect); }

.cat-stat {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

/* =============================================
   1問UI：進捗バー・選択肢・ナビ
   ============================================= */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-light);
  border-radius: 20px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 600;
}

/* 選択肢（1問UI用） */
.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: background 0.12s, border-color 0.12s;
  font-size: 0.93rem;
  width: 100%;
  box-sizing: border-box;
}

.option-item:hover {
  background: var(--primary-pale);
  border-color: var(--primary-light);
}

.option-item.selected {
  background: var(--primary-pale);
  border-color: var(--primary);
}

.option-item .option-radio {
  display: none;
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}

.option-item.selected .option-letter {
  background: var(--primary);
  color: var(--white);
}

/* クイズナビ */
.quiz-nav {
  display: flex;
  justify-content: flex-end;
  padding: 20px 0 8px;
}

/* =============================================
   タイマーバー（画面下部固定）
   ============================================= */
.timer-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px;
  font-size: 0.9rem;
  z-index: 1000;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}

.timer-label {
  opacity: 0.75;
  font-size: 0.82rem;
}

.timer-time {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  min-width: 5ch;
  text-align: center;
}

.timer-bar.timer-warn {
  background: #b91c1c;
  animation: timer-pulse 1s ease-in-out infinite alternate;
}

@keyframes timer-pulse {
  from { opacity: 1; }
  to   { opacity: 0.85; }
}

/* タイマーバーぶん body に余白 */
body.has-timer-bar {
  padding-bottom: 52px;
}

/* =============================================
   広告スペース
   ============================================= */
.ad-slot {
  width: 100%;
  text-align: center;
  margin: 24px 0;
  min-height: 0;
  overflow: hidden;
}

/* 中身が空の広告枠は非表示 */
.ad-slot:empty {
  display: none;
  margin: 0;
}

/* =============================================
   固定ページ共通（about / privacy / terms / contact）
   ============================================= */
.static-page {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow);
  line-height: 1.85;
}

.static-page h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 28px 0 10px;
  padding-left: 12px;
  border-left: 4px solid var(--primary-light);
}

.static-page h2:first-child { margin-top: 0; }

.static-page p {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 10px;
}

.static-page ul {
  padding-left: 1.4em;
  margin-bottom: 10px;
}

.static-page ul li {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

.static-page .updated {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* お問い合わせ用カード */
.contact-card {
  background: var(--primary-pale);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}

.contact-card p { font-size: 0.9rem; margin-bottom: 6px; }
.contact-card p:last-child { margin-bottom: 0; }

/* =============================================
   レスポンシブ
   ============================================= */
@media (max-width: 600px) {
  .hero-title      { font-size: 1.45rem; }
  .page-hero-title { font-size: 1.2rem; }
  .cards-grid      { grid-template-columns: repeat(2, 1fr); }
  .steps           { grid-template-columns: 1fr 1fr; }
  .set-card        { flex-direction: column; align-items: flex-start; }
  .score-big       { font-size: 2.8rem; }
  .site-header .inner { height: 52px; }
  .header-nav a    { margin-left: 12px; font-size: 0.8rem; }
  .btn-large       { padding: 12px 24px; font-size: 0.95rem; }
  .result-nav      { flex-direction: column; align-items: center; }
  .result-nav .btn { width: 100%; max-width: 320px; }
  .cat-row         { grid-template-columns: 80px 1fr 70px; }
  .static-page     { padding: 24px 20px; }
}

@media (max-width: 400px) {
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .steps      { grid-template-columns: 1fr; }
}
