/* CSP — 通信営業の案件×信用プラットフォーム
   Design tokens benchmarked on 助太刀 onboarding: near-black canvas, signal-yellow accent,
   big centered questions with keyword highlight, top progress bar, round yellow FAB. */

:root {
  --bg: #141414;
  --bg-raised: #1d1d1d;
  --bg-card: #222222;
  --line: #333333;
  --text: #f4f4f2;
  --text-muted: #9b9b96;
  --accent: #ffd400;          /* signal yellow */
  --accent-ink: #141414;
  --accent-dim: #8f7d10;
  --good: #4ecb71;
  --warn: #ff6b5e;
  --info: #6db3ff;
  --radius: 16px;
  --radius-s: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 20px 120px; }
.wrap-wide { max-width: 1080px; margin: 0 auto; padding: 20px 20px 80px; }

/* brand */
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .mark {
  font-weight: 900; letter-spacing: 0.06em; font-size: 1.5rem;
  color: var(--accent-ink); background: var(--accent);
  padding: 2px 10px; border-radius: 8px;
}
.brand .sub { color: var(--text-muted); font-size: 0.8rem; }

/* wizard question typography (benchmark signature) */
.q-title {
  font-size: clamp(1.5rem, 5.4vw, 2rem);
  font-weight: 800; text-align: center; line-height: 1.5; margin: 28px 0 8px;
}
.q-title em { font-style: normal; color: var(--accent); }
.q-note { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin: 0 0 24px; }

/* progress */
.progress-track { position: fixed; top: 0; left: 0; right: 0; height: 5px; background: #2a2a2a; z-index: 30; }
.progress-bar { height: 100%; background: #8b8b86; width: 0%; transition: width .3s ease; }
.step-count { color: var(--text-muted); font-size: 0.85rem; margin: 18px 0 0; }

/* match banner (benchmark: 条件に合う事業者数) */
.match-banner {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(90deg, #1c2733, #17202a);
  border: 1px solid #2b3947; border-radius: var(--radius-s);
  padding: 10px 14px;
}
.match-banner .label { font-size: 0.85rem; font-weight: 700; }
.match-banner .hint { font-size: 0.75rem; color: var(--text-muted); }
.match-banner .num { color: var(--accent); font-size: 1.6rem; font-weight: 900; white-space: nowrap; }
.match-banner .num small { color: var(--text); font-size: 0.75rem; font-weight: 400; margin-left: 2px; }

/* option cards */
.opt-group { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; margin: 8px 0 20px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 16px; cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.opt:last-child { border-bottom: none; }
.opt:hover { background: #2a2a2a; }
.opt .box {
  flex: none; width: 26px; height: 26px; margin-top: 2px;
  border-radius: 7px; border: 2px solid #555; background: #191919;
  display: grid; place-items: center; font-weight: 900; color: transparent; font-size: 0.9rem;
}
.opt .box.round { border-radius: 50%; }
.opt.selected .box { background: #fff; border-color: #fff; color: #141414; }
.opt.selected .box.round { background: #191919; border-color: #fff; color: var(--accent); }
.opt.selected .box.round::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.opt .body { flex: 1; }
.opt .label { font-size: 1.05rem; font-weight: 600; }
.opt .desc { font-size: 0.8rem; color: var(--text-muted); }

/* inputs */
.field { background: var(--bg-card); border-radius: var(--radius-s); padding: 4px 14px; margin: 10px 0; display: flex; align-items: center; gap: 12px; }
.field label { flex: none; color: var(--text); font-size: 0.95rem; min-width: 3.5em; }
.field input, .field select {
  flex: 1; background: transparent; border: none; color: var(--text);
  font-size: 1.05rem; padding: 14px 0; outline: none; width: 100%;
}
.field input::placeholder { color: #666; }
textarea.big {
  width: 100%; min-height: 160px; background: var(--bg-card); border: none; border-radius: var(--radius-s);
  color: var(--text); font-size: 1rem; padding: 14px; outline: none; resize: vertical;
  font-family: inherit; line-height: 1.7;
}
.char-count { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
.small-note { color: var(--text-muted); font-size: 0.78rem; }

/* nav FABs (benchmark signature) */
.wiz-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(20,20,20,.92) 40%);
  max-width: 640px; margin: 0 auto;
}
.fab {
  width: 64px; height: 64px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; font-size: 1.5rem; transition: transform .1s, opacity .2s;
}
.fab:active { transform: scale(.94); }
.fab.next { background: var(--accent); color: var(--accent-ink); }
.fab.next:disabled { background: var(--accent-dim); cursor: not-allowed; }
.fab.back { background: transparent; color: var(--text); border: 1px solid #444; }
.skip-btn {
  background: transparent; color: var(--text); border: 1px solid #4a4a4a; border-radius: 999px;
  padding: 12px 34px; font-size: 1rem; cursor: pointer;
}

/* buttons */
.btn {
  display: inline-block; border: none; cursor: pointer; font-weight: 700;
  border-radius: 999px; padding: 12px 22px; font-size: 0.95rem;
  background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid #4a4a4a; }
.btn.danger { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.btn.small { padding: 7px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* console layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.topbar .who { font-size: 0.85rem; color: var(--text-muted); text-align: right; }
.card { background: var(--bg-card); border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.grid { display: grid; gap: 14px; }
@media (min-width: 860px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.stat { background: var(--bg-card); border-radius: var(--radius); padding: 16px 18px; }
.stat .n { font-size: 1.7rem; font-weight: 900; color: var(--accent); }
.stat .l { font-size: 0.8rem; color: var(--text-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: #333; color: var(--text); }
.badge.yellow { background: var(--accent); color: var(--accent-ink); }
.badge.green { background: #1d3a27; color: var(--good); }
.badge.red { background: #3a1d1d; color: var(--warn); }
.badge.blue { background: #1d2a3a; color: var(--info); }

table.list { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; }

.trust-line { font-size: 0.82rem; color: var(--text-muted); }
.trust-score { font-weight: 900; color: var(--accent); }
.trust-flag-bad { color: var(--warn); font-weight: 700; }

.code-reveal {
  background: #101418; border: 1px dashed var(--accent); border-radius: var(--radius-s);
  padding: 14px; margin: 10px 0; font-family: ui-monospace, monospace; font-size: 1.15rem;
  color: var(--accent); letter-spacing: 0.08em; text-align: center;
}

.tabs { display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.tab { background: transparent; color: var(--text-muted); border: 1px solid #3a3a3a; border-radius: 999px; padding: 8px 18px; cursor: pointer; font-size: 0.88rem; }
.tab.active { background: var(--text); color: #141414; border-color: var(--text); font-weight: 700; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #2c2c2c; color: var(--text); border-radius: 999px; padding: 12px 22px;
  font-size: 0.9rem; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.5);
}
.hidden { display: none !important; }

.flow-strip { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.68rem; color: var(--text-muted); margin: 6px 0; }
.flow-strip span { padding: 2px 8px; border-radius: 6px; background: #2a2a2a; }
.flow-strip span.done { background: #2c2a12; color: var(--accent); }
.flow-strip span.now { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
input:focus-visible, button:focus-visible, .opt:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dark-native form controls (fix white-on-white select) */
:root { color-scheme: dark; }
.field select { background: var(--bg-card); }
.field select option { background: #1d1d1d; color: var(--text); }

/* fix: native select dropdown was white-on-white */
.field select { background-color: #1f1f1f; color: var(--text); color-scheme: dark; }
.field select option { background: #1f1f1f; color: var(--text); }
