/**
 * LINE査定モーダル（モバイル下部固定バーのLINEボタンから起動）
 * - 下部固定バーのLINEボタンをタップ → このモーダルを開く
 * - モーダル内下部の CV ボタンから LINE 登録へ遷移
 * クラス名は汎用（gwlm-*）。他CSSとの衝突回避のため接頭辞を付与。
 */

:root {
  --gwlm-line: #06c755;   /* LINEグリーン */
  --gwlm-blue: #1857c3;   /* サイトの primary（ステップ番号などのアクセント） */
  --gwlm-ink: #1a2330;
  --gwlm-sub: #5b6675;
}

/* 背景スクロールロック（JSで body に付与） */
body.gwlm-noscroll { position: fixed; width: 100%; overflow: hidden; }

/* ===== overlay ===== */
.gwlm-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(10, 20, 35, .55);
  display: none; align-items: flex-end;
}
.gwlm-overlay.is-open { display: flex; animation: gwlm-fade .2s ease; }
@keyframes gwlm-fade { from { opacity: 0 } to { opacity: 1 } }

/* ===== bottom sheet ===== */
.gwlm-sheet {
  width: 100%; max-height: 92vh; background: #fff;
  border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  animation: gwlm-up .28s cubic-bezier(.2, .8, .2, 1);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--gwlm-ink);
  will-change: transform;
}
@keyframes gwlm-up { from { transform: translateY(40px); opacity: .4 } to { transform: translateY(0); opacity: 1 } }

.gwlm-top { padding: 12px 16px 4px; position: relative; flex: none; touch-action: none; }
.gwlm-grip { width: 44px; height: 5px; background: #dfe4ea; border-radius: 3px; margin: 0 auto; }
.gwlm-close {
  position: absolute; right: 14px; top: 8px; width: 32px; height: 32px;
  border-radius: 50%; background: #f0f2f5; border: 0; font-size: 16px; color: #77808c; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0;
}

.gwlm-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px 16px; }

/* hook */
.gwlm-hook { text-align: center; margin: 2px 0 14px; }
.gwlm-eyebrow { color: var(--gwlm-line); font-weight: 900; font-size: 12px; letter-spacing: .5px; }
.gwlm-hook h2 { font-size: 29px; font-weight: 900; margin: 5px 0 3px; line-height: 1.18; }
.gwlm-hook h2 em { color: var(--gwlm-line); font-style: normal; }
.gwlm-lead { font-size: 18px; font-weight: 800; margin-top: 2px; }

/* 縦サンプル動画（任意・遅延ロード） */
.gwlm-video { display: flex; gap: 12px; align-items: center; background: #f6f8fa; border-radius: 14px; padding: 12px; margin-bottom: 16px; }
.gwlm-video-thumb {
  flex: none; width: 112px; aspect-ratio: 9/16; border-radius: 11px; overflow: hidden; position: relative;
  border: 0; padding: 0; cursor: pointer; background: #12314f center/cover no-repeat;
}
.gwlm-video-thumb .gwlm-play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); display: flex; align-items: center; justify-content: center;
  color: var(--gwlm-line); font-size: 18px; padding-left: 3px;
}
.gwlm-video-thumb .gwlm-dur { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; color: #fff; font-size: 9.5px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.gwlm-video-text b { font-size: 13.5px; display: block; margin-bottom: 6px; }
.gwlm-video-points { list-style: none; margin: 0; padding: 0; }
.gwlm-video-points li {
  position: relative; padding-left: 18px;
  font-size: 12px; color: var(--gwlm-sub); font-weight: 700; line-height: 1.75;
}
.gwlm-video-points li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--gwlm-line); font-weight: 900;
}
/* 動画は独立したライトボックス（モーダルの上に重なる別オーバーレイ）で再生。
   閉じても下のモーダルは残る（× でモーダルごと消えない）。 */
.gwlm-video-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, .92);
  display: none; align-items: center; justify-content: center;
  padding: 24px 12px;
}
.gwlm-video-overlay.is-open { display: flex; animation: gwlm-fade .2s ease; }
.gwlm-video-stage { width: 100%; display: flex; align-items: center; justify-content: center; }
.gwlm-video-stage video { max-width: 100%; max-height: 86vh; width: auto; border-radius: 12px; background: #000; }
.gwlm-vclose {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 14px;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 18px; z-index: 1;
  display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0;
}

/* 撮影フロー */
/* 全面青バー・白字・中央、下に三角矢印 */
.gwlm-flow-title {
  position: relative;
  font-size: 16px; font-weight: 900; text-align: center;
  color: #fff; background: var(--gwlm-blue);
  margin: 2px -16px 20px; padding: 7px 16px;
}
.gwlm-flow-title::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 9px solid transparent; border-top-color: var(--gwlm-blue); border-bottom: 0;
}
.gwlm-flow { position: relative; padding-left: 6px; }
.gwlm-step { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 14px; position: relative; }
.gwlm-step:last-child { padding-bottom: 2px; }
.gwlm-step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 2px; width: 2px; background: #e2e7ec; }
.gwlm-num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--gwlm-blue); color: #fff;
  font-size: 14px; font-weight: 900; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.gwlm-step-body { padding-top: 2px; }
.gwlm-step-body b { font-size: 14px; }
.gwlm-tag { font-size: 11px; color: var(--gwlm-line); font-weight: 800; margin-left: 6px; }
.gwlm-step-body em { font-style: normal; color: var(--gwlm-sub); font-weight: 600; font-size: 12px; display: block; margin-top: 2px; line-height: 1.55; }

.gwlm-disc { font-size: 10px; color: #b7bfc9; text-align: center; margin: 12px 2px 2px; }

/* sticky CV */
.gwlm-foot {
  flex: none; border-top: 1px solid #eef1f5; background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 16px rgba(0, 0, 0, .06);
}
.gwlm-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; background: var(--gwlm-line); color: #fff;
  border: 0; border-radius: 13px; padding: 15px; font-size: 16.5px; font-weight: 900; line-height: 1.2;
  text-decoration: none; box-shadow: 0 6px 16px rgba(6, 199, 85, .32); cursor: pointer;
}
.gwlm-cta .gwlm-cta-ico { width: 22px; height: 22px; flex: none; display: block; }
.gwlm-cta-sub { text-align: center; font-size: 11.5px; color: var(--gwlm-sub); margin-top: 8px; font-weight: 700; }

/* 固定バーのLINEボタン上に「動画で簡単」の吹き出し（ぴょこぴょこ）
   対象は #mobile-btns 内の LINE ボタン。モバイル固定バー表示時のみ。 */
@media (max-width: 767px) {
  #mobile-btns a[href*="s.lmes.jp"] { position: relative; overflow: visible; column-gap: 8px; }
  /* アイコンと文字を少し離し、文字は左揃え（「詳しく見る」は右揃えのまま） */
  #mobile-btns a[href*="s.lmes.jp"] .brxe-text-basic { text-align: left; }
  #mobile-btns a[href*="s.lmes.jp"]::before {
    content: "最短当日！";
    position: absolute; left: 50%; bottom: calc(100% + 10px);
    white-space: nowrap;
    background: #e60033; color: #fff;
    font-size: 12px; font-weight: 900; line-height: 1;
    padding: 5px 10px; border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
    pointer-events: none; z-index: 2;
    animation: gwlm-bob 1.1s ease-in-out infinite;
    transition: opacity .3s ease;
  }
  #mobile-btns a[href*="s.lmes.jp"]::after {
    content: ""; position: absolute; left: 50%; bottom: calc(100% + 5px);
    border: 5px solid transparent; border-top-color: #e60033; border-bottom: 0;
    pointer-events: none; z-index: 2;
    animation: gwlm-bob 1.1s ease-in-out infinite;
    transition: opacity .3s ease;
  }
  /* 1画面ぶんスクロールしたら吹き出しを消す（JSが body に gwlm-past-fold を付与） */
  body.gwlm-past-fold #mobile-btns a[href*="s.lmes.jp"]::before,
  body.gwlm-past-fold #mobile-btns a[href*="s.lmes.jp"]::after { opacity: 0; }
}
@keyframes gwlm-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-4px); }
}

/* PC/タブレット（768px〜）: 中央ダイアログ表示。モバイルはボトムシートのまま */
@media (min-width: 768px) {
  .gwlm-overlay { align-items: center; justify-content: center; padding: 24px; }
  .gwlm-sheet {
    width: 100%; max-width: 440px; margin: 0 auto;
    border-radius: 22px; max-height: 86vh; animation-name: gwlm-pop;
  }
  .gwlm-grip { display: none; }
  .gwlm-video-stage video { max-height: 78vh; }
}
@keyframes gwlm-pop {
  from { transform: translateY(16px) scale(.98); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* SPバーのLINEボタンに「詳しく見る」ヒント（押したら詳細が開く合図） */
.gwlm-sp-more { display: block; font-size: 9px; font-weight: 700; margin-top: 2px; opacity: .9; text-align: right; }

/* PC 右下の固定LINEボタン（FAB）。モバイルは下部バーがあるので非表示 */
.gwlm-pc-fab { display: none; }
@media (min-width: 768px) {
  /* 初期は大きく表示（フォームが見えるまでの注目喚起）。
     フォームが画面に入ると body.gwlm-fab-shrink が付き、現行サイズへ縮小する。 */
  .gwlm-pc-fab {
    position: fixed; right: 20px; bottom: 20px; z-index: 40;
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--gwlm-line); color: #fff; text-decoration: none;
    padding: 20px 34px; border-radius: 999px; font-weight: 900; font-size: 20px;
    box-shadow: 0 12px 32px rgba(6, 199, 85, .48);
    transform-origin: bottom right;
    transition: transform .2s ease, box-shadow .2s ease, padding .2s ease,
                font-size .2s ease, gap .2s ease, right .2s ease, bottom .2s ease;
  }
  .gwlm-pc-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(6, 199, 85, .56); }
  .gwlm-pc-fab-ico { width: 32px; height: 32px; flex: none; display: block; transition: width .2s ease, height .2s ease; }
  .gwlm-pc-fab-txt { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
  .gwlm-fab-more { font-size: 14px; font-weight: 700; opacity: .92; align-self: flex-end; transition: font-size .2s ease; }
  .gwlm-pc-fab-badge {
    position: absolute; top: -15px; left: 50%;
    background: #e60033; color: #fff; font-size: 14px; font-weight: 900; line-height: 1;
    padding: 5px 13px; border-radius: 999px; white-space: nowrap;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .2);
    animation: gwlm-bob 1.1s ease-in-out infinite;
    transition: font-size .2s ease, padding .2s ease, top .2s ease;
  }

  /* フォームが見えたら現行サイズへ縮小 */
  body.gwlm-fab-shrink .gwlm-pc-fab {
    right: 16px; bottom: 16px; gap: 8px;
    padding: 13px 22px; font-size: 15px;
    box-shadow: 0 8px 24px rgba(6, 199, 85, .4);
  }
  body.gwlm-fab-shrink .gwlm-pc-fab:hover { box-shadow: 0 12px 28px rgba(6, 199, 85, .48); }
  body.gwlm-fab-shrink .gwlm-pc-fab-ico { width: 24px; height: 24px; }
  body.gwlm-fab-shrink .gwlm-fab-more { font-size: 11px; }
  body.gwlm-fab-shrink .gwlm-pc-fab-badge { top: -12px; font-size: 11px; padding: 4px 10px; }
}
