/* LIFF 予約画面スタイル（モバイルファースト） */

:root {
  --primary: #06c755;
  --primary-dark: #05a847;
  --text: #222;
  --muted: #777;
  --border: #ddd;
  --bg: #f7f7f7;
  --danger: #d33;
}

* { box-sizing: border-box; }

/* hidden 属性を CSS の display 指定より常に優先させる */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
}

.app-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
}
.app-header h1 { margin: 0; font-size: 18px; }
.step-indicator { font-size: 12px; margin-top: 4px; opacity: 0.9; }

.screen { padding: 16px; max-width: 480px; margin: 0 auto; }
.screen h2 { font-size: 17px; margin: 0 0 12px; }

/* ローディング */
.spinner {
  width: 36px; height: 36px; margin: 48px auto 12px;
  border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { text-align: center; color: var(--muted); }

/* ボタン */
.btn {
  display: block; width: 100%; padding: 12px; margin-top: 10px;
  font-size: 16px; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: bold; }
.btn.primary:disabled { background: #9fdcb7; border-color: #9fdcb7; }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.btn.small { width: auto; display: inline-block; padding: 6px 12px; font-size: 14px; margin-top: 0; }
.btn.link { background: none; border: none; color: var(--primary-dark); text-decoration: underline; }
.actions { margin-top: 16px; }

/* コース一覧 */
.course-list { display: flex; flex-direction: column; gap: 10px; }
.course-card {
  display: flex; gap: 12px; padding: 12px; background: #fff;
  border: 2px solid var(--border); border-radius: 10px; cursor: pointer;
}
.course-card.selected { border-color: var(--primary); background: #f0fbf4; }
.course-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.course-card .noimg {
  width: 72px; height: 72px; border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px;
}
.course-card .info { flex: 1; }
.course-card .name { font-weight: bold; }
.course-card .meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.course-card .item-b { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* カレンダー */
.calendar-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.month-label { font-weight: bold; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.calendar .day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
}
.calendar .day.blank { background: none; border: none; }
.calendar .day .mark { font-size: 15px; font-weight: bold; }
.calendar .day.open { cursor: pointer; }
.calendar .day.open .mark { color: var(--primary-dark); }
.calendar .day.full .mark { color: var(--danger); }
.calendar .day.closed, .calendar .day.out { color: #bbb; background: var(--bg); }
.calendar .day.closed .mark, .calendar .day.out .mark { color: #bbb; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* 時刻一覧 */
.time-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.time-list .btn { margin-top: 0; }

/* フォーム */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; margin-bottom: 4px; }
.field .required { color: var(--danger); font-size: 12px; margin-left: 4px; }
.field input, .field textarea {
  width: 100%; padding: 10px; font-size: 16px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.field input[readonly] { background: var(--bg); color: var(--muted); }

/* サマリ */
.summary {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin: 0 0 16px;
}
.summary dt { font-size: 12px; color: var(--muted); margin-top: 8px; }
.summary dt:first-child { margin-top: 0; }
.summary dd { margin: 2px 0 0; }
.summary .code { font-weight: bold; font-size: 18px; }

/* 予約一覧 */
.reservation-list { display: flex; flex-direction: column; gap: 10px; }
.reservation-item { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.reservation-item .row1 { display: flex; justify-content: space-between; align-items: center; }
.reservation-item .code { font-size: 13px; color: var(--muted); }
.reservation-item .badge { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.badge.confirmed { background: #e3f7eb; color: var(--primary-dark); }
.badge.cancelled { background: #eee; color: var(--muted); }
.reservation-item .when { font-weight: bold; margin-top: 4px; }
.reservation-item .course { font-size: 14px; color: var(--muted); margin-top: 2px; }

.note { font-size: 13px; color: var(--danger); background: #fff4f4; border-radius: 8px; padding: 8px 12px; }
.empty-text { color: var(--muted); text-align: center; padding: 16px 0; }

/* ダイアログ */
.dialog-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.dialog { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 360px; }
.dialog p { margin: 0 0 16px; white-space: pre-wrap; }
.dialog-actions .btn { margin-top: 8px; }
