/* ==========================================================================
   MALP Theme — V5H (Neo-Japanese Horizontal, 藍)
   既存のクラス名は完全互換。配色・タイポ・装飾だけを差し替え。
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+JP:wght@300;400;500;600;700;900&family=Noto+Serif+JP:wght@300;400;500;600;700;900&family=Shippori+Mincho:wght@400;500;600;700;800&display=swap');

/* Design Tokens — 藍 (ai) */
:root {
  --ink: #0f1420; /* 墨寄りの紺 */
  --ink-2: #4c5368;
  --ink-3: #8a8f9f;
  --paper: #eae4d5; /* 生成 */
  --paper-2: #d3cdb9; /* 少し濃い生成 */
  --paper-3: #f5f1e4; /* 薄い生成（カード内） */
  --accent: #1e3a7a; /* 藍 */
  --accent-2: #a35a1d; /* 朱 */
  --danger: #a3281d;

  /* 後方互換: 旧名を新トークンにマップ */
  --bg-base: var(--paper);
  --bg-gradient-1: var(--paper);
  --bg-gradient-2: var(--paper);
  --accent-gold: var(--accent);
  --accent-cyan: var(--accent);
  --accent-red: var(--danger);
  --accent-green-1: var(--ink);
  --accent-green-2: var(--ink);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --card-bg: var(--paper-3);
  --card-border: var(--ink);

  --line: var(--ink);
  --fs-serif: 'Shippori Mincho', 'Noto Serif JP', serif;
  --fs-sans: 'Noto Sans JP', sans-serif;
  --fs-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--fs-sans);
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

/* Screen Navigation */
.screen {
  display: none;
  opacity: 0;
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  position: relative;
}
.screen.active {
  display: block;
  animation: fadeIn 0.4s ease forwards;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography */
h1 {
  font-family: var(--fs-serif);
  font-size: clamp(32px, 7vw, 44px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  color: var(--ink);
  text-wrap: pretty;
}
h1 br + * {
  display: inline;
}
h2 {
  font-family: var(--fs-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  color: var(--ink);
}

.text-gold {
  color: var(--accent);
  font-family: var(--fs-serif);
  font-weight: 600;
}
.text-cyan {
  color: var(--accent);
  font-weight: 600;
}
.text-secondary {
  color: var(--ink-2);
}
.text-muted {
  color: var(--ink-3);
}
.text-center {
  text-align: center;
}
.text-sm {
  font-size: 13px;
}
.text-lg {
  font-size: 18px;
}
.font-bold {
  font-weight: 700;
}

/* --- 和モチーフ: スクリーン共通ヘッダー罫 --- */
.screen::before {
  content: 'MALP · 不動産 M&A 手残り診断';
  display: block;
  font-family: var(--fs-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  padding-bottom: 10px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--ink);
}

/* --- 印鑑風の四角囲み文字 --- */
.stamp {
  display: inline-block;
  border: 2px solid var(--accent);
  padding: 2px 6px;
  margin: 0 2px;
  line-height: 1;
  color: var(--accent);
}

/* --- スタート画面 --- */
#screen-start h1 {
  font-size: clamp(34px, 8vw, 52px);
  line-height: 1.35;
  text-align: left;
}
#screen-start .text-center > p.text-secondary {
  text-align: left;
  font-family: var(--fs-serif);
  line-height: 2;
  font-size: 15px;
  color: var(--ink-2);
  padding: 14px 0 18px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 24px !important;
}
#screen-start .text-center {
  text-align: left;
}

/* CTA Button — 墨インク風 */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--fs-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 4px 4px 0 0 var(--accent);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.2s ease;
}
.cta-button::before {
  content: '';
  flex: 0 0 8px;
}
.cta-button:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 0 var(--ink);
}
.cta-button:active {
  transform: translate(0, 0);
  box-shadow: 2px 2px 0 0 var(--accent);
}
.cta-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 0 var(--ink-3);
}

/* Card — 紙のパネル */
.card {
  background: var(--paper-3);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: 22px;
  margin-bottom: 14px;
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(15, 20, 32, 0.08);
  pointer-events: none;
}
.card--gold {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 0 var(--accent);
}
.card--cyan {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 0 var(--ink-2);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 2px;
  background: rgba(15, 20, 32, 0.1);
  border: 0;
  margin-bottom: 22px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* Choice Grid */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.choice-button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 18px 16px;
  background: var(--paper-3);
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--fs-serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  position: relative;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.choice-button::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color 0.15s;
}
.choice-button:hover {
  background: var(--paper-2);
}
.choice-button:hover::before {
  border-color: rgba(15, 20, 32, 0.15);
}
.choice-button.selected {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 0 var(--accent);
  transform: translate(-1px, -1px);
}
.choice-button.selected::before {
  border-color: rgba(234, 228, 213, 0.2);
}

/* Number Input */
.number-input-wrap {
  position: relative;
  margin-bottom: 16px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 14px 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.number-input-wrap::before {
  content: '金額';
  font-family: var(--fs-serif);
  font-size: 13px;
  color: var(--ink-2);
  width: 48px;
  flex: 0 0 48px;
}
.number-input {
  flex: 1;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--fs-serif);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: none;
  width: 100%;
}
.number-input:focus {
  outline: none;
}
.number-input::placeholder {
  color: var(--ink-3);
  font-weight: 400;
  font-size: 22px;
}
.number-input-wrap::after {
  content: '円';
  font-family: var(--fs-serif);
  font-size: 22px;
  color: var(--ink-2);
}

/* text 入力（法人名など）は金額UIでなく別フォーム見え */
.number-input[placeholder='法人名を入力'] {
  font-size: 18px;
  font-family: var(--fs-sans);
  font-weight: 500;
}
.number-input-wrap:has(.number-input[placeholder='法人名を入力'])::before {
  content: '社名';
}
.number-input-wrap:has(.number-input[placeholder='法人名を入力'])::after {
  content: '';
}

/* 単独<input class="number-input">（wrap無し）にも枠を効かせる */
#question-body > input.number-input {
  border: 1px solid var(--ink);
  padding: 14px 16px;
  font-size: 18px;
  font-family: var(--fs-sans);
  background: var(--paper-3);
  margin-bottom: 16px;
}

/* Preset */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 18px;
}
.preset-button {
  padding: 11px 10px;
  background: var(--paper-3);
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--fs-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.preset-button:hover {
  background: var(--paper-2);
}
.preset-button.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Checkbox */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
  border-top: 1px solid var(--ink);
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  background: transparent;
  border: 0;
  border-bottom: 1px dotted var(--ink-3);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}
.checkbox-item:hover {
  background: rgba(15, 20, 32, 0.03);
}
.checkbox-item.checked {
  background: rgba(30, 58, 122, 0.06);
}
.checkbox-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 18px;
}
.checkbox-item label {
  color: var(--ink-2);
  font-family: var(--fs-serif);
  font-size: 15px;
  cursor: pointer;
  flex: 1;
}
.checkbox-item.checked label {
  color: var(--ink);
  font-weight: 600;
}

/* Nav Buttons */
.nav-buttons {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.nav-button--back,
.nav-button--next {
  flex: 1;
  padding: 15px 18px;
  border-radius: 0;
  font-family: var(--fs-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s;
}
.nav-button--back {
  background: var(--paper-3);
  border: 1px solid var(--ink);
  color: var(--ink);
}
.nav-button--back:hover {
  background: var(--paper-2);
}
.nav-button--next {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: var(--paper);
  box-shadow: 3px 3px 0 0 var(--accent);
}
.nav-button--next:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 0 var(--ink);
}
.nav-button--next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 0 var(--ink-3);
}

/* Loading */
.loading-spinner {
  width: 52px;
  height: 52px;
  border: 2px solid var(--ink);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 28px;
  position: relative;
}
.loading-spinner::after {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-steps {
  list-style: none;
  padding: 0;
  max-width: 340px;
  margin: 0 auto;
  border-top: 1px solid var(--ink);
}
.loading-steps li {
  color: var(--ink-2);
  font-family: var(--fs-serif);
  font-size: 14px;
  padding: 12px 6px;
  border-bottom: 1px dotted var(--ink-3);
  text-align: left;
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}
.loading-steps li:nth-child(1) {
  animation-delay: 0.5s;
}
.loading-steps li:nth-child(2) {
  animation-delay: 1.5s;
}
.loading-steps li:nth-child(3) {
  animation-delay: 2.5s;
}
.loading-steps li:nth-child(4) {
  animation-delay: 3.5s;
}

/* Result Banner */
.result-banner {
  text-align: center;
  padding: 28px 20px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  margin-bottom: 18px;
  position: relative;
  box-shadow: 4px 4px 0 0 var(--accent);
}
.result-banner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(234, 228, 213, 0.25);
}
.result-banner p.text-secondary,
.result-banner .text-secondary {
  color: rgba(234, 228, 213, 0.7) !important;
}
.result-banner .text-muted {
  color: rgba(234, 228, 213, 0.5) !important;
}
.result-banner__amount {
  font-family: var(--fs-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--paper);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 8px 0;
}

/* Blur overlay */
.blurred {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
.blur-overlay {
  position: relative;
}
.blur-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 32, 0.5);
  backdrop-filter: blur(4px);
}

/* Badge — 和風ラベル */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--paper-3);
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--fs-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.5;
}

/* Features Row — 3カラムの実績セル */
.features-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 26px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.feature-item {
  text-align: left;
  padding: 16px 12px;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--ink);
  border-radius: 0;
}
.feature-item:last-child {
  border-right: 0;
}
.feature-item__icon {
  font-family: var(--fs-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
  line-height: 1;
}
.feature-item__label {
  font-family: var(--fs-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
}
.feature-item__num {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.feature-item__sub {
  font-family: var(--fs-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.feature-item__desc {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 6px;
}

/* Trust Badges — 小型のインラインチップ */
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  margin-bottom: 22px;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  font-family: var(--fs-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

/* Footer Note */
.footer-note {
  text-align: left;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--fs-serif);
  padding: 24px 0 0;
  margin-top: 20px;
  line-height: 1.9;
  border-top: 1px solid var(--ink);
}

/* Question number / sub */
#question-number {
  font-family: var(--fs-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}
#question-title {
  font-family: var(--fs-serif);
}
#question-sub {
  font-family: var(--fs-serif);
  color: var(--ink-2);
  font-size: 14px;
  padding-bottom: 14px;
  border-bottom: 1px dotted var(--ink-3);
  margin-bottom: 8px;
}

/* Loading screen */
#screen-loading .text-center > p.text-secondary {
  font-family: var(--fs-serif);
  font-size: 15px;
}

/* Responsive */
@media (min-width: 768px) {
  .screen {
    max-width: 640px;
    padding: 48px 28px 64px;
  }
  h2 {
    font-size: 26px;
  }
  .card {
    padding: 28px;
  }
  .result-banner__amount {
    font-size: 48px;
  }
}

/* Print / ロードステップのマージン */
.loading-steps li::before {
  content: '· ';
  color: var(--accent);
  margin-right: 4px;
}
