/* --- CTA（#cta-final）: セクション単位の横余白（app.css に sm:px 等が無い場合でも確実に） --- */
#cta-final {
  box-sizing: border-box;
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

@media (min-width: 640px) {
  #cta-final {
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  }
}

@media (min-width: 768px) {
  #cta-final {
    padding-left: max(2rem, env(safe-area-inset-left, 0px));
    padding-right: max(2rem, env(safe-area-inset-right, 0px));
  }
}

#cta-final .lp-cta-inner {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

/* --- Googleフォーム埋め込み（#contact） --- */
.lp-gform-iframe {
  min-height: 72rem;
}

@media (min-width: 768px) {
  .lp-gform-iframe {
    min-height: 80rem;
  }
}

/* --- ページトップへ（固定ボタン） --- */
.lp-page-top {
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 40;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 9999px;
  border: 3px solid #fff;
  padding: 0;
  background: linear-gradient(165deg, #ff9f45 0%, #f97316 45%, #ea580c 100%);
  color: #fff;
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.06),
    0 4px 12px rgb(0 0 0 / 0.18),
    0 12px 28px rgb(234 88 12 / 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, opacity 0.25s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.lp-page-top__icon {
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.2));
}

.lp-page-top:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.08),
    0 8px 20px rgb(0 0 0 / 0.2),
    0 16px 36px rgb(234 88 12 / 0.45);
  filter: brightness(1.05);
}

.lp-page-top:active {
  transform: translateY(-1px) scale(0.98);
}

.lp-page-top:focus-visible {
  outline: 3px solid #bef264;
  outline-offset: 4px;
}

.lp-page-top.is-hidden {
  opacity: 0;
  pointer-events: none;
}

#site-nav.lp-topnav.is-scrolled {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.08);
}

/* 旧ヒーロー上ナビ（nav-on-hero）用 — 互換のため残す */
#site-nav.is-scrolled:not(.lp-topnav) {
  background-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07);
  backdrop-filter: blur(8px);
}

#site-nav.is-scrolled:not(.lp-topnav) .nav-on-hero {
  color: #374151;
  text-shadow: none;
}

#site-nav.is-scrolled:not(.lp-topnav) .nav-on-hero:hover {
  color: #2d5a1b;
}

#site-nav.is-scrolled:not(.lp-topnav) .nav-cta-hero {
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* FLOW: 左の縦線（白背景上でドットと重なる） */
.lp-flow-track {
  position: relative;
}

.lp-flow-rail {
  position: absolute;
  left: calc(1.25rem - 1px);
  top: 1.125rem;
  bottom: 1.125rem;
  width: 2px;
  background-color: #d1d5db;
  border-radius: 9999px;
  z-index: 0;
}

.lp-flow-step:last-child .lp-flow-step-body {
  padding-bottom: 0;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* FAQ: 開閉をスムーズに（grid 0fr → 1fr） */
.faq-panel-slot {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-panel-slot {
  grid-template-rows: 1fr;
}

.faq-panel-slot-inner {
  min-height: 0;
  overflow: hidden;
}

.faq-panel {
  padding-left: 3.25rem;
  padding-right: 1.25rem;
  transform: translateY(-4px);
  opacity: 0;
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.is-open .faq-panel {
  transform: translateY(0);
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .faq-panel-slot {
    transition-duration: 0.01ms;
  }

  .faq-panel {
    transition-duration: 0.01ms;
  }

  .faq-chevron {
    transition-duration: 0.01ms;
  }
}

/* --- モバイル: 3枚以上カードの横スワイプ + ドット --- */
.lp-carousel-dots {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0;
  list-style: none;
}

.lp-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  padding: 0;
  border: none;
  background: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}

.lp-carousel-dot.is-active {
  background: #2d5a1b;
  transform: scale(1.2);
}

.lp-carousel-shell--inverse .lp-carousel-dot {
  background: rgba(255, 255, 255, 0.35);
}

.lp-carousel-shell--inverse .lp-carousel-dot.is-active {
  background: #bef264;
}

@media (max-width: 767.98px) {
  .lp-carousel-shell[data-lp-carousel-active='true'] .lp-carousel-track {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    grid-template-columns: none !important;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;
    margin-inline: -1.5rem;
    padding-inline: 1.5rem;
    padding-bottom: 0.25rem;
    scrollbar-width: none;
  }

  .lp-carousel-shell[data-lp-carousel-active='true'] .lp-carousel-track::-webkit-scrollbar {
    display: none;
  }

  .lp-carousel-shell[data-lp-carousel-active='true'] .lp-carousel-track > * {
    flex: 0 0 min(86vw, 22rem);
    max-width: min(86vw, 22rem);
    scroll-snap-align: start;
    scroll-snap-stop: normal;
  }

  .lp-carousel-shell[data-lp-carousel-active='true'] .lp-carousel-dots {
    display: flex;
  }
}

/* --- テーブル: 1列目固定 + 横スクロール --- */
/* app.css の Tailwind ビルドに min-w-[600px] 等が含まれていないため、
   ここで min-width を指定しないと w-full のみが効き、狭い画面でも横スクロールが出ません。 */
.lp-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}

.lp-table-scroll table {
  position: relative;
  width: 100%;
}

.lp-table--plan table {
  min-width: 600px;
}

.lp-table--compare table {
  min-width: 640px;
}

/* 会社概要は比較表などと同じ max-w-6xl 内で幅いっぱい。2列のため min-width は付けない */
.lp-table--company table {
  min-width: 0;
}

.lp-table-scroll thead th:first-child,
.lp-table-scroll tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  white-space: nowrap;
  box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.18);
}

.lp-table-scroll thead th:first-child {
  z-index: 3;
}

.lp-table--plan thead th:first-child {
  background-color: #2d5a1b;
}

.lp-table--plan tbody td:first-child {
  background-color: #f2f8ee;
}

.lp-table--compare thead th:first-child {
  background-color: #1a3a14;
  color: #d1d5db;
}

.lp-table--compare tbody td:first-child {
  background-color: #f2f8ee;
  color: #1a3a14;
}

.lp-table--company tbody th {
  position: sticky;
  left: 0;
  z-index: 2;
  white-space: nowrap;
  box-shadow: 4px 0 12px -6px rgba(0, 0, 0, 0.18);
  background-color: #f2f8ee;
}

.lp-table--company tbody td {
  background-color: #fff;
}

/* =============================================================================
   LP（index.html から移行）— 横スクロール行・ドット、フォーム、カリキュラム、ヒーロー
   ============================================================================= */

.lp-swipe-row {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.lp-swipe-row::-webkit-scrollbar {
  display: none;
}

.lp-swipe-dots {
  display: none;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

@media (max-width: 767px) {
  .lp-swipe-dots {
    display: flex;
  }
}

.lp-swipe-dots__dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #cbd5e1;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lp-swipe-dots__dot.is-active {
  width: 10px;
  height: 10px;
  background: #2d5a1b;
}

/* Contact form: Tailwind purge に gap-x / space-y-8 が無いため明示指定 */
#contact-form .lp-contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 1.5rem;
  row-gap: 1.25rem;
}

@media (min-width: 768px) {
  #contact-form .lp-contact-grid {
    grid-template-columns: 1fr 1fr;
    row-gap: 0;
  }
}

#contact-form .lp-contact-grid + .lp-contact-grid,
#contact-form .lp-contact-message {
  margin-top: calc(2rem * 2 / 3);
}

@media (min-width: 768px) {
  #contact-form .lp-contact-grid + .lp-contact-grid,
  #contact-form .lp-contact-message {
    margin-top: calc(2.5rem * 2 / 3);
  }
}

#curriculum .lp-plan-row-yellow td {
  background-color: #fefce8;
}

/* 元 text-base(1rem) / md:text-lg(1.125rem) の 1.5 倍 */
#curriculum .lp-curriculum-catch {
  font-size: 1.5rem;
  line-height: 1.375;
}

@media (min-width: 768px) {
  #curriculum .lp-curriculum-catch {
    font-size: 1.6875rem;
  }
}

/* スマホ: 大きめの見出し・数字を約75%に（md以上は Tailwind のまま） */
@media (max-width: 767px) {
  main#root .text-3xl {
    font-size: 1.40625rem !important;
  }

  main#root .text-4xl {
    font-size: 1.6875rem !important;
  }

  main#root .text-5xl {
    font-size: 2.25rem !important;
  }

  main#root .text-6xl {
    font-size: 2.8125rem !important;
  }

  main#root h2.text-2xl,
  main#root h3.text-2xl,
  main#root p.text-2xl {
    font-size: 1.125rem !important;
  }

  main#root h2.text-xl,
  main#root h3.text-xl {
    font-size: 0.9375rem !important;
  }

  #hero .text-lg {
    font-size: 0.875rem !important;
  }

  #curriculum .lp-curriculum-catch {
    font-size: 1.125rem;
    line-height: 1.4;
  }

  nav#site-nav .text-2xl {
    font-size: 1.5rem !important;
  }
}

/* PC: ヒーロー h1 の2行目「コスト」〜「変える。」を1行に（「る。」だけ改行されない） */
@media (min-width: 768px) {
  #hero h1 {
    font-size: clamp(2rem, 3.8vw, 3.75rem) !important;
    line-height: 1.3 !important;
  }

  #hero h1 .lp-hero-headline-main {
    white-space: nowrap;
  }
}

/* ヒーロー リード（AI導入で〜） */
@media (max-width: 767px) {
  #hero .lp-hero-lead {
    font-size: 1.3rem !important;
    line-height: 1.28 !important;
  }
}

@media (min-width: 768px) {
  #hero .lp-hero-lead {
    font-size: clamp(1.45rem, 2.65vw, 2.5rem) !important;
    line-height: 1.28 !important;
  }
}
