/* 秋のご案内ご予約フォーム */
:root {
  --ink: #2b2620;
  --muted: #6b655c;
  --line: #ddd6c8;
  --paper: #fbf8f2;
  --card: #ffffff;
  --accent: #8a5a2b;      /* 稲穂・土の色 */
  --accent-dark: #6e4620;
  --accent-soft: #f3e9db;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --focus: #c99a5b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
a { color: var(--accent-dark); }

.site-header {
  background: var(--accent);
  color: #fff;
  padding: 14px 16px;
}
.site-header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  max-width: 760px;
  margin-inline: auto;
}
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 12px 40px;
}
.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
}

/* 説明 */
.intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}
.help { color: var(--muted); font-size: 0.93rem; margin: 4px 0 12px; }
.help.center { text-align: center; }
.muted { color: var(--muted); }
.right { text-align: right; }
.pre { white-space: pre-wrap; }

/* ブロック */
.block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.block h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}
.block h3 { font-size: 1rem; margin: 18px 0 6px; }
.page-title { font-size: 1.25rem; margin: 4px 0 8px; }

/* フィールド */
.field { margin: 14px 0; }
.field label, .field .label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
}
.field label small, .field .label small, .item-name small, .item-text label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
}
.req {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
  font-weight: 600;
}
input[type="text"], input[type="password"], input[type="date"], textarea {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #bfb7a8;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  width: 100%;
  max-width: 100%;
}
input:focus, textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--accent);
}
.w-full  { max-width: 100%; }
.w-name  { max-width: 22em; }
.w-tel   { max-width: 18em; }
.w-short { max-width: 12em; }
textarea { min-height: 6.5em; resize: vertical; }

.field.is-error input { border-color: var(--danger); background: var(--danger-soft); }
.error { color: var(--danger); font-size: 0.9rem; margin: 4px 0 0; }
.field-note { font-size: 0.88rem; margin: 4px 0 0; }

.alert {
  background: var(--danger-soft);
  border: 1px solid #e6b3ae;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.alert p { margin: 0 0 4px; font-weight: 600; }
.alert ul { margin: 0; padding-left: 1.3em; }
.alert-warn { background: #fff6e0; border-color: #ecd39a; color: #6b4d00; }

/* ラジオ */
.radios { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radios-vertical { flex-direction: column; gap: 6px; }
.radio {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-weight: 400 !important;
  cursor: pointer;
  margin: 0 !important;
}
.radio input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }

.dest-fields {
  border-left: 3px solid var(--accent-soft);
  padding-left: 12px;
  margin: 8px 0 16px;
}

/* 商品 */
.category { margin: 18px 0 8px; }
.category h3 {
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 4px;
  margin: 0 0 4px;
}
.category-desc { margin: 4px 0 8px 2px; font-size: 0.9rem; color: var(--muted); }
table.items { width: 100%; border-collapse: collapse; }
table.items td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.items tr:last-child td { border-bottom: 0; }
table.items .item-name label { font-weight: 400; margin: 0; }
table.items .item-qty-cell { width: 1%; white-space: nowrap; text-align: right; }
table.items input.qty {
  width: 7em;
  text-align: center;
  padding: 8px 6px;
  font-size: 1.05rem;
}
table.items tr.has-value td { background: #fffaf0; }
table.items tr.has-value .item-name label { font-weight: 600; }
table.items .item-text label { font-weight: 600; margin: 4px 0 4px; }

/* 確認画面 */
.confirm dl { margin: 0; display: grid; grid-template-columns: 11em 1fr; gap: 6px 12px; }
.confirm dt { color: var(--muted); font-weight: 500; }
.confirm dd { margin: 0; }
table.confirm-items { width: 100%; border-collapse: collapse; }
table.confirm-items th { text-align: left; background: var(--accent-soft); padding: 6px 8px; font-size: 0.95rem; }
table.confirm-items td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.confirm-items td.name { width: 45%; }
table.confirm-items td.value { text-align: left; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }

/* 完了 */
.complete { text-align: center; }
.order-id { font-size: 1.15rem; }
.order-id strong { font-size: 1.5rem; color: var(--accent-dark); }

/* ボタン */
.actions { display: flex; justify-content: center; gap: 12px; margin: 24px 0 8px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-width: 12em;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-secondary { background: #fff; color: var(--accent-dark); }
.btn-secondary:hover { background: var(--accent-soft); }

/* 管理 */
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .field { flex: 1 1 12em; }
.table-wrap { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
.admin-table th { background: var(--accent-soft); }

/* スマートフォン */
@media (max-width: 560px) {
  body { font-size: 15px; }
  .tab { padding: 8px 10px; font-size: 0.9rem; }
  .container { padding: 12px 8px 32px; }
  .block { padding: 12px; }
  .confirm dl { grid-template-columns: 1fr; gap: 0; }
  .confirm dt { margin-top: 8px; font-size: 0.85rem; }
  .btn { width: 100%; }
  .actions-two { flex-direction: column-reverse; }
  table.items input.qty { width: 5.5em; }
  table.items .unit { font-size: 0.85rem; min-width: 3.4em; }
}

/* 初期設定 */
.kv { display: grid; grid-template-columns: 10em 1fr; gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
table.items .unit { display: inline-block; min-width: 3.6em; margin-left: 4px; color: var(--muted); font-size: 0.9rem; vertical-align: middle; text-align: left; }
table.items input.qty { vertical-align: middle; }

/* 管理画面のタブなど */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--accent); margin: 8px 0 16px; overflow-x: auto; }
.tab { white-space: nowrap; flex: none; padding: 8px 16px; border-radius: 6px 6px 0 0; text-decoration: none; color: var(--accent-dark); background: var(--accent-soft); font-weight: 600; }
.tab.is-active { background: var(--accent); color: #fff; }
.alert-ok { background: #e8f3e6; border-color: #b5d3ae; color: #24531c; }
.actions-left { justify-content: flex-start; margin: 12px 0; }
.btn-small { padding: 6px 12px; min-width: 0; font-size: 0.9rem; }
form.inline { display: inline; }
.help-box { margin: 8px 0 12px; }
.help-box summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; }
.help-box table td { white-space: normal; }
input[type="file"] { font: inherit; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d17; }
.danger-box summary { color: var(--danger); }
.mail-preview { background: #f6f3ee; border: 1px solid var(--line); border-radius: 6px; padding: 12px; font-size: 0.85rem; white-space: pre-wrap; overflow-wrap: anywhere; }
