/* チャイルド・ケモ・ハウス様 メールフォームの見た目（入力ページ・確認・完了の共通）2026-10-26 アンダーアップ
   サイトの CSS とぶつからないよう、すべて .mf の中だけに効かせる */
.mf {
  --mf-accent: #2f7a4b;          /* サイトの緑（白い文字が読める濃さ） */
  --mf-accent-ink: #fff;
  --mf-accent-soft: #e8f4ec;
  --mf-ink: #222;
  --mf-sub: #6b6459;
  --mf-line: #cfdcd3;            /* 薄い緑がかった線 */
  --mf-bg: #fff;
  --mf-field: #f8fbf9;
  --mf-error: #c0262d;
  --mf-ok: #2e7d4f;
  --mf-radius: 10px;
  box-sizing: border-box;
  max-width: 760px;
  margin: 0 auto;
  color: var(--mf-ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .02em;
  text-align: left;
}
.mf[data-theme="recruit"] {
  --mf-accent: #d9730d;          /* 求人ページのオレンジ */
  --mf-accent-soft: #fdf1e3;
  --mf-line: #e3d6c5;
}
.mf *, .mf *::before, .mf *::after { box-sizing: border-box; }
.mf p { margin: 0; }
/* サイトの main.css が「.form-wrap の最後の段落は幅50%」にしているのを打ち消す */
.mf p, .mf p:last-child { width: auto !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; float: none !important; }
/* 求人 LP の main.css が「#form span は赤字・110%」「#form form p は中央寄せ」にしているのを打ち消す。
   ID の指定に負けないよう :not(#mf-x) で強さを足している（mf-x という ID は使っていない） */
.mf:not(#mf-x) span { margin-right: 0; font-size: inherit; color: inherit; }
.mf:not(#mf-x) .mf-badge { display: inline-block; font-size: 11px; }
.mf:not(#mf-x) .mf-badge.is-req { color: var(--mf-accent-ink); }
.mf:not(#mf-x) .mf-badge.is-opt { color: var(--mf-sub); }
.mf:not(#mf-x) .mf-choice span { display: inline-flex; font-size: 15px; }
.mf:not(#mf-x) .mf-choice input:checked + span { color: var(--mf-ink); }
.mf:not(#mf-x) .mf-form p { text-align: left; }
.mf:not(#mf-x) .mf-form .mf-count { text-align: right; }
.mf:not(#mf-x) .mf-form .mf-note { text-align: center; }

/* 1 入力 → 2 確認 → 3 完了 */
.mf-steps { display: flex; gap: 8px; list-style: none; margin: 0 0 28px; padding: 0; counter-reset: mfstep; }
.mf-steps li {
  flex: 1; position: relative; padding: 10px 6px 0; border-top: 4px solid var(--mf-line);
  color: var(--mf-sub); font-size: 13px; text-align: center; counter-increment: mfstep; list-style: none; background: none;
}
.mf-steps li::before { content: "STEP " counter(mfstep); display: block; font-size: 11px; letter-spacing: .12em; }
.mf-steps li.is-done { border-top-color: var(--mf-accent); color: var(--mf-ink); }
.mf-steps li.is-current { border-top-color: var(--mf-accent); color: var(--mf-accent); font-weight: 700; }

.mf-card {
  background: var(--mf-bg); border: 1px solid var(--mf-line); border-radius: 16px;
  padding: 36px 40px; box-shadow: 0 10px 30px rgba(60, 40, 20, .06);
}
.mf-lead { color: var(--mf-sub); font-size: 14px; margin-bottom: 24px !important; }
.mf-lead strong { color: var(--mf-accent); }

/* 項目 */
.mf-field { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }
.mf-label, .mf-field > legend {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 0;
  font-size: 15px; font-weight: 700; color: var(--mf-ink); float: none;
}
.mf-badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  line-height: 1.7; letter-spacing: .05em;
}
.mf-badge.is-req { background: var(--mf-accent); color: var(--mf-accent-ink); }
.mf-badge.is-opt { background: #ece8df; color: var(--mf-sub); }
.mf-hint { margin-top: 6px !important; color: var(--mf-sub); font-size: 13px; }

.mf input[type="text"], .mf input[type="email"], .mf input[type="tel"], .mf input[type="number"],
.mf select, .mf textarea {
  display: block; width: 100%; max-width: 100%; margin: 0; padding: 13px 14px;
  border: 1.5px solid var(--mf-line); border-radius: var(--mf-radius); background: var(--mf-field);
  color: var(--mf-ink); font: inherit; font-size: 16px; line-height: 1.5;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
  -webkit-appearance: none; appearance: none; height: auto;
}
.mf textarea { min-height: 180px; resize: vertical; }
.mf select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6459' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.mf input::placeholder, .mf textarea::placeholder { color: #aaa197; }
.mf input:hover, .mf select:hover, .mf textarea:hover { border-color: #bdb4a3; }
.mf input:focus, .mf select:focus, .mf textarea:focus {
  outline: none; border-color: var(--mf-accent); background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mf-accent) 18%, transparent);
}
.mf .is-invalid input, .mf .is-invalid select, .mf .is-invalid textarea { border-color: var(--mf-error); background: #fff7f7; }
.mf .is-valid input, .mf .is-valid textarea { border-color: color-mix(in srgb, var(--mf-ok) 55%, var(--mf-line)); }
.mf-error { display: none; margin-top: 6px !important; color: var(--mf-error); font-size: 13px; font-weight: 700; }
.mf-error::before { content: "！"; display: inline-block; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%;
  background: var(--mf-error); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 1px; }
.mf .is-invalid .mf-error { display: block; }
.mf-suggest { display: none; margin-top: 6px !important; font-size: 13px; color: var(--mf-ink); }
.mf-suggest.is-show { display: block; }
.mf-suggest button { padding: 0; border: 0; background: none; color: var(--mf-accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.mf-count { margin-top: 4px !important; color: var(--mf-sub); font-size: 12px; text-align: right; }
.mf-count.is-over { color: var(--mf-error); font-weight: 700; }

.mf-row { display: flex; align-items: center; gap: 10px; }
.mf-row input { max-width: 120px; }

/* 選択肢（ラジオ・チェック）をボタンの形に */
.mf-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.mf-choice { position: relative; margin: 0; cursor: pointer; }
.mf-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.mf-choice span {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1.5px solid var(--mf-line);
  border-radius: 999px; background: var(--mf-field); font-size: 15px; line-height: 1.4; transition: all .15s; user-select: none;
}
.mf-choice span::before {
  content: ""; width: 16px; height: 16px; border: 1.5px solid #b3aa99; border-radius: 4px; background: #fff; flex: none; transition: all .15s;
}
.mf-choice input[type="radio"] + span::before { border-radius: 50%; }
.mf-choice:hover span { border-color: #bdb4a3; }
.mf-choice input:checked + span { border-color: var(--mf-accent); background: var(--mf-accent-soft); color: var(--mf-ink); font-weight: 700; }
.mf-choice input:checked + span::before {
  border-color: var(--mf-accent); background: var(--mf-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l3 3 5-6' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/10px no-repeat;
}
.mf-choice input[type="radio"]:checked + span::before { background: var(--mf-accent); box-shadow: inset 0 0 0 3px #fff; }
.mf-choice input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--mf-accent) 22%, transparent); }

/* ボタン */
.mf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.mf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 260px; min-height: 58px;
  padding: 14px 32px; border: 0; border-radius: 999px; background: var(--mf-accent); color: var(--mf-accent-ink);
  font: inherit; font-size: 17px; font-weight: 700; letter-spacing: .08em; text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--mf-accent) 30%, transparent); transition: transform .12s, box-shadow .12s, opacity .12s;
  -webkit-appearance: none; appearance: none; width: auto; height: auto;
}
.mf-btn::after { content: "→"; font-weight: 400; transition: transform .15s; }
.mf-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px color-mix(in srgb, var(--mf-accent) 34%, transparent); color: var(--mf-accent-ink); }
.mf-btn:hover::after { transform: translateX(3px); }
.mf-btn:active { transform: translateY(1px); }
.mf-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--mf-accent) 45%, #fff); outline-offset: 3px; }
.mf-btn[disabled], .mf-btn.is-busy { opacity: .6; cursor: wait; transform: none; }
.mf-btn.is-busy::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: mf-spin .8s linear infinite; }
.mf-btn.is-ghost { background: #fff; color: var(--mf-ink); border: 1.5px solid var(--mf-line); box-shadow: none; min-width: 180px; }
.mf-btn.is-ghost::after { content: none; }
.mf-btn.is-ghost::before { content: "←"; font-weight: 400; }
.mf-btn.is-ghost:hover { color: var(--mf-ink); border-color: #bdb4a3; }
@keyframes mf-spin { to { transform: rotate(360deg); } }

.mf-note { margin-top: 22px !important; color: var(--mf-sub); font-size: 12px; text-align: center; }
.mf-note::before { content: "🔒 "; }

/* 確認画面の一覧 */
.mf-review { margin: 0; padding: 0; border-top: 1px solid var(--mf-line); }
.mf-review div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 16px 4px; border-bottom: 1px solid var(--mf-line); }
.mf-review dt { margin: 0; color: var(--mf-sub); font-size: 14px; font-weight: 700; }
.mf-review dd { margin: 0; word-break: break-word; overflow-wrap: anywhere; }
.mf-review dd.is-empty { color: #aaa197; }

/* 誤り・完了 */
.mf-alert { margin: 0 0 24px; padding: 16px 20px; border-radius: var(--mf-radius); background: #fff3f3; border: 1px solid #f1c4c6; color: var(--mf-error); }
.mf-alert ul { margin: 8px 0 0; padding-left: 1.2em; }
.mf-alert li { margin: 2px 0; list-style: disc; }
.mf-done { text-align: center; padding: 12px 0 4px; }
.mf-done-icon {
  display: inline-grid; place-items: center; width: 76px; height: 76px; margin-bottom: 18px; border-radius: 50%;
  background: var(--mf-accent-soft); color: var(--mf-accent); font-size: 38px; line-height: 1;
  animation: mf-pop .5s cubic-bezier(.2, 1.4, .4, 1) both;
}
.mf-done h2 { margin: 0 0 12px; font-size: 24px; font-weight: 700; color: var(--mf-ink); }
.mf-done p { color: var(--mf-sub); }
@keyframes mf-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.mf-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* 確認・完了画面（mailform.php が出す画面）の外枠 */
body.mf-page { margin: 0; min-height: 100vh; background: #f2f7f3; }
body.mf-page[data-theme="recruit"] { background: #f1e9e0; }
.mf-head { background: #fff; padding: 14px 24px; border-bottom: 3px solid #00ac4d; }
.mf-head img { display: block; height: 44px; width: auto; }
body.mf-page[data-theme="recruit"] .mf-head { background: #f1e9e0; border-bottom: 1px solid #e3d6c5; }
.mf-main { padding: 40px 16px 64px; }
.mf-title { margin: 0 0 6px; font-size: 26px; font-weight: 700; text-align: center; letter-spacing: .1em; color: var(--mf-ink); }
.mf-sub { margin: 0 0 28px !important; text-align: center; color: var(--mf-sub); font-size: 14px; }
.mf-foot { padding: 24px 16px 40px; color: #5f6b63; font-size: 12px; text-align: center; }

@media (max-width: 640px) {
  .mf { font-size: 15px; }
  .mf-card { padding: 24px 18px; border-radius: 14px; }
  .mf-review div { grid-template-columns: 1fr; gap: 4px; padding: 14px 2px; }
  .mf-actions { flex-direction: column-reverse; align-items: stretch; }
  .mf-btn, .mf-btn.is-ghost { min-width: 0; width: 100%; }
  .mf-steps li { font-size: 12px; }
  .mf-main { padding: 24px 12px 48px; }
  .mf-title { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .mf *, .mf *::before, .mf *::after { animation: none !important; transition: none !important; }
}

/* 案内文の電話番号のリンクをサイトの緑に（チャイルド・ケモ・ハウス様） */
.mf-lead a { color: var(--mf-accent); }
