/*
 * 予約確定フォームの見た目
 * スマートフォンからの入力を前提に、1カラムを基本として組んでいる。
 */

:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --ink: #2c2a28;
  --ink-muted: #77716b;
  --line: #e2ddd7;
  --accent: #8a6f4e;
  --accent-dark: #6f583d;
  --error: #b3423a;
  --error-bg: #fdf2f1;
  --success: #3d7a5a;
  --success-bg: #f0f7f3;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /*
   * ゴシック体。Windows では游ゴシックが細く出るため、
   * BIZ UDPゴシック・メイリオを先に見て、はっきりした字面にする。
   */
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Meiryo", "Yu Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

/* 管理画面からの確認表示であることを示す帯 */
.preview-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 8px 16px;
  background: #8a6b2f;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

/* ---------- 全体の枠 ---------- */

.site-header {
  padding: 28px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.site-header .brand {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
}

.site-header h1 {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.site-footer {
  padding: 24px 16px 40px;
  text-align: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.center { text-align: center; }
.muted { color: var(--ink-muted); }
.small { font-size: 13px; }

.lead {
  margin: 4px 4px 20px;
  font-size: 14px;
  color: var(--ink-muted);
}

/* ---------- 読み込み中 ---------- */

.spinner {
  width: 28px;
  height: 28px;
  margin: 8px auto 12px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- お知らせ枠 ---------- */

.notice.error {
  border-color: #e8c4c0;
  background: var(--error-bg);
}

.notice.error h2, .notice.error p { color: var(--error); }
.notice.error .muted { color: #a06b66; }

.notice.success {
  border-color: #c2ddce;
  background: var(--success-bg);
}

.notice.success h2 { color: var(--success); }

/* 受け取ってはいるが、登録が完了していないとき */
.notice.warn {
  border-color: #e0cfa8;
  background: #fdf8ee;
}

.notice.warn h2 { color: #8a6b2f; }

#submit-error ul {
  margin: 8px 0 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--error);
}

/* ---------- フォーム ---------- */

.section-desc {
  margin: -4px 0 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .field { grid-column: span 2; }
  .field.col-2 { grid-column: span 1; }
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

/* 必須バッジ */
.req-mark {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--error);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

/* ---------- ご案内文＋同意チェック ---------- */

.notice-block {
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f6;
}

.notice-heading {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
}

/* 案内文が長いので、枠内でスクロールさせて全体の見通しを保つ */
.notice-body {
  max-height: 260px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  line-height: 1.8;
  color: #4a4642;
  overscroll-behavior: contain;
}

.notice-body p { margin: 0 0 10px; }
.notice-body p:last-child { margin-bottom: 0; }

.notice-body h4 {
  margin: 16px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
}

.notice-body ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.notice-body li { margin-bottom: 2px; }

.checkbox.consent {
  margin-top: 14px !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 600 !important;
}

.notice-block.has-error {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ---------- 項目のまとまり（氏名・住所など） ---------- */

.group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 18px;
  margin: 0 0 18px;
}

.group > legend {
  font-size: 14px;
  font-weight: 600;
  padding: 0 8px;
}

.group > .help { margin: 0 0 12px; }

.group.has-error { border-color: var(--error); }

/* 再入力欄 */
.confirm-entry { margin-top: 8px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="datetime-local"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  /* 16px 未満だと iPhone で入力時に画面が拡大されてしまう */
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2377716b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 34px;
}

.field textarea { resize: vertical; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field .help {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--error);
  font-weight: 600;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--error);
  background: var(--error-bg);
}

/* ---------- チェックボックス ---------- */

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  line-height: 1.6;
}

.checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent);
}

.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf8f6;
}

/* ---------- 送信ボタン ---------- */

.actions {
  text-align: center;
  margin-top: 24px;
}

.btn-primary {
  width: 100%;
  max-width: 340px;
  padding: 15px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease;
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: default;
}

.btn-spinner { display: none; }

/* 「修正する」など、主役ではないボタン */
.btn-secondary {
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-muted);
  background: var(--panel);
  border: 1px solid var(--line);
  font: inherit;
}

.btn-secondary.btn-block {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px 20px;
}

.btn-secondary.btn-block:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 送信前のご確認 ---------- */

.confirm-section { margin-top: 22px; }
.confirm-section:first-child { margin-top: 0; }

.confirm-section > h3 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.confirm-rows { display: grid; grid-template-columns: 1fr; gap: 0; }

.confirm-row {
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 4px 16px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--line);
}

.confirm-row:last-child { border-bottom: 0; }

.confirm-row dt { color: var(--ink-muted); font-size: 13px; }
.confirm-row dd { margin: 0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; }

@media (max-width: 560px) {
  .confirm-row { grid-template-columns: 1fr; }
  .confirm-row dd { padding-left: 1em; }
}

.actions .muted { margin: 12px 0 0; }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- お見積もり金額 ---------- */

.estimate-rows { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }

.estimate-rows dt { color: var(--ink-muted); font-size: 14px; }
.estimate-rows dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.estimate-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.estimate-total__label { font-size: 14px; font-weight: 600; }

.estimate-total__amount {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.estimate-note { margin: 12px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink-muted); }

/* 土日祝の追加料金のご案内（金額には足さず、全員にお伝えする） */
.estimate-note--fee {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--panel-alt, #f6f5f2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

/* お見積もりに添える注意書き（お支度を済ませてご来店いただく方など） */
.estimate-caution {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--error-bg, #fdf2f1);
}

.estimate-caution p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--error);
}

.estimate-caution p:last-child { margin-bottom: 0; }

/* ---------- 撮影パターンの確認 ---------- */

.pattern-lead { margin: 0 0 14px; font-size: 13px; line-height: 1.8; color: var(--ink-muted); }

.pattern-outfit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.pattern-outfit__name { font-size: 14px; font-weight: 600; }

.pattern-outfit__kind {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-muted);
}

.pattern-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

.pattern-chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.pattern-chip:hover { border-color: var(--ink-muted); }

.pattern-chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.pattern-result { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.pattern-count { margin: 0 0 8px; font-size: 18px; font-weight: 700; }

.pattern-list { margin: 0 0 10px; padding-left: 20px; font-size: 14px; line-height: 1.9; }

.pattern-note { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink-muted); }
.pattern-note.is-over { color: var(--error); }

.pattern-course {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.pattern-course__name { font-size: 14px; font-weight: 600; min-width: 8em; }

.pattern-course__select {
  flex: 1;
  min-width: 220px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.pattern-warn {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--error-bg, #fdf2f1);
  color: var(--error);
  font-size: 13px;
  line-height: 1.7;
}

.pattern-save { margin-top: 14px; }
.pattern-save__action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pattern-save__action .req-mark { margin-left: 0; }
.pattern-note.is-done { color: var(--ok, #2f7a55); }

/* 衣装サイズを何個選べばよいか */
.size-hint {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.size-hint.is-done { color: var(--ok, #2f7a55); }

/* 店舗LINEへのご案内 */
.line-guide {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.line-guide__text { margin: 0 0 10px; font-size: 13px; line-height: 1.7; color: var(--ink-muted); }

.line-guide__btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: #06c755;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.line-guide__btn:hover { background: #05b34c; }

/* 選択肢が絞られている理由 */
.narrow-hint {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
}

/* 主役1名のプランのご案内 */
.pattern-main-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-muted);
}

.pattern-save .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 注意のご案内 */
.caution {
  padding: 14px 16px;
  border: 1px solid var(--error);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--error-bg, #fdf2f1);
}

.caution p { margin: 0 0 8px; font-size: 14px; line-height: 1.8; }
.caution p:last-child { margin-bottom: 0; }

/* チェックをいただくまで先へ進めないときの案内 */
.gate-hint {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--error);
}

/* 予約日時（日にち＋時刻） */
.slot { display: flex; flex-wrap: wrap; gap: 8px; }
.slot__date { flex: 1 1 10em; }
.slot__time { flex: 0 1 9em; }

.done-detail { margin: 12px 0 0; font-size: 15px; line-height: 1.9; }

/* 仮予約の内容と違うときのお知らせ */
.match-note {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--warn-bg, #fdf8ee);
  color: var(--warn, #8a6b2f);
  font-size: 13px;
  line-height: 1.7;
}

/* ---- ご予約の選択（照合画面） ---- */

.match-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.match-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  transition: border-color .15s, background .15s;
}

.match-item:hover,
.match-item:focus-visible {
  border-color: var(--accent);
  background: #fbf9f7;
}

.match-time {
  flex: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.match-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.match-course {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---- 他に残っているご予約のお知らせ ---- */

.other-reservations {
  margin: 12px 0 0;
  padding: 0 0 0 18px;
}

.other-reservations li { margin-bottom: 4px; }

/* ---- 表示だけの項目（撮影カルテの内容をそのまま出す） ---- */

.field.is-readonly label {
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}

.readonly-value {
  margin: 2px 0 0;
  padding: 10px 0 10px 12px;
  font-size: 16px;
  line-height: 1.5;
  border-left: 3px solid var(--line);
  word-break: break-all;
}

.readonly-value.is-empty {
  color: var(--error);
  border-left-color: var(--error);
}

/* ---- ご予約内容のコピー（LINEでのお問い合わせ用） ---- */

.line-copy {
  margin: 0 0 12px;
}

.line-copy__note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
}

.line-copy__note.is-done { color: var(--success); }
.line-copy__note.is-over { color: var(--error); }

/* ---- 着付け・ヘアメイクのタブ ---- */

.beauty-tabs {
  margin: 4px 0 0;
}

.beauty-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.beauty-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  color: var(--ink-muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}

.beauty-tab:hover { border-color: var(--accent); }

.beauty-tab.is-active {
  color: var(--panel);
  background: var(--accent);
  border-color: var(--accent);
}

.beauty-tab__count {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.beauty-tab.has-entry:not(.is-active) {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: #fbf9f7;
}

.beauty-tab.has-entry:not(.is-active) .beauty-tab__count { color: var(--accent-dark); }

/* 表示の切り替えは class で行う。hidden にすると送信対象から外れてしまう。 */
.beauty-panel:not(.is-active) { display: none; }

/* ---- やり直しの導線（URLの期限切れ） ---- */

.btn-inline {
  display: inline-block;
  width: auto;
  padding: 12px 22px;
  text-decoration: none;
}

/* ---- 衣装サイズ（性別で絞る） ---- */

/* 隠すのは class で。hidden にすると送信の扱いが変わってしまう。 */
.checkbox-list label.checkbox.is-filtered { display: none; }

/* 片方だけになったら、1列にして見やすくする */
.checkbox-list.is-narrowed { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }

/* ---- ご予約ごとのお手続き（照合の結果） ---- */

.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.match-card .match-item {
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
}

.match-card .match-item:hover { background: var(--panel); }

.match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
}

.match-actions .btn-inline { flex: 1 1 auto; text-align: center; }

/* キャンセルは、押し間違いを避けるため控えめにする */
.btn-secondary.btn-inline {
  color: var(--ink-muted);
  background: var(--panel);
  border: 1px solid var(--line);
}

.btn-secondary.btn-inline:hover {
  color: var(--error);
  border-color: var(--error);
}

/* ---- 美容料金のキャンセル代 ---- */

.fee-amount {
  font-size: 20px;
  color: var(--error);
}

/* ---- 行き止まりにしないための導線 ---- */

.back-link {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
}

.back-link a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.back-link a:hover { color: var(--accent-dark); }
