/* みらい樹倶楽部 会員ページ
   方向性：kgen.co.jp の骨格 ＋ アイソメトリック・フラットベクターのメインビジュアル
           ＋ モダンな余白と細い罫線。装飾は足さず、余白と型で見せる。
   フォント：Noto Sans JP のみ（見出しの英字も同フォントで字間を開けて使う） */

:root {
  /* 地色：生成り〜オフホワイト */
  --bg: #fbfaf7;
  --bg-alt: #f2f6ee;      /* メインビジュアルの草地に寄せた淡い緑 */
  --sky: #e4f0f4;         /* メインビジュアルの空 */
  --card: #ffffff;

  /* 文字：ソフトなダークグリーン */
  --ink: #1f2e28;
  --ink-soft: #5d6d65;
  --ink-mute: #8a978f;

  /* アクセント：深いティールグリーン（既存スライドの指定色） */
  --accent: #1b7a68;
  --accent-hover: #15614f;
  --accent-wash: #e8f2ef;

  /* 罫線は極細・低コントラスト */
  --line: #e5e8e1;
  --line-strong: #d3d9cf;

  /* 最下部のダーク地 */
  --dark: #16241f;
  --dark-ink: #e6ece8;

  --radius: 14px;
  --radius-lg: 22px;
  --header-h: 64px;
  --shell: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* 追従ヘッダー / 固定バーの分だけアンカー位置を下げる */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  font-feature-settings: "palt" 1;   /* 日本語の詰め。モダンな見え方に効く */
  letter-spacing: 0.02em;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }

/* ============================================================
   共通パーツ
   ============================================================ */

/* 見出し：英語大見出し ＋ 葉アイコン ＋ 日本語小見出し */
.sec-head { margin-bottom: 40px; }

.sec-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.sec-eyebrow::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--accent);
  /* 葉のかたち（CSSのみ・画像を増やさない） */
  -webkit-mask: radial-gradient(circle at 0% 100%, transparent 63%, #000 64%) no-repeat,
                radial-gradient(circle at 100% 0%, transparent 63%, #000 64%) no-repeat;
  mask: radial-gradient(circle at 0% 100%, transparent 63%, #000 64%) no-repeat,
        radial-gradient(circle at 100% 0%, transparent 63%, #000 64%) no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.sec-title {
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.sec-lead {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* 角丸ピル型ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn:disabled { background: var(--line-strong); cursor: not-allowed; transform: none; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--line-strong); }
.btn--ghost:hover { background: var(--accent-wash); }
.btn--block { width: 100%; justify-content: center; }
.btn__arrow { font-size: 17px; line-height: 1; }

/* カード：影を使わず細罫で仕切る */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}

/* 数値などの「現在の状態」表示 */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.stat {
  background: var(--card);
  padding: 22px 20px;
}

.stat__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-bottom: 6px;
}

.stat__value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.stat__value small { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
.stat__note { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; line-height: 1.6; }

.notice {
  background: var(--accent-wash);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

/* ============================================================
   ログイン画面
   ============================================================ */

#screen-auth {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(60rem 32rem at 50% -20%, var(--sky), transparent 70%),
    var(--bg);
}

.auth-box { width: 100%; max-width: 420px; text-align: center; }
.auth-mark { font-size: 13px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 18px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.auth-lead { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 32px; }

.field { text-align: left; margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }

.field input {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;   /* iOS の自動ズーム防止のため16px以上 */
  color: var(--ink);
  background: var(--card);
}

.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
/* 桁数が増えても収まるよう、字間は控えめにして中央寄せにする */
.field input.otp { letter-spacing: 0.32em; text-align: center; font-size: 21px; font-weight: 700; }
.field input.otp::placeholder { letter-spacing: normal; font-size: 15px; font-weight: 400; color: var(--ink-mute); }

.auth-msg { font-size: 13.5px; margin-top: 16px; min-height: 20px; }
.auth-msg.is-error { color: #b4483c; }
.auth-msg.is-ok { color: var(--accent); }
.auth-back { margin-top: 20px; font-size: 13.5px; color: var(--ink-mute); background: none; border: none; cursor: pointer; font-family: inherit; text-decoration: underline; }

/* ============================================================
   追従ヘッダー（PC）
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header__brand { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.site-nav a:hover { background: var(--accent-wash); color: var(--accent); }

.site-header__logout {
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-mute);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 4px;
  white-space: nowrap;
}

.site-header__logout:hover { color: var(--ink); }

/* ============================================================
   ② 応援チケットの配分
   ============================================================ */

.alloc { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }

.alloc-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 28px;
  background: var(--card);
}

.alloc-row + .alloc-row { border-top: 1px solid var(--line); }
.alloc-row__body { flex: 1; min-width: 0; }
.alloc-row__name { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.alloc-row__desc { font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); }

.alloc-row__link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.alloc-row__link:hover { text-decoration: underline; }

/* 枚数の増減。数字の入力ではなく増減ボタンにして、合計が崩れないようにする */
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }

.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--accent);
  font-family: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.stepper button:hover:not(:disabled) { background: var(--accent-wash); border-color: var(--accent); }
.stepper button:disabled { color: var(--line-strong); cursor: not-allowed; }

.stepper__count {
  min-width: 46px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.alloc-msg { font-size: 13.5px; margin: 18px 0 0; min-height: 20px; color: var(--ink-soft); }
.alloc-msg.is-ok { color: var(--accent); font-weight: 700; }
.alloc-msg.is-error { color: #b4483c; }
.alloc-empty { padding: 32px 28px; background: var(--card); color: var(--ink-mute); font-size: 14px; }

.alloc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

@media (max-width: 640px) {
  .alloc-row { flex-direction: column; align-items: stretch; gap: 18px; padding: 22px; }
  .stepper { justify-content: flex-end; }
  .alloc-actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   ① 歓迎（メインビジュアル）
   ============================================================ */

.hero { background: var(--bg); overflow: hidden; }

/* 空色は画像の背面だけに敷く（本文は生成り地に置く） */
.hero__media { position: relative; background: var(--sky); }

.hero__media img {
  width: 100%;
  height: clamp(220px, 34vw, 420px);
  object-fit: cover;
  object-position: center 62%;   /* 空を切って集落を見せる */
}

/* padding のショートハンドを使うと .shell の左右余白（24px）を打ち消すので、
   縦方向だけを指定すること */
.hero__body { padding-top: 56px; padding-bottom: 8px; }
.hero__eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent); margin-bottom: 16px; }

.hero__title {
  font-size: clamp(26px, 4.6vw, 40px);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}

.hero__text { max-width: 640px; color: var(--ink-soft); font-size: 15.5px; }
.hero__text p + p { margin-top: 20px; }

/* ============================================================
   セクション
   ============================================================ */

.section { padding: 80px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: none; }
.section--tint { background: var(--bg-alt); border-top-color: transparent; }

.event {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
}

.event__body { padding: 32px; }
.event__name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.event__subtitle { font-size: 14px; font-weight: 500; color: var(--accent); margin-bottom: 16px; line-height: 1.7; }
.event__lead { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 24px; }

.event__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 26px;
}

.event__meta dt { font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink-mute); margin-bottom: 5px; }
.event__meta dd { font-size: 15px; font-weight: 500; }
.event__meta .price-member { color: var(--accent); font-weight: 700; }

/* ============================================================
   ⑤お問い合わせ・⑥退会・フッター（最下部のみダーク地）
   ============================================================ */

.site-footer { background: var(--dark); color: var(--dark-ink); padding: 72px 0 100px; }
.site-footer .sec-eyebrow { color: #7fc9b4; }
.site-footer .sec-eyebrow::before { background: #7fc9b4; }
.site-footer .sec-title { color: #fff; }
.site-footer .sec-lead { color: rgba(230, 236, 232, 0.72); }
.site-footer .btn { background: #fff; color: var(--dark); }
.site-footer .btn:hover { background: #dfe9e4; }

/* ログアウト：見つけやすいように輪郭のあるボタンで置く */
.footer-signout { margin-top: 56px; }

.footer-signout button {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dark-ink);
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 11px 28px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.footer-signout button:hover { background: rgba(255, 255, 255, 0.09); }

/* ⑥ご退会について：十分な余白を空けた小さなテキストリンク1行 */
.withdraw { margin-top: 52px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); }

.withdraw button {
  font-family: inherit;
  font-size: 12.5px;
  color: rgba(230, 236, 232, 0.5);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.withdraw button:hover { color: rgba(230, 236, 232, 0.85); }

/* ============================================================
   スマホ：下部固定バー（3項目）＋ 右下トップ戻りボタン
   ============================================================ */

.mobile-bar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-bar__inner { display: grid; grid-template-columns: repeat(3, 1fr); }

.mobile-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  text-decoration: none;
}

.mobile-bar a:active { color: var(--accent); }
.mobile-bar__icon { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.to-top {
  display: none;
  position: fixed;
  right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 61;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 3px 14px rgba(31, 46, 40, 0.2);
}

@media (max-width: 860px) {
  .site-nav { display: none; }
  .mobile-bar { display: block; }
  .to-top { display: flex; }
  .section { padding: 60px 0; }
  .card, .event__body { padding: 24px; }
  .hero__body { padding-top: 40px; padding-bottom: 4px; }
  .site-footer { padding: 60px 0 110px; }
  .withdraw { margin-top: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
