/* ============================================================
   MailForm — 汎用スタイル
   既存サイトに組み込む場合も .mf 配下だけに効くようにしています。
   ============================================================ */
:root {
  --mf-accent: #2b5f8a;
  --mf-text: #222;
  --mf-muted: #666;
  --mf-line: #d6d9dd;
  --mf-bg: #fff;
  --mf-field-bg: #fafbfc;
  --mf-error: #c62828;
  --mf-radius: 6px;
}

body {
  margin: 0;
  background: #f4f5f7;
  color: var(--mf-text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

.mf {
  box-sizing: border-box;
  max-width: 760px;
  margin: 40px auto;
  padding: 40px 48px;
  background: var(--mf-bg);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.mf *, .mf *::before, .mf *::after { box-sizing: border-box; }

.mf-title {
  margin: 0 0 24px;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}

/* ステップ表示 */
.mf-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.mf-steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--mf-muted);
  font-size: .85rem;
}
.mf-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--mf-line);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
}
.mf-steps li + li::after { content: none; }
.mf-steps li:not(:last-child) { padding-right: 18px; border-right: 1px solid var(--mf-line); }
.mf-steps li[aria-current="step"] { color: var(--mf-text); font-weight: 700; }
.mf-steps li[aria-current="step"]::before { background: var(--mf-accent); }

.mf-lead { margin: 0 0 28px; font-size: .95rem; }
.mf-small { font-size: .85rem; color: var(--mf-muted); }

.mf-notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-left: 4px solid var(--mf-error);
  background: #fdecea;
  color: var(--mf-error);
  font-size: .9rem;
}

/* 入力行 */
.mf-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 8px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--mf-line);
}
.mf-row:first-of-type { border-top: 1px solid var(--mf-line); }
.mf-row > label,
.mf-row > .mf-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-self: start;
  padding-top: 8px;
  font-weight: 700;
  font-size: .95rem;
}

.mf-req, .mf-opt {
  display: inline-block;
  padding: 0 6px;
  border-radius: 3px;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.7;
}
.mf-req { background: var(--mf-error); color: #fff; }
.mf-opt { background: var(--mf-line); color: var(--mf-muted); }

.mf input[type="text"],
.mf input[type="email"],
.mf input[type="tel"],
.mf input[type="date"],
.mf select,
.mf textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-radius);
  background: var(--mf-field-bg);
  color: var(--mf-text);
  font: inherit;
  font-size: 1rem; /* iOSのズーム防止 */
  transition: border-color .15s, box-shadow .15s;
}
.mf select { min-height: 46px; }
.mf textarea { resize: vertical; min-height: 180px; }
.mf input[type="date"] { max-width: 240px; min-height: 46px; -webkit-appearance: none; appearance: none; }
.mf input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.mf input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.mf input:focus, .mf select:focus, .mf textarea:focus {
  outline: none;
  border-color: var(--mf-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mf-accent) 20%, transparent);
  background: #fff;
}
.mf input[aria-invalid="true"], .mf select[aria-invalid="true"], .mf textarea[aria-invalid="true"] { border-color: var(--mf-error); background: #fffafa; }
.mf ::placeholder { color: #aaa; }

.mf-label { margin: 0; }
.mf-note { margin: 6px 0 0; color: var(--mf-muted); font-size: .85rem; }

/* ラジオ・チェックボックス */
.mf-choices { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 8px; }
.mf-choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.mf-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--mf-accent); }
.mf [aria-invalid="true"] .mf-choices { padding: 8px 10px; border: 1px solid var(--mf-error); border-radius: var(--mf-radius); background: #fffafa; }

/* 郵便番号 */
.mf-zip { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.mf-zip-mark { color: var(--mf-muted); font-weight: 700; }
.mf-zip-status { margin: 6px 0 0; color: var(--mf-muted); font-size: .85rem; }
.mf-zip-status:empty { display: none; }

.mf-error { margin: 6px 0 0; color: var(--mf-error); font-size: .85rem; }

/* 同意 */
.mf-agree { margin: 28px 0 0; text-align: center; }
.mf-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.mf-check input { width: 18px; height: 18px; accent-color: var(--mf-accent); }
.mf a { color: var(--mf-accent); }

/* ボタン */
.mf-actions { margin-top: 36px; text-align: center; }
.mf-actions--split { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.mf-actions--split form { margin: 0; }

.mf-btn {
  display: inline-block;
  min-width: 240px;
  padding: 14px 32px;
  border: 2px solid var(--mf-accent);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s, background .15s, color .15s;
}
.mf-btn--primary { background: var(--mf-accent); color: #fff; }
.mf-btn--primary:hover { opacity: .85; }
.mf-btn--ghost { background: #fff; color: var(--mf-accent); }
.mf-btn--ghost:hover { background: color-mix(in srgb, var(--mf-accent) 8%, #fff); }
.mf-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--mf-accent) 40%, transparent); outline-offset: 2px; }
.mf-btn[disabled] { opacity: .5; cursor: wait; }

/* 確認画面 */
.mf-confirm {
  display: grid;
  grid-template-columns: 200px 1fr;
  margin: 0;
  border-top: 1px solid var(--mf-line);
}
.mf-confirm dt, .mf-confirm dd {
  margin: 0;
  padding: 16px 0;
  border-bottom: 1px solid var(--mf-line);
}
.mf-confirm dt { font-weight: 700; font-size: .95rem; }
.mf-confirm dd { word-break: break-word; }

/* 完了画面 */
.mf-done { text-align: center; }

/* ハニーポット（画面外へ） */
.mf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* スマホ */
@media (max-width: 640px) {
  .mf { margin: 0; padding: 28px 18px 40px; border-radius: 0; box-shadow: none; }
  .mf-title { font-size: 1.35rem; }
  .mf-row, .mf-confirm { grid-template-columns: 1fr; }
  .mf-row { gap: 6px; padding: 16px 0; }
  .mf-row > label,
.mf-row > .mf-label { padding-top: 0; }
  .mf-confirm dt { padding-bottom: 0; border-bottom: 0; }
  .mf-confirm dd { padding-top: 4px; }
  .mf-btn { width: 100%; min-width: 0; }
  .mf-actions--split { flex-direction: column-reverse; }
  .mf-actions--split form { width: 100%; }
}

/* iframe 埋め込み時（assets/frame.js が html に .mf-embedded を付与） */
.mf-embedded body { background: transparent; }
.mf-embedded .mf { max-width: none; margin: 0; padding: 32px 24px 40px; border-radius: 0; box-shadow: none; background: transparent; }
@media (max-width: 640px) {
  .mf-embedded .mf { padding: 20px 4px 32px; }
}
