/* =========================================================
   Minsai 採用力診断アプリ - スタイルシート
   メインカラー: #9E1C33 (エンジ/ワインレッド)
   アクセントカラー: #E85526 (オレンジ)
   ========================================================= */

:root {
  --main-color: #9E1C33;
  --accent-color: #E85526;
  --grad: linear-gradient(120deg, #9E1C33 0%, #E85526 100%);
  --grad-soft: linear-gradient(120deg, rgba(158,28,51,0.08) 0%, rgba(232,85,38,0.08) 100%);
  --text-dark: #262223;
  --text-mid: #5c5457;
  --text-light: #8a8285;
  --bg-page: #FAF7F5;
  --card-bg: #ffffff;
  --border-soft: #eee0e0;
  --danger: #d32f2f;
  --success: #2e7d32;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 6px 24px rgba(158,28,51,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-page);
  color: var(--text-dark);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-logo {
  height: 34px;
  width: auto;
}

.header-tagline {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tagline-badge {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.tagline-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--main-color);
}

.trust-bar {
  background: var(--grad-soft);
  border-top: 1px solid var(--border-soft);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--main-color);
}

.trust-bar i { margin-right: 4px; color: var(--accent-color); }

.trust-sep { color: var(--border-soft); font-weight: 400; }

.progress-track {
  height: 4px;
  background: #f1e6e6;
  width: 100%;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--grad);
  transition: width 0.4s ease;
}

/* ---------------- Layout / Screens ---------------- */
#app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 60px;
  min-height: 60vh;
}

.screen { display: none; animation: fadeIn 0.4s ease; }
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-inner { padding-top: 28px; }

/* ---------------- Intro ---------------- */
.intro-hero {
  text-align: center;
  padding: 60px 10px 30px;
}

.hero-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.5;
  margin: 0 0 20px;
  color: var(--text-dark);
}

.accent-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  color: var(--text-mid);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto 28px;
}

.hero-points {
  list-style: none;
  padding: 0;
  margin: 0 auto 36px;
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.hero-points li {
  font-weight: 500;
  color: var(--text-dark);
}

.hero-points i {
  color: var(--main-color);
  margin-right: 8px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(158,28,51,0.28);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:not(:disabled):hover { box-shadow: 0 10px 26px rgba(158,28,51,0.4); }

.btn-outline {
  background: #fff;
  color: var(--main-color);
  border: 2px solid var(--main-color);
}

.btn-outline:hover { background: rgba(158,28,51,0.06); }

.btn-cta {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 26px rgba(232,85,38,0.4);
  width: 100%;
  padding: 18px 24px;
  font-size: 1.05rem;
}

.btn-cta:hover { box-shadow: 0 14px 32px rgba(232,85,38,0.55); }

.btn-large { padding: 16px 34px; font-size: 1.05rem; }

/* ---------------- Step label / titles ---------------- */
.step-label {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.screen-title {
  font-size: 1.4rem;
  font-weight: 900;
  margin: 0 0 24px;
  color: var(--text-dark);
}

/* ---------------- Question Blocks (Step1) ---------------- */
.question-block {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-card);
}

.q-text {
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-dark);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.choice-btn {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-mid);
  transition: all 0.15s ease;
  text-align: center;
}

.choice-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.choice-btn.selected {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(158,28,51,0.3);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-hint {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ---------------- Market screen（マーケット感・参考情報） ---------------- */
.market-disclaimer {
  background: var(--grad-soft);
  border: 1px solid rgba(158,28,51,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--text-mid);
  margin-bottom: 22px;
}

.market-disclaimer i { color: var(--accent-color); margin-right: 4px; }

.market-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.market-card {
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
}

.market-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.market-job-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-dark);
}

.market-difficulty-badge {
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.market-budget {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--main-color);
  margin-bottom: 8px;
}

.market-budget i { margin-right: 4px; }

.market-note {
  font-size: 0.82rem;
  color: var(--text-mid);
  margin: 0;
}

.market-issue,
.market-solution {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
}

.market-issue p,
.market-solution p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.market-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 999px;
}

.market-tag-issue {
  background: #fdecea;
  color: var(--danger);
}

.market-tag-solution {
  background: #e9f6ea;
  color: var(--success);
}

.market-summary-box {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.9rem;
  line-height: 1.7;
  border-left: 4px solid var(--accent-color);
  background: #fff7f2;
  color: var(--text-dark);
}

.market-summary-box i { color: var(--accent-color); margin-right: 6px; }
.market-summary-box strong { color: var(--main-color); }

.market-summary-text {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ---------------- Gap chart（領域別ギャップ図解） ---------------- */
.gap-chart-wrap {
  position: relative;
  height: 300px;
}

/* ---------------- Step2 Quiz ---------------- */
.area-sub {
  color: var(--text-mid);
  font-weight: 600;
  margin: -14px 0 18px;
}

.area-progress-dots {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.area-dot {
  width: 22px;
  height: 6px;
  border-radius: 4px;
  background: var(--border-soft);
}

.area-dot.done { background: var(--grad); }
.area-dot.current { background: var(--accent-color); }

.quiz-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 28px;
  min-height: 3em;
}

.scale-choices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.scale-btn {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: all 0.15s ease;
}

.scale-btn:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.scale-btn.selected {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

.scale-emoji {
  font-size: 1.6rem;
  font-weight: 900;
}

/* ---------------- Loading ---------------- */
.loading-wrap {
  text-align: center;
  padding: 100px 20px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 6px solid #f1e6e6;
  border-top-color: var(--main-color);
  margin: 0 auto 20px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  color: var(--text-mid);
  font-weight: 600;
}

/* ---------------- Result ---------------- */
.result-inner { padding-bottom: 20px; }

.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin: 0 0 12px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i { color: var(--main-color); }

.card-desc {
  color: var(--text-mid);
  font-size: 0.9rem;
  margin: -4px 0 16px;
}

.type-card {
  text-align: center;
  background: var(--grad-soft);
  border: 1px solid rgba(158,28,51,0.15);
}

/* ---------------- Summary card ---------------- */
.summary-card {
  background: #fff;
  border-left: 4px solid var(--accent-color);
}

.summary-text {
  color: var(--text-mid);
  margin: 0;
  font-size: 0.92rem;
}

/* ---------------- Improve card（90点未達/+αポイント） ---------------- */
.improve-card {
  background: linear-gradient(120deg, #fff9f0 0%, #fff4ec 100%);
  border: 1px solid #f2d9c2;
}

.improve-gap {
  color: var(--text-mid);
  margin: 0 0 16px;
  font-size: 0.92rem;
}

.improve-gap strong { color: var(--accent-color); }

.improve-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.improve-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #f2d9c2;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.improve-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.improve-item h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
}

.improve-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.result-eyebrow {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  margin: 0 0 6px;
}

.type-name {
  font-size: 1.6rem;
  font-weight: 900;
  margin: 0 0 12px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.type-desc {
  color: var(--text-mid);
  max-width: 560px;
  margin: 0 auto 20px;
}

.score-gauge-wrap {
  position: relative;
  width: 220px;
  margin: 10px auto 0;
}

.score-gauge-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--main-color);
  line-height: 1;
}

.score-max {
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 600;
}

.radar-wrap {
  position: relative;
  height: 340px;
  max-width: 480px;
  margin: 0 auto;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-mid);
}

.radar-legend-item { display: flex; align-items: center; gap: 6px; }

.radar-legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
}

/* ---------------- Bucket flow ---------------- */
.bucket-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.bucket-phase {
  display: flex;
  align-items: stretch;
  gap: 14px;
  border-left: 4px solid var(--border-soft);
  padding: 10px 0 10px 18px;
  position: relative;
}

.bucket-phase.leak { border-left-color: var(--danger); }
.bucket-phase.ok { border-left-color: var(--success); }

.bucket-phase-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad-soft);
  color: var(--main-color);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.bucket-phase.leak .bucket-phase-icon { background: #fdecea; color: var(--danger); }
.bucket-phase.ok .bucket-phase-icon { background: #e9f6ea; color: var(--success); }

.bucket-phase-body h4 {
  margin: 4px 0 4px;
  font-size: 0.98rem;
  font-weight: 800;
}

.bucket-phase-body p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.bucket-phase.leak .bucket-phase-body p { color: var(--danger); font-weight: 600; }

.bucket-arrow {
  text-align: center;
  color: var(--text-light);
  margin: 2px 0 2px 14px;
}

/* ---------------- Loss card ---------------- */
.loss-card {
  display: flex;
  gap: 16px;
  background: linear-gradient(120deg, #fff7f2 0%, #fff0ee 100%);
  border: 1px solid #f7cfc4;
}

.loss-icon {
  font-size: 1.8rem;
  color: var(--accent-color);
  flex-shrink: 0;
}

.loss-title { color: var(--accent-color); }

.loss-text {
  color: var(--text-mid);
  margin: 0 0 16px;
}

.loss-text strong { color: var(--main-color); }

.loss-amount {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.loss-amount-label {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 600;
}

.loss-amount-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--danger);
}

/* ---------------- Prescription ---------------- */
.prescription-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.prescription-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.prescription-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.prescription-item h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
}

.prescription-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-mid);
}

.prescription-issue {
  margin: 4px 0 8px !important;
}

.prescription-issue strong { color: var(--danger); }

.prescription-action-label {
  margin: 0 0 4px !important;
}

.prescription-action-label strong { color: var(--main-color); }

.prescription-actions {
  margin: 0 0 10px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prescription-actions li {
  font-size: 0.85rem;
  color: var(--text-mid);
}

.prescription-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--main-color);
  background: var(--grad-soft);
  padding: 2px 10px;
  border-radius: 999px;
}

/* ---------------- Offer banner ---------------- */
.offer-banner {
  background: var(--grad);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  color: #fff;
  text-align: center;
  margin-bottom: 26px;
  box-shadow: 0 16px 36px rgba(158,28,51,0.35);
}

.offer-badge {
  display: inline-block;
  background: #fff;
  color: var(--main-color);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.offer-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 0 12px;
}

.offer-price {
  font-size: 1rem;
  margin: 0 0 18px;
  font-weight: 600;
}

.offer-strike {
  text-decoration: line-through;
  opacity: 0.75;
}

.offer-price-big {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0 4px;
}

.offer-includes {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: rgba(255,255,255,0.12);
  padding: 16px 22px;
  border-radius: var(--radius-md);
}

.offer-includes li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.offer-elevate-logo {
  height: 18px;
  width: auto;
  border-radius: 3px;
  background: #fff;
  padding: 1px 4px;
}

.offer-safety {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  font-size: 0.85rem;
  font-weight: 600;
}

.offer-note {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 10px;
}

.result-nav { justify-content: center; }

/* ---------------- Zero-based result ---------------- */
.zero-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.zero-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.zero-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.zero-item h4 {
  margin: 4px 0 6px;
  font-weight: 800;
}

.zero-item p {
  margin: 0;
  color: var(--text-mid);
  font-size: 0.9rem;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border-soft);
  padding: 24px 16px;
  text-align: center;
}

.footer-logo {
  height: 26px;
  margin: 0 auto 8px;
}

.footer-inner p {
  color: var(--text-light);
  font-size: 0.78rem;
  margin: 0;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
  .hero-title { font-size: 1.5rem; }
  .scale-choices { grid-template-columns: repeat(2, 1fr); }
  .quiz-card { padding: 24px 16px; }
  .choice-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-row { justify-content: center; }
  .offer-includes { width: 100%; }
  .radar-wrap { height: 280px; }
}

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

/* ---------------- Print / PDF保存用スタイル ----------------
   「診断レポートをPDFで保存」ボタン押下時、body に .print-mode を付与し
   window.print() を呼び出す。ブラウザの「PDFとして保存」機能を利用する
   クライアントサイドのみの仕組み（サーバー側PDF生成は行わない）。
------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .nav-row,
  .offer-note,
  #btn-download-pdf,
  #btn-restart,
  #btn-restart-zero {
    display: none !important;
  }

  body { background: #fff; }

  .result-card, .offer-banner {
    box-shadow: none !important;
    border: 1px solid #e5d9d9;
    break-inside: avoid;
  }

  .offer-banner { color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  #app-main { max-width: 100%; padding: 0 10px; }
}
