* { box-sizing: border-box; }

:root {
  --bg: #FAF8F4;
  --bg-card: #FFFFFF;
  --bg-subtle: #F0EBE0;
  --text: #2C2824;
  --text-muted: #6B655C;
  --accent: #7C6F5A;
  --accent-dark: #5A4F3E;
  --border: #D4CCB8;
  --border-light: #E8E2D4;
  --success: #6B7F5D;
  --error: #A64D48;
  --warning: #C08A3E;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "游明朝", YuMincho, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== ヘッダー ===== */
.header {
  text-align: center;
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 32px;
}

.store-name {
  font-size: 28px;
  font-weight: 500;
  margin: 0 0 8px;
  letter-spacing: 0.1em;
  color: var(--text);
}

.subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* ===== ステップ ===== */
.step { display: none; }
.step.active { display: block; }

.step-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 0.05em;
}

.guide {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

/* ===== カレンダー ===== */
.calendar-wrap {
  margin-bottom: 24px;
}

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

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.month-block {
  margin-bottom: 32px;
}

.month-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--accent-dark);
  letter-spacing: 0.08em;
}

.date-list {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.date-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-light);
}

.date-row:last-child {
  border-bottom: none;
}

.date-row.holiday {
  background: #F5F1E8;
}

.date-cell {
  flex: 0 0 80px;
  padding: 16px 12px;
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.date-cell.weekend .day-wd {
  color: var(--error);
}

.day-num {
  font-size: 20px;
  font-weight: 500;
}

.day-wd {
  font-size: 13px;
  color: var(--text-muted);
}

.slots-cell {
  flex: 1;
  display: flex;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
}

.slot-btn {
  flex: 1 1 0;
  min-width: 110px;
  padding: 10px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.slot-btn:hover:not(.disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.slot-btn.disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.slot-label {
  font-size: 14px;
  font-weight: 500;
}

.slot-avail {
  font-size: 11px;
  color: var(--text-muted);
}

.slot-btn:hover:not(.disabled) .slot-avail {
  color: rgba(255,255,255,0.85);
}

.holiday-label {
  color: var(--text-muted);
  font-size: 14px;
  padding: 8px 0;
}

.note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: 3px;
  font-size: 12px;
  color: var(--text-muted);
}

.note ul {
  margin: 0;
  padding-left: 18px;
}

/* ===== 選択済み表示 ===== */
.selected-slot {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  margin-bottom: 24px;
  border-radius: 0 3px 3px 0;
}

.selected-inner {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
}

.selected-date {
  font-size: 16px;
  font-weight: 500;
}

.selected-slot-label {
  font-size: 14px;
  color: var(--accent-dark);
}

/* ===== フォーム ===== */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.required {
  font-size: 10px;
  background: var(--error);
  color: white;
  padding: 2px 6px;
  border-radius: 2px;
  margin-left: 6px;
  font-weight: normal;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* ===== 人数入力 ===== */
.number-input {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 200px;
}

.number-input input {
  text-align: center;
  font-size: 18px;
  font-weight: 500;
  width: 80px;
}

.num-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 18px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all 0.15s;
}

.num-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== ボタン ===== */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  flex: 1;
  min-width: 140px;
  padding: 14px 20px;
  font-size: 15px;
  font-family: inherit;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.05em;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-primary:disabled {
  background: var(--text-muted);
  border-color: var(--text-muted);
  cursor: not-allowed;
}

.btn-primary.is-loading {
  position: relative;
  padding-right: 44px;
  pointer-events: none;
}

.btn-primary.is-loading::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 0;
  bottom: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
}

/* ===== 確認ボックス ===== */
.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 20px 24px;
}

.confirm-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px 16px;
}

.confirm-dl dt {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: normal;
}

.confirm-dl dd {
  margin: 0;
  font-size: 15px;
}

/* ===== 完了画面 ===== */
.complete-box {
  text-align: center;
  padding: 20px 0;
}

.check-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 32px;
  line-height: 60px;
  margin: 0 auto 20px;
}

.complete-box h2 {
  font-size: 22px;
  margin: 0 0 12px;
  font-weight: 500;
}

.complete-box .small {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 20px;
}

.complete-box .confirm-box {
  text-align: left;
  margin: 24px 0;
}

/* ===== トースト ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 20px;
  border-radius: 3px;
  font-size: 14px;
  transition: transform 0.2s;
  max-width: 90%;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--error);
  color: white;
}

.toast.success {
  background: var(--success);
  color: white;
}

/* ===== フッター ===== */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 40px;
  border-top: 1px solid var(--border-light);
}

/* ===== レスポンシブ ===== */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .store-name { font-size: 24px; }
  .date-cell { flex: 0 0 64px; padding: 12px 8px; }
  .day-num { font-size: 18px; }
  .slots-cell { padding: 8px; gap: 6px; }
  .slot-btn { min-width: 0; padding: 8px 4px; }
  .slot-label { font-size: 13px; }
  .confirm-dl {
    grid-template-columns: 80px 1fr;
    gap: 10px 12px;
  }
  .button-row { flex-direction: column-reverse; }
  .btn-primary, .btn-secondary { width: 100%; }
}
