/* =============================================================================
 *  Actara 研修アプリ ── スタイル（明るく・写真を活かすデザイン）
 * ============================================================================= */

:root {
  --bg:        #f6f8fb;
  --surface:   #ffffff;
  --ink:       #1c2536;
  --ink-soft:  #5b6678;
  --line:      #e6ebf2;
  --accent:    #2563eb;
  --accent-2:  #38bdf8;
  --good:      #16a34a;
  --bad:       #dc2626;
  --warn:      #d97706;
  --shadow:    0 6px 24px rgba(28, 37, 54, .08);
  --shadow-sm: 0 2px 10px rgba(28, 37, 54, .06);
  --radius:    18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
               system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ---------- ヘッダー / フッター ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-weight: 700; letter-spacing: .02em; }
.header-spacer { flex: 1; }
.back-btn {
  border: none; background: #eef2f8; color: var(--ink);
  font-size: 15px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.back-btn:hover { background: #e3e9f3; }

.app-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 28px 16px 40px;
}

/* ---------- レイアウト ---------- */
.view {
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 18px 10px;
  min-height: 60vh;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title { font-size: 26px; font-weight: 800; margin: 6px 0 2px; }
.page-sub   { color: var(--ink-soft); margin: 0 0 22px; }

/* ---------- キャリア選択（ホーム） ---------- */
.hero-lead {
  background: linear-gradient(135deg, #eaf2ff, #f0fbff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px;
  margin-bottom: 26px;
}
.hero-lead h1 { margin: 0 0 6px; font-size: 24px; }
.hero-lead p  { margin: 0; color: var(--ink-soft); }

.section-label {
  font-size: 13px; font-weight: 700; letter-spacing: .08em;
  color: var(--ink-soft); text-transform: uppercase;
  margin: 26px 4px 12px;
}

.carrier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.carrier-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
  text-align: left;
}
.carrier-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.carrier-cover {
  height: 96px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.carrier-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--c, #2563eb), transparent 120%);
  opacity: .92;
}
.carrier-cover .initial {
  position: absolute; right: 14px; bottom: -16px;
  width: 48px; height: 48px; border-radius: 14px;
  background: #fff; color: var(--c, #2563eb);
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.carrier-body { padding: 22px 18px 18px; }
.carrier-body h3 { margin: 0 0 2px; font-size: 19px; }
.carrier-body .tag { color: var(--ink-soft); font-size: 13px; }
.carrier-stats {
  display: flex; gap: 14px; margin-top: 14px;
  font-size: 12.5px; color: var(--ink-soft);
}
.carrier-stats b { color: var(--ink); }

/* ---------- キャリア詳細：タブ ---------- */
.carrier-hero {
  border-radius: var(--radius);
  padding: 28px 24px;
  color: #fff;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  background-size: cover; background-position: center;
}
.carrier-hero h1 { margin: 0; font-size: 28px; }
.carrier-hero p  { margin: 4px 0 0; opacity: .9; }

.tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 22px;
  position: sticky; top: 60px; z-index: 10;
  background: var(--bg); padding: 6px 0;
}
.tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14.5px; font-weight: 600;
  cursor: pointer;
  transition: all .12s ease;
}
.tab:hover { border-color: #cdd7e6; }
.tab.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---------- カード（共通） ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p  { margin: 0; color: var(--ink-soft); }
.pill {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 10px; border-radius: 999px;
  background: #eef2f8; color: var(--ink-soft);
  margin-bottom: 8px;
}
.pill.catch    { background: #fff1e6; color: #b45309; }
.pill.roleplay { background: #e6f4ff; color: #1d4ed8; }

/* ---------- 知識：カテゴリ見出し ---------- */
.cat-head {
  font-size: 15px; font-weight: 800;
  margin: 22px 4px 10px; color: var(--accent);
}

/* ---------- 動画 ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0d1220;
  margin-bottom: 12px;
}
.video-frame iframe,
.video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #aeb9cc; gap: 8px; text-align: center;
  background: repeating-linear-gradient(45deg, #11182b, #11182b 12px, #131c33 12px, #131c33 24px);
}
.video-placeholder .icon { font-size: 34px; }

/* ---------- ノウハウ：手順 ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 12px 0 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 44px;
  border-bottom: 1px dashed var(--line);
}
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 8px;
  width: 28px; height: 28px;
  background: var(--accent); color: #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}

/* ---------- テスト ---------- */
.test-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .test-menu { grid-template-columns: 1fr; } }
.test-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.test-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.test-card .big { font-size: 30px; }
.test-card h3 { margin: 8px 0 4px; }
.test-card p { color: var(--ink-soft); margin: 0; font-size: 13.5px; }

.q-card { background: var(--surface); border: 1px solid var(--line);
          border-radius: 14px; padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.q-num { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.q-text { font-size: 17px; font-weight: 700; margin: 4px 0 14px; }

.opt {
  display: block; width: 100%; text-align: left;
  border: 1.5px solid var(--line); background: #fff;
  border-radius: 12px; padding: 13px 16px; margin-bottom: 10px;
  font-size: 15px; cursor: pointer; transition: all .1s ease;
}
.opt:hover { border-color: #b9c6da; }
.opt.selected { border-color: var(--accent); background: #f0f6ff; }
.opt.correct  { border-color: var(--good); background: #ecfdf3; }
.opt.wrong    { border-color: var(--bad);  background: #fef2f2; }
.opt .mark { float: right; font-weight: 800; }

textarea.answer {
  width: 100%; min-height: 110px;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; resize: vertical;
}
textarea.answer:focus { outline: none; border-color: var(--accent); }

.explain {
  margin-top: 12px; padding: 12px 14px;
  background: #f7faff; border-left: 4px solid var(--accent);
  border-radius: 8px; font-size: 14px; color: var(--ink-soft);
}
.explain.model { background: #f3fdf6; border-color: var(--good); }
.kw { display: inline-block; font-size: 12px; font-weight: 700;
      padding: 2px 9px; border-radius: 999px; margin: 3px 4px 0 0; }
.kw.hit  { background: #ecfdf3; color: var(--good); }
.kw.miss { background: #f1f4f8; color: var(--ink-soft); }

/* ---------- ボタン ---------- */
.btn {
  border: none; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 13px 22px;
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-sm); transition: filter .12s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #eef2f8; color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 結果 ---------- */
.score-hero {
  text-align: center; padding: 30px 20px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eaf2ff, #f0fbff);
  border: 1px solid var(--line); margin-bottom: 18px;
}
.score-hero .score { font-size: 52px; font-weight: 900; color: var(--accent); }
.score-hero .label { color: var(--ink-soft); }

/* ---------- 空状態 ---------- */
.empty {
  text-align: center; color: var(--ink-soft);
  padding: 48px 20px; border: 2px dashed var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.empty .icon { font-size: 40px; opacity: .6; }
.empty p { margin: 10px 0 0; }
.empty code { background: #eef2f8; padding: 2px 7px; border-radius: 6px; font-size: 13px; }
