/* =========================================================================
   contact-sales.css — 営業支援専用お問い合わせフォーム
   service-sales.html（.sales-lp-root）のデザイントークンをそのまま踏襲する。
     ink #141B2B / sub #596478 / border #D9E0E8 / soft #F7F8FA
     accent #355AA8（hover #27467F）/ light #7896D6 / navy #0D1B32
   本ファイルは .cs-root スコープに閉じ、共通ヘッダー・フッターおよび
   他ページのCSS（contact.css / service.css 等）へは一切影響しない。
   ========================================================================= */

.cs-root {
  --cs-ink: #141B2B;
  --cs-sub: #596478;
  --cs-mute: #6B7789;
  --cs-line: #D9E0E8;
  --cs-line-soft: #E8ECF1;
  --cs-soft: #F7F8FA;
  --cs-accent: #355AA8;
  --cs-accent-dark: #27467F;
  --cs-accent-light: #7896D6;
  --cs-accent-tint: #F4F7FC;
  --cs-navy: #0D1B32;
  --cs-error: #C0392F;
  --cs-error-tint: rgba(192, 57, 47, 0.07);
}

/* 日本語の不自然な折返し（1文字だけ次行に落ちる等）を抑制 */
.cs-root h1,
.cs-root h2,
.cs-root h3,
.cs-root p,
.cs-root label,
.cs-root span,
.cs-root li {
  overflow-wrap: break-word;
  line-break: strict;
}
/* 語の途中で改行させたくない範囲に付与する */
.cs-root .cs-nobr { display: inline-block; }

.cs-root h1,
.cs-root h2,
.cs-root .cs-hero-lead,
.cs-root .cs-legend-note,
.cs-root .cs-purpose-title,
.cs-root .cs-purpose-note {
  text-wrap: pretty;
}

/* =========================================================================
   1. ファーストビュー（service-sales.html のヒーローと同じダークネイビー）
   ========================================================================= */
.cs-hero {
  position: relative;
  overflow: hidden;
  background: var(--cs-navy);
  color: #ffffff;
}
/* 営業支援ページのヒーロー／最終CTAと同系の、ごく控えめな光の演出 */
.cs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(110% 80% at 14% -12%, rgba(53, 90, 168, 0.42) 0%, rgba(13, 27, 50, 0) 60%),
    radial-gradient(70% 60% at 96% 112%, rgba(120, 150, 214, 0.16) 0%, rgba(13, 27, 50, 0) 58%);
  pointer-events: none;
}
.cs-hero-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--header-h, 76px) + clamp(48px, 6vw, 84px)) clamp(20px, 4vw, 56px) clamp(48px, 5vw, 76px);
}
.cs-hero-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
}
.cs-hero-label::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 1px;
  background: #4A6499;
}
.cs-hero-label span {
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: 0.28em;
  color: var(--cs-accent-light);
}
.cs-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 800;
  line-height: 1.44;
  letter-spacing: 0.005em;
}
.cs-hero-lead {
  margin: 22px 0 0;
  max-width: 46em;
  font-size: clamp(14px, 1.4vw, 15.5px);
  line-height: 2;
  color: rgba(255, 255, 255, 0.78);
}
/* 営業支援ページへ戻る導線 */
.cs-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  padding-bottom: 2px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.cs-root .cs-hero-back { color: rgba(255, 255, 255, 0.72); }
.cs-root .cs-hero-back:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

/* =========================================================================
   2. フォーム全体
   ========================================================================= */
.cs-body {
  background: var(--cs-soft);
  border-top: 1px solid rgba(120, 150, 214, 0.22);
}
.cs-body-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(40px, 5vw, 72px) clamp(20px, 4vw, 56px) clamp(56px, 6vw, 96px);
}

.cs-form {
  background: #ffffff;
  border: 1px solid var(--cs-line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(17, 30, 50, 0.03);
  padding: clamp(24px, 3.6vw, 48px);
}

/* ---- セクション見出し ---- */
.cs-block { border-top: 1px solid var(--cs-line-soft); margin-top: clamp(32px, 3.6vw, 44px); padding-top: clamp(28px, 3.2vw, 40px); }
.cs-block:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.cs-legend {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0 0 6px;
  font-size: clamp(16px, 1.8vw, 19px);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--cs-ink);
}
.cs-legend-note {
  margin: 0 0 clamp(18px, 2.2vw, 24px);
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--cs-sub);
}
.cs-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* =========================================================================
   3. 問い合わせ目的の選択カード（radio）
   ========================================================================= */
.cs-purpose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* 5番目（その他）は横幅いっぱい */
.cs-purpose-grid > li:nth-child(5) { grid-column: 1 / -1; }

.cs-purpose {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 14px;
  height: 100%;
  padding: 18px 18px 18px 16px;
  background: #ffffff;
  border: 1px solid var(--cs-line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.cs-purpose:hover { border-color: #9BB0D4; }

/* 実際のradioは視覚的に隠すがキーボード操作は維持する */
.cs-purpose-radio {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}

.cs-purpose-num {
  grid-row: 1 / span 2;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.08em;
  color: var(--cs-mute);
  transition: color 0.2s ease;
}
.cs-purpose-title {
  grid-column: 2;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--cs-ink);
}
.cs-purpose-note {
  grid-column: 2;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--cs-sub);
}
/* チェックアイコン（選択時のみ表示） */
.cs-purpose-check {
  grid-row: 1 / span 2;
  grid-column: 3;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--cs-line);
  border-radius: 50%;
  background: #ffffff;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.cs-purpose-check svg {
  width: 11px;
  height: 11px;
  stroke: #ffffff;
  stroke-width: 3;
  fill: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* ---- 選択時：ごく薄いブルー背景＋ブルーborder（青ベタ塗りにはしない） ---- */
.cs-purpose.is-selected,
.cs-purpose:has(.cs-purpose-radio:checked) {
  background: var(--cs-accent-tint);
  border-color: var(--cs-accent);
  box-shadow: inset 0 0 0 1px rgba(53, 90, 168, 0.28);
}
.cs-purpose.is-selected .cs-purpose-num,
.cs-purpose:has(.cs-purpose-radio:checked) .cs-purpose-num { color: var(--cs-accent); }
.cs-purpose.is-selected .cs-purpose-check,
.cs-purpose:has(.cs-purpose-radio:checked) .cs-purpose-check {
  background: var(--cs-accent);
  border-color: var(--cs-accent);
}
.cs-purpose.is-selected .cs-purpose-check svg,
.cs-purpose:has(.cs-purpose-radio:checked) .cs-purpose-check svg { opacity: 1; }

/* キーボードフォーカス */
.cs-purpose:has(.cs-purpose-radio:focus-visible),
.cs-purpose.is-focused {
  outline: 2px solid var(--cs-accent);
  outline-offset: 2px;
}

/* =========================================================================
   4. 入力項目
   ========================================================================= */
.cs-fields { display: grid; gap: clamp(18px, 2.2vw, 24px); }
.cs-fields--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cs-field { min-width: 0; }
.cs-field--full { grid-column: 1 / -1; }

.cs-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--cs-ink);
}
.cs-req,
.cs-opt {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.6;
  border-radius: 3px;
}
.cs-req { color: #ffffff; background: var(--cs-accent); }
.cs-opt { color: var(--cs-mute); background: var(--cs-soft); border: 1px solid var(--cs-line); }

.cs-input,
.cs-select,
.cs-textarea {
  width: 100%;
  max-width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--cs-ink);
  background: #ffffff;
  border: 1px solid var(--cs-line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.cs-input::placeholder,
.cs-textarea::placeholder { color: #A3ABB8; }
.cs-textarea { min-height: 132px; resize: vertical; }
.cs-textarea--tall { min-height: 156px; }

.cs-select {
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23355AA8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 17px;
}
.cs-select.is-placeholder { color: #A3ABB8; }

.cs-input:focus,
.cs-select:focus,
.cs-textarea:focus {
  outline: none;
  border-color: var(--cs-accent);
  box-shadow: 0 0 0 3px rgba(53, 90, 168, 0.12);
}

.cs-help {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--cs-mute);
}

/* =========================================================================
   5. チップ型の複数選択／単一選択（支援内容・希望開始時期）
   ========================================================================= */
.cs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cs-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 15px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cs-ink);
  background: #ffffff;
  border: 1px solid var(--cs-line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.cs-chip:hover { border-color: #9BB0D4; }
.cs-chip input {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.cs-chip::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 1px solid #C3CBD6;
  border-radius: 3px;
  background: #ffffff;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
/* 単一選択（希望開始時期）は丸型 */
.cs-chips--single .cs-chip::before { border-radius: 50%; }

.cs-chip.is-selected,
.cs-chip:has(input:checked) {
  background: var(--cs-accent-tint);
  border-color: var(--cs-accent);
  color: var(--cs-accent-dark);
}
.cs-chip.is-selected::before,
.cs-chip:has(input:checked)::before {
  border-color: var(--cs-accent);
  background: var(--cs-accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E")
    center / 10px 10px no-repeat;
}
.cs-chip:has(input:focus-visible),
.cs-chip.is-focused { outline: 2px solid var(--cs-accent); outline-offset: 2px; }

/* =========================================================================
   6. 条件分岐ブロック（目的の選択に応じて表示）
   ========================================================================= */
/* 高さアニメーションのために overflow:hidden を常時適用する。
   フォーカスリング（outline / box-shadow）が左右で切れないよう、
   ネガティブマージンと同量のパディングで“のりしろ”を確保している。 */
.cs-conditional {
  overflow: hidden;
  margin-inline: -8px;
  padding-inline: 8px;
  transition: height 0.22s ease;
}
/* 内側は margin を一切使わない（overflow切替時のマージン相殺で高さが跳ねるのを防ぐ）。
   区切り線は padding の中に絶対配置して、線の上下に余白を確保する。 */
.cs-cond-inner {
  position: relative;
  padding-top: calc(clamp(32px, 3.6vw, 44px) + clamp(28px, 3.2vw, 40px));
}
.cs-cond-inner::before {
  content: "";
  position: absolute;
  top: clamp(32px, 3.6vw, 44px);
  left: 0;
  right: 0;
  height: 1px;
  background: var(--cs-line-soft);
}
.cs-conditional[data-empty="true"] .cs-cond-inner { display: none; }

.cs-cond-field { transition: opacity 0.2s ease; }
.cs-cond-field[hidden] { display: none; }
.cs-cond-field.is-entering { opacity: 0; }

/* 選択肢が少ない項目は横に伸ばしすぎない */
.cs-field--half .cs-input,
.cs-field--half .cs-select { max-width: 460px; }

/* =========================================================================
   7. 送信・エラー・完了
   ========================================================================= */
.cs-error {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--cs-error);
}
.cs-error::before {
  content: "!";
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  color: #ffffff;
  background: var(--cs-error);
  border-radius: 50%;
}
.cs-field.has-error .cs-error,
.cs-fieldset.has-error .cs-error { display: flex; }
.cs-field.has-error .cs-input,
.cs-field.has-error .cs-select,
.cs-field.has-error .cs-textarea {
  border-color: var(--cs-error);
  box-shadow: 0 0 0 3px var(--cs-error-tint);
}
.cs-fieldset.has-error .cs-purpose { border-color: rgba(192, 57, 47, 0.5); }

.cs-submit-row {
  margin-top: clamp(28px, 3.2vw, 40px);
  padding-top: clamp(24px, 2.8vw, 32px);
  border-top: 1px solid var(--cs-line-soft);
}
.cs-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 0 26px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.5;
  color: #ffffff;
  background: var(--cs-accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}
.cs-submit:hover { background: var(--cs-accent-dark); transform: translateY(-1px); }
.cs-submit:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 3px; }
.cs-submit-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--cs-mute);
  text-align: center;
}
.cs-submit-note a { color: var(--cs-accent); text-decoration: underline; text-underline-offset: 2px; }

.cs-success {
  display: none;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 clamp(22px, 2.6vw, 30px);
  padding: 18px 20px;
  background: var(--cs-accent-tint);
  border: 1px solid rgba(53, 90, 168, 0.28);
  border-left: 3px solid var(--cs-accent);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--cs-ink);
}
.cs-success.is-visible { display: flex; }

/* 送信失敗の通知。完了表示と同じ形で色だけエラー系にする。 */
.cs-notice {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 28px);
  padding: clamp(14px, 2.4vw, 18px) clamp(16px, 2.6vw, 22px);
  border-radius: 10px;
  font-size: 0.94rem;
  line-height: 1.8;
}
.cs-notice.is-visible { display: flex; }
.cs-notice--error {
  background: rgba(200, 40, 40, 0.07);
  border: 1px solid rgba(200, 40, 40, 0.30);
  border-left: 3px solid #C82828;
  color: #8f1d1d;
}
.cs-success svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; stroke: var(--cs-accent); stroke-width: 2.4; fill: none; }

/* =========================================================================
   8. レスポンシブ
   ========================================================================= */
@media (max-width: 860px) {
  .cs-purpose-grid { grid-template-columns: 1fr; }
  .cs-purpose-grid > li:nth-child(5) { grid-column: auto; }
  .cs-fields--2col { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .cs-form {
    padding: 22px 18px 26px;
    border-radius: 12px;
  }
  .cs-purpose { padding: 15px 14px; gap: 3px 12px; }
  .cs-purpose-title { font-size: 14px; }
  .cs-purpose-note { font-size: 12px; }
  /* iOSでの自動ズームを防ぐため入力文字は16px以上を維持 */
  .cs-input,
  .cs-select,
  .cs-textarea { font-size: 16px; }
  .cs-submit { font-size: 14.5px; letter-spacing: 0.03em; padding: 0 18px; }
}

@media (max-width: 380px) {
  .cs-chip { padding: 8px 12px; font-size: 12.5px; }
}

/* =========================================================================
   9. アニメーション抑制の設定を尊重する
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  .cs-root *,
  .cs-root *::before,
  .cs-root *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .cs-submit:hover { transform: none; }
}
