/* =========================================================================
   fstep-inner.css — 内側ページ共通スタイル（LPトーン）
   -------------------------------------------------------------------------
   LP（css/lp.css）と同じ和モダン・生成り基調のデザイントークンを共有し、
   intake / persona-select / consultation の 3 画面を「同じサービス」に見せる。
   lp.css へは直接依存させず、必要なトークンをここへコピーして独立管理する。
   ========================================================================= */

:root {
  /* --- LP から移植したデザイントークン --- */
  --cream: #fff7ec;
  --ivory: #fffaf2;
  --paper: #f8ecd9;
  --peach: #f7c7b2;
  --peach-strong: #e06f57;
  --orange: #f2a13a;
  --navy: #17375f;
  --ink: #243047;
  --muted: #6e6470;
  --line: rgba(126, 87, 55, 0.16);
  --shadow: 0 22px 50px rgba(132, 86, 47, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max: 1180px;

  /* 内側ページで多用する明朝見出し用フォント */
  --font-serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --font-sans:
    "Hiragino Sans", "Yu Gothic", "YuGothic", "Noto Sans JP", system-ui,
    sans-serif;
}

/* === 基本リセット & ボディ === */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #fff8ee 0%, #fff3e8 48%, #fff8ef 100%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  line-height: 1.75;
  overflow-x: hidden;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
}

/* === レイアウト === */
.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
main {
  padding-bottom: 48px;
}

/* === ヘッダー（LP の site-header トーン） === */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 250, 242, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(216, 132, 90, 0.14);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 72px;
  padding: 12px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 55, 95, 0.22);
  border-radius: 50%;
  color: var(--peach-strong);
  background: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  overflow: hidden;
}
.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--navy);
}
.brand-sub {
  margin-top: 1px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ヘッダー右側の認証表示（header-auth.js が注入するリンクを LP トーンで上書き）。
   テキストリンクのままだと狭い画面で「ログ/イン」のように文字の途中で折り返し、
   タップ領域も小さく押しづらかったため、ピル型ボタンにする。
   ログイン＝ゴースト / 会員登録＝塗り（主導線）。区切りの「/」はボタン化に伴い非表示。 */
#headerAuth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0; /* ブランド名側に押されて潰れないようにする */
}
#headerAuth .headerAuthLink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  border: 1px solid rgba(23, 55, 95, 0.22);
  background: rgba(255, 255, 255, 0.7);
  transition:
    background 0.18s ease,
    opacity 0.18s ease;
}
#headerAuth .headerAuthLink:hover {
  background: rgba(224, 111, 87, 0.1);
}
/* 会員登録は塗りボタンで主導線として目立たせる */
#headerAuth .headerAuthLink[href="/register.html"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 8px 18px rgba(23, 55, 95, 0.2);
}
#headerAuth .headerAuthLink[href="/register.html"]:hover {
  background: var(--navy);
  opacity: 0.88;
}
#headerAuth .headerAuthSep {
  display: none;
}
/* ログイン中表示（{nickname} さん + ログアウト） */
#headerAuth .headerAuthWrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
#headerAuth .headerAuthName {
  color: var(--ink);
  white-space: nowrap;
  max-width: 10em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === 見出し部品 === */
.eyebrow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  color: var(--peach-strong);
  font-weight: 800;
  letter-spacing: 0.2em;
  font-size: 12px;
  margin: 0 0 14px;
  /* iOS Safari はflex内の裸テキストノードの幅計算に癖があり「今日の/一歩を/…」と
     縦に折り返してしまうため、折り返し自体を禁止する（2026-07-13 実機で確認） */
  white-space: nowrap;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  flex: 0 0 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 111, 87, 0.6));
}
.eyebrow::after {
  background: linear-gradient(90deg, rgba(224, 111, 87, 0.6), transparent);
}
h1.title {
  text-align: center;
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy);
  font-size: clamp(26px, 3.6vw, 40px);
  letter-spacing: 0.12em;
  line-height: 1.5;
}
.leadCopy {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.9;
  font-size: 14px;
  margin: 0 0 32px;
}

/* === ボタン（LP の丸みのあるピル UI） === */
button {
  font-family: var(--font-sans);
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 12px 22px;
  min-height: 44px;
  color: #fff;
  background: linear-gradient(135deg, #ef8a6a, #d94d46);
  box-shadow:
    0 14px 28px rgba(211, 83, 70, 0.22),
    inset 0 1px rgba(255, 255, 255, 0.45);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}
button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 18px 34px rgba(211, 83, 70, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.45);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
button.ghost {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(23, 55, 95, 0.16);
  box-shadow: none;
}
button.ghost:hover:not(:disabled) {
  background: #fff;
  box-shadow: 0 10px 20px rgba(132, 86, 47, 0.1);
}
button.danger {
  color: #fff;
  background: linear-gradient(135deg, #e2685f, #c0392b);
  box-shadow: 0 14px 28px rgba(192, 57, 43, 0.22);
}
/* 会話終了後に出す「もう一度話す」導線。前向きな緑で次の一手として目立たせる。 */
button.restart {
  color: #fff;
  background: linear-gradient(135deg, #4caf6e, #2e9e5b);
  box-shadow: 0 14px 28px rgba(46, 158, 91, 0.22);
}

/* LP と同名の .btn 系（内側でも共通利用できるよう定義） */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  min-height: 56px;
  padding: 0 28px;
  color: #fff;
  background: linear-gradient(135deg, #ef8a6a, #d94d46);
  box-shadow:
    0 18px 34px rgba(211, 83, 70, 0.28),
    inset 0 1px rgba(255, 255, 255, 0.45);
}
.btn-secondary {
  min-height: 56px;
  padding: 0 24px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(23, 55, 95, 0.14);
}

/* === intake フォーム === */
.intakeCard {
  width: min(480px, 100%);
  padding: 34px 36px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(216, 132, 90, 0.18);
  box-shadow: var(--shadow);
}
.fieldGroup {
  margin-bottom: 22px;
}
.fieldLabel {
  display: block;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--navy);
  margin-bottom: 8px;
}
.fieldInput {
  width: 100%;
  padding: 13px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.fieldInput::placeholder {
  color: rgba(110, 100, 112, 0.55);
}
.fieldInput:focus {
  border-color: var(--peach-strong);
  box-shadow: 0 0 0 3px rgba(224, 111, 87, 0.14);
}
select.fieldInput {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2317375f' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
#intakeError {
  display: none;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(217, 83, 70, 0.1);
  border: 1px solid rgba(217, 83, 70, 0.3);
  color: #a5342b;
  font-size: 13px;
  line-height: 1.7;
}
.submitBtn {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  letter-spacing: 0.14em;
}

/* === persona-select キャラクターカード（LP の character-card トーン） === */
/* accent 色は persona-selector.js が --card-accent / --card-accent-bg に注入する */
.personaGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 22px;
}
.personaCard {
  --card-accent: var(--peach-strong);
  --card-accent-bg: rgba(224, 111, 87, 0.08);
  cursor: pointer;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(216, 132, 90, 0.18);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.personaCard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 60% at 50% -10%,
    var(--card-accent),
    transparent 62%
  );
  opacity: 0.1;
  pointer-events: none;
}
.personaCard:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent);
  box-shadow: 0 24px 56px rgba(132, 86, 47, 0.18);
}
.personaPortrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-size: cover;
  background-position: top center;
  border-radius: 16px;
  border: 1px solid rgba(216, 132, 90, 0.2);
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(132, 86, 47, 0.14);
}
.personaCard .personaName {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--navy);
  margin-bottom: 2px;
}
.personaCard .personaKana {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-bottom: 10px;
}
.personaCard .personaTitle {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--card-accent);
  margin-bottom: 8px;
}
.personaCard .personaDesc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

/* === レスポンシブ === */
@media (max-width: 760px) {
  .header-inner {
    gap: 14px;
    min-height: 64px;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .brand-title {
    font-size: 16px;
  }
  /* 認証ピルボタンはスマホでは少しコンパクトに（タップ領域38pxは維持） */
  #headerAuth {
    gap: 6px;
    /* ゲストバッジ（登録して残高を守る）が付くと1行に収まらず横はみ出しするため、
       折り返しを許可してバッジを2段目（右寄せ）に落とす（2026-07-13 実機で確認）。
       min-width: 0 はflexアイテムの自動最小幅（=1行分の幅）を解除するのに必須 */
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 6px;
    min-width: 0;
    /* ベースの flex-shrink: 0（潰れ防止）を解除しないと縮まず折り返せない */
    flex-shrink: 1;
  }
  #headerAuth .headerAuthLink {
    min-height: 38px;
    padding: 0 13px;
    font-size: 12.5px;
  }
  .intakeCard {
    padding: 26px 20px;
  }
}
