/* ==================================================================
   BizQ 受検者側スタイル  [UI-F]
   ------------------------------------------------------------------
   このファイル1枚で、受検者が見る全画面をまかなう。
     ・index.php  サービス紹介
     ・start.php  同意＋基本情報
     ・terms.php / privacy.php  規約類
     ・exam.php   認知テスト（思考力）
     ・survey.php 性格特性の検査

   受検画面の方針（仕様書 §7）
     ・白背景・最大幅 720px・本文 17px・行間 1.8
     ・気が散る要素を置かない（アニメーション・色の主張・装飾を足さない）
     ・角丸 2px。グラデーション・発光シャドウは使わない
     ・正誤や優劣を色で示さない
     ・フォーカスリングは消さない（キーボードだけで最後まで受検できること）
   ================================================================== */

/* ==================================================================
   0) 共通の小物
   ================================================================== */

/* 読み上げ用にだけ残すラベル */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sec-h {
  font-size: 17px;
  margin: 30px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
}

/* ==================================================================
   1) サービス紹介（index.php）
   ================================================================== */

.feat-grid { align-items: stretch; }
.feat { display: flex; flex-direction: column; }
.feat-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  color: var(--brand); margin-bottom: 12px;
}
.feat-t { font-size: 15.5px; margin: 0 0 8px; }
.feat-d { font-size: 13.5px; color: var(--sub); margin: 0; line-height: 1.85; }

.time-table { margin-bottom: 12px; }
.time-table td, .time-table th { white-space: nowrap; }
.time-table td:nth-child(2) { white-space: normal; }
.time-note { margin: 0; line-height: 1.85; }

.sample-cap { margin: 0 0 10px; }
.sample-wrap { overflow-x: auto; border: 1px solid var(--line); background: #fff; padding: 10px; }
.sample-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.sample-list { margin: 16px 0 0; padding-left: 1.2em; font-size: 13.5px; }
.sample-list li { margin-bottom: 6px; }

.start-cta .lead { font-size: 14.5px; }
.code-h { font-size: 14px; margin: 0 0 4px; }
.code-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.code-form input { width: 260px; }
@media (max-width: 560px) {
  .code-form input { width: 100%; }
  .code-form .btn { width: 100%; }
}

/* ==================================================================
   2) 申し込みフォーム（start.php）
   ================================================================== */

.form-card .card-title.mt { margin-top: 26px; }
.req {
  font-style: normal; font-size: 11px; font-weight: 700;
  border: 1px solid var(--ink); padding: 0 5px; margin-left: 6px;
  vertical-align: 1px;
}
.fld-err {
  display: block; font-style: normal; font-size: 12.5px;
  color: var(--danger); margin-top: 4px; font-weight: 600;
}
.fld-err.block { margin-top: 8px; }
.fld-help { display: block; font-style: normal; font-size: 12px; color: var(--sub); margin-top: 4px; }
input[aria-invalid="true"] { border-color: var(--danger); }

.consent { border: 1px solid var(--ink); padding: 14px 16px; margin-bottom: 16px; }
.consent-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.consent-check input { margin-top: 5px; flex-shrink: 0; width: 18px; height: 18px; }
.consent-note { margin: 8px 0 0; }
.start-note { margin-bottom: 18px; }

/* ==================================================================
   3) 規約・プライバシー（terms.php / privacy.php）
   ================================================================== */

.doc-h1 { font-size: 22px; margin: 4px 0 18px; }
.doc { line-height: 1.9; }
.doc-h2 {
  font-size: 15px; margin: 26px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.doc-h2:first-of-type { margin-top: 10px; }
.doc-p { font-size: 14px; margin: 0 0 10px; }
.doc-ol { font-size: 14px; margin: 0 0 10px; padding-left: 1.5em; }
.doc-ol > li { margin-bottom: 7px; }
.doc-kv { margin: 6px 0 12px; font-size: 14px; }
.doc-table { margin: 6px 0 12px; font-size: 13.5px; }
.doc-table td { white-space: normal; }
.doc-date { font-size: 13px; color: var(--sub); margin-top: 22px; }
.doc-back { margin-top: 16px; }

/* 未記入の空欄。公開前の記入漏れが目に付くよう、破線で囲って残す */
.fillin {
  display: inline-block; border-bottom: 1px dashed var(--line-strong);
  padding: 0 3px; letter-spacing: .1em;
}
.fillin-note { font-size: 11.5px; color: var(--danger); margin-left: 4px; white-space: nowrap; }

/* ==================================================================
   4) 受検画面の枠（exam.php / survey.php）
   ================================================================== */

/* 受検中は白背景・大きめの文字。測定条件をそろえるため一定にする */
body.bare .pub-wrap { max-width: 720px; font-size: 17px; line-height: 1.8; }
body.bare .card { padding: 26px 24px; }
body.bare .lead { font-size: 16px; line-height: 1.85; }
@media (max-width: 640px) {
  body.bare .pub-wrap { padding-left: 14px; padding-right: 14px; }
  body.bare .card { padding: 18px 15px; }
}

/* ---- 上部の帯：セクション名・進捗・残り時間。これ以外は置かない ---- */
.exam-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 0 11px; margin-bottom: 18px;
}
.exam-bar[hidden] { display: none; }
.exam-bar-main { flex: 1; min-width: 0; }
.exam-bar-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 6px;
}
.exam-sec { font-size: 14px; font-weight: 700; }
.exam-count { font-size: 12.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.exam-timer {
  font-size: 18px; color: var(--sub); font-variant-numeric: tabular-nums;
  letter-spacing: .04em; min-width: 62px; text-align: right; flex-shrink: 0;
}
/* 残り30秒からは太く黒くするだけ。点滅させない（焦らせすぎないため） */
.exam-timer.is-low { color: var(--ink); font-weight: 700; }
.exam-timer.is-plain { font-size: 14px; }

/* ---- 各画面の見出し ---- */
.exam-step { font-size: 12.5px; color: var(--sub); margin: 0 0 4px; letter-spacing: .06em; }
.exam-h { font-size: 22px; margin: 0 0 4px; }
.exam-h2 { font-size: 14.5px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.exam-chc { font-size: 12.5px; color: var(--sub); margin: 0 0 16px; }
.exam-fatal-h { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.exam-loading .lead, .exam-timeup .lead { color: var(--sub); }

.exam-rules { margin: 0 0 18px; padding-left: 1.25em; font-size: 15px; }
.exam-rules li { margin-bottom: 7px; }

.exam-meta { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.exam-meta-i { border: 1px solid var(--line); padding: 9px 16px; min-width: 140px; }
.exam-meta-l { display: block; font-size: 11.5px; color: var(--sub); }
.exam-meta-v { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---- 例題（採点対象外） ---- */
.exam-example { border: 1px solid var(--line); padding: 18px 18px 14px; margin-bottom: 20px; background: #fafafa; }
.exam-example .q { margin-bottom: 4px; }
.exam-answer { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.exam-answer-h { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.exam-answer-p { font-size: 14px; margin: 0 0 5px; color: var(--sub); line-height: 1.8; }

/* ---- 出題・終了 ---- */
.exam-actions { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.exam-actions .btn { min-width: 180px; }
.exam-hint { margin: 10px 0 0; font-size: 12.5px; }
.exam-end-count { font-size: 16px; font-weight: 700; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .exam-actions .btn { width: 100%; }
}

/* ==================================================================
   5) 問題の表示
   ================================================================== */

.q { margin: 0; }

/* ---- MR 図形推論 ---- */
.q-matrix { text-align: center; margin-bottom: 22px; }
.q-matrix svg { display: inline-block; width: 100%; max-width: 320px; height: auto; }

/* ---- NS 数量推論 ---- */
.q-series {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-bottom: 10px;
}
.q-term {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 48px; padding: 0 10px;
  border: 1px solid var(--line-strong); background: #fff;
  font-size: 20px; font-variant-numeric: tabular-nums;
}
.q-term.is-blank { border-width: 2px; border-color: var(--ink); font-weight: 700; }

/* ---- VA 言語推理 ---- */
.q-stem {
  font-size: 20px; line-height: 1.75; margin: 0 0 20px;
  padding: 16px 18px; border: 1px solid var(--line-strong); background: #fff;
}

/* ---- PS 処理速度 ---- */
.q-speed {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.q-str {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 30px; letter-spacing: .16em; font-weight: 700;
  padding: 12px 16px; border: 1px solid var(--line-strong); background: #fff;
}
.q-vs { color: var(--sub); font-size: 20px; }

.q-note { font-size: 13.5px; color: var(--sub); margin: 0 0 18px; text-align: center; }

/* ==================================================================
   6) 選択肢
   ・クリック領域は最低 44px 高（誤タップを避ける）
   ・正誤を色で塗らない。選択中は罫線の太さと背景の濃さだけで示す
   ================================================================== */

.opts { display: flex; flex-direction: column; gap: 8px; }

.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 46px; padding: 8px 14px;
  font: inherit; text-align: left;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  cursor: pointer;
}
.opt:hover { background: #f6f6f4; }
.opt:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.opt.is-on { border-color: var(--ink); border-width: 2px; background: #f2f2f0; padding: 7px 13px; }
.opt[disabled] { cursor: default; }

.opt-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex-shrink: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: #fff;
}
.opt.is-on .opt-key { border-color: var(--ink); border-width: 2px; }
.opt-body { flex: 1; min-width: 0; font-size: 17px; }

/* MR は 4列×2行のグリッドに SVG をそのまま並べる */
.opts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opts-grid .opt {
  flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; min-height: 0;
}
.opts-grid .opt.is-on { padding: 7px 3px; }
/* 図形は原寸 90px。拡大しすぎると1画面に8つ収まらないので上限を付ける */
.opts-grid .opt-body { width: 100%; max-width: 112px; margin: 0 auto; }
.opt-svg svg { display: block; width: 100%; height: auto; }

/* PS の2択は横並び（押しやすさを優先） */
.opts-row { flex-direction: row; gap: 12px; }
.opts-row .opt { justify-content: center; min-height: 64px; font-size: 19px; }
.opts-row .opt-body { flex: 0 0 auto; font-size: 19px; }

/* 例題の選択肢（押せない）。正解は罫線を太くして示す（色は使わない） */
.opt.is-static { cursor: default; background: #fff; opacity: 1; }
.opt.is-static:hover { background: #fff; }
.opt.is-answer { border-color: var(--ink); border-width: 2px; padding: 7px 13px; }
.opts-grid .opt.is-answer { padding: 7px 3px; }

@media (max-width: 560px) {
  /* SP では MR の選択肢を2列に。3×3 の図は横幅に合わせて縮む */
  .opts-grid { grid-template-columns: repeat(2, 1fr); }
  .opts-grid .opt-body { max-width: 140px; }
  .q-matrix svg { max-width: 100%; }
  .q-str { font-size: 22px; letter-spacing: .12em; padding: 10px 12px; }
  .q-stem { font-size: 17px; padding: 13px 14px; }
  .q-term { min-width: 48px; height: 44px; font-size: 17px; }
  .opt-body { font-size: 16px; }
}

/* ==================================================================
   7) 性格特性の検査（survey.php）
   ================================================================== */

.survey-lead { margin-bottom: 16px; }
.survey-page { font-size: 12.5px; color: var(--sub); margin: 0 0 6px; letter-spacing: .06em; }

.qitem {
  border: 0; border-top: 1px solid var(--line);
  margin: 0; padding: 18px 0 16px;
}
.qitem:first-of-type { border-top: 0; padding-top: 6px; }
.qitem.is-bad { border-left: 3px solid var(--danger); padding-left: 12px; }
.qitem-h { display: flex; gap: 10px; align-items: baseline; padding: 0; margin: 0 0 12px; }
.qitem-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 24px; flex-shrink: 0;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums;
}
.qitem.is-done .qitem-no { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.qitem-t { font-size: 17px; line-height: 1.6; }
.qitem-err { font-size: 12.5px; color: var(--danger); font-weight: 600; margin: 8px 0 0; }

.scale { display: flex; align-items: center; gap: 12px; }
.scale-end { font-size: 11.5px; color: var(--sub); width: 84px; flex-shrink: 0; line-height: 1.45; }
.scale-end-r { text-align: right; }
.scale-opts { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

/* ラジオ本体は隠さず、キーボード操作とフォーカスリングを活かす */
.sc {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 46px; padding: 6px 2px;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: #fff; cursor: pointer;
}
.sc:hover { background: #f6f6f4; }
.sc input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.sc input:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sc-b { font-size: 12.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.sc-t { display: none; }
.sc:has(input:checked) { border-color: var(--ink); border-width: 2px; background: #f2f2f0; padding: 5px 1px; }
.sc:has(input:checked) .sc-b { color: var(--ink); font-weight: 700; }

/* 「次へ」を DOM 上で先に置いているので、表示位置は order で入れ替える */
.survey-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
}
#surveyNext { order: 2; }
#surveyPrev { order: 1; }
.survey-spacer { order: 1; }

@media (max-width: 640px) {
  .scale { flex-direction: column; align-items: stretch; gap: 6px; }
  .scale-end { width: auto; font-size: 11px; }
  .scale-end-l::before { content: "1 = "; }
  .scale-end-r { text-align: left; }
  .scale-end-r::before { content: "5 = "; }
  .scale-opts { gap: 5px; }
  .qitem-t { font-size: 16px; }
  .survey-actions { flex-direction: column-reverse; align-items: stretch; }
  .survey-actions .btn { width: 100%; }
}

/* ==================================================================
   8) 印刷
   受検画面は紙に出すものではないので、印刷されても実害のない形にする
   ================================================================== */
@media print {
  .exam-bar, .exam-actions, .survey-actions { display: none !important; }
}

/* ==================================================================
   スマホ幅（〜560px）の補正（2026-09-03）
   ------------------------------------------------------------------
   ・所要時間の表: 4列のうち数値2列を nowrap にしていたため、375px では
     「内容」列が 80px ほどしか残らず 1 文字ずつ折れていた。
     スマホでは 1 行＝1 ブロックに組み替える（パート／内容／問題数・制限時間）。
   ・結果の見本 SVG: min-width 560px で横スクロール前提。スクロールできる
     ことが分かるように、包みに薄い影と案内文を出す。
   ================================================================== */
@media (max-width: 560px) {
  .time-table thead { display: none; }
  .time-table, .time-table tbody { display: block; width: 100%; }
  .time-table tr {
    display: grid;
    grid-template-columns: 5.4em minmax(0, 1fr) auto;
    column-gap: 10px; row-gap: 3px;
    padding: 10px 0; border-bottom: 1px solid var(--line, #ddd);
  }
  .time-table tr:last-child { border-bottom: 0; }
  .time-table tr:hover td { background: transparent; }
  .time-table td { display: block; padding: 0; border: 0; white-space: normal; }
  .time-table td:nth-child(1) { grid-row: 1 / 3; color: var(--sub, #666); font-size: 13px; white-space: nowrap; }
  .time-table td:nth-child(2) { grid-column: 2 / 4; }
  .time-table td:nth-child(3) { grid-column: 2; text-align: left; font-size: 13px; color: var(--sub, #666); }
  .time-table td:nth-child(4) { grid-column: 3; text-align: right; font-size: 13px; color: var(--sub, #666); white-space: nowrap; }

  .sample-wrap { position: relative; }
  .sample-wrap::after {
    content: "横にスクロールできます";
    display: block; margin-top: 6px; font-size: 11.5px; color: var(--sub, #666); text-align: right;
  }
}
