/* ===== Apply section (clean) ===== */

/* 背景が見えないときの保険用（スライドの下地） */
.section-apply {
  background: linear-gradient(180deg, var(--gray-700), var(--gray-800));
}

/* apply セクションの薄い黒オーバーレイの色だけ定義（レイヤーは hero.css 側） */
.apply-overlay {
  background:
    radial-gradient(1200px 600px at 70% 30%, rgba(255,255,255,0.08), transparent 60%),
    linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.55));
}

/* フォーム本体（コンパクト） */
.apply-form{
  background:#16181b;
  border:1px solid rgba(255,255,255,0.06);
  border-radius:18px;
  padding:24px;
  box-shadow:var(--shadow);
}
.apply-form .form-row{ display:grid; gap:8px; margin-bottom:12px; }
.apply-form label{ color:var(--muted); font-size:14px; }
.apply-form .req{ color:var(--gold); }

.apply-form input,
.apply-form select,
.apply-form textarea{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  background:#0f1114;
  color:var(--text);
  border:1px solid rgba(255,255,255,0.08);
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease;
}
.apply-form input:focus,
.apply-form select:focus,
.apply-form textarea:focus{
  border-color:var(--gold-600);
  box-shadow:0 0 0 4px rgba(255,215,0,0.08);
}

/* 2列グリッド（モバイルは1列） */
.apply-form .grid{
  display:grid;
  gap:12px 16px;
  grid-template-columns:1fr 1fr;
}
@media (max-width:720px){
  .apply-form .grid{ grid-template-columns:1fr; }
}

/* 送信行 */
.form-actions{ display:flex; align-items:center; gap:16px; flex-wrap:wrap; margin-top:10px; }
.form-note{ color:var(--muted); font-size:12px; margin:0; }
.error{ color:#ffb4b4; font-size:12px; min-height:16px; margin-top:4px; }

/* --- 統一トーン：fieldsetの線を消して余白だけに --- */
.apply-form fieldset{ border:0; margin:0 0 6px 0; padding:0; }
.apply-form legend.segmented-title{ font-weight:600; margin:0 0 8px; color:var(--text); }

/* --- Segmented（ボタン化ラジオ）: サイト全体と統一 --- */
.segmented{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.segmented > input[type="radio"]{
  position:absolute !important; opacity:0 !important; width:0; height:0; pointer-events:none;
}
.segmented-btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 16px; border-radius:999px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.28);
  color:#fff; letter-spacing:.02em;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
  transition: background .2s ease, border-color .2s ease, transform .12s ease, box-shadow .2s ease;
}
.segmented-btn:hover{ transform: translateY(-1px); }
.segmented > input[type="radio"]:checked + .segmented-btn{
  background: linear-gradient(180deg, rgba(255,215,0,0.22), rgba(255,215,0,0.12));
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.28) inset, 0 6px 20px rgba(0,0,0,0.22);
}

/* 折り畳み：▶/▼（既存） */
.policy{ border:1px solid rgba(255,255,255,0.12); border-radius:12px; background:rgba(0,0,0,0.22); overflow:hidden; }
.policy > summary{ display:flex; align-items:center; gap:8px; cursor:pointer; list-style:none; padding:10px 12px; font-weight:600; }
.policy > summary::-webkit-details-marker{ display:none; }
.policy > summary::marker{ content:""; }
.policy .twisty{ width:1em; text-align:center; }
.policy .twisty::before{ content:"▶"; display:inline-block; transition:transform .2s ease; }
.policy[open] .twisty::before{ content:"▼"; }
.policy .policy-body{ padding:10px 12px 14px; line-height:1.8; }

/* フィールドセットの枠を完全撤去 */
.apply-form fieldset,
.apply-form .segmented{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0 0 12px;
}
.apply-form legend.segmented-title{
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

/* 折り畳みタイトルは既存のまま（▶/▼は以前のCSSでOK） */
.policy .policy-body{
  padding: 10px 12px 14px;
  line-height: 1.8;
  /* 閉じている時はブラウザが非表示にするのでここでは何もしない */
}
/* 開いた状態：本文は“3行ぶんの高さ”で固定し、残りはスクロール */
.policy[open] .policy-body{
  max-height: calc(1.8em * 3 + 16px); /* 行高×3 + 余白の目安 */
  overflow-y: auto;
}

/* ネイティブの丸ラジオは隠す */
.segmented > input[type="radio"]{
  position: absolute !important;
  opacity: 0 !important;
  width: 0; height: 0; pointer-events: none;
}

/* 統一感のあるゴールドアクセント + 視認性UP */
.segmented-btn{
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.45);
  color: #fff; font-weight: 600; letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
  transition: background .2s ease, border-color .2s ease,
              transform .12s ease, box-shadow .2s ease, color .2s ease;
}
.segmented-btn:hover{
  background: rgba(255,215,0,0.12);
  border-color: rgba(255,215,0,0.50);
  transform: translateY(-1px);
}
.segmented > input[type="radio"]:checked + .segmented-btn{
  background: linear-gradient(180deg, rgba(255,215,0,0.28), rgba(255,215,0,0.18));
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.35) inset, 0 8px 24px rgba(0,0,0,0.28);
}
.segmented > input[type="radio"]:checked + .segmented-btn:hover{
  background: linear-gradient(180deg, rgba(255,215,0,0.35), rgba(255,215,0,0.22));
}
.segmented > input[type="radio"]:focus-visible + .segmented-btn{
  outline: 2px solid rgba(255,215,0,0.7);
  outline-offset: 2px;
}
.segmented-btn:active{ transform: translateY(0); }

/* === 同意チェックの配置を安定させる === */
.apply-form .form-row > .checkbox{
  grid-column: 1 / -1;           /* グリッドをまたいで1行扱いに */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  background: transparent;
  border: 0;
}
.apply-form .form-row > .checkbox input[type="checkbox"]{
  position: static !important;   /* 万一の継承を打ち消し */
  width: 18px; height: 18px;
  margin: 0;
  flex: 0 0 18px;
}
.apply-form .form-row > .checkbox:before,
.apply-form .form-row > .checkbox:after{ content: none; }

/* （念のため）fieldset/segmented の枠は出さない */
.apply-form fieldset,
.apply-form .segmented{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  margin: 0 0 12px;
}
/* 送信ボタンの状態色（#apply 限定） */
#apply .btn-primary.is-loading{
  filter: saturate(0.6) brightness(0.9);
  cursor: wait;
}
#apply .btn-primary.is-success{
  background: linear-gradient(180deg, rgba(255,215,0,0.95), rgba(255,215,0,0.75));
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255,215,0,0.35) inset, 0 8px 24px rgba(0,0,0,0.28);
}
#apply .btn-primary.is-error{
  background: linear-gradient(180deg, rgba(220,38,38,0.85), rgba(185,28,28,0.85));
  border-color: rgba(220,38,38,0.9);
  box-shadow: 0 0 0 1px rgba(220,38,38,0.35) inset, 0 8px 24px rgba(0,0,0,0.28);
}