/**
 * reservation.css - 予約アプリのスタイル
 * 温かみのあるオレンジ系プレミアムデザイン
 */

/* ============================================================
   カスタムプロパティ
   ============================================================ */
:root {
  --primary: #FF8C42;
  --primary-dark: #E67A30;
  --primary-light: #FFB347;
  --primary-pale: #FFF3E8;
  --accent-gold: #FFD700;
  --accent-green: #4ECDC4;
  --accent-pink: #E8A0BF;

  --bg-start: #FFFAF5;
  --bg-end: #FFE8D6;

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-bg-solid: #ffffff;
  --card-border: rgba(255, 140, 66, 0.12);
  --card-shadow: 0 8px 32px rgba(255, 140, 66, 0.10);
  --card-shadow-hover: 0 12px 40px rgba(255, 140, 66, 0.18);

  --text-primary: #2D2D2D;
  --text-secondary: #5A5A5A;
  --text-muted: #9E9E9E;
  --text-white: #FFFFFF;

  --success: #4CAF50;
  --danger: #FF5252;
  --warning: #FFC107;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   リセット & ベース
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg-start) 0%, var(--bg-end) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   アプリコンテナ
   ============================================================ */
.app-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   ヘッダー
   ============================================================ */
.app-header {
  text-align: center;
  padding: 40px 0 24px;
  position: relative;
}

.header-decoration {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  margin: 0 auto 20px;
}

.header-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.header-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ============================================================
   プログレスバー
   ============================================================ */
.progress-bar {
  position: relative;
  margin-bottom: 32px;
  padding: 0 8px;
}

.progress-track {
  position: absolute;
  top: 18px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: rgba(255, 140, 66, 0.15);
  border-radius: 2px;
  z-index: 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

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

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  background: var(--card-bg-solid);
  border: 2px solid rgba(255, 140, 66, 0.2);
  color: var(--text-muted);
  transition: var(--transition);
}

.progress-step.active .step-circle {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.progress-step.done .step-circle {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.progress-step.active .step-label {
  color: var(--primary-dark);
  font-weight: 600;
}

.progress-step.done .step-label {
  color: var(--success);
}

/* ============================================================
   ステップコンテナ
   ============================================================ */
.step-container {
  flex: 1;
}

.step {
  display: none;
  animation: fadeSlideIn 0.4s ease-out;
}

.step.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.step-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.step-header-row .step-title {
  margin-bottom: 0;
  flex: 1;
}

/* ============================================================
   戻るボタン
   ============================================================ */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.btn-back:hover {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-color: var(--primary);
}

.back-icon {
  font-size: 16px;
  line-height: 1;
}

/* ============================================================
   サービスカード (Step 1)
   ============================================================ */
.service-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(255, 140, 66, 0.25);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
}

.service-card.selected::before {
  opacity: 1;
}

.service-card:nth-child(1)::before { background: linear-gradient(90deg, #FF8C42, #FFB347); }
.service-card:nth-child(2)::before { background: linear-gradient(90deg, #4ECDC4, #44B09E); }
.service-card:nth-child(3)::before { background: linear-gradient(90deg, #E8A0BF, #C77DBA); }

.service-card-icon {
  width: 200px;
  height: 200px;
  min-width: 200px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  overflow: hidden;
}

.service-card-icon span {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  overflow: hidden;
}

.service-card-content {
  flex: 1;
  min-width: 0;
}

.service-card-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.service-card-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.service-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 20px;
  background: var(--primary-pale);
  color: var(--primary-dark);
}

/* ============================================================
   選択済みサービスバッジ
   ============================================================ */
.selected-service-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.selected-info-banner {
  padding: 12px 16px;
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  border-left: 3px solid var(--primary);
}

/* ============================================================
   カレンダー (Step 2)
   ============================================================ */
.calendar-container {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-month-year {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}

.calendar-nav {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--primary-pale);
  border-radius: 50%;
  font-size: 20px;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-family: var(--font);
}

.calendar-nav:hover {
  background: var(--primary);
  color: white;
}

.calendar-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar-nav:disabled:hover {
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
}

.weekday {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.weekday.sun { color: var(--danger); }
.weekday.sat { color: #4A90D9; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
  cursor: default;
  position: relative;
}

.calendar-cell.empty {
  cursor: default;
}

.calendar-cell.today {
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--primary-light);
}

.calendar-cell.available {
  background: rgba(255, 140, 66, 0.08);
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 600;
}

.calendar-cell.available:hover {
  background: rgba(255, 140, 66, 0.2);
  transform: scale(1.08);
}

.calendar-cell.available.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.3);
}

.calendar-cell.unavailable {
  color: var(--text-muted);
  opacity: 0.4;
}

.calendar-cell.past {
  color: var(--text-muted);
  opacity: 0.25;
}

.calendar-cell.sun-day {
  color: var(--danger);
}

.calendar-cell.sun-day.unavailable,
.calendar-cell.sun-day.past {
  color: var(--text-muted);
}

.calendar-cell.sat-day {
  color: #4A90D9;
}

.calendar-cell.sat-day.unavailable,
.calendar-cell.sat-day.past {
  color: var(--text-muted);
}

.calendar-cell.available.sun-day,
.calendar-cell.available.sat-day {
  color: var(--primary-dark);
}

.calendar-cell.available.selected.sun-day,
.calendar-cell.available.selected.sat-day {
  color: white;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-dot.available {
  background: rgba(255, 140, 66, 0.3);
}

.legend-dot.unavailable {
  background: #E0E0E0;
}

.legend-dot.today {
  box-shadow: inset 0 0 0 2px var(--primary-light);
  background: transparent;
}

/* ============================================================
   時間選択 (Step 3)
   ============================================================ */
.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.time-slot {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 2px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.time-slot:hover:not(.sold-out) {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.time-slot.selected {
  border-color: var(--primary);
  background: var(--primary-pale);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.15);
}

.time-slot.sold-out {
  opacity: 0.4;
  cursor: not-allowed;
}

.time-slot-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.time-slot.selected .time-slot-time {
  color: var(--primary-dark);
}

.time-slot-remaining {
  font-size: 12px;
  color: var(--text-secondary);
}

.time-slot-remaining.few {
  color: var(--danger);
  font-weight: 600;
}

.time-slot.sold-out .time-slot-time {
  color: var(--text-muted);
}

.time-slot.sold-out .time-slot-remaining {
  color: var(--danger);
  font-weight: 600;
}

/* ============================================================
   フォーム (Step 4)
   ============================================================ */
.reservation-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.required {
  font-size: 11px;
  font-weight: 500;
  color: var(--danger);
  background: rgba(255, 82, 82, 0.08);
  padding: 1px 8px;
  border-radius: 10px;
}

.optional {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 8px;
  border-radius: 10px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg-solid);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text-primary);
  transition: var(--transition-fast);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.12);
}

.form-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 82, 82, 0.1);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 0;
  overflow: hidden;
  transition: var(--transition-fast);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* 人数コントロール */
.guests-control {
  display: flex;
  align-items: center;
  gap: 0;
}

.guests-btn {
  width: 44px;
  height: 44px;
  background: var(--primary-pale);
  border: 2px solid rgba(0, 0, 0, 0.08);
  color: var(--primary-dark);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  font-family: var(--font);
}

.guests-btn:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: none;
}

.guests-btn:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: none;
}

.guests-btn:hover {
  background: var(--primary);
  color: white;
}

.guests-input {
  width: 64px;
  text-align: center;
  border-radius: 0;
  -moz-appearance: textfield;
  font-weight: 600;
  font-size: 17px;
}

.guests-input::-webkit-outer-spin-button,
.guests-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============================================================
   ボタン共通
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: var(--transition-fast);
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
}

.btn-arrow {
  font-size: 18px;
  transition: var(--transition-fast);
}

.btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-icon {
  font-size: 18px;
}

.btn-confirm {
  background: linear-gradient(135deg, var(--success), #43A047);
  font-size: 16px;
  padding: 16px 28px;
}

.btn-confirm:hover {
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.35);
}

/* ============================================================
   確認画面 (Step 5)
   ============================================================ */
.confirm-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.confirm-section {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.confirm-section:last-child {
  border-bottom: none;
}

.confirm-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.confirm-section-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
}

.confirm-notice {
  padding: 12px 16px;
  background: rgba(255, 193, 7, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  margin-bottom: 20px;
}

.confirm-notice p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   完了画面 (Step 6)
   ============================================================ */
.complete-container {
  text-align: center;
  padding: 20px 0;
}

.complete-icon-wrapper {
  margin-bottom: 24px;
}

.complete-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #43A047);
  color: white;
  font-size: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
}

@keyframes scaleIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.complete-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.complete-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.reservation-id-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  background: var(--primary-pale);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.reservation-id-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.reservation-id-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: 0.05em;
}

.complete-summary {
  text-align: left;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.complete-summary .confirm-section {
  padding: 12px 20px;
}

/* ============================================================
   フッター
   ============================================================ */
.app-footer {
  text-align: center;
  padding: 24px 0 16px;
  margin-top: auto;
}

.app-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 480px) {
  .app-container {
    padding: 0 12px 32px;
  }

  .header-title {
    font-size: 24px;
  }

  .step-label {
    font-size: 10px;
  }

  .step-circle {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .progress-track {
    top: 16px;
    left: 32px;
    right: 32px;
  }

  .service-card {
    padding: 16px;
    gap: 12px;
  }

  .service-card-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 24px;
  }

  .time-slots {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .calendar-cell {
    font-size: 13px;
  }

  .reservation-id-value {
    font-size: 17px;
  }
}

@media (min-width: 768px) {
  .app-container {
    padding: 0 24px 48px;
  }

  .header-title {
    font-size: 32px;
  }

  .time-slots {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   ローディングスピナー
   ============================================================ */
.loading-spinner {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner::before {
  content: '';
  display: block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 140, 66, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================================
   完了画面 メール通知
   ============================================================ */
.complete-mail-notice {
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(76, 175, 80, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 20px;
  border-left: 3px solid var(--success);
}

/* サービスカード動的グラデーション */
.service-card .service-card-icon[style] {
  color: white;
}
