:root {
  --primary: #0A0A0A;
  --primary-soft: #1A1A1A;
  --accent: #D4AF37;
  --accent-dark: #A8862A;
  --accent-light: #F4D77A;
  --danger: #B91C1C;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --text: #111827;
  --text-on-dark: #F5F5F5;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --tap: 48px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

/* ─────────── Loader ─────────── */
.loader {
  position: fixed; inset: 0; z-index: 999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--primary); color: var(--text-on-dark);
}
.loader-mark {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--accent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  animation: pulse 1.4s ease-in-out infinite;
  margin-bottom: 16px;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.loader p { color: var(--text-on-dark); font-size: 14px; opacity: 0.8; }

/* ─────────── Header ─────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.header {
  background: var(--primary); color: var(--text-on-dark);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.brand-name { font-weight: 700; letter-spacing: 0.04em; font-size: 15px; }

.close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: var(--text-on-dark);
  border: none; font-size: 24px; line-height: 1; cursor: pointer;
}

.progress {
  height: 3px; background: rgba(255,255,255,0.15);
  position: relative; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--accent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-label {
  display: flex; justify-content: space-between;
  padding: 8px 20px;
  font-size: 12px; opacity: 0.85;
}
.progress-label span:last-child { font-weight: 500; color: var(--accent-light); }

/* ─────────── Main / Steps ─────────── */
.main { flex: 1; padding: 24px 20px 100px; max-width: 600px; margin: 0 auto; width: 100%; }

.step { display: none; animation: fadeUp 0.35s ease; }
.step.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-h {
  font-size: 22px; font-weight: 700; margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.step-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* ─────────── Hero (Step 1) ─────────── */
.hero { margin-bottom: 28px; }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 24px;
  background: var(--primary); border-radius: var(--radius);
  padding: 18px 12px;
  box-shadow: var(--shadow-md);
}
.stat { text-align: center; color: var(--text-on-dark); }
.stat-num {
  font-family: 'Inter', sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.02em;
}
.stat-unit { font-size: 12px; opacity: 0.8; margin-left: 1px; }
.stat-label { font-size: 11px; opacity: 0.75; margin-top: 2px; }

.hero-title {
  font-size: 26px; font-weight: 700; line-height: 1.35;
  letter-spacing: -0.02em; margin-bottom: 10px;
}
.hero-sub { color: var(--text-muted); font-size: 14px; }

/* ─────────── Fields ─────────── */
.field { margin-bottom: 22px; }
.field label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 8px; color: var(--text);
}
.req { background: var(--danger); color: white; font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.opt { background: var(--border); color: var(--text-muted); font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }

input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: inherit; font-size: 16px; color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: var(--tap);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}
.hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ─────────── Chip selector ─────────── */
.chip-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.chip-grid input { display: none; }
.chip {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 8px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px;
  text-align: center; cursor: pointer;
  transition: all 0.18s ease;
  background: var(--surface);
  min-height: var(--tap);
}
.chip-grid input:checked + .chip {
  background: var(--primary); color: var(--accent);
  border-color: var(--primary);
  font-weight: 500;
}

/* ─────────── Upload ─────────── */
.upload-area {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 16px; border: 2px dashed var(--border);
  border-radius: var(--radius); background: #fff;
  cursor: pointer; transition: all 0.2s;
}
.upload-area:hover { border-color: var(--accent); background: #FFFCF3; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-text { font-weight: 500; color: var(--text); }
.upload-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.photo-preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px;
}
.photo-preview img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm);
  position: relative;
  transition: opacity 0.3s;
}
.photo-preview img.uploaded {
  box-shadow: 0 0 0 2px #22C55E;
}
.photo-preview img.upload-failed {
  opacity: 0.5;
  box-shadow: 0 0 0 2px var(--danger);
}
.photo-status {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px; padding: 8px 12px;
  background: #FFFCF3; border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

/* ─────────── Plans ─────────── */
.plans { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.plan {
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 18px;
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.plan.selected {
  border-color: var(--accent); background: #FFFCF3;
  box-shadow: var(--shadow-md);
}
.plan.highlight::before {
  content: attr(data-badge);
  position: absolute; top: -10px; right: 16px;
  background: var(--accent); color: var(--primary);
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; letter-spacing: 0.04em;
}
.plan-h {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.plan-name { font-size: 16px; font-weight: 700; }
.plan-price {
  font-family: 'Inter', sans-serif; font-weight: 700;
  font-size: 20px; color: var(--primary);
}
.plan-price-unit { font-size: 13px; color: var(--text-muted); margin-left: 2px; font-weight: 500; }
.plan-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.plan-features { list-style: none; }
.plan-features li {
  font-size: 13px; padding: 4px 0;
  display: flex; gap: 8px;
}
.plan-features li::before { content: "✓"; color: var(--accent-dark); font-weight: 700; }

/* ─────────── Quote card ─────────── */
.quote-card {
  background: var(--primary); color: var(--text-on-dark);
  border-radius: var(--radius); padding: 20px;
  margin-bottom: 24px; box-shadow: var(--shadow-lg);
  border: 2px solid var(--accent);
}
.quote-label { font-size: 12px; opacity: 0.8; margin-bottom: 6px; letter-spacing: 0.06em; }
.quote-amount {
  font-family: 'Inter', sans-serif; font-size: 32px; font-weight: 700;
  color: var(--accent); letter-spacing: -0.02em;
}
.quote-detail { font-size: 13px; opacity: 0.85; margin-top: 4px; }
.quote-roi { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.15); }
.roi-line { font-size: 13px; padding: 4px 0; opacity: 0.95; }
.roi-line strong { color: var(--accent-light); font-family: 'Inter', sans-serif; margin-left: 4px; }

/* ─────────── Buttons ─────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 16px 20px;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
  min-height: 52px; text-decoration: none;
}
.btn-primary {
  background: var(--primary); color: var(--accent);
  box-shadow: var(--shadow-md);
}
.btn-primary:hover, .btn-primary:active {
  background: var(--primary-soft); transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}
.btn-gold {
  background: var(--accent); color: var(--primary);
  box-shadow: var(--shadow-md);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-row { display: flex; gap: 10px; margin-top: 24px; }
.btn-row .btn-ghost { flex: 0 0 35%; }
.btn-row .btn-primary { flex: 1; }
.arrow { font-size: 18px; }

/* ─────────── Trust signals ─────────── */
.trust {
  background: #F0FDF4; border-radius: var(--radius-sm); padding: 14px 16px;
  border-left: 3px solid #16A34A;
  margin: 20px 0;
}
.trust-item { font-size: 13px; padding: 3px 0; color: #14532D; }

/* ─────────── Done screen ─────────── */
.done { text-align: center; padding: 20px 0; }
.done-mark {
  width: 88px; height: 88px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--accent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  animation: bounce 0.8s ease;
}
@keyframes bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.done-h { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.done-sub { color: var(--text-muted); margin-bottom: 24px; }
.done-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 18px; text-align: left;
  margin-bottom: 24px;
}
.done-card-h {
  font-size: 12px; color: var(--text-muted);
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.done-card div { font-size: 14px; padding: 4px 0; }
.done-cta-label { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.done .btn { margin-bottom: 10px; }

/* ─────────── Footer ─────────── */
.footer {
  background: var(--primary); color: rgba(255,255,255,0.7);
  text-align: center; padding: 20px;
  font-size: 11px;
}
.footer-link {
  display: inline-block; margin-top: 8px;
  color: var(--accent); text-decoration: none; font-weight: 500;
}
.footer-link:hover { text-decoration: underline; }

/* ─────────── Responsive ─────────── */
@media (max-width: 360px) {
  .chip-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { font-size: 22px; }
  .stat-num { font-size: 18px; }
}
