/* =============================================
   apply.css — 申込みページ専用スタイル
   style.css を継承して使用
   ============================================= */

/* ── スキップリンク（アクセシビリティ） ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  z-index: 9999;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
}

/* ── ロゴ画像 ── */
.apply-header__logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}
.apply-footer__logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ── 申込みページ：ヘッダーは常に白背景 ── */
.header--scrolled {
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}
.header--scrolled .header__logo-img {
  filter: none;
}
.header--scrolled .header__nav-link {
  color: var(--color-text);
}
.header--scrolled .header__nav-link:hover {
  color: var(--color-primary);
}

/* ── ページヒーロー（コンパクト） ── */
.apply-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #253d6a 100%);
  padding: calc(var(--header-height) + 64px) 0 72px;
  text-align: center;
}
.apply-hero__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}
.apply-hero__label {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.apply-hero__label::before,
.apply-hero__label::after {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--color-gold);
}
.apply-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  color: var(--color-white);
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin-bottom: 20px;
}
.apply-hero__title span {
  font-size: 1.75rem;
  color: var(--color-gold);
}
.apply-hero__desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 2;
}

/* ── サービス概要（申込みページ向け） ── */
.apply-summary {
  background: var(--color-bg);
}
.apply-summary__title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 12px;
}
.apply-summary__desc {
  font-size: 14px;
  color: var(--color-text-light);
  text-align: center;
  line-height: 1.9;
  margin-bottom: 48px;
}

/* 特典リスト */
.apply-benefits {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.apply-benefits__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
.apply-benefits__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(91, 122, 112, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-top: 2px;
}
.apply-benefits__name {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.apply-benefits__tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 2px;
}
.apply-benefits__tag--gold {
  background: var(--color-gold);
  color: var(--color-white);
}
.apply-benefits__amount {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1;
}
.apply-benefits__amount span {
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-light);
  letter-spacing: 0;
}
.apply-benefits__note {
  font-size: 11px;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* 最大受取額バナー */
.apply-summary__max {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
  padding: 24px 40px;
  flex-wrap: wrap;
}
.apply-summary__max-label {
  font-size: 14px;
  opacity: 0.8;
}
.apply-summary__max-amount {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.apply-summary__max-note {
  font-size: 12px;
  opacity: 0.55;
}

/* ── 入会条件 ── */
.apply-cond__title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 500;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 40px;
}
.apply-cond__list {
  max-width: 680px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.apply-cond__row {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--color-border);
}
.apply-cond__row:last-child { border-bottom: none; }
.apply-cond__term {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  background: rgba(91, 122, 112, 0.08);
  padding: 3px 12px;
  border-radius: 2px;
  white-space: nowrap;
  min-width: 80px;
  text-align: center;
  margin-top: 2px;
  flex-shrink: 0;
}
.apply-cond__desc {
  font-size: 14px;
  color: var(--color-text);
  line-height: 1.8;
}

/* ── お申込みフォームセクション ── */
.apply-form-section {
  background: var(--color-bg);
}
.apply-form-header {
  text-align: center;
  margin-bottom: 48px;
}
.apply-form-header__title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 34px);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.apply-form-header__desc {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 2;
}

/* 申し込み方法選択 */
.apply-form-methods {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 40px 0 48px;
  flex-wrap: wrap;
}

.apply-form-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}

.apply-form-method--line {
  background-color: #00B900;
  color: var(--color-white);
}

.apply-form-method--line:hover {
  background-color: #008C00;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 185, 0, 0.3);
}

/* フォーム本体 */
.apply-form {
  max-width: 820px;
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
}

/* form-row: 姓・名／ふりがな等を 2 カラム横並び（モバイルでも維持） */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.form-group { margin-bottom: 16px; }
@media (max-width: 600px) {
  .apply-form { padding: 24px 18px; }
  .form-row { gap: 8px; } /* スマホでも横並びは維持、隙間だけ詰める */
}

/* エラー・ヒント */
.form-error {
  display: block;
  font-size: 12px;
  color: #c0392b;
  margin-top: 6px;
  min-height: 18px;
}
.form-hint {
  font-size: 12px;
  color: var(--color-text-light);
  margin-top: 6px;
  line-height: 1.6;
}
.form-input--error {
  border-color: #c0392b !important;
}
.form-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.form-link:hover { color: var(--color-primary); }

/* チェックボックス */
.form-fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
  padding: 16px 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  transition: all var(--transition);
  line-height: 1.6;
}
.form-checkbox:hover {
  border-color: var(--color-accent);
  background: rgba(91, 122, 112, 0.04);
}
.form-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.form-checkbox__custom {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--transition);
  position: relative;
  display: block;
}
.form-checkbox input:checked ~ .form-checkbox__custom {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
/* チェック状態のとき外枠も濃く + 背景うすく着色 */
.form-checkbox:has(input:checked) {
  border-color: var(--color-accent);
  background: rgba(91, 122, 112, 0.08);
}
.form-checkbox input:checked ~ .form-checkbox__custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}
.form-checkbox input:focus ~ .form-checkbox__custom {
  outline: 3px solid rgba(91, 122, 112, 0.4);
  outline-offset: 2px;
}

/* 送信ボタン */
.apply-form__submit {
  width: 100%;
  justify-content: center;
  padding: 18px 32px;
  font-size: 16px;
}

/* フォーカスリング（アクセシビリティ） */
.form-input:focus,
.form-select:focus,
.form-checkbox:focus-within {
  outline: 3px solid rgba(91, 122, 112, 0.4);
  outline-offset: 2px;
}

/* ── レスポンシブ ── */
@media (max-width: 768px) {
  .apply-header__logo-img {
    height: 28px;
  }

  .apply-hero {
    padding: calc(var(--header-height) + 40px) 0 48px;
  }
  .apply-benefits {
    grid-template-columns: 1fr;
  }
  .apply-benefits__item {
    flex-direction: row;
  }
  .apply-form-methods {
    margin: 32px 0 40px;
  }
  .apply-form-method {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    font-size: 13px;
  }
  .apply-form {
    padding: 32px 24px;
  }
  .apply-summary__max {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    padding: 24px;
  }
  .apply-summary__max-note {
    display: none;
  }
  .apply-cond__row {
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
  }
}

/* ==============================================
   responsive fix — 2026-03-27
   ============================================== */

/* ── apply-form-method：スマホで min-width 解除 ──
   min-width: 200px が 375px幅で 2カラム時にはみ出す。
*/
/* responsive fix */
@media (max-width: 480px) {
  .apply-form-method {
    min-width: 0;
    width: 100%;
    flex: none;
    padding: 14px 20px;
    font-size: 14px;
    justify-content: center;
  }
  .apply-form-methods {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* ── apply-form の左右パディング：375px対応 ── */
/* responsive fix */
@media (max-width: 480px) {
  .apply-form {
    padding: 28px 16px;
  }
  .apply-hero__inner {
    padding: 0 16px;
  }
  /* apply-hero__desc の改行 */
  .apply-hero__desc br {
    display: none;
  }
  .apply-hero__desc {
    overflow-wrap: break-word;
  }
}

/* ── apply-cond__term：スマホで min-width 解除 ── */
/* responsive fix */
@media (max-width: 480px) {
  .apply-cond__term {
    min-width: 0;
    width: fit-content;
  }
}

/* ── 株主名簿一致判定結果ボックス（application-complete.php）── */

.match-result {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
  border-width: 1px;
  border-style: solid;
}

.match-result--ok {
  background-color: rgba(16, 185, 129, 0.08);  /* --color-success 8% */
  border-color: rgba(16, 185, 129, 0.35);
  color: #065f46;  /* success ダーク */
}

.match-result--ng {
  background-color: rgba(245, 158, 11, 0.08);  /* --color-warning 8% */
  border-color: rgba(245, 158, 11, 0.40);
  color: #92400e;  /* warning ダーク */
}

.match-result__icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.match-result--ok .match-result__icon {
  color: var(--color-success, #10B981);
}

.match-result--ng .match-result__icon {
  color: var(--color-warning, #F59E0B);
}

.match-result__body {
  flex: 1;
  min-width: 0;
}

.match-result__message {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  margin: 0 0 4px;
}

.match-result__sub {
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0 0;
  opacity: 0.85;
}

.match-result__contact {
  margin: 8px 0 0;
  font-size: 13px;
}

.match-result__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.match-result__link:hover {
  opacity: 0.75;
}

@media (max-width: 480px) {
  .match-result {
    padding: 14px 16px;
    gap: 10px;
  }

  .match-result__message {
    font-size: 13px;
  }
}

/* ==============================================
   EFO 多段ステップフォーム
   ============================================== */

/* JS なしフォールバック: efo-active が付くまでは全ステップ表示 */
.apply-form #applicationForm:not(.efo-active) .efo-step,
.apply-form #applicationForm:not(.efo-active) .efo-step-nav { display: block; }
.apply-form #applicationForm:not(.efo-active) .efo-progress,
.apply-form #applicationForm:not(.efo-active) .efo-steps { display: none; }
.apply-form #applicationForm:not(.efo-active) [data-efo-next],
.apply-form #applicationForm:not(.efo-active) [data-efo-prev] { display: none; }

/* JS が動いた状態 */
.apply-form #applicationForm.efo-active .efo-step { display: none; }
.apply-form #applicationForm.efo-active .efo-step.is-active { display: block; }

/* 旧プログレスバーは廃止（ステップ円が進捗を表現する） */
.efo-progress, .efo-progress__bar { display: none; }
.efo-progress-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 11px;
  color: var(--color-text-light, #6b7280);
  margin: 0 0 8px;
  letter-spacing: 0.05em;
}
.efo-progress-meta__label { display: none; } /* ステップ円が示すので冗長表示は隠す */

/* ステップインジケーター（円 + 接続線 + ラベル） */
.efo-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  position: relative;
}
.efo-steps > li {
  position: relative;
  display: flex;
  justify-content: center;
}
/* ステップ間を結ぶ線（左→右） */
.efo-steps > li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px; /* 円の中心と揃える */
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--color-border, #e5e7eb);
  z-index: 0;
}
.efo-steps__item {
  position: relative;
  z-index: 1;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: default;
  font-family: inherit;
  color: var(--color-text-light, #6b7280);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.efo-steps__item:focus-visible {
  outline: 2px solid var(--color-primary, #1A2B4A);
  outline-offset: 4px;
  border-radius: 4px;
}
.efo-steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border, #e5e7eb);
  color: var(--color-text-light, #6b7280);
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  line-height: 1;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.efo-steps__item.is-active .efo-steps__num {
  background: var(--color-primary, #1A2B4A);
  border-color: var(--color-primary, #1A2B4A);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(26,43,74,0.10);
}
.efo-steps__item.is-active {
  color: var(--color-primary, #1A2B4A);
  font-weight: 600;
}
.efo-steps__item.is-done .efo-steps__num {
  background: var(--color-accent, #B89A5A);
  border-color: var(--color-accent, #B89A5A);
  color: #fff;
  font-size: 0; /* 数字は隠してチェックを描画 */
}
.efo-steps__item.is-done .efo-steps__num::before {
  content: '';
  display: block;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(2px, -2px);
  font-size: 0;
}
/* 完了ステップから次までの接続線を gold 化 */
.efo-steps > li.is-done::after {
  background: var(--color-accent, #B89A5A);
}
.efo-steps__item.is-done {
  color: var(--color-text, #1f2937);
}
.efo-steps__item[data-step]:not(.is-active):not(.is-done):hover .efo-steps__num {
  border-color: var(--color-primary, #1A2B4A);
  color: var(--color-primary, #1A2B4A);
}
@media (max-width: 480px) {
  .efo-steps__item { font-size: 11px; }
  .efo-steps__num { width: 32px; height: 32px; font-size: 13px; }
  .efo-steps > li:not(:last-child)::after { top: 16px; }
}

/* ステップセクション本体 */
.efo-step {
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 16px;
}
.efo-step__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--color-primary, #1A2B4A);
}
.efo-step__desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--color-text-light, #6b7280);
  line-height: 1.7;
}

/* ステップ間ナビ */
.efo-step-nav {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.efo-step-nav__right { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }

/* 入力フィールドの状態色 */
.form-input.is-valid {
  border-color: #15803d !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2315803d'%3E%3Cpath d='M13.485 1.515 6 9 2.515 5.515.5 7.53 6 13.03 15.5 3.53z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 32px;
}
.form-input.is-error {
  border-color: #b91c1c !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b91c1c'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-1 4h2v5H7Zm0 6h2v2H7Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px 14px;
  padding-right: 32px;
}

/* 郵便番号→住所補完ステータス */
.efo-zip-status {
  font-size: 11px;
  margin: 4px 0 0;
  color: var(--color-text-light, #6b7280);
}
.efo-zip-status--loading { color: #2563eb; }
.efo-zip-status--ok      { color: #15803d; }
.efo-zip-status--warn    { color: #b45309; }

/* 確認画面 */
.efo-confirm {
  background: #fafaf6;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0 0 16px;
}
.efo-confirm__list {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}
.efo-confirm__list dt {
  color: var(--color-text-light, #6b7280);
  font-weight: 500;
  font-size: 13px;
}
.efo-confirm__list dd {
  margin: 0;
  color: var(--color-text, #111827);
  word-break: break-word;
}
@media (max-width: 600px) {
  .efo-confirm__list { grid-template-columns: 1fr; gap: 2px 0; }
  .efo-confirm__list dt { font-size: 11px; margin-top: 8px; padding-bottom: 0; }
  .efo-confirm__list dd { padding-bottom: 8px; border-bottom: 1px solid #f0eee8; }
  .efo-confirm__list dd:last-of-type { border-bottom: none; }
  .efo-step { padding: 18px 16px; }
  .efo-step-nav { gap: 8px; }
  .efo-step-nav__right { width: 100%; }
  .efo-step-nav__right .btn { flex: 1 1 auto; }
}

/* ── 必須未入力時の disabled ボタン状態 ────────────── */
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
  filter: grayscale(0.4);
  transform: none !important;
  box-shadow: none !important;
}
.btn:disabled:hover,
.btn[aria-disabled="true"]:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* 入力フィールド + 単位（株／円 等） — input 内右寄せに単位を重ねる */
.form-input-wrap {
  position: relative;
}
.form-input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--color-text-light, #6b7280);
  pointer-events: none;
  line-height: 1;
  letter-spacing: 0.05em;
}
.form-input-wrap .form-input { padding-right: 40px; }
