/* ============================================================
   投資家タイプ診断 — Design System
   Concept: 金融 × AI × ゲーミフィケーション
   (Linear / Stripe / Notion / modern fintech UI を参照した
   ダーク基調・グラデーションアクセントのミニマルデザイン)
   ============================================================ */

:root {
  --bg-0: #05070d;
  --bg-1: #0b0f1a;
  --bg-2: #121828;
  --bg-card: #131a2b;
  --bg-card-hover: #182036;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-0: #f5f7fb;
  --text-1: #c4cbdc;
  --text-2: #8992ab;
  --text-3: #5b6480;

  --accent-1: #7c5cff; /* violet */
  --accent-2: #00d4b8; /* teal */
  --accent-3: #ff7a59; /* coral */
  --accent-4: #ffd166; /* gold */

  --grad-primary: linear-gradient(135deg, #7c5cff 0%, #00d4b8 100%);
  --grad-warm: linear-gradient(135deg, #ff7a59 0%, #ffd166 100%);
  --grad-hero: radial-gradient(circle at 20% 0%, rgba(124, 92, 255, 0.35), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(0, 212, 184, 0.25), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(255, 122, 89, 0.12), transparent 55%);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 0 1px rgba(124, 92, 255, 0.25), 0 8px 30px rgba(124, 92, 255, 0.15);

  --font-sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", "Segoe UI", Roboto, sans-serif;

  --max-width: 480px;
  --header-h: 56px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
}

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

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

button {
  font-family: inherit;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

/* ---------- Layout ---------- */

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-0);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(5, 7, 13, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-0);
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.8);
}

.footer {
  margin-top: auto;
  padding: 32px 20px 40px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.8;
}

.footer a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Hero / Landing ---------- */

.hero {
  position: relative;
  padding: 56px 20px 40px;
  background: var(--grad-hero);
  overflow: hidden;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  background: rgba(0, 212, 184, 0.1);
  border: 1px solid rgba(0, 212, 184, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.hero h1 .gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 15px;
  color: var(--text-1);
  max-width: 340px;
  margin: 0 auto 28px;
}

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 28px;
  color: var(--text-2);
  font-size: 12px;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
  background: var(--grad-primary);
  color: #05070d;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-0);
  border: 1px solid var(--border-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
}

.btn-sm {
  width: auto;
  padding: 10px 18px;
  font-size: 13px;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

/* ---------- Cards / sections ---------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.section {
  padding: 28px 20px;
}

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.04em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title .icon {
  font-size: 14px;
}

/* how-it-works steps — compact 2-column grid (icon + short label) */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.step-card-wide {
  grid-column: span 2;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.step-card .step-icon {
  font-size: 20px;
  line-height: 1;
}

.step-card .step-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
}

.step-card-wide .step-num {
  position: static;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--accent-2);
  border: 1px solid var(--border-strong);
}

.step-card .step-label {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}

/* type preview grid on landing */

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.type-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.type-chip-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.type-chip-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
}

/* ---------- Diagnosis flow ---------- */

.progress-wrap {
  padding: 16px 20px 0;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}

.progress-bar {
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 20px;
}

.question-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.question-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 24px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-0);
  font-size: 14.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.option-btn.selected {
  border-color: var(--accent-1);
  background: rgba(124, 92, 255, 0.12);
}

.option-key {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.diagnosis-footer {
  padding: 8px 20px 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  font-size: 13px;
  padding: 10px 0;
  cursor: pointer;
  background: none;
  border: none;
}

.back-link[disabled] {
  opacity: 0.3;
  pointer-events: none;
}

/* ---------- Result page ---------- */

.result-hero {
  text-align: center;
  padding: 40px 20px 28px;
  background: var(--grad-hero);
}

.result-kicker {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}

.result-type-name {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.35;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 6px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.result-type-en {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.result-tagline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
  margin-bottom: 4px;
}

.result-oneliner {
  font-size: 13.5px;
  color: var(--text-1);
  max-width: 320px;
  margin: 12px auto 0;
}

.type-id-badge {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 700;
}

/* axis bars */

.axis-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.axis-row .axis-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
  color: var(--text-1);
}

.axis-row .axis-labels .active-label {
  font-weight: 700;
  color: var(--text-0);
}

.axis-track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-2);
  overflow: hidden;
}

.axis-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.axis-row[data-axis="income"] .axis-fill {
  background: var(--grad-warm);
}

.axis-row[data-axis="activity"] .axis-fill {
  background: linear-gradient(135deg, #00d4b8, #7c5cff);
}

.axis-row[data-axis="horizon"] .axis-fill {
  background: linear-gradient(135deg, #ffd166, #00d4b8);
}

/* content lists */

.pill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pill-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
}

.pill-item .mark {
  flex-shrink: 0;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.pill-item.strength .mark {
  background: rgba(0, 212, 184, 0.18);
  color: var(--accent-2);
}

.pill-item.weakness .mark {
  background: rgba(255, 122, 89, 0.18);
  color: var(--accent-3);
}

.pill-item.neutral .mark {
  background: rgba(124, 92, 255, 0.18);
  color: var(--accent-1);
}

.callout {
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-1);
}

.callout-warn {
  background: rgba(255, 122, 89, 0.08);
  border: 1px solid rgba(255, 122, 89, 0.25);
}

.callout-info {
  background: rgba(0, 212, 184, 0.08);
  border: 1px solid rgba(0, 212, 184, 0.25);
}

/* prompt box */

.prompt-box {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 16px;
  max-height: 260px;
  overflow-y: auto;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-0);
  color: var(--bg-0);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* share */

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

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-btn .icon {
  font-size: 20px;
}

.share-card-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.share-card-preview canvas {
  width: 100%;
  height: auto;
  display: block;
}

/* CTA / cross-sell */

.cta-card {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(0, 212, 184, 0.1));
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.cta-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.cta-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 0;
}

.pr-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-3);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px 8px;
}

.cta-card-note {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 10px;
  margin-bottom: 0;
}

.cta-card-secondary {
  background: var(--bg-card);
  border-color: var(--border);
}

.cta-card p {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 14px;
}

/* retake */

.retake-link {
  display: block;
  text-align: center;
  padding: 16px;
  color: var(--text-3);
  font-size: 13px;
}

/* disclaimer */

.disclaimer {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.8;
  padding: 16px;
  background: var(--bg-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* utility */

.text-center {
  text-align: center;
}
.mt-8 {
  margin-top: 8px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mb-8 {
  margin-bottom: 8px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.visually-hide {
  display: none !important;
}

/* skeleton / loading */

.loading-dots::after {
  content: "";
  display: inline-block;
  width: 1em;
}

@media (min-width: 540px) {
  .hero h1 {
    font-size: 34px;
  }
}

/* fade-in animation for content blocks */

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

.fade-up {
  animation: fadeUp 0.4s ease both;
}
