/* ============================================================
   劇団夢創 予約サイト - スマートフォン対応スタイル
   ============================================================ */

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

:root {
  --primary: #6a0dad;
  --primary-light: #9c4dcc;
  --primary-dark: #4a0080;
  --accent: #e91e8c;
  --gold: #f5a623;
  --bg: #f8f5ff;
  --white: #ffffff;
  --gray-light: #f0f0f0;
  --gray: #999;
  --text: #333;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.12);
}

body {
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- ヘッダー ---- */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  color: white;
  padding: 16px 16px 12px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.site-header .production { font-size: 11px; opacity: 0.85; }
.site-header h1 { font-size: 26px; font-weight: bold; margin: 4px 0 6px; }
.site-header .hall  { font-size: 12px; opacity: 0.8; }
.site-header .ticket-reserve-label { font-size: 13px; margin-top: 6px; background: rgba(255,255,255,0.2); display: inline-block; padding: 2px 14px; border-radius: 20px; letter-spacing: 0.08em; }

/* ---- ステップインジケーター ---- */
.step-bar {
  background: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-bottom: 1px solid #e0d0f0;
  overflow-x: auto;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray-light);
  color: var(--gray);
  font-size: 12px;
  font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
}
.step-dot.active { background: var(--primary); color: white; }
.step-dot.done   { background: #4caf50; color: white; }
.step-line { width: 24px; height: 2px; background: var(--gray-light); flex-shrink: 0; }
.step-line.done { background: #4caf50; }

/* ---- ステップコンテンツ ---- */
.step { display: none; padding: 16px; max-width: 600px; margin: 0 auto; }
.step.active { display: block; }
.step-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
}

/* ---- 公演選択カード ---- */
.performance-card {
  background: white;
  border: 2px solid #e0d0f0;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.performance-card:hover, .performance-card:active { border-color: var(--primary); }
.performance-card.selected {
  border-color: var(--primary);
  background: #f3e8ff;
  box-shadow: 0 0 0 3px rgba(106,13,173,0.15);
}
.performance-card .perf-num {
  display: inline-block;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 28px; height: 28px;
  text-align: center;
  line-height: 28px;
  font-weight: bold;
  margin-right: 8px;
  font-size: 14px;
}
.performance-card .perf-label { font-size: 16px; font-weight: bold; }
.performance-card .perf-date  { color: var(--gray); font-size: 13px; margin-top: 4px; }
.performance-card .check-icon {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 22px;
  display: none;
}
.performance-card.selected .check-icon { display: block; }

/* ---- 指定席案内 ---- */
.reserved-guide { background: #fff; border: 1px solid #e0d0f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.reserved-guide-title { font-size: 15px; font-weight: bold; color: #6a0dad; margin-bottom: 8px; }
.section-heading { font-size: 15px; font-weight: bold; color: #333; margin-bottom: 10px; }
.tap-guide-block { background: #fff; border: 1px solid #e0d0f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.tap-guide-text { font-size: 15px; font-weight: bold; color: #6a0dad; margin: 0 0 8px; text-align: center; }
.reserved-guide-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.guide-badge { font-size: 11px; font-weight: bold; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.guide-badge.premium { background: #e91e8c; color: #fff; }
.guide-badge.s-seat { background: #f5a623; color: #333; }
.guide-text { font-size: 12px; color: #555; }
.guide-note { font-size: 11px; color: #888; margin: 6px 0 0; }

/* ---- 座席マップ ---- */
.seat-map-wrapper {
  background: white;
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.stage-label {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  color: white;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 12px;
  letter-spacing: 4px;
}
.seat-map-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
.seat-map-svg { display: block; }

/* 座席カラー凡例 */
.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: #faf8ff;
  border-radius: 8px;
  border: 1px solid #e0d0f0;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text);
}
.legend-box {
  width: 16px; height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* ---- 自由席入力 ---- */
.free-seat-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.free-seat-title {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 12px;
  color: var(--primary-dark);
}
.ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-light);
}
.ticket-row:last-child { border-bottom: none; }
.ticket-info .ticket-name { font-size: 14px; font-weight: 600; }
.ticket-info .ticket-price { font-size: 13px; color: var(--primary); font-weight: bold; }
.qty-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qty-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { background: var(--primary); color: white; }
.qty-num {
  font-size: 20px;
  font-weight: bold;
  min-width: 28px;
  text-align: center;
}
.free-capacity-info {
  font-size: 12px;
  color: var(--gray);
  text-align: right;
  margin-top: 8px;
}
.pair-remaining-info {
  font-size: 13px;
  color: #6a0dad;
  font-weight: bold;
  text-align: right;
  margin-top: 8px;
}

/* ---- 選択済み座席バッジ ---- */
.selected-seats-bar {
  background: #f3e8ff;
  border: 1px solid #c9a0ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.selected-seats-bar .bar-title { font-weight: bold; color: var(--primary-dark); margin-bottom: 4px; }
.seat-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  margin: 2px;
}

/* ---- フォーム ---- */
.form-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  color: var(--primary-dark);
  margin-bottom: 5px;
}
.form-label .required {
  background: #e53935;
  color: white;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
}
.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input.error { border-color: #e53935; }
.error-msg { color: #e53935; font-size: 12px; margin-top: 3px; display: none; }
.error-msg.show { display: block; }

/* ---- 引き取り方法 ---- */
.pickup-option {
  background: white;
  border: 2px solid #ddd;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.pickup-option:hover, .pickup-option:active { border-color: var(--primary); }
.pickup-option.selected { border-color: var(--primary); background: #f3e8ff; }
.pickup-option h3 { font-size: 16px; color: var(--primary-dark); margin-bottom: 4px; }
.pickup-option p  { font-size: 13px; color: var(--gray); }
.pickup-option .pickup-radio {
  display: flex; align-items: flex-start; gap: 10px;
}
.pickup-option .radio-circle {
  width: 22px; height: 22px;
  border: 2px solid #ccc;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.pickup-option.selected .radio-circle {
  border-color: var(--primary);
  background: var(--primary);
}
.pickup-option.selected .radio-circle::after {
  content: '';
  width: 8px; height: 8px;
  background: white;
  border-radius: 50%;
}

/* ---- 確認画面 ---- */
.confirm-section {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.confirm-section h3 {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-light);
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-light);
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label { color: var(--gray); flex-shrink: 0; margin-right: 8px; }
.confirm-value { font-weight: 600; text-align: right; }
.confirm-total {
  background: var(--primary-dark);
  color: white;
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 17px;
  font-weight: bold;
  margin-top: 8px;
}

/* ---- 完了画面 ---- */
.complete-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.complete-icon { font-size: 60px; margin-bottom: 12px; }
.complete-title { font-size: 22px; font-weight: bold; color: var(--primary-dark); margin-bottom: 8px; }
.complete-subtitle { color: var(--gray); font-size: 14px; margin-bottom: 16px; }
.reservation-num {
  background: var(--bg);
  border: 2px dashed var(--primary);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  font-size: 13px;
}
.reservation-num strong { font-size: 24px; color: var(--primary); display: block; margin-top: 4px; }
.notice-box {
  background: #fff8e1;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  text-align: left;
  margin-top: 12px;
}
.notice-box h4 { color: #e65100; margin-bottom: 6px; }

/* ---- ボタン ---- */
.btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.5px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(106,13,173,0.35);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(106,13,173,0.25); }
.btn-primary:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }
.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
  margin-top: 8px;
}
.btn-secondary:active { background: var(--bg); }

.btn-group { padding: 8px 0 24px; }

/* ---- ローディング ---- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
  background: white;
  border-radius: 16px;
  padding: 28px 36px;
  text-align: center;
}
.spinner {
  width: 44px; height: 44px;
  border: 4px solid #f0e8ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--primary-dark); }

/* ---- トースト通知 ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #323232;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 2000;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #c62828; }

/* ---- 残席表示 ---- */
.availability-badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: bold;
  margin-left: 8px;
}
.avail-ok    { background: #e8f5e9; color: #2e7d32; }
.avail-few   { background: #fff3e0; color: #e65100; }
.avail-none  { background: #ffebee; color: #c62828; }

/* ---- レスポンシブ ---- */
@media (min-width: 480px) {
  .step { padding: 20px; }
  .btn { font-size: 18px; }
}
