/*!
 * lp.css — AIstep 画像LP 共通スタイル（ADR-0017）
 * --------------------------------------------------------------------------
 * 全LPが共有する基底スタイル。LP固有の色・幅は CSS変数で上書きする。
 *
 *   <link rel="stylesheet" href="/common/lp.css">
 *   <style>:root { --lp-bg: #fdf2f8; --lp-max-width: 750px; }</style>
 *
 * ここは「上書きされる前提の基底」に徹する。LP1本だけの調整は
 * LP側の <style> に書き、このファイルには入れない（ADR-0017）。
 * --------------------------------------------------------------------------
 */

:root {
  /* LP側で上書きする想定の変数 */
  --lp-bg: #f3f5f7;             /* ページ地の色（LP本体の外側） */
  --lp-paper: #fff;             /* LP本体の背景 */
  --lp-max-width: 853px;        /* LP本体の最大幅 */
  --lp-cta-safe-space: clamp(130px, 35vw, 210px); /* 固定CTAに隠れない余白 */

  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--lp-bg);
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 0 0 var(--lp-cta-safe-space);
  overflow-x: hidden;
  background: var(--lp-bg);
}

img {
  max-width: 100%;
}

/* ── LP本体のコンテナ ────────────────────────────────────── */

.lp {
  width: min(100%, var(--lp-max-width));
  margin: 0 auto;
  overflow: hidden;
  background: var(--lp-paper);
  box-shadow: 0 0 40px rgb(15 41 69 / 8%);
}

/* 画像セクション（隙間なく縦に連結する） */
.lp-section {
  margin: 0;
  line-height: 0;
}

.lp-section > img {
  display: block;
  width: 100%;
  height: auto;
}

/* ── CTA（共通の見た目・状態） ───────────────────────────── */

.inline-cta {
  padding: clamp(10px, 2.5vw, 24px) clamp(6px, 2vw, 18px);
  background: var(--lp-paper);
}

.inline-cta a,
.fixed-cta a {
  display: block;
  border-radius: 24px;
  line-height: 0;
  transition:
    filter 160ms ease,
    transform 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.inline-cta img,
.fixed-cta img {
  display: block;
  width: 100%;
  height: auto;
}

.inline-cta a:hover,
.fixed-cta a:hover {
  filter: brightness(1.04) saturate(1.03);
  transform: translateY(-2px);
}

.inline-cta a:active,
.fixed-cta a:active {
  transform: translateY(1px) scale(0.995);
}

.inline-cta a:focus-visible,
.fixed-cta a:focus-visible {
  outline: 4px solid #1367d1;
  outline-offset: 4px;
}

/* lp-cta.js が遷移先を決められなかったとき（LINEコード未設定など） */
[data-line-cta][aria-disabled="true"] {
  cursor: default;
}

/* 画面下部に貼り付く画像CTA */
.fixed-cta {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 0;
  width: min(calc(100% - 16px), 560px);
  margin-inline: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgb(39 119 24 / 24%));
}

.fixed-cta a {
  overflow: hidden;
  pointer-events: auto;
}

/* ── スティッキーCTA（LP本体の幅いっぱいに敷く旧来型） ───────── */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 200;
  width: 100%;
  max-width: var(--lp-max-width);
  line-height: 0;
  transform: translateX(-50%);
  transition: opacity .3s ease, visibility .3s ease;
}

/* フォームが画面に入ったら引っ込める（lp-form.js が付け外しする） */
.sticky-cta.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.sticky-cta a {
  display: block;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 -4px 12px rgb(0 0 0 / 12%);
  transition: opacity .3s ease;
}

.sticky-cta a:hover {
  opacity: .92;
}

/* 光沢が横切るエフェクト */
.sticky-cta a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  z-index: 2;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgb(255 255 255 / 0%) 0%,
    rgb(255 255 255 / 55%) 50%,
    rgb(255 255 255 / 0%) 100%
  );
  pointer-events: none;
  transform: skewX(-20deg);
  animation: lp-shine 3.8s ease-in-out infinite;
}

.sticky-cta img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center center;
  will-change: transform;
  animation: lp-heartbeat 2.6s ease-in-out infinite;
}

/* 画像ではなく文字でCTAを出す場合（フォームへスクロールさせる用途） */
.sticky-cta--button a {
  margin: 0 14px 14px;
  padding: 17px 16px;
  color: #fff;
  text-align: center;
  background: linear-gradient(180deg, #21d96c 0%, #06c755 55%, #05aa48 100%);
  border-radius: 16px;
  box-shadow: 0 7px 0 #03833a, 0 10px 24px rgb(6 199 85 / 35%);
  transition: transform .12s ease, box-shadow .12s ease, opacity .3s ease;
}

.sticky-cta--button a:hover {
  opacity: .96;
  transform: translateY(2px);
  box-shadow: 0 5px 0 #03833a, 0 8px 18px rgb(6 199 85 / 32%);
}

.sticky-cta--button a:active {
  transform: translateY(6px);
  box-shadow: 0 1px 0 #03833a, 0 3px 9px rgb(6 199 85 / 28%);
}

.sticky-cta .cta-label {
  display: block;
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: .03em;
  text-shadow: 0 1px 2px rgb(0 82 34 / 26%);
  transform-origin: center center;
  will-change: transform;
  animation: lp-heartbeat 2.6s ease-in-out infinite;
}

@keyframes lp-heartbeat {
  0%, 50%, 100% { transform: scale(1); }
  10% { transform: scale(1.035); }
  20% { transform: scale(1); }
  30% { transform: scale(1.035); }
  40% { transform: scale(1); }
}

@keyframes lp-shine {
  0%, 30% { left: -75%; }
  65%, 100% { left: 125%; }
}

/* ── フッター ──────────────────────────────────────────── */

.site-footer {
  padding: 30px 20px 34px;
  color: #fff;
  text-align: center;
  background: #071a3d;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
}

.site-footer a {
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
  text-underline-offset: 4px;
}

.site-footer a:hover {
  color: #71decf;
}

.site-footer a:focus-visible {
  outline: 3px solid #71decf;
  outline-offset: 4px;
  border-radius: 2px;
}

.site-footer p {
  margin: 20px 0 0;
  color: rgb(255 255 255 / 70%);
  font-size: 12px;
}

/* ── ユーティリティ ────────────────────────────────────── */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  border: 0 !important;
  clip: rect(0 0 0 0) !important;
}

@media (max-width: 480px) {
  .inline-cta {
    padding: 8px 4px;
  }

  .inline-cta a,
  .fixed-cta a {
    border-radius: 14px;
  }

  .fixed-cta {
    bottom: max(5px, env(safe-area-inset-bottom));
    width: calc(100% - 10px);
  }

  .site-footer nav {
    flex-direction: column;
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .inline-cta a,
  .fixed-cta a {
    transition: none;
  }

  .sticky-cta img,
  .sticky-cta .cta-label {
    animation: none;
  }

  .sticky-cta a::before {
    display: none;
    animation: none;
  }
}

@media print {
  body {
    padding-bottom: 0;
    background: #fff;
  }

  .lp {
    box-shadow: none;
  }

  .fixed-cta,
  .sticky-cta {
    display: none;
  }
}
