/* style.css
   名刺マッチングアプリ Pro のスタイル。スマホ縦画面ファースト。
   フレームワーク不使用のため、シンプルなユーティリティ的クラスで構成する。 */

:root {
  --color-bg: #f4f5f7;
  --color-surface: #ffffff;
  --color-primary: #2f6fed;
  --color-primary-dark: #1e4fb8;
  --color-accent: #ff8a3d;
  --color-text: #1c1e21;
  --color-text-sub: #6b7280;
  --color-border: #e2e4e9;
  --color-danger: #d9433e;
  --color-success: #2b9348;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(20, 20, 30, 0.08);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding-bottom: 76px; /* bottom nav分の余白 */
  position: relative;
}

a { color: inherit; text-decoration: none; }

.screen {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 4px 0;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:active { opacity: 0.75; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-secondary { background: #eef1f6; color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 20px; font-size: 18px; border-radius: 18px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.capture-hero {
  flex: 1;
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(160deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  border-radius: 22px;
  padding: 24px;
  text-align: center;
}
.capture-hero .icon { font-size: 64px; }
.capture-hero .btn-primary {
  background: #fff;
  color: var(--color-primary-dark);
  font-size: 20px;
  padding: 18px 30px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-sub);
  margin: 0 0 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-sub);
}
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="url"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
  color: var(--color-text);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 70px; }

.confidence-row {
  display: flex;
  gap: 6px;
}
.confidence-chip {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 12px;
  cursor: pointer;
  background: #fff;
}
.confidence-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  background: #eef1f6;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--color-text);
}
.tag.match { background: #ffe6cf; color: #8a4a12; font-weight: 700; }

.match-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid transparent;
}
.match-card.rank-1 { border-color: var(--color-accent); }
.match-rank {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-accent);
}
.match-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-primary-dark);
}
.match-name { font-size: 17px; font-weight: 700; }
.match-company { font-size: 13px; color: var(--color-text-sub); }
.match-reason {
  font-size: 14px;
  line-height: 1.6;
  background: #f7f8fb;
  border-radius: 10px;
  padding: 10px 12px;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--color-border);
  display: flex;
  z-index: 50;
}
.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  font-size: 11px;
  color: var(--color-text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.bottom-nav a.active { color: var(--color-primary); font-weight: 700; }
.bottom-nav .icon { font-size: 20px; }

.person-list-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}
.person-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #dfe6f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-primary-dark);
  flex-shrink: 0;
}
.completeness-badge {
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef1f6;
  color: var(--color-text-sub);
  white-space: nowrap;
}
.completeness-badge.high { background: #dff5e3; color: var(--color-success); }

.search-row {
  display: flex;
  gap: 8px;
}
.search-row input { flex: 1; }

.tabs {
  display: flex;
  gap: 8px;
  background: #eef1f6;
  border-radius: 10px;
  padding: 4px;
}
.tabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-text-sub);
}
.tabs button.active { background: #fff; color: var(--color-primary-dark); box-shadow: var(--shadow); }

.locked-section {
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  padding: 14px;
  background: #fbfbfd;
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.top-bar .back {
  font-size: 20px;
  padding: 4px 8px;
  cursor: pointer;
}

.empty-state {
  text-align: center;
  color: var(--color-text-sub);
  padding: 40px 16px;
  font-size: 14px;
}

.image-preview {
  width: 100%;
  border-radius: 12px;
  max-height: 240px;
  object-fit: contain;
  background: #eee;
}

.stage-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef1f6;
}
.stage-badge.closed { background: #dff5e3; color: var(--color-success); }
.stage-badge.dead { background: #f6dede; color: var(--color-danger); }

.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,25,0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  max-width: 90%;
  text-align: center;
}

.weight-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.weight-row label { flex: 1; font-size: 13px; }
.weight-row input[type="number"] { width: 70px; }

hr.sep { border: none; border-top: 1px solid var(--color-border); margin: 8px 0; }

.small-muted { font-size: 12px; color: var(--color-text-sub); }

/* AI版説明文バッジ(Phase 3) */
.ai-badge {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ダッシュボード用SVGチャートのラッパー(Phase 3) */
.funnel-chart-wrap,
.scatter-chart-wrap {
  width: 100%;
  overflow-x: auto;
}
.funnel-chart-wrap svg,
.scatter-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* MFA(TOTP)のシークレット/リカバリーコード表示(Phase 3) */
.mfa-secret-box {
  background: #f7f8fb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  word-break: break-all;
  white-space: pre-wrap;
  border: 1px solid var(--color-border);
}
