/* ============================================================
   事前登録フォーム（モーダル表示）
   - ヘッダー・FV・最下部CTA・下部バーの「事前登録」ボタンでモーダルを開く
   - 下部バー：FVのCVボタンを過ぎてセカンドビューに入ったら表示。最下部CTAが見えている間とモーダル表示中は隠す
   ============================================================ */
:root{--rf-red:#d93a3f;--rf-green:#5b7a07;--rf-line:#d6d8cc;--rf-field:#fafaf7}
/* モーダル本体 */
.rf-modal{box-sizing:border-box;width:min(560px,calc(100% - 32px));max-width:none;max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:0;border:0;border-radius:24px;background:#fff;color:var(--ink);box-shadow:0 40px 100px -30px rgba(25,31,15,.45),0 2px 8px rgba(25,31,15,.08);overflow:hidden;overscroll-behavior:contain}
.rf-modal[open]{display:flex;flex-direction:column;animation:rfModalIn .28s cubic-bezier(.2,.7,.2,1)}
.rf-modal::backdrop{background:rgba(32,38,21,.42);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);animation:rfFade .28s ease}
@keyframes rfModalIn{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
@keyframes rfFade{from{opacity:0}to{opacity:1}}
html.rf-lock{overflow:hidden}
.rf-modal-inner{position:relative;overflow-y:auto;padding:40px 40px 36px;word-break:normal}
.rf-close{position:absolute;top:18px;right:18px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:#f1f1ec;color:#262922;cursor:pointer;transition:background .2s}
.rf-close:hover{background:#e6e8dc}
.rf-close:focus-visible{outline:3px solid var(--olive);outline-offset:2px}
.rf-close svg{width:20px;height:20px}
.rf-head{margin:0 0 26px}
.rf-head h2{padding-right:48px}
.rf-head h2{margin:0;font-family:var(--sans);font-size:22px;font-weight:700;line-height:1.45;letter-spacing:.02em;color:#1f2419}
.rf-head p{margin:8px 0 0;font-size:14px;line-height:1.7;color:#6c7065}
/* フォーム */
.rf-form{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;margin:0}
.rf-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.rf-field{display:grid;gap:8px;min-width:0}
.rf-field>label{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 10px;font-size:14px;font-weight:700;line-height:1.4;color:#1f2419}
.rf-sub{font-size:12px;font-weight:500;color:#6c7065}
.rf-req{flex:none;font-size:11px;font-weight:700;line-height:1.2;letter-spacing:.04em;color:var(--rf-green)}
.rf-field input,.rf-field select{box-sizing:border-box;width:100%;height:50px;margin:0;padding:0 16px;border:1px solid var(--rf-line);border-radius:10px;background:var(--rf-field);color:var(--ink);font:inherit;font-size:16px;line-height:1.4;transition:border-color .15s,box-shadow .15s,background-color .15s}
.rf-field input::placeholder{color:#a3a79a}
.rf-field select{appearance:none;-webkit-appearance:none;padding-right:44px;background:var(--rf-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23262922' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 16px center/18px no-repeat;cursor:pointer}
.rf-field select.is-placeholder{color:#8b8f82}
.rf-field input:hover,.rf-field select:hover{border-color:#b5ba9f}
.rf-field input:focus,.rf-field select:focus{outline:0;border-color:#7e9c1c;background-color:#fff;box-shadow:0 0 0 4px rgba(218,235,87,.5)}
.rf-form [aria-invalid="true"]{border-color:var(--rf-red);background-color:#fff8f8}
.rf-modal .rf-error{margin:0;font-size:12px;line-height:1.6;color:#c53035}
.rf-modal .rf-error:empty{display:none}
.rf-modal .rf-privacy{margin:4px 0 0;font-size:14px;line-height:1.7;color:#3a3f33}
.rf-nowrap{white-space:nowrap}
.rf-privacy a{color:var(--rf-green);text-decoration:underline;text-underline-offset:3px}
.rf-privacy a:focus-visible{outline:2px solid #6d8a12;outline-offset:2px}
/* 送信ボタン（.btn.primary のデザインを使い、横幅いっぱい・文字は左寄せ） */
.rf-modal .rf-submit{width:100%;min-height:60px;margin-top:6px;padding:10px 12px 10px 30px;justify-content:space-between;font-family:inherit;font-size:16px;line-height:1.3;cursor:pointer}
.rf-modal .rf-submit::after{width:36px;height:36px}
@media (max-width:560px){
  .rf-modal{width:calc(100% - 24px);max-height:calc(100dvh - 24px);border-radius:20px}
  .rf-modal-inner{padding:30px 20px 24px}
  .rf-close{top:12px;right:12px;width:40px;height:40px}
  .rf-head{margin-bottom:22px}
  .rf-head h2{font-size:19px}
  .rf-head p{font-size:13px}
  .rf-form{gap:16px}
  .rf-field input,.rf-field select{height:48px}
  .rf-modal .rf-submit{min-height:56px;font-size:15px;padding-left:24px}
}
/* 下部バー */
.rf-bar{position:fixed;z-index:25;left:50%;bottom:16px;display:flex;align-items:center;gap:26px;box-sizing:border-box;width:max-content;max-width:calc(100% - 24px);padding:10px 10px 10px 32px;border:1px solid #e3e5da;border-radius:100px;background:rgba(255,255,255,.96);box-shadow:0 18px 44px -16px rgba(39,48,20,.35);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);transform:translateX(-50%);transition:opacity .3s ease,transform .35s cubic-bezier(.2,.7,.2,1),visibility 0s linear 0s}
.rf-bar:not(.is-shown){opacity:0;visibility:hidden;transform:translate(-50%,18px);pointer-events:none;transition:opacity .2s ease,transform .25s ease,visibility 0s linear .25s}
.rf-bar p{margin:0;font-size:15px;font-weight:600;color:#3a3f33;white-space:nowrap}
/* ボタンはヘッダーナビの「事前登録」ボタン（.header-actions .btn.primary）と同じデザイン */
.rf-bar .btn{min-height:56px;padding:10px 11px 10px 28px;gap:14px;font-family:inherit;font-size:15px;line-height:1.2;cursor:pointer}
.rf-bar .btn::after{width:32px;height:32px}
/* バー内の説明文と大きめのボタンが並びきらない幅では、ボタンだけを横幅いっぱいに表示 */
@media (max-width:660px){
  .rf-bar{left:12px;right:12px;bottom:12px;width:auto;max-width:none;padding:8px;transform:none}
  .rf-bar:not(.is-shown){transform:translateY(18px)}
  .rf-bar p{display:none}
  .rf-bar .btn{width:100%;justify-content:space-between}
  .rf-bar .btn::before{content:"";width:32px;flex:none}
}
@media (prefers-reduced-motion:reduce){
  .rf-bar,.rf-bar:not(.is-shown){transition:none}
  .rf-modal[open],.rf-modal::backdrop{animation:none}
}
