/* ===== MEO Review Collector - 共通スタイル ===== */
:root {
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --brand-900: #1e3a8a;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow:    0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', 'Meiryo', sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ===== サーベイ画面（顧客向け） ===== */
.survey-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand-50) 0%, #fff 50%, var(--brand-100) 100%);
  padding: 24px 16px 64px;
}

.survey-card {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.survey-header {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
  color: #fff;
  padding: 32px 28px 28px;
  text-align: center;
}
.survey-header .logo {
  height: 56px;
  margin-bottom: 12px;
}
.survey-header h1 {
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.survey-header .subtitle {
  font-size: 13px;
  opacity: 0.85;
  margin: 0;
}

.survey-body {
  padding: 28px 28px 32px;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
.step-dot {
  width: 28px;
  height: 4px;
  background: var(--gray-200);
  border-radius: 4px;
  transition: 0.2s;
}
.step-dot.active { background: var(--brand-600); }
.step-dot.done   { background: var(--brand-300); }

.field { margin-bottom: 22px; }
.field label,
.field .label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
  font-size: 14px;
}
.field .hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.field textarea { min-height: 120px; resize: vertical; }

/* 星評価 */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  gap: 6px;
}
.star-rating input { display: none; }
.star-rating label {
  cursor: pointer;
  font-size: 44px;
  color: var(--gray-200);
  transition: color 0.15s, transform 0.15s;
  user-select: none;
  margin: 0;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: #fbbf24;
}
.star-rating label:hover { transform: scale(1.1); }

.rating-text {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 8px;
  min-height: 1.5em;
}

/* 小型の星評価（サブ項目） */
.mini-star {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 3px;
}
.mini-star input { display: none; }
.mini-star label {
  cursor: pointer;
  font-size: 24px;
  color: var(--gray-200);
  transition: color 0.15s;
}
.mini-star label:hover,
.mini-star label:hover ~ label,
.mini-star input:checked ~ label { color: #fbbf24; }

/* チェックボックスチップ */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-group input { display: none; }
.chip-group label {
  display: inline-block;
  padding: 8px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: 0.15s;
}
.chip-group input:checked + label {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.chip-group label:hover { border-color: var(--brand-400); }

/* ラジオピル */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-group input { display: none; }
.pill-group label {
  display: inline-block;
  padding: 10px 18px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
}
.pill-group input:checked + label {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--brand-700);
  font-weight: 600;
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: 0.15s;
}
.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { background: var(--brand-700); transform: translateY(-1px); text-decoration: none; color: #fff; }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: #fff;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-50); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; text-decoration: none; }

.btn-google {
  background: #fff;
  color: var(--gray-800);
  border: 1.5px solid var(--gray-200);
  font-weight: 600;
}
.btn-google:hover { background: var(--gray-50); }

.btn-block { width: 100%; }
.btn-lg { padding: 16px 28px; font-size: 16px; }

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

/* 生成結果 */
.generated-box {
  background: var(--brand-50);
  border: 2px solid var(--brand-200);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  margin-bottom: 16px;
}
.generated-box .label {
  display: inline-block;
  background: var(--brand-600);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
}
.generated-box p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--gray-800);
}

.regenerate-link {
  text-align: right;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ローディング */
.loader {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.thinking {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}
.thinking .loader {
  border-color: var(--gray-200);
  border-top-color: var(--brand-600);
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
}

/* サンクス */
.thanks-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.text-center { text-align: center; }
.muted { color: var(--gray-500); font-size: 13px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }

/* フッタ */
.survey-footer {
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 24px;
}

/* ステップ表示制御 */
.step { display: none; }
.step.active { display: block; }

/* ===== 管理画面 ===== */
.admin-body {
  background: var(--gray-100);
  min-height: 100vh;
}
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  color: #fff;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.sidebar .brand h2 {
  font-size: 16px;
  margin: 0 0 4px;
  color: #fff;
}
.sidebar .brand .role {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: 0.15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar nav a.active {
  background: rgba(255,255,255,0.08);
  border-left-color: var(--brand-300);
  color: #fff;
  font-weight: 600;
}
.sidebar nav a .icon { width: 18px; opacity: 0.9; }

.main {
  padding: 0;
  min-width: 0;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar h1 {
  font-size: 18px;
  margin: 0;
  color: var(--gray-900);
}
.topbar .user-info {
  font-size: 13px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 12px;
}

.content { padding: 28px; }

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 20px;
}
.card h2, .card h3 {
  margin-top: 0;
  color: var(--gray-900);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--brand-600);
}
.stat-card .label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
}
.stat-card .sub {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 4px;
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger  { border-left-color: var(--danger); }

/* テーブル */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th, table.data td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: top;
}
table.data thead th {
  background: var(--gray-50);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-200);
}
table.data tbody tr:hover { background: var(--brand-50); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info    { background: var(--brand-100); color: var(--brand-800); }
.badge-gray    { background: var(--gray-200); color: var(--gray-700); }

.star-display { color: #fbbf24; letter-spacing: 1px; }
.star-display .empty { color: var(--gray-300); }

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar input,
.toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

/* フラッシュ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14px;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ===== ログイン画面（2カラム白基調デザイン） ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 50%, #f1f5f9 100%);
}

.auth-visual {
  flex: 1;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 25%, #2563eb 55%, #0891b2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 50px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(125,211,252,0.35) 0%, transparent 38%),
    radial-gradient(circle at 82% 78%, rgba(56,189,248,0.30) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.12;
  pointer-events: none;
}
.auth-visual-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 460px;
}
.auth-visual .brand-mark {
  width: 76px;
  height: 76px;
  background: rgba(255,255,255,0.22);
  border: 2px solid rgba(255,255,255,0.55);
  border-radius: 22px;
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  font-size: 34px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.auth-visual h2 {
  font-size: 38px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow:
    0 2px 4px rgba(15,23,42,0.35),
    0 4px 16px rgba(15,23,42,0.2);
}
.auth-visual .tagline {
  font-size: 16px;
  font-weight: 400;
  color: #f1f5fb;
  margin: 0 0 40px;
  line-height: 1.8;
  text-shadow: 0 1px 3px rgba(15,23,42,0.3);
}
.auth-visual .feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: inline-block;
}
.auth-visual .feature-list li {
  font-size: 14.5px;
  font-weight: 500;
  padding: 9px 0 9px 34px;
  position: relative;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(15,23,42,0.3);
}
.auth-visual .feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 9px;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.95);
  color: #1e40af;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15,23,42,0.2);
}

/* 装飾のフロート要素 */
.auth-visual .float-card {
  position: absolute;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 12px;
  color: #1e293b;
  box-shadow: 0 12px 32px rgba(15,23,42,0.25);
  z-index: 0;
}
.auth-visual .float-card.fc1 {
  top: 12%;
  left: 8%;
  transform: rotate(-6deg);
}
.auth-visual .float-card.fc2 {
  bottom: 14%;
  right: 8%;
  transform: rotate(5deg);
}
.auth-visual .float-card .stars { color: #f59e0b; letter-spacing: 1px; font-size: 14px; }
.auth-visual .float-card .text { margin-top: 2px; color: #475569; font-size: 11px; font-weight: 500; }

.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 18px;
  padding: 44px 38px;
  box-shadow:
    0 1px 3px rgba(15,23,42,0.04),
    0 20px 48px rgba(15,23,42,0.06);
  border: 1px solid rgba(0,0,0,0.04);
}
.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
}
.auth-card .subtitle {
  font-size: 13px;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .auth-wrap { flex-direction: column; }
  .auth-visual {
    min-height: 200px;
    padding: 36px 28px 32px;
  }
  .auth-visual h2 { font-size: 26px; }
  .auth-visual .tagline { font-size: 13px; margin-bottom: 16px; }
  .auth-visual .feature-list { display: none; }
  .auth-visual .float-card { display: none; }
  .auth-visual .brand-mark { width: 54px; height: 54px; font-size: 24px; margin-bottom: 14px; border-radius: 16px; }
  .auth-form-side { padding: 24px 16px 40px; }
  .auth-card { padding: 32px 26px; border-radius: 14px; }
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gray-400);
  font-size: 12px;
  margin: 20px 0;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* レビュー詳細モーダル */
.review-detail {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 8px;
}
.review-detail dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}
.review-detail dt { color: var(--gray-500); font-weight: 500; }
.review-detail dd { margin: 0; color: var(--gray-800); }
.review-detail .review-text {
  background: #fff;
  border-left: 3px solid var(--brand-400);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  white-space: pre-wrap;
}

/* モバイル */
@media (max-width: 768px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 16px 0;
  }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: 0 12px; }
  .sidebar nav a { padding: 8px 14px; border-left: none; border-radius: var(--radius-sm); }
  .content { padding: 16px; }
  .survey-header { padding: 24px 20px 20px; }
  .survey-body { padding: 24px 20px; }
  .star-rating label { font-size: 38px; }
  .review-detail dl { grid-template-columns: 100px 1fr; }
}
