/* ================================================================
 * Pricing Simulation Page  （Figma: 193:603 / 334:405）
 * ============================================================== */

/* ---------------- ① Page Hero (1920×300) ---------------- */
.sim-hero {
  position: relative;
  height: 300px;
  /* PC: Figma書き出しの 1920×1280 画像 */
  background: linear-gradient(rgba(34,34,34,.5), rgba(34,34,34,.5)),
              url("../img/page-mv-sim.jpg") center/cover no-repeat,
              #222;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
@media (max-width: 767px) {
  /* SP: 低解像度ソース（現状維持） */
  .sim-hero {
    background: linear-gradient(rgba(34,34,34,.5), rgba(34,34,34,.5)),
                url("../img/page-mv-sim-sp.jpg") center/cover no-repeat,
                #222;
  }
}
.sim-hero__inner { padding: 0 24px; }
.sim-hero__title {
  font-family: var(--font-jp-heading);
  font-weight: var(--fw-black);
  font-size: 42px;
  line-height: 1.3;
  text-shadow: var(--shadow-text);
  letter-spacing: .06em;
}
.sim-hero__en {
  display: block;
  margin-top: 10px;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700; /* Inter Bold */
  font-size: 14px;
  letter-spacing: .5em;
  opacity: .95;
}
@media (max-width: 767px) {
  .sim-hero { height: 180px; }
  .sim-hero__title { font-size: 26px; }
  .sim-hero__en { font-size: 11px; letter-spacing: .35em; }
}

/* ---------------- ② Intro ---------------- */
.sim-intro {
  padding-block: 80px 40px;
  /* スティッキーヘッダー(.site-header 約70px)の高さ分、自動スクロール時に余白を確保 */
  scroll-margin-top: 90px;
}
.sim-intro__inner {
  text-align: center;
  font-family: var(--font-jp-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-base);
  line-height: 1.8;
  color: #1D99B2;
  max-width: 820px;
  margin-inline: auto;
  padding: 0 24px;
}
@media (max-width: 767px) {
  .sim-intro { padding-block: 40px 24px; }
  .sim-intro__inner { font-size: var(--fs-body); text-align: left; }
  .sim-intro__inner br { display: none; }
}

/* ---------------- ③ Main (input + result) ---------------- */
.sim-main {
  padding-block: 0 80px;
  /* スティッキーヘッダー(.site-header 約70px)の高さ分、自動スクロール時に余白を確保 */
  scroll-margin-top: 90px;
}
.sim-main__inner {
  display: grid;
  /* 左：フォーム 395px固定 ／ 右：結果カード（残り幅）
     viewport 1024〜1047 でも右カラムが破綻しないよう 1fr にする */
  grid-template-columns: 395px minmax(0, 1fr);
  gap: 30px;
  align-items: stretch; /* 左右カラムの高さを揃える */
  max-width: 1000px;
  margin-inline: auto;
  padding: 0 24px;
}
@media (max-width: 1023px) {
  .sim-main__inner {
    grid-template-columns: 1fr;
    max-width: 575px;
    gap: 24px;
  }
}

/* ---------------- Form card（トップページ .sim-card と完全一致） ---------------- */
.sim-card {
  width: 395px;
  max-width: 100%;
  background: #f5f5f5;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(34, 34, 34, 0.25);
  overflow: hidden;
}
.sim-card__title {
  margin: 0;
  padding: 20px 30px;
  background: linear-gradient(90deg, #1fa6c1 0%, #006d83 100%);
  color: #fff;
  font-family: var(--font-jp-heading);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.8;
  text-align: center;
}
.sim-card__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 30px 30px;
}
.sim-card__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 0.5px solid #d9d9d9;
  border-radius: 5px;
  box-shadow: 0 4px 0 #d9d9d9;
  min-height: 72px;
  overflow: hidden;
}
.sim-card__row label {
  flex: 0 0 80px;
  font-family: var(--font-jp-body);
  font-weight: 500;
  font-size: 14px;
  color: #222;
  white-space: nowrap;
}
.sim-card__input {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sim-card__input select,
.sim-card__input input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #f9f9f9;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  color: #222;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
@media (max-width: 767px) {
  /* iOSでinput fontが16px未満だとフォーカス時に自動ズームで画面がゆれるのを防止 */
  .sim-card__input select,
  .sim-card__input input { font-size: 16px; }
}
.sim-card__input input[type="number"]::-webkit-inner-spin-button,
.sim-card__input input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}
.sim-card__input--select {
  position: relative;
}
.sim-card__input--select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #1fa6c1;
  border-bottom: 2px solid #1fa6c1;
  transform: translateY(-75%) rotate(45deg);
  pointer-events: none;
}
.sim-card__input select {
  background: #fff;
  padding-right: 32px;
}
.sim-card__suffix {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 14px;
  color: #666;
  white-space: nowrap;
}
.sim-card__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 295px;
  padding: 20px 60px;
  margin: 0 auto;
  background: linear-gradient(90deg, #1fa6c1 0%, #006d83 100%);
  border: 0;
  border-radius: 50px;
  color: #fff;
  font-family: var(--font-jp-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 0.15s var(--ease),
    filter 0.15s var(--ease);
  white-space: nowrap;
}
.sim-card__submit:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.sim-card__submit:active {
  transform: translateY(1px);
}
.sim-card__submit-arrow {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* ---------------- Result card (575×517) ---------------- */
/* 外側：青グラデーション枠（Figma: 193:638） */
.sim-result {
  width: 100%;
  max-width: 100%;
  min-height: 517px;
  background: linear-gradient(to right, #1fa6c1 0%, #006d83 100%);
  border-radius: 10px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  align-self: stretch; /* grid cell を満たす */
}

/* hidden属性を display:flex 等で上書きしないよう明示 */
.sim-result [hidden] { display: none !important; }

/* 初期表示（入力前）── グラデ背景の上に白文字＋点線枠 */
.sim-result__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  font-family: var(--font-jp-heading);
  font-weight: var(--fw-bold);
  font-size: 17px;
  line-height: 2;
  letter-spacing: .03em;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  padding: 40px 24px;
  background: transparent;
}
.sim-result__empty p { margin: 0; }

/* 結果表示 ── 白カード化（Figma: 193:639）
   トップから遷移してきた直後はふわっとフェードイン */
.sim-result__filled {
  background: var(--color-white);
  border-radius: 10px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s var(--ease, ease), transform .45s var(--ease, ease);
}
.sim-result__filled.is-shown {
  opacity: 1;
  transform: translateY(0);
}

/* サマリー行（3項目） */
.sim-result__summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 30px;
  font-family: var(--font-jp-body);
  font-weight: var(--fw-medium);
  font-size: 16px;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sim-result__summary li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sim-result__summary img { width: 20px; height: 20px; flex-shrink: 0; }
.sim-result__summary strong {
  margin: 0 4px;
  color: var(--color-text);
  font-weight: var(--fw-bold);
}

/* プランラベル ＼ あなたに合うプランは ／ */
.sim-result__label {
  text-align: center;
  font-family: var(--font-jp-body);
  font-weight: var(--fw-bold);
  font-size: 18px;
  color: var(--color-primary-darker);
  margin: 0;
}

/* プランカード本体 */
.sim-result__card {
  width: 100%;
  box-sizing: border-box;
  animation: simFadeIn var(--dur-slow) var(--ease);
}

/* ── プラン別カラー（pricing-config の theme_color に対応） ── */
.sim-result__card[data-plan-theme="short"]  .sim-result__head { background: var(--color-primary-darker); }   /* #007c91 */
.sim-result__card[data-plan-theme="middle"] .sim-result__head { background: var(--color-primary); }          /* #1fa6c1 */
.sim-result__card[data-plan-theme="long"]   .sim-result__head { background: var(--color-accent-orange-b); }  /* #f29f05 */

/* プラン別：価格セルのボーダーカラー */
.sim-result__card[data-plan-theme="short"]  .sim-result__price-cell { border-color: var(--color-primary-darker); }
.sim-result__card[data-plan-theme="middle"] .sim-result__price-cell { border-color: var(--color-primary); }
.sim-result__card[data-plan-theme="long"]   .sim-result__price-cell { border-color: var(--color-accent-orange-b); }

/* プラン別：サブプランpillの文字色 */
.sim-result__card[data-plan-theme="short"]  .sim-result__plan-sub { color: var(--color-primary-darker); }
.sim-result__card[data-plan-theme="middle"] .sim-result__plan-sub { color: var(--color-primary); }
.sim-result__card[data-plan-theme="long"]   .sim-result__plan-sub { color: var(--color-accent-orange-b); }

/* プラン名カラーヘッダー（Figma: 193:666 / h:131, py:30, gap:16, rounded-t:10） */
.sim-result__head {
  background: var(--color-primary-darker);
  color: var(--color-white);
  padding: 30px 16px;
  text-align: center;
  border-radius: 10px 10px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 131px;
  box-sizing: border-box;
}
.sim-result__plan {
  font-family: var(--font-jp-heading);
  font-weight: var(--fw-black);
  font-size: 32px;
  line-height: 1;
  margin: 0;
  color: var(--color-white);
}
.sim-result__plan-sub {
  display: inline-block;
  background: var(--color-white);
  color: var(--color-primary-darker);
  padding: 10px 20px;
  border-radius: 50px;
  font-family: var(--font-jp-heading);
  font-weight: var(--fw-black);
  font-size: 16px;
  line-height: 1;
}

/* 価格ブロック（2カラム） */
.sim-result__prices {
  display: grid;
  /* 左：1泊単価（4桁）／右：合計（最大6桁）。
     6桁時に右セルの数字と「／〇〇泊」が詰まらないよう右セルを広めに取る */
  grid-template-columns: 0.85fr 1.15fr;
  width: 100%;
  box-sizing: border-box;
}
.sim-result__price-cell {
  padding: 16px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  background: var(--color-white);
  border: 2px solid var(--color-primary-darker);
  border-top: 0;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
/* 左セル：左下だけ角丸、右ボーダーはなし（中央の仕切りは次セルの左ボーダーで表現） */
.sim-result__price-cell:first-child {
  border-right: 0;
  border-radius: 0 0 0 10px;
}
/* 右セル：右下だけ角丸 */
.sim-result__price-cell:last-child {
  border-radius: 0 0 10px 0;
}
.sim-result__price {
  font-family: var(--font-en);
  font-weight: 900;
  color: #e01b1f;
  line-height: 1.5;
  display: inline-flex;
  align-items: flex-end;
  white-space: nowrap;
  /* トップページ(.plan-row__price) と同一：drop-shadow で影、stroke で白フチ */
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.25));
}
/* ¥ / , / 数字 — stroke fill の paint-order で背面に白フチを描画 */
.sim-result__price-sym,
.sim-result__price-num {
  color: #e01b1f;
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
  text-shadow: none;
  line-height: 1.5;
}
.sim-result__price-sym { font-size: 24px; }
.sim-result__price-num { font-size: 32px; }
.sim-result__unit {
  font-family: var(--font-jp-body);
  font-weight: var(--fw-medium);
  font-size: 16px;
  color: #222;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 2px;
}

/* 寝具（布団）のご案内（白カード内・結果下部） */
.sim-result__futon {
  margin: 0;
  padding: 12px 14px;
  background: #fff6e5;
  border: 1px solid var(--color-accent-orange-b, #f29f05);
  border-radius: 8px;
  color: #8a5a00;
  font-family: var(--font-jp-body);
  font-weight: var(--fw-bold);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}
.sim-result__futon[hidden] { display: none; }

/* 注意書き（白カード外・グラデーション背景上） */
.sim-result__note {
  text-align: left;
  font-family: var(--font-jp-body);
  font-weight: var(--fw-medium);
  font-size: 12px;
  color: var(--color-white);
  line-height: 1.5;
  margin: 0;
  padding: 0 4px;
}

/* エラー */
.sim-result__error {
  background: #ffe3e3;
  color: #b71c1c;
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: var(--fw-bold);
  text-align: center;
  margin-top: 16px;
}

@keyframes simFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------------- ④ カンタン申込 CTA（トップページと共通：top.css と完全同期） ---------------- */
.cta-apply {
  padding: 50px 50px;
  display: flex;
  justify-content: center;
  background: #fff;
}
.cta-apply__card {
  position: relative;
  width: 100%;
  max-width: 1820px;
  height: 481px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  isolation: isolate;
}
.cta-apply__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #ffd447;
  /* 市松模様（チェッカーパターン）— 2枚の45度グラデを重ねて格子化 */
  background-image:
    linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.35) 25%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.35) 75%
    ),
    linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.35) 25%,
      transparent 25%,
      transparent 75%,
      rgba(255, 255, 255, 0.35) 75%
    );
  background-size: 120px 120px;
  background-position:
    0 0,
    60px 60px;
}
.cta-apply__content {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: 50px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 50px;
}

/* ---- タイトル（画像書き出し） ---- */
.cta-apply__title {
  margin: 0;
  padding: 0;
  text-align: center;
  line-height: 0;
}
.cta-apply__title img {
  display: inline-block;
  width: auto;
  height: 104px; /* Figma実寸：1148×208 @2x → 574×104 */
  max-width: 100%;
}

/* ---- リード ---- */
.cta-apply__lead {
  margin: 0;
  font-family: var(--font-jp-body);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.5;
  color: #006d83;
  text-align: center;
}

/* ---- ボタン ---- */
.cta-apply__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 295px;
  padding: 20px 60px;
  background: linear-gradient(90deg, #1fa6c1 0%, #006d83 100%);
  border-radius: 50px;
  color: #fff;
  font-family: var(--font-jp-heading);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    filter 0.15s var(--ease);
}
.cta-apply__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  opacity: 1;
}
.cta-apply__btn-arrow {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* ---- イラスト ---- */
.cta-apply__illust {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.cta-apply__illust--left {
  left: 100px;
  top: 189px;
  width: 214px;
  height: 292px;
}
.cta-apply__illust--right {
  right: 121px;
  bottom: 0;
  width: 301px;
  height: 280px;
}

@media (max-width: 767px) {
  .cta-apply {
    padding: 0 20px 40px;
  }
  .cta-apply__card {
    height: auto;
    border-radius: 12px;
  }
  .cta-apply__bg {
    background-size: 60px 60px;
    background-position:
      0 0,
      30px 30px;
  }
  /* SPではカード下部に左右イラスト並べて表示（男女とも同サイズに揃える） */
  .cta-apply__card {
    padding-bottom: 170px;
  }
  .cta-apply__content {
    padding-bottom: 60px !important;
  }
  .cta-apply__illust {
    position: absolute;
    top: auto;
    bottom: 0;
    height: 160px;
    object-fit: contain;
    object-position: center bottom;
    z-index: 2;
  }
  .cta-apply__illust--left {
    left: -30px;
    right: auto;
  }
  .cta-apply__illust--right {
    right: -50px;
    left: auto;
  }
  .cta-apply__content {
    padding: 40px 20px;
    gap: 24px;
  }
  .cta-apply__title img {
    height: auto;
    max-height: 64px;
    width: auto;
  }
  .cta-apply__lead {
    font-size: 14px;
    line-height: 1.7;
  }
  .cta-apply__lead br {
    display: none;
  }
  .cta-apply__btn {
    width: 100%;
    max-width: 295px;
    padding: 16px 20px;
    font-size: 14px;
  }
  .cta-apply__btn-arrow {
    width: 24px;
    height: 24px;
  }
}

/* ---------------- ≤ 767: Mobile fallback ---------------- */
@media (max-width: 767px) {
  .sim-main { padding-block: 0 48px; }
  .sim-main__inner { padding: 0 16px; }

  /* フォームカード */
  .sim-card { width: 100%; }

  /* 結果カード */
  .sim-result { padding: 16px; min-height: 0; gap: 16px; }
  .sim-result__empty { padding: 32px 20px; font-size: 15px; line-height: 1.9; }
  .sim-result__filled {
    padding: 16px;
    gap: 16px;
    /* SP: ヘッダー(58px)分のスクロール余白。トップ遷移時、結果カード上部が隠れないように */
    scroll-margin-top: 70px;
  }
  .sim-result__summary { gap: 6px 14px; font-size: 13px; justify-content: flex-start; }
  .sim-result__summary img { width: 16px; height: 16px; }
  .sim-result__label { font-size: 16px; }
  .sim-result__head { padding: 22px 12px; min-height: 0; gap: 12px; }
  .sim-result__plan { font-size: 24px; }
  .sim-result__plan-sub { font-size: 13px; padding: 6px 16px; }
  .sim-result__price-cell { padding: 14px 6px; gap: 2px; }
  .sim-result__price-sym { font-size: 18px; -webkit-text-stroke: 2px #fff; }
  .sim-result__price-num { font-size: 24px; -webkit-text-stroke: 2px #fff; }
  .sim-result__unit { font-size: 12px; }
  .sim-result__note br { display: none; }
}
