/* LP詳細ページ：吹き出しから開く「見積もり依頼」のフォーム（temp/parts-estimate.php・js/estimate.js）
   見た目は LP制作.jp のお問い合わせページ（https://rdlp.jp/lp-inquiry ）に合わせている。
   吹き出しは画面幅1,570px以上でしか出ないので、スマホ用の指定は持たない。 */

/* 吹き出し（今の .icon_images の中に入るボタン） */
.icon_images .est-balloon { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; transition: transform .18s ease; }
.icon_images .est-balloon:hover { transform: scale(1.05); }
.icon_images .est-balloon img { display: block; width: 100%; height: auto; }
.icon_images .est-balloon:focus-visible { outline: 3px solid #181818; outline-offset: 2px; border-radius: 50%; }

/* reCAPTCHA のバッジは隠し、フォームの中に文で書いている（Google の決まり） */
.grecaptcha-badge { visibility: hidden !important; }

.est-back[hidden], .est-modal[hidden], .est-modal [hidden] { display: none !important; }
html.est-lock { overflow: hidden; }

/* 広告（z-index 9999〜10000）より上に出す。フォームのボタンの隣に広告が見えると押し間違いになるため */
.est-back { position: fixed; inset: 0; z-index: 2147483000; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s ease; }
.est-back.is-open { opacity: 1; }

.est-modal { position: fixed; left: 50%; top: 50%; z-index: 2147483001; width: 920px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; box-sizing: border-box; background: #ffffff; border-radius: 4px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3); color: #181818; font-family: Meiryo, Osaka, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif; font-size: 14px; line-height: 1.5; text-align: left; word-break: auto-phrase; opacity: 0; transform: translate(-50%, calc(-50% + 16px)); transition: opacity .22s ease, transform .22s ease; }
.est-modal.is-open { opacity: 1; transform: translate(-50%, -50%); }
.est-modal *, .est-modal *::before, .est-modal *::after { box-sizing: border-box; }
.est-modal p { margin: 0; }
/* サイト全体の a { display: block; position: relative; z-index: 10 } を打ち消す */
.est-modal a { display: inline; position: static; z-index: auto; color: #181818; text-decoration: underline; transition: none; }
.est-modal a:hover { color: #c0508c; }
.est-modal button, .est-modal input, .est-modal textarea { font-family: inherit; }
.est-modal button:focus-visible, .est-modal input:focus-visible, .est-modal textarea:focus-visible, .est-modal a:focus-visible, .est-modal [tabindex]:focus-visible { outline: 3px solid #181818; outline-offset: 2px; }

.est-close { position: absolute; right: 8px; top: 8px; z-index: 2; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }

.est-form { display: flex; flex-direction: column; gap: 18px; margin: 0; padding: 34px 40px 22px 40px; }
.est-cols { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: 36px; align-items: start; }

/* 左：参考にするLP */
.est-ref { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* 画像の高さのままにする（右の列が注意の文で伸びても、画像の下に空白を作らない）。サムネイルは 280x560 を幅250pxで見せるので、最大で高さ500px */
.est-ref-img { position: relative; flex: none; max-height: 500px; overflow: hidden; border: 1px solid #dcdcdc; background: #f4f4f2; }
.est-ref-img img { display: block; width: 100%; height: auto; }
.est-ref-img::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0, #ffffff 100%); }
.est-ref-ttl { font-size: 13px; font-weight: 700; line-height: 1.6; }

/* 右：見出しと入力欄 */
.est-fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.est-head { margin-bottom: 10px; padding-right: 20px; }
.est-ttl { margin: 0; padding: 0; border: 0; background: none; color: #181818; font-family: YuMincho, "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 23px; font-weight: 600; line-height: 1.4; }
.est-ttl span { font-size: 16px; }
.est-lead { display: flex; align-items: center; gap: 7px; margin-top: 8px !important; font-size: 13px; line-height: 1.6; }
.est-lead svg { flex: none; }
.est-lead a { margin: 0 4px; font-weight: 700; }

/* 項目名は、注意の文が出ても入力欄の高さ（48px）の中央にそろえる */
.est-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); column-gap: 12px; align-items: start; }
.est-row-top { align-items: stretch; }
.est-row-grow { flex: none; }
.est-lab { display: flex; align-items: center; min-height: 48px; margin: 0; font-size: 14px; font-weight: 400; color: #181818; }
.est-row-top .est-lab { align-items: flex-start; min-height: 0; padding-top: 12px; }
.est-lab small { font-size: 11px; color: #555555; }
.est-req, .est-opt { flex: none; display: inline-block; width: 46px; margin-right: 10px; padding: 5px 0; border-radius: 3px; color: #ffffff; font-size: 13px; font-weight: 700; line-height: 1; letter-spacing: .05em; text-align: center; }
.est-req { background: #d7000f; }
.est-opt { background: #3f9ad6; }

.est-modal .est-in { display: block; width: 100%; height: 48px; margin: 0; border: 3px solid #ebebeb; border-radius: 6px; background: #ebebeb; padding: 0 15px; font-size: 16px; line-height: 1.5; color: #000000; box-shadow: none; }
.est-modal textarea.est-in { height: 100px; padding: 11px 15px; resize: none; }
.est-modal .est-in::placeholder { color: #8a8a8a; }
/* 入力した欄は、選択したときと同じ色の枠にする */
.est-modal .est-in:not(:placeholder-shown) { border-color: transparent; background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #dc82b4 0, #78c8ff 100%) border-box; }
.est-modal .est-in.is-err { border-color: #d7000f; background: #ebebeb; }
.est-err { margin-top: 6px !important; font-size: 13px; color: #d7000f; }

/* 作りたいもの（1つ選ぶ） */
.est-choice2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.est-radio, .est-check { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; border: 3px solid #ebebeb; border-radius: 6px; background: #ebebeb; color: #181818; cursor: pointer; white-space: nowrap; }
.est-radio { gap: 8px; padding: 4px 10px; font-size: 15px; }
.est-radio input, .est-check input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.est-dot { flex: none; width: 18px; height: 18px; border: 1.5px solid #8a8a8a; border-radius: 50%; background: #ffffff; }
.est-radio:has(input:checked), .est-check:has(input:checked) { border-color: transparent; background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #dc82b4 0, #78c8ff 100%) border-box; font-weight: 700; }
.est-radio:has(input:checked) .est-dot { border-color: #181818; background: radial-gradient(circle, #181818 0 4.5px, #ffffff 5px); }
.est-radio:has(input:focus-visible), .est-check:has(input:focus-visible) { outline: 3px solid #181818; outline-offset: 2px; }

/* 集客方法（複数選べる） */
.est-choice4 { display: flex; gap: 6px; }
.est-check { flex: 1 1 auto; min-width: 0; padding: 4px; font-size: 13px; }
.est-choice4.is-err .est-check { border-color: #d7000f; }

/* 持ち込み割引（自前の選択パネル） */
.est-mw { position: relative; }
.est-mw-btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; border: 3px solid #ebebeb; border-radius: 6px; background: #ebebeb; padding: 0 13px 0 15px; font-size: 15px; color: #000000; cursor: pointer; text-align: left; }
.est-mw-btn.is-set { border-color: transparent; background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #dc82b4 0, #78c8ff 100%) border-box; }
.est-mw-cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-mw-btn svg { flex: none; }
.est-badge { flex: none; padding: 3px 12px; border: 2px solid transparent; border-radius: 999px; background: linear-gradient(#ffffff, #ffffff) padding-box, linear-gradient(to right, #dc82b4 0, #78c8ff 100%) border-box; color: #181818; font-size: 13px; font-style: normal; font-weight: 700; white-space: nowrap; }
.est-mw-list { position: absolute; left: 0; right: 0; top: 54px; z-index: 5; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 8px; background: #ffffff; box-shadow: 0 10px 30px rgba(0, 0, 0, .22), 0 0 0 1px #dcdcdc; }
.est-mw-opt { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 14px; border-radius: 6px; background: #ffffff; cursor: pointer; }
.est-mw-opt > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.est-mw-opt b { font-size: 15px; font-weight: 700; }
.est-mw-opt i { font-size: 12px; font-style: normal; color: #555555; }
.est-mw-opt:hover, .est-mw-opt.is-active { background: #f2f2f2; }
.est-mw-opt[aria-selected="true"] { background: #f6eef6; }
.est-mw-note { margin-top: 4px !important; padding: 8px 14px 6px 14px; border-top: 1px dotted #b4b4b4; font-size: 12px; color: #555555; }
.est-mw-note a { color: #555555; }

/* 下：送信 */
.est-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px dotted #181818; }
.est-fail { width: 100%; padding: 10px 14px; border: 2px solid #d7000f; border-radius: 6px; font-size: 13px; color: #d7000f; text-align: center; }
.est-send { width: 400px; height: 72px; padding: 4px; border: 0; border-radius: 4px; background: linear-gradient(to right, #dc82b4 0, #78c8ff 100%); cursor: pointer; transition: opacity .2s ease; }
.est-send:hover { opacity: .75; }
.est-send > span { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 3px; background: #ffffff; color: #000000; font-size: 18px; }
.est-send b { font-weight: 700; }
.est-send svg { position: absolute; right: 18px; top: 50%; margin-top: -9px; }
.est-send[disabled] { cursor: default; opacity: 1; }
.est-send[disabled] > span { background: rgba(255, 255, 255, .85); }
.est-send[disabled] svg { display: none; }
.est-fine { font-size: 11px; line-height: 1.7; color: #555555; text-align: center; }
.est-fine a { color: #555555; }

/* 送信したあと */
.est-done { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 56px 40px 52px 40px; text-align: center; }
.est-done-ttl { margin: 0; padding: 0; border: 0; background: none; color: #181818; font-family: YuMincho, "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 24px; font-weight: 600; line-height: 1.5; }
.est-done p { font-size: 14px; line-height: 1.9; }
/* 送信後は見出しへ移動させる（読み上げのため）。枠は出さない */
.est-modal .est-done-ttl:focus, .est-modal .est-done-ttl:focus-visible, .est-modal .est-ttl:focus, .est-modal .est-ttl:focus-visible { outline: none; }
.est-done-acts { display: flex; align-items: center; gap: 16px; margin-top: 6px; font-size: 14px; }
.est-done-btn { height: 48px; padding: 0 34px; border: 1px solid #181818; border-radius: 4px; background: #ffffff; color: #181818; font-size: 14px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .est-back, .est-modal, .est-send, .icon_images .est-balloon { transition: none; }
}
