/* ============================================================
   public/css/style.css - モール出店診断アプリ スタイル
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  line-height: 1.6;
}

/* ============================================================
   接続ページ
   ============================================================ */
.page-connect {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.connect-wrapper { max-width: 480px; width: 100%; }

.connect-card { text-align: center; }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #60a5fa;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 38px;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 16px;
}

.gradient-text {
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 36px;
}

.hero-sub strong { color: #e2e8f0; }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 20px;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.feature-list {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: left;
}

.feature-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feature-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }

.feature-item strong {
  display: block;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.feature-item span { color: #64748b; font-size: 13px; }

.btn-connect {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: 'Noto Sans JP', sans-serif;
}

.btn-connect:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.5);
}

.note { color: #475569; font-size: 12px; margin-top: 14px; }

/* ============================================================
   共通ヘッダー
   ============================================================ */
.app-header {
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
  padding: 16px 24px;
}

.header-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-label { font-size: 10px; color: #60a5fa; letter-spacing: 2px; margin-bottom: 2px; }
.header-title { font-size: 17px; font-weight: 800; color: #fff; }
.header-shop  { font-size: 12px; color: #94a3b8; }

/* ============================================================
   ローディング
   ============================================================ */
.view-wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 16px 80px;
}

.loading-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  max-width: 480px;
  margin: 40px auto;
}

/* ステップインジケーター */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 6px;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s;
}

.step.active .step-num {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 0 0 4px #bfdbfe;
}

.step.completed .step-num {
  background: #1d4ed8;
  color: #fff;
}

.step-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-right: 12px;
}

.step.active .step-label,
.step.completed .step-label { color: #1d4ed8; font-weight: 700; }

.step-line {
  width: 24px;
  height: 2px;
  background: #e5e7eb;
  margin: 0 4px 0 -4px;
}

/* スピナー */
.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-msg { font-size: 16px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.loading-sub { font-size: 13px; color: #9ca3af; }

/* ============================================================
   結果画面
   ============================================================ */
.result-container { display: flex; flex-direction: column; gap: 20px; }

.card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-label { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 16px; }

/* ショップサマリー */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 500px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

.summary-item {
  text-align: center;
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 8px;
}

.summary-label { font-size: 11px; color: #9ca3af; margin-bottom: 4px; }
.summary-value { font-size: 18px; font-weight: 900; color: #1e293b; }

.ai-comment {
  background: #eff6ff;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.7;
}

/* トップモールカード */
.card-top {
  border-radius: 16px;
  padding: 24px;
  color: #fff;
}

.top-badge { font-size: 12px; font-weight: 600; letter-spacing: 2px; opacity: 0.85; margin-bottom: 6px; }
.top-mall-name { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.top-increase { font-size: 36px; font-weight: 900; margin-bottom: 4px; }
.top-meta { font-size: 13px; opacity: 0.85; margin-bottom: 18px; }

.top-recommendation {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
}

/* モール別カード */
.section-title { font-size: 15px; font-weight: 700; color: #374151; }

.mall-card {
  background: #fff;
  border: 2px solid #eee;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.mall-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.rank-icon  { font-size: 20px; }
.mall-icon  { font-size: 20px; }
.mall-name  { font-weight: 700; font-size: 16px; flex: 1; }

.score-badge {
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  border-radius: 20px;
  padding: 2px 12px;
}

.score-bar-wrap { margin-bottom: 16px; }

.score-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.score-bar-bg {
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 500px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-item {
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.stat-label { font-size: 10px; color: #9ca3af; margin-bottom: 4px; }
.stat-value { font-size: 17px; font-weight: 900; }

.mall-reason {
  background: #f0fdf4;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #166534;
  margin-bottom: 8px;
  line-height: 1.6;
}

.mall-risk {
  background: #fefce8;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #854d0e;
  line-height: 1.6;
}

/* ESCMS CTA */
.cta-block {
  background: linear-gradient(135deg, #064e3b, #065f46);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(6, 78, 59, 0.3);
}

.cta-label { font-size: 11px; color: #6ee7b7; letter-spacing: 3px; font-weight: 700; margin-bottom: 10px; }
.cta-title { color: #fff; font-size: 20px; font-weight: 900; line-height: 1.5; margin-bottom: 12px; }
.cta-pitch { color: #a7f3d0; font-size: 14px; line-height: 1.7; margin-bottom: 24px; }

.btn-cta-primary {
  display: block;
  width: 100%;
  padding: 16px 24px;
  margin-bottom: 12px;
  background: #10b981;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  font-family: 'Noto Sans JP', sans-serif;
  transition: transform 0.15s;
}

.btn-cta-primary:hover { transform: translateY(-1px); }

.btn-cta-secondary {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: transparent;
  border: 1px solid #6ee7b7;
  border-radius: 12px;
  color: #6ee7b7;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.15s;
}

.btn-cta-secondary:hover { background: rgba(110, 231, 183, 0.1); }

.cta-note { color: #6ee7b7; font-size: 11px; margin-top: 16px; opacity: 0.6; }

.btn-rediagnose {
  padding: 10px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: background 0.15s;
}

.btn-rediagnose:hover { background: #f8fafc; }

/* エラー画面 */
.error-card {
  background: #fff;
  border-radius: 20px;
  padding: 48px 32px;
  text-align: center;
  max-width: 400px;
  margin: 40px auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}

.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-card h2 { color: #dc2626; margin-bottom: 8px; }
.error-card p  { color: #6b7280; margin-bottom: 24px; font-size: 14px; }

.btn-back {
  display: inline-block;
  padding: 12px 24px;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
