/* 共通スタイル(スマホ優先 → 画面が広い時だけ調整) */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7785;
  --line: #d9dee5;
  --primary: #2563eb;
  --primary-text: #ffffff;
  --danger: #dc2626;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px; /* 16px未満だとiPhoneで入力時に勝手に拡大される */
  line-height: 1.7;
  overflow-wrap: anywhere; /* 長い文字列で横にはみ出さない */
}

.container {
  width: 100%;
  max-width: 640px; /* PCでも読みやすい幅で中央寄せ */
  margin: 0 auto;
  padding: 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

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

h1 { font-size: 1.4rem; margin: 0 0 12px; line-height: 1.4; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* 入力部品(次のステップで使用) */
label { display: block; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%;
  min-height: 48px; /* 指で押しやすい大きさ */
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-text);
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (min-width: 768px) {
  .container { padding-top: 40px; }
  .card { padding: 28px 28px; }
  h1 { font-size: 1.7rem; }
}

/* ===== ステップ3で追加 ===== */
[hidden] { display: none !important; }
.site-head { margin-bottom: 12px; }
.pre { white-space: pre-wrap; }
.meta { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; }

a.btn, .btn { display: flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 12px; }
.btn-sub { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; margin-bottom: 8px; }
.badge.ok   { background: #dcfce7; color: #166534; }
.badge.wait { background: #fef3c7; color: #92400e; }
.badge.end  { background: #e5e7eb; color: #4b5563; }

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
fieldset.field legend, .field > label { font-weight: 600; padding: 0; margin-bottom: 4px; display: block; }
.help { margin: 0 0 6px; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.req, .opt { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px; font-size: 0.72rem; font-weight: 700; vertical-align: middle; }
.req { background: #fee2e2; color: var(--danger); }
.opt { background: #e5e7eb; color: #4b5563; }

.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 400; cursor: pointer; margin: 0; }
.choice input { width: 22px; height: 22px; min-height: 0; flex: 0 0 auto; margin: 0; }

.policy { white-space: pre-wrap; background: #f1f5f9; border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 0.9rem; max-height: 200px; overflow-y: auto; }
.person h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 14px; }

.error-box { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; }
.error-box ul { margin: 4px 0 0; padding-left: 20px; }
.err-title { margin: 0; font-weight: 700; }

.done { text-align: center; }
.receipt { font-size: 2rem; font-weight: 800; letter-spacing: 0.05em; margin: 0 0 12px; }

@media (min-width: 768px) {
  .choices { grid-template-columns: repeat(2, 1fr); }
}

/* ===== ステップ4で追加 ===== */
/* ボット対策の見えない欄(画面外へ退避。display:none だとボットに見抜かれるため) */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 入力 → 確認 → 完了 の進行表示 */
.steps { display: flex; list-style: none; margin: 0 0 16px; padding: 0; gap: 6px; }
.steps li { flex: 1; text-align: center; padding: 6px 0; border-radius: 999px; background: #e5e7eb; color: #6b7280; font-size: 0.85rem; font-weight: 700; }
.steps li.on { background: var(--primary); color: #fff; }
.steps li.past { background: #dbeafe; color: #1e40af; }

/* 確認画面の一覧 */
.sum-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: 0; }
.sum-k { color: var(--muted); font-size: 0.85rem; }
.sum-v { font-size: 1.05rem; white-space: pre-wrap; }

.ts-box { display: flex; justify-content: center; margin: 8px 0; min-height: 4px; }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== ステップ5で追加 ===== */
.btn-danger { background: var(--danger); color: #fff; }

/* ===== ステップ6で追加 ===== */
.notice { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
