/* ============================================================
   ミナモト精工 採用サイト｜フォーム共通スタイル
   採用エントリー / 工場見学申込 で共有
   ============================================================ */

:root {
  --accent: #1E46E8;
  --ink: #0e1116;
  --ink-2: #3c4450;
  --ink-3: #6b7480;
  --line: rgba(14,17,22,0.12);
  --line-soft: rgba(14,17,22,0.08);
  --bg: #f4f5f7;
  --card: #ffffff;
  --dark: #0f1216;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); }

/* ---------- ヘッダー ---------- */
.fm-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.fm-header-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 13px clamp(16px,5vw,32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.fm-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
}
.fm-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Anton', sans-serif;
  font-size: 16px;
  flex: none;
}
.fm-brand-name { font-weight: 900; font-size: 14.5px; letter-spacing: 0.01em; }
.fm-brand-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.13em;
  color: var(--ink-3);
  display: block;
  margin-top: 1px;
}
.fm-back {
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .25s ease, color .25s ease;
}
.fm-back:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- ヒーロー ---------- */
.fm-hero {
  position: relative;
  overflow: hidden;
  background: var(--dark);
  color: #fff;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.045) 0, rgba(255,255,255,0.045) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0, rgba(255,255,255,0.045) 1px, transparent 1px, transparent 64px);
}
.fm-hero-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(34px,7vw,60px) clamp(16px,5vw,32px) clamp(30px,6vw,52px);
  position: relative;
  z-index: 2;
}
.fm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #8fa3ff;
}
.fm-eyebrow span {
  width: 8px; height: 8px;
  background: var(--accent);
  flex: none;
}
.fm-hero h1 {
  font-size: clamp(27px,6.4vw,46px);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin: 15px 0 0;
}
.fm-hero-lead {
  font-size: clamp(13.5px,3.4vw,15.5px);
  line-height: 2;
  color: rgba(255,255,255,0.72);
  margin: 14px 0 0;
  max-width: 34em;
}
.fm-watermark {
  position: absolute;
  right: -1%;
  bottom: -8%;
  font-family: 'Anton', sans-serif;
  font-size: clamp(80px,20vw,190px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.08);
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ---------- 本体 ---------- */
.fm-main {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(26px,6vw,48px) clamp(16px,5vw,32px) clamp(60px,10vw,90px);
}
.fm-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(22px,5vw,44px);
  box-shadow: 0 20px 50px rgba(14,17,22,0.06);
}

/* ---------- フィールド ---------- */
.fm-form { display: flex; flex-direction: column; gap: clamp(20px,3.4vw,26px); }
.fm-field { display: flex; flex-direction: column; gap: 9px; }
.fm-label {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.fm-req {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(30,70,232,0.08);
  padding: 2px 8px;
  border-radius: 999px;
}
.fm-opt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
}
.fm-hint { font-size: 12px; color: var(--ink-3); line-height: 1.6; }

.fm-input, .fm-select, .fm-textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--line-soft);
  border-radius: 10px;
  padding: 13px 15px;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.fm-textarea { min-height: 128px; resize: vertical; line-height: 1.8; }
.fm-input:focus, .fm-select:focus, .fm-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30,70,232,0.1);
}
.fm-input::placeholder, .fm-textarea::placeholder { color: #a4acb6; }
.fm-select {
  appearance: none;
  -webkit-appearance: none;
  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 fill='%236b7480' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* ---------- 選択チップ（ラジオ / チェック） ---------- */
.fm-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.fm-chip { position: relative; }
.fm-chip input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
  pointer-events: none;
}
.fm-chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--bg);
  border: 1.5px solid var(--line-soft);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease, transform .15s ease;
  user-select: none;
}
.fm-chip span::before {
  content: "";
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid #c2c9d2;
  flex: none;
  transition: border-color .2s ease, background .2s ease;
}
.fm-chip input[type="checkbox"] + span::before { border-radius: 5px; }
.fm-chip span:hover { border-color: #b5c0d8; transform: translateY(-1px); }
.fm-chip input:checked + span {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(30,70,232,0.06);
}
.fm-chip input:checked + span::before {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1.5 5.5 4 8l5.5-5.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.fm-chip input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(30,70,232,0.15);
}

/* 2カラムグリッド（氏名・フリガナ等） */
.fm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px,3vw,22px); }

/* ---------- 同意 ---------- */
.fm-agree {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 15px 17px;
}
.fm-agree input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.fm-agree label { font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.fm-agree a { font-weight: 700; }

/* ---------- 送信ボタン ---------- */
.fm-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 18px 32px;
  cursor: pointer;
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}
.fm-submit:hover { background: var(--ink); transform: translateY(-2px); box-shadow: 0 14px 30px rgba(14,17,22,0.18); }
.fm-submit:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.fm-submit .fm-spin {
  width: 17px; height: 17px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fm-rot .7s linear infinite;
  display: none;
}
.fm-submit.is-loading .fm-spin { display: inline-block; }
@keyframes fm-rot { to { transform: rotate(360deg); } }

.fm-privacy { font-size: 11.5px; color: var(--ink-3); line-height: 1.75; margin: 4px 0 0; }

/* ---------- エラー表示 ---------- */
.fm-error-banner {
  display: none;
  background: #fdecec;
  border: 1px solid #f3b7b7;
  color: #b42318;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.6;
}
.fm-error-banner.is-shown { display: block; }
.fm-field.has-error .fm-input,
.fm-field.has-error .fm-select,
.fm-field.has-error .fm-textarea { border-color: #e0524d; background: #fff; }
.fm-field-error { display: none; font-size: 12px; font-weight: 700; color: #d0332c; }
.fm-field.has-error .fm-field-error { display: block; }

/* ---------- 完了画面 ---------- */
.fm-done { display: none; text-align: center; padding: clamp(14px,4vw,30px) 0; }
.fm-done.is-shown { display: block; animation: fm-fade .6s ease both; }
.fm-form.is-hidden { display: none; }
@keyframes fm-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fm-done-check {
  width: 64px; height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(30,70,232,0.1);
  display: grid;
  place-items: center;
}
.fm-done-check svg { width: 32px; height: 32px; }
.fm-done h2 { font-size: clamp(21px,5vw,28px); font-weight: 900; margin: 20px 0 0; }
.fm-done p { font-size: 14px; line-height: 2; color: var(--ink-2); margin: 12px 0 0; }
.fm-done .fm-back-home {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 15px 30px;
  text-decoration: none;
  transition: background .3s ease, transform .3s ease;
}
.fm-done .fm-back-home:hover { background: var(--accent); transform: translateY(-2px); }

/* ---------- サイド情報カード ---------- */
.fm-note {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%,230px), 1fr));
  gap: 12px;
}
.fm-note-item {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 18px;
}
.fm-note-item .k {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}
.fm-note-item .v { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin-top: 6px; }

/* ---------- フッター ---------- */
.fm-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.55);
  padding: 26px clamp(16px,5vw,32px);
}
.fm-footer-inner {
  max-width: 940px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.fm-footer-inner .name { color: #fff; font-family: 'Zen Kaku Gothic New', sans-serif; font-weight: 900; font-size: 13px; letter-spacing: 0.01em; }

/* ---------- モバイル ---------- */
@media (max-width: 560px) {
  .fm-grid { grid-template-columns: 1fr; }
  .fm-brand-sub { display: none; }
  .fm-chip span { padding: 10px 15px; font-size: 13px; }
}
