/* ==========================================================================
   style.css — レイアウト / ビジュアル（theme.css の変数を使う）
   色・フォントは直接ハードコードしない。theme.css 変数のみ参照。
   スマホファースト：SPベースで書き、PCで広がるメディアクエリで上書き。
   ========================================================================== */

/* ==========================================================================
   1. HEADER
   ========================================================================== */
.site-header {
  width: 100%;
  background: var(--c-primary);
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  max-width: 1100px;
  margin-inline: auto;
}

/* ロゴ */
.site-header__logo {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: 15px;
  color: var(--c-white);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-header__logo span {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

/* 電話CTA */
.site-header__tel {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-cta);
  color: var(--c-white);
  font-family: var(--f-tel);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: opacity var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}

.site-header__tel:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.site-header__tel .tel-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.site-header__tel .tel-label {
  font-size: 10px;
  font-weight: 500;
  display: block;
  line-height: 1;
  opacity: 0.85;
}

.site-header__tel .tel-num {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: block;
  letter-spacing: 0.04em;
}

@media (min-width: 768px) {
  .site-header {
    padding: 0 var(--header-pad);
  }
  .site-header__inner {
    height: 64px;
  }
  .site-header__logo {
    font-size: 20px;
  }
  .site-header__logo span {
    font-size: 12px;
  }
  .site-header__tel {
    padding: 8px 20px;
    gap: 10px;
  }
  .site-header__tel .tel-num {
    font-size: 18px;
  }
  .site-header__tel .tel-label {
    font-size: 11px;
  }
}

/* ==========================================================================
   2. KV（全幅・picture で SP/PC 出し分け）
   ========================================================================== */
.kv {
  width: 100%;
  background: var(--c-primary);
  line-height: 0;
}

.kv__picture {
  display: block;
  width: 100%;
}

.kv__picture img {
  width: 100%;
  height: auto;
  display: block;
}

/* KV下部CTA（「無料で登録する」ボタン） */
.kv__cta-wrap {
  background: var(--c-primary);
  padding: 20px var(--sp-gutter) 24px;
  text-align: center;
  line-height: normal;
}

.btn-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--grad-cta);
  color: var(--c-white);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 18px;
  padding: 16px 32px;
  border-radius: 8px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 14px rgba(65, 162, 49, 0.45);
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.04em;
  animation: ctaPulse 2.4s ease-in-out infinite;
}

.btn-entry::after {
  content: "▶";
  font-size: 12px;
  opacity: 0.85;
}

.btn-entry:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(65, 162, 49, 0.5);
  animation-play-state: paused;
}

.btn-entry:active {
  transform: translateY(1px) scale(0.99);
  animation-play-state: paused;
}

/* メインCTAの「呼吸」パルス（点滅ではなく穏やかなグロー） */
@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(65, 162, 49, 0.45); }
  50%      { box-shadow: 0 6px 18px rgba(65, 162, 49, 0.55), 0 0 0 6px rgba(65, 162, 49, 0.10); }
}

.kv__sub {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: normal;
}

@media (min-width: 768px) {
  .kv__cta-wrap {
    padding: 28px 20px 32px;
  }
  .btn-entry {
    font-size: 20px;
    padding: 18px 48px;
  }
}

/* ==========================================================================
   3. FORM SECTION（5ステップ・ページの主役）
   ========================================================================== */
.form-section {
  padding: 8px 0 40px;
  background: var(--c-bg);
}

#lp-form {
  width: 100%;
}

/* ---- ステップヘッダー（許可番号 + 更新日） ---- */
.form-step-meta {
  background: var(--c-band);
  padding: 8px var(--sp-gutter);
  font-size: 11px;
  color: var(--c-muted);
  text-align: center;
  line-height: 1.6;
  border-bottom: 1px solid var(--c-line);
}

/* ---- 進捗インジケーター（数字バッジ型） ---- */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px var(--sp-gutter) 16px;
}

.step-indicator__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

/* バッジ間のライン */
.step-indicator__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 17px;
  right: calc(-50%);
  width: 100%;
  height: 2px;
  background: var(--c-line);
  z-index: 0;
}

.step-indicator__item.done::after,
.step-indicator__item.active::after {
  background: var(--c-primary);
}

.step-indicator__badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-num);
  font-weight: 800;
  font-size: 16px;
  border: 2px solid var(--c-line);
  background: var(--c-white);
  color: var(--c-muted);
  position: relative;
  z-index: 1;
  transition: background var(--t), border-color var(--t), color var(--t);
}

.step-indicator__item.active .step-indicator__badge {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-white);
  box-shadow: 0 2px 8px rgba(34, 82, 159, 0.3);
  animation: badgePop 0.32s ease;
}

@keyframes badgePop {
  0%   { transform: scale(0.55); opacity: 0.4; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1);    opacity: 1; }
}

.step-indicator__item.done .step-indicator__badge {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: var(--c-white);
  font-size: 14px;
}

.step-indicator__label {
  font-size: 9px;
  color: var(--c-muted);
  font-weight: 500;
  white-space: nowrap;
}

.step-indicator__item.active .step-indicator__label {
  color: var(--c-primary);
  font-weight: 700;
}

/* ---- ステップパネル ---- */
.step-panel {
  display: none;
}

.step-panel.is-active {
  display: block;
}

/* ステップ遷移：進む=右から / 戻る=左から（方向感で迷子防止） */
.step-panel.anim-next { animation: stepSlideNext 0.26s ease both; }
.step-panel.anim-back { animation: stepSlideBack 0.26s ease both; }

@keyframes stepSlideNext {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes stepSlideBack {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ステップタイトル */
.step-title {
  font-family: var(--f-body);
  font-size: 20px;
  font-weight: 700;
  color: var(--c-primary);
  text-align: center;
  padding: 0 var(--sp-gutter) 6px;
  line-height: 1.4;
}

.step-title-note {
  font-size: 13px;
  color: var(--c-muted);
  font-weight: 500;
  text-align: center;
  margin-bottom: 16px;
}

/* ---- フィールドグループ ---- */
.field-group {
  margin-bottom: 20px;
  padding: 0 var(--sp-gutter);
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-ink);
  margin-bottom: 8px;
  line-height: 1.4;
}

.field-label .required-badge {
  display: inline-block;
  /* #e83838: エラー/必須バッジ専用赤。theme.css に定義なし（意図的ハードコード） */
  background: #e83838;
  color: var(--c-white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.field-label .optional-badge {
  display: inline-block;
  background: var(--c-muted);
  color: var(--c-white);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---- テキスト入力 / select ---- */
.form-input,
.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--c-line);
  border-radius: var(--radius);
  font-size: 16px; /* iOSズーム防止 */
  font-family: var(--f-body);
  color: var(--c-ink);
  background: var(--c-white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(34, 82, 159, 0.15);
}

.form-select {
  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' stroke='%236b7587' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* エラー状態 */
/* #e83838: エラー専用赤。theme.css に定義なし（意図的ハードコード） */
.form-input.is-error,
.form-select.is-error {
  border-color: #e83838;
  box-shadow: 0 0 0 3px rgba(232, 56, 56, 0.12);
}

.field-error {
  font-size: 12px;
  color: #e83838;
  margin-top: 5px;
  display: none;
}

.field-error.is-visible {
  display: block;
}

/* ---- チェックボックス グループ（STEP1 職種選択） ---- */
.job-group {
  margin-bottom: 16px;
}

.job-group__heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-primary);
  letter-spacing: 0.05em;
  padding: 5px 10px;
  background: var(--c-band);
  border-left: 3px solid var(--c-primary);
  border-radius: 0 4px 4px 0;
  margin-bottom: 8px;
}

.checkbox-list,
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ラベル全体がクリック領域 */
.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 2px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-white);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  user-select: none;
}

.checkbox-item:hover,
.radio-item:hover {
  border-color: var(--c-primary);
  background: var(--c-band);
}

/* タップ時の沈み込み（スマホで「押せた」手応え） */
.checkbox-item:active,
.radio-item:active {
  transform: scale(0.985);
}

.checkbox-item.is-checked,
.radio-item.is-checked {
  border-color: var(--c-primary);
  /* #eaf0fb: --c-primary(#22529f) の10%透過薄水色。選択フィードバック専用（theme.css に定義なし） */
  background: #eaf0fb;
  animation: choicePop 0.25s ease;
}

/* 選択した瞬間の軽いバウンス */
@keyframes choicePop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* ネイティブ input は非表示 → カスタム表示で代替 */
.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  accent-color: var(--c-primary);
  cursor: pointer;
  margin: 0;
}

/* ---- 免責文（全ステップ固定） ---- */
.disclaimer {
  font-size: 11px;
  color: var(--c-muted);
  text-align: center;
  padding: 12px var(--sp-gutter);
  line-height: 1.6;
  border-top: 1px solid var(--c-line);
  margin-top: 8px;
}

/* ---- ボタンエリア ---- */
.step-buttons {
  padding: 16px var(--sp-gutter) 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 「次へ」「送信」ボタン */
.btn-next,
.btn-submit {
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 8px;
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 17px;
  color: var(--c-white);
  background: var(--grad-cta);
  box-shadow: 0 4px 14px rgba(65, 162, 49, 0.4);
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-align: center;
}

.btn-next:hover,
.btn-submit:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(65, 162, 49, 0.5);
}

.btn-next:active,
.btn-submit:active {
  transform: translateY(1px) scale(0.99);
}

/* 送信ボタンは最終CV地点なので呼吸パルスで後押し */
.btn-submit {
  animation: ctaPulse 2.4s ease-in-out infinite;
}
.btn-submit:hover,
.btn-submit:active {
  animation-play-state: paused;
}

/* 「戻る」ボタン */
.btn-back {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid var(--c-line);
  border-radius: 8px;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--c-muted);
  background: var(--c-white);
  cursor: pointer;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}

.btn-back:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-band);
}

/* 最終ボタンの文言（2行テキスト対応） */
.btn-submit .btn-label-main {
  display: block;
  font-size: 17px;
}
.btn-submit .btn-label-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 3px;
}

/* ---- デスクトップ最適化（縦長な単列フォームの間延びを解消） ---- */
@media (min-width: 768px) {
  /* フォーム列をやや広げ、上下にゆとりを持たせる */
  .form-section {
    padding: 32px 0 56px;
  }
  .form-section .container {
    max-width: 680px;
  }
  /* 選択肢を2カラムにして縦の冗長さを抑える（STEP1職種 / STEP2経験） */
  .checkbox-list,
  .radio-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  /* ナビゲーションを横並び（左:戻る／右:次へ・送信） */
  .step-buttons {
    flex-direction: row-reverse;
    align-items: stretch;
    gap: 12px;
  }
  .step-buttons .btn-next,
  .step-buttons .btn-submit {
    flex: 1;
  }
  .step-buttons .btn-back {
    width: auto;
    flex: 0 0 150px;
  }
}

/* ==========================================================================
   4. FOOTER
   ========================================================================== */
.site-footer {
  background: var(--c-primary);
  padding: 24px var(--sp-gutter) calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}

.footer-company {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-white);
  margin-bottom: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-bottom: 14px;
}

.footer-links a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t-fast);
}

.footer-links a:hover {
  color: var(--c-white);
}

.footer-copy {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

@media (min-width: 768px) {
  .site-footer {
    padding: 32px var(--header-pad) 32px;
  }
}

/* ==========================================================================
   5. STICKY CTA（SP下部固定）
   ========================================================================== */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--c-white);
  border-top: 1px solid var(--c-line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -3px 16px rgba(26, 43, 69, 0.14);
  display: flex;
  gap: 8px;
}

/* SP: 追従CTA（固定バー）ぶんの下余白を body に確保し、
   フッター下端が固定バーに隠れて最後までスクロールできない問題を解消 */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
  }
}

.sticky-cta__entry {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-cta);
  color: var(--c-white);
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 8px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(65, 162, 49, 0.4);
  transition: opacity var(--t-fast), transform var(--t-fast);
  text-align: center;
}

.sticky-cta__entry:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.sticky-cta__entry:active {
  transform: translateY(1px) scale(0.99);
}

.sticky-cta__tel {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1px;
  background: var(--c-white);
  border: 2px solid var(--c-cta);
  color: var(--c-cta);
  border-radius: 8px;
  padding: 6px 14px;
  min-width: 80px;
  transition: background var(--t-fast), color var(--t-fast);
  text-align: center;
}

.sticky-cta__tel:hover {
  background: var(--c-cta);
  color: var(--c-white);
}

.sticky-cta__tel-icon {
  font-size: 18px;
  line-height: 1;
}

.sticky-cta__tel-label {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

/* PC では sticky CTA を非表示（フォーム余白は section 3 のデスクトップ最適化で指定） */
@media (min-width: 768px) {
  .sticky-cta {
    display: none;
  }
}

/* ==========================================================================
   6. ユーティリティ
   ========================================================================== */

/* フォームセクション全体の背景カード */
.form-card {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 16px;
}

/* Zipと都道府県横並び（STEP3） */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* 郵便番号は幅固定 */
.field-row .field-zip {
  max-width: 140px;
}

/* スクロールイン（IntersectionObserver で .in-view を付与） */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   7. モーション設定の尊重（酔い・低スペック端末配慮）
   prefers-reduced-motion: reduce の環境では全アニメ/トランジションを無効化
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
