/*
 * トップページ（LP）と規約ページ。Claude Design のハンドオフ（Waripay.dc.html / Waripay LP.dc.html）に合わせる。
 * アプリ画面に影響しないよう、すべて body.lp の中だけに効かせる。
 * スマホ（〜1023px）が基本。1024px以上でPCレイアウトに切り替える。
 */
body.lp {
  --lp-primary: #0e7c66;
  --lp-primary-hover: #0a5f4e;
  --lp-primary-soft: #e3f1ec;
  --lp-dark: #0b2b25;
  --lp-beige: #f6f4ee;
  --lp-beige-deep: #edebe4;
  --lp-text: #1b2a26;
  --lp-text-weak: #3f4f4a;
  --lp-note: #5c6b66;
  --lp-on-dark: #cfe0da;
  --lp-on-dark-note: #a9c4bc;
  --lp-input-border: #dfe5e2;
  --lp-divider: #e6ebe9;
  --lp-line: #06c755;

  margin: 0;
  background: #fff;
  color: var(--lp-text);
  font-family: "Zen Kaku Gothic New", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

body.lp * { box-sizing: border-box; }
body.lp a { color: var(--lp-primary); }
body.lp a:hover { color: var(--lp-primary-hover); }
/* リセットは詳細度0にして、各クラスの指定が必ず勝つようにする */
:where(body.lp) :where(h1, h2, h3, p) { margin: 0; }
:where(body.lp) :where(h3) { font-weight: 700; line-height: 1.4; }
body.lp .num { font-variant-numeric: tabular-nums; }
body.lp .pc { display: none; }

.lp-flash { margin: 0; padding: 10px 20px; background: #fdecea; color: #c0392b; }
.lp-inner { max-width: 560px; margin: 0 auto; }

/* 暗い背景のブロック（ファーストビューと最後の誘導） */
.lp-dark { background: var(--lp-dark); color: #fff; }
.lp-top { padding: 0 20px 36px; }
.lp-header { display: flex; align-items: center; height: 56px; }
body.lp .lp-logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .02em; text-decoration: none; }
.lp-logo-icon { width: 28px; height: 28px; display: block; }

/* 戻ってきた人のグループ一覧 */
.lp-my-groups {
  margin: 4px 0 24px; padding: 14px 16px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px;
  display: flex; flex-direction: column; gap: 2px;
}
.lp-my-groups-title { font-size: 14px; color: var(--lp-on-dark-note); font-weight: 500; margin-bottom: 6px; }
body.lp .lp-my-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; color: #fff; text-decoration: none; }
.lp-my-group-text { display: flex; flex-direction: column; min-width: 0; }
.lp-my-group-name { font-weight: 700; font-size: 16px; line-height: 1.4; }
.lp-my-group-members { font-size: 14px; color: var(--lp-on-dark-note); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-my-group-when { display: flex; align-items: center; gap: 6px; flex: none; font-size: 14px; color: var(--lp-on-dark-note); }
.lp-chevron { color: #fff; font-size: 18px; }

/* ファーストビュー */
.lp-h1 { margin: 16px 0 12px; font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
.lp-promise { margin-bottom: 24px; color: var(--lp-on-dark); font-weight: 500; }

.lp-form { background: #fff; color: var(--lp-text); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.lp-form .errors { margin: 0; }
.lp-field { display: flex; flex-direction: column; gap: 6px; }
.lp-field span { font-size: 14px; font-weight: 700; color: var(--lp-text-weak); }
.lp-field input {
  height: 46px; padding: 0 14px; border: 1.5px solid var(--lp-input-border); border-radius: 12px;
  font: inherit; font-size: 16px; color: var(--lp-text); background: #fff; outline: none;
}
.lp-field input::placeholder { color: #98a5a0; }
.lp-field input:focus { border-color: var(--lp-primary); box-shadow: 0 0 0 3px rgba(14, 124, 102, .15); }
.lp-button {
  height: 48px; border: 0; border-radius: 12px; background: var(--lp-primary); color: #fff;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; transition: opacity .15s;
}
.lp-button:hover { background: var(--lp-primary-hover); }
/* 両方入力するまではボタンを薄くする（押すとブラウザの必須チェックが働く） */
.lp-form:invalid .lp-button { opacity: .45; }
.lp-form-note { font-size: 14px; color: var(--lp-note); text-align: center; }

/* メインビジュアル：写真枠（今はグラデーション）＋傾けた精算結果 */
.lp-hero-lead { color: var(--lp-on-dark); }
.lp-hero-lead.sp { margin: 36px 0 14px; line-height: 1.6; }
.lp-hero-lead b { color: #fff; }
.lp-visual { position: relative; padding-bottom: 150px; }
.lp-photo { position: relative; height: 300px; border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, #128a72 0%, #0e7c66 50%, #0a4f42 100%); }
.lp-photo-bird { position: absolute; left: 50%; top: 10px; width: 150px; height: 150px; margin-left: -75px; }
.lp-settlement {
  position: absolute; left: 14px; right: 14px; bottom: 0;
  background: #fff; color: var(--lp-text); border-radius: 18px; padding: 18px 20px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .4); transform: rotate(-3deg); line-height: 1.5;
}
.lp-settlement-head { display: flex; justify-content: space-between; align-items: center; }
.lp-label { font-size: 13px; font-weight: 700; color: var(--lp-note); letter-spacing: .04em; }
.lp-badge { background: var(--lp-primary); color: #fff; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 4px 12px; }
.lp-settlement-transfers { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; font-size: 18px; }
.lp-settlement-transfers > div, .lp-settlement-expenses > div { display: flex; justify-content: space-between; align-items: center; }
.lp-arrow { color: var(--lp-primary); }
.lp-settlement-note { font-size: 13px; color: var(--lp-note); }
.lp-divider { border-top: 1px solid #eef1ef; margin: 12px 0 8px; }
.lp-settlement-expenses { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; color: var(--lp-text-weak); font-size: 15px; }

/* セクション共通 */
.lp-section { padding: 48px 20px; }
.lp-white { background: #fff; }
.lp-beige { background: var(--lp-beige); }
.lp-h2 { margin-bottom: 24px; font-size: 26px; line-height: 1.35; font-weight: 700; }
.lp-h2-tight { margin-bottom: 8px; }
.lp-sub { margin-bottom: 20px; color: var(--lp-note); }

/* 3ステップ */
.lp-steps { display: flex; flex-direction: column; gap: 32px; }
.lp-step { display: flex; flex-direction: column; gap: 14px; }
.lp-step-head { display: flex; gap: 12px; align-items: flex-start; }
.lp-step-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--lp-primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lp-step h3 { margin: 2px 0 4px; font-size: 19px; }
.lp-step p { color: var(--lp-text-weak); }
.lp-mock { margin-left: 44px; background: var(--lp-beige); border-radius: 16px; padding: 18px 16px 0; overflow: hidden; }
.lp-mock-screen { background: #fff; border-radius: 14px 14px 0 0; padding: 16px 14px 18px; box-shadow: 0 -2px 12px rgba(0, 0, 0, .05); font-size: 14px; line-height: 1.4; }
.lp-mock-label { font-size: 12px; font-weight: 700; color: var(--lp-text-weak); margin: 10px 0 4px; }
.lp-mock-label:first-child { margin-top: 0; }
.lp-mock-field { height: 40px; border: 1.5px solid var(--lp-input-border); border-radius: 10px; display: flex; align-items: center; padding: 0 10px; }
.lp-mock-button { height: 40px; border-radius: 10px; background: var(--lp-primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 12px; }
.lp-mock-button.line { background: var(--lp-line); margin-top: 0; }
.lp-mock-button.outline { height: 36px; background: #fff; color: var(--lp-text); border: 1.5px solid var(--lp-input-border); margin-top: 8px; }
.lp-mock-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.lp-check { width: 22px; height: 22px; border-radius: 50%; background: var(--lp-primary-soft); color: var(--lp-primary); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.lp-mock-sub { color: var(--lp-note); margin: 6px 0 12px; font-size: 13px; }
.lp-mock-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: 700; font-size: 15px; }
.lp-mock-count { font-size: 12px; font-weight: 400; color: var(--lp-note); }
.lp-mock-expense { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef1ef; }
.lp-mock-expense:nth-last-child(2) { border-bottom: 0; }
.lp-mock-expense-title { flex: 1; min-width: 0; }
.lp-mock-expense-title span { margin-left: 6px; font-size: 12px; color: var(--lp-note); }
.lp-mock-expense + .lp-mock-button { margin-top: 10px; }
/* 人ごとに色を固定する */
.lp-avatar { width: 22px; height: 22px; flex: none; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.lp-avatar.taro { background: var(--lp-primary); }
.lp-avatar.jiro { background: #2f6f9f; }
.lp-avatar.hanako { background: #c2743a; }

/* みんなで出かけるときに */
.lp-section.lp-beige:has(.lp-scenes) { padding: 40px 20px; }
.lp-scenes { display: flex; flex-direction: column; gap: 12px; }
.lp-scene { background: #fff; border-radius: 16px; padding: 20px; }
.lp-scene h3 { margin-bottom: 6px; font-size: 19px; }
.lp-scene p { color: var(--lp-text-weak); }

/* 細かい立替も、ちゃんと割れる */
.lp-features { list-style: none; margin: 0; padding: 0; }
.lp-features li { position: relative; padding: 16px 0 16px 22px; border-top: 1px solid var(--lp-divider); }
.lp-features li:last-child { border-bottom: 1px solid var(--lp-divider); }
.lp-features li::before { content: ""; position: absolute; left: 0; top: 27px; width: 8px; height: 8px; border-radius: 50%; background: var(--lp-primary); }
.lp-features h3 { margin-bottom: 2px; font-size: 17px; line-height: 1.5; }
.lp-features p { color: var(--lp-text-weak); }

/* ほかの方法との違い（スマホはカード、PCは表） */
.lp-compare-cards { display: flex; flex-direction: column; gap: 12px; }
.lp-compare-card { border: 1px solid var(--lp-divider); border-radius: 16px; overflow: hidden; background: #fff; }
.lp-compare-method { padding: 14px 18px; font-weight: 700; font-size: 17px; background: var(--lp-beige-deep); }
.lp-compare-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.lp-compare-body > div { display: flex; gap: 10px; }
.lp-compare-body > div > span:last-child { color: var(--lp-text-weak); }
.lp-compare-key { flex: none; width: 72px; padding-top: 2px; font-size: 14px; font-weight: 700; color: #8a9793; }
.lp-compare-key.waripay { color: var(--lp-primary); }

.lp-compare-table { grid-template-columns: 220px 1fr 1fr; border: 1px solid var(--lp-divider); border-radius: 20px; overflow: hidden; background: #fff; }
.lp-compare-table > div { padding: 20px 24px; border-top: 1px solid var(--lp-divider); color: var(--lp-text-weak); }
.lp-compare-table > .th { padding: 16px 24px; border-top: 0; background: var(--lp-beige-deep); font-size: 14px; font-weight: 700; color: var(--lp-note); }
.lp-compare-table > .th.waripay { background: var(--lp-primary-soft); color: var(--lp-primary); }
.lp-compare-table > .method { font-weight: 700; color: var(--lp-text); }
.lp-compare-table > .waripay:not(.th) { font-weight: 700; color: var(--lp-text); background: #f7fbf9; }

/* 最後の誘導 */
.lp-final { padding: 56px 20px 32px; }
.lp-final-bird { display: block; width: 72px; height: 72px; margin-bottom: 16px; }
.lp-final-h2 { margin-bottom: 12px; font-size: 28px; line-height: 1.35; font-weight: 700; }
.lp-final-sub { margin-bottom: 24px; color: var(--lp-on-dark); }
body.lp .lp-button-light { display: flex; align-items: center; justify-content: center; height: 52px; border-radius: 12px; background: #fff; color: var(--lp-primary); font-size: 17px; font-weight: 700; text-decoration: none; }
body.lp .lp-button-light:hover { background: var(--lp-primary-soft); }
.lp-footer-links { display: flex; gap: 20px; align-items: center; margin-top: 48px; font-size: 14px; }
.lp-footer-logo { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #fff; }
.lp-footer-logo svg { width: 20px; height: 20px; }
body.lp .lp-footer-links a { color: var(--lp-on-dark-note); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }

/* 規約ページ */
.lp-legal { max-width: 720px; margin: 0 auto; line-height: 1.8; }
.lp-legal-header { display: flex; align-items: center; height: 56px; padding: 0 20px; border-bottom: 1px solid var(--lp-divider); }
body.lp .lp-legal-logo { font-weight: 700; font-size: 18px; letter-spacing: .02em; color: var(--lp-text); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
.lp-legal-logo svg { width: 28px; height: 28px; display: block; }
.lp-legal-body { padding: 32px 20px 64px; color: var(--lp-text-weak); }
.lp-legal-body h1 { margin-bottom: 8px; font-size: 28px; line-height: 1.35; font-weight: 700; color: var(--lp-text); }
.lp-legal-updated { margin-bottom: 32px; font-size: 14px; color: var(--lp-note); }
.lp-legal-lead { margin-bottom: 24px; }
.lp-legal-body h2 { margin: 32px 0 8px; font-size: 19px; font-weight: 700; color: var(--lp-text); }
.lp-legal-body ul { margin: 0; padding-left: 20px; }
.lp-legal-after-list { margin-top: 8px; }
.lp-legal-footer { padding: 24px 20px; border-top: 1px solid var(--lp-divider); display: flex; gap: 20px; font-size: 14px; }
body.lp .lp-legal-footer a { min-height: 44px; display: inline-flex; align-items: center; }

/* PC */
@media (min-width: 1024px) {
  body.lp .sp { display: none; }
  body.lp .pc { display: block; }
  body.lp br.pc { display: inline; }

  .lp-inner { max-width: 1280px; padding: 0 80px; }
  .lp-top, .lp-section, .lp-final { padding-left: 0; padding-right: 0; }

  .lp-top { padding-bottom: 72px; }
  .lp-header { height: 72px; }
  body.lp .lp-logo { font-size: 20px; }
  .lp-logo-icon { width: 32px; height: 32px; }
  .lp-my-groups { max-width: 560px; }

  .lp-hero { display: grid; grid-template-columns: 560px 1fr; gap: 56px; align-items: start; margin-top: 40px; }
  .lp-h1 { margin: 0 0 16px; font-size: 44px; line-height: 1.25; white-space: nowrap; }
  .lp-promise { margin-bottom: 12px; font-size: 18px; }
  .lp-hero-lead.pc { margin-bottom: 28px; color: var(--lp-on-dark-note); }
  .lp-form { padding: 24px; gap: 16px; max-width: 460px; }
  .lp-field input, .lp-button { height: 52px; }

  .lp-visual { padding-bottom: 60px; }
  .lp-photo { height: 420px; border-radius: 24px; }
  .lp-photo-bird { left: auto; right: 24px; top: 20px; width: 340px; height: 340px; margin-left: 0; }
  .lp-settlement { left: -48px; right: auto; width: 300px; padding: 18px 20px; transform: rotate(-5deg); font-size: 15px; box-shadow: 0 24px 48px rgba(0, 0, 0, .35); }
  .lp-settlement-transfers { gap: 6px; margin: 10px 0 6px; font-size: 17px; }
  .lp-label, .lp-badge, .lp-settlement-note { font-size: 12px; }

  .lp-section { padding-top: 88px; padding-bottom: 88px; }
  .lp-section.lp-beige:has(.lp-scenes) { padding: 72px 0; }
  .lp-h2 { margin-bottom: 40px; font-size: 36px; line-height: 1.3; }
  .lp-h2-tight { margin-bottom: 8px; }
  .lp-sub { margin-bottom: 32px; }

  .lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .lp-step { gap: 16px; }
  .lp-step .lp-mock { order: -1; margin-left: 0; height: 280px; border-radius: 20px; padding: 28px 28px 0; }
  .lp-step .lp-mock-screen { height: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px; }
  .lp-step h3 { font-size: 20px; }

  .lp-scenes { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .lp-scene { border-radius: 20px; padding: 28px; }
  .lp-scene h3 { font-size: 22px; }

  .lp-features-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 72px; align-items: start; }
  .lp-features-wrap .lp-h2 { margin-bottom: 0; }
  .lp-features li { padding-top: 18px; padding-bottom: 18px; }
  .lp-features li::before { top: 30px; }
  .lp-features h3 { font-size: 19px; }

  body.lp .lp-compare-table.pc { display: grid; }

  .lp-final { padding: 96px 0 40px; text-align: center; }
  .lp-final-bird { width: 88px; height: 88px; margin: 0 auto 20px; }
  .lp-final-h2 { font-size: 40px; line-height: 1.3; }
  .lp-final-sub { margin-bottom: 32px; font-size: 18px; }
  body.lp .lp-button-light { display: inline-flex; height: 56px; padding: 0 40px; font-size: 18px; }
  .lp-footer-links { justify-content: center; gap: 24px; margin-top: 72px; }
}

/* マスコット：ホバーで跳ねる（動きを減らす設定の人には動かさない） */
@keyframes lp-bird-hop {
  0%, 100% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-12%) rotate(-8deg); }
  55% { transform: translateY(0) rotate(4deg); }
  75% { transform: translateY(-4%) rotate(-2deg); }
}
.lp-photo-bird, .lp-final-bird, .lp-logo-icon, .lp-footer-logo svg, .lp-legal-logo svg { transform-origin: 50% 90%; }
/* スクロールに合わせて少しだけ浮いて首をかしげる。ホバー中はホバーの動きが優先（詳細度が高い） */
@keyframes lp-bird-scroll {
  from { transform: translateY(6px) rotate(4deg); }
  to { transform: translateY(-6px) rotate(-4deg); }
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .lp-photo-bird, .lp-final-bird { animation: lp-bird-scroll linear both; animation-timeline: view(); }
  }
}
@media (prefers-reduced-motion: no-preference) {
  .lp-visual:hover .lp-photo-bird,
  .lp-final-bird:hover,
  .lp-logo:hover .lp-logo-icon,
  .lp-footer-logo:hover svg,
  .lp-legal-logo:hover svg { animation: lp-bird-hop .8s ease-in-out infinite; }
}

/* ファーストビューの作成ボタン（作成は /groups/new の別ページ） */
.lp-hero-cta { display: flex; flex-direction: column; gap: 10px; }
body.lp .lp-button-hero { display: flex; align-items: center; justify-content: center; height: 56px; border-radius: 14px; background: #fff; color: var(--lp-primary); font-size: 18px; font-weight: 700; text-decoration: none; }
body.lp .lp-button-hero:hover { background: var(--lp-primary-soft); }
.lp-hero-cta p { font-size: 14px; color: var(--lp-on-dark-note); text-align: center; }

/* 「あーーーーー！！！」からの「もう、覚えなくていい。」 */
.lp-relief { padding: 44px 20px 40px; }
.lp-relief-chat { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.lp-bubble { background: #fff; border-radius: 18px; border-top-left-radius: 6px; padding: 10px 16px; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }
.lp-bubble:nth-child(2) { margin-left: 16px; opacity: .9; }
.lp-bubble:nth-child(3) { margin-left: 32px; opacity: .8; }
.lp-bubble:nth-child(4) { margin-left: 48px; opacity: .7; }
.lp-shout { margin: 10px 0 0 24px; font-size: 34px; line-height: 1.1; font-weight: 700; color: var(--lp-primary); letter-spacing: .02em; transform: rotate(-3deg); }
.lp-relief-answer { display: flex; gap: 14px; align-items: flex-start; margin-top: 28px; }
.lp-relief-avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--lp-primary); display: flex; align-items: center; justify-content: center; }
.lp-relief-avatar svg { width: 48px; height: 48px; }
.lp-relief-h2 { margin-bottom: 4px; font-size: 20px; line-height: 1.4; font-weight: 700; }
.lp-relief-answer p { color: var(--lp-text-weak); }

/* グループ作成ページ */
.lp-create { min-height: 100vh; padding: 0 20px 48px; }
.lp-create-h1 { margin: 24px 0 8px; font-size: 28px; line-height: 1.35; font-weight: 700; }
.lp-create-sub { margin-bottom: 24px; color: var(--lp-on-dark); }

@media (min-width: 1024px) {
  .lp-hero-cta { max-width: 460px; }
  .lp-relief { padding: 72px 0; }
  .lp-relief-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
  .lp-bubble { font-size: 17px; }
  .lp-shout { font-size: 44px; }
  .lp-relief-answer { gap: 20px; margin-top: 0; }
  .lp-relief-avatar { width: 104px; height: 104px; }
  .lp-relief-avatar svg { width: 80px; height: 80px; }
  .lp-relief-h2 { font-size: 28px; }
  .lp-create .lp-inner { max-width: 620px; }
  .lp-create-h1 { margin-top: 48px; font-size: 36px; }
}
