/* TPRF 予約フォーム */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}
.hidden { display: none !important; }

.container { max-width: 520px; margin: 0 auto; padding: 16px; }

.page-header { text-align: center; padding: 24px 0 8px; }
.page-header h1 { font-size: 1.6rem; color: #7b1fa2; font-weight: 700; }

/* ステップ */
.steps { display: flex; justify-content: center; gap: 4px; margin: 16px 0 20px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; max-width: 64px; }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; background: #ddd; color: #999;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; transition: all 0.3s;
}
.step-label { font-size: 0.7rem; color: #999; }
.step.active .step-num { background: #7b1fa2; color: #fff; }
.step.active .step-label { color: #7b1fa2; font-weight: 600; }
.step.done .step-num { background: #4caf50; color: #fff; }
.step.done .step-label { color: #4caf50; }

/* パネル */
.panel { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 16px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 16px; color: #333; }

/* タイプ選択 */
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.type-card {
  background: #fafafa; border: 2px solid #e0e0e0; border-radius: 12px;
  padding: 20px 12px; cursor: pointer; text-align: center; transition: all 0.2s;
}
.type-card:hover { border-color: #7b1fa2; background: #f3e5f5; }
.type-name { font-size: 1.1rem; font-weight: 600; }
.type-desc { font-size: 0.8rem; color: #888; margin-top: 4px; }

/* カレンダー */
.calendar-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.nav-btn {
  border: 1px solid #ddd; border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 0.85rem;
  padding: 8px 12px;
}
.nav-btn-wide { width: auto; height: auto; border-radius: 8px; }
.nav-btn:hover:not(:disabled) { background: #f3e5f5; }
.nav-btn:disabled { opacity: 0.3; cursor: default; }

.calendar-legend { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; font-size: 0.75rem; color: #666; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-ok { background: #4caf50; }
.dot-few { background: #ff9800; }
.dot-closed { background: #e0e0e0; }

.calendar-month { margin-bottom: 20px; }
.calendar-month-title { font-weight: 600; font-size: 1rem; text-align: center; margin-bottom: 8px; color: #7b1fa2; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-header { text-align: center; font-size: 0.75rem; font-weight: 600; color: #888; padding: 4px 0; }
.cal-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer; transition: all 0.15s;
}
.cal-empty { cursor: default; }
.cal-day { font-size: 0.9rem; }
.cal-ok { background: #e8f5e9; color: #2e7d32; }
.cal-ok:hover { background: #c8e6c9; }
.cal-few { background: #fff3e0; color: #e65100; }
.cal-few:hover { background: #ffe0b2; }
.cal-closed { background: #f5f5f5; color: #ccc; cursor: default; }

.loading { text-align: center; padding: 24px; color: #888; }

.selected-date { font-size: 1rem; font-weight: 600; color: #7b1fa2; margin-bottom: 12px; }
.selected-menu-info { font-size: 0.85rem; color: #666; margin-bottom: 12px; }

/* 時間帯 */
.slots-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; border: 2px solid #e0e0e0; border-radius: 8px;
  background: #fff; cursor: pointer; transition: all 0.15s;
}
.slot-btn:hover:not(:disabled) { border-color: #7b1fa2; background: #f3e5f5; }
.slot-time { font-weight: 600; font-size: 0.95rem; }
.slot-avail { font-size: 0.8rem; color: #4caf50; margin-top: 2px; }
.slot-full { opacity: 0.4; cursor: default; }
.slot-full .slot-avail { color: #e53935; }

/* フォーム */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.req { color: #e53935; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #7b1fa2; box-shadow: 0 0 0 2px rgba(123,31,162,0.15);
}
.hint { color: #888; font-size: 0.75rem; display: block; margin-top: 4px; }
.field-error { color: #e53935; font-size: 0.75rem; display: block; margin-top: 4px; }
.input-error { border-color: #e53935 !important; }
.input-error:focus { box-shadow: 0 0 0 2px rgba(229,57,53,0.2) !important; }

/* 確認テーブル */
.confirm-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.confirm-table th, .confirm-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 0.9rem; }
.confirm-table th { width: 110px; color: #888; font-weight: 500; }

/* ボタン */
.nav-buttons { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  padding: 12px 24px; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.btn-back { background: #eee; color: #666; flex: 0 0 auto; white-space: nowrap; }
.btn-back:hover { background: #ddd; }
.btn-next { background: #7b1fa2; color: #fff; flex: 1; }
.btn-next:hover { background: #6a1b9a; }
.btn-submit { background: #4caf50; color: #fff; flex: 1; }
.btn-submit:hover { background: #43a047; }
.btn-submit:disabled { background: #ccc; cursor: default; }
.btn-cancel { background: #e53935; color: #fff; flex: 1; }
.btn-cancel:hover { background: #c62828; }
.btn-cancel:disabled { background: #ccc; cursor: default; }

/* 完了 */
.done-msg { text-align: center; color: #666; font-size: 0.9rem; line-height: 1.8; margin-bottom: 16px; }
.done-id { text-align: center; font-size: 1.1rem; margin-bottom: 12px; }
.done-note { text-align: center; color: #999; font-size: 0.8rem; margin-top: 8px; }

/* トースト */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 12px 24px; border-radius: 8px;
  font-size: 0.9rem; z-index: 9999; transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast-error { background: #e53935; }

@media (max-width: 400px) {
  .container { padding: 8px; }
  .panel { padding: 16px; }
  .type-cards { grid-template-columns: 1fr; }
  .slots-grid { grid-template-columns: 1fr; }
  .confirm-table th { width: 80px; }
}
