/* ==========================================================================
   無限くん診断 — スマホ最適化スタイル
   基調色: 濃紺 / 黄色 / 白
   設計方針: 片手・親指で3分以内に完了できること。タップ領域は最低 48px。
   ========================================================================== */

/* 配色は assets/無限くん案内.png（既存チラシ）から採色しています。
   チラシは濃紺・黄色・白に加えて「水色」と「クリーム」を補助色に使っているため、
   そこまで含めて再現しています。 */
:root {
  /* 濃紺 — ロゴ文字・番号バッジ・フッター */
  --navy-900: #0e2141;
  --navy-800: #152c52;
  --navy-700: #1e3c6e;
  --navy-600: #2b5a9e;
  --navy-050: #eaf3fc;

  /* 黄色 — 無限くん本体・見出し帯・アクセント */
  --yellow-500: #ffc72c;
  --yellow-600: #efb312;
  --yellow-400: #ffd75e;
  --yellow-100: #fff4d4;

  /* 水色 — セクション地色・枠線（チラシの各ブロック） */
  --blue-500: #4a90d9;
  --blue-200: #cfe2f5;
  --blue-100: #eaf3fc;

  /* クリーム — 「できること」カードの地色 */
  --cream: #fdf5e0;

  /* 白・グレー */
  --white: #ffffff;
  --gray-050: #f4f8fd;
  --gray-200: #dbe5f0;
  --gray-400: #93a3b8;
  --gray-600: #56657c;

  --danger: #c0392b;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 10px rgba(6, 20, 46, 0.08);
  --shadow-lift: 0 6px 20px rgba(6, 20, 46, 0.16);

  --tap: 48px;
  --page-max: 560px;

  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
          "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--navy-800);
  color: var(--navy-900);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  /* iOS でフォーム入力時に拡大されないよう 16px を下回らせない */
  font-size: 16px;
}

/* 画面全体の器 ---------------------------------------------------------- */

.app {
  max-width: var(--page-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--gray-050);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ヘッダー -------------------------------------------------------------- */

.header {
  background: var(--navy-800);
  color: var(--white);
  padding: 14px 18px 12px;
  padding-top: calc(14px + env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 20;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 無限くんのモチーフである ∞ をマークに使う（チラシのロゴ・ノートPCと同じ記号） */
.header__mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--yellow-500);
  color: var(--navy-900);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  flex: 0 0 auto;
  line-height: 1;
  box-shadow: 0 2px 0 var(--yellow-600);
}

.header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.header__subtitle {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--yellow-500);
  font-weight: 600;
}

/* 進捗バー ------------------------------------------------------------- */

.progress {
  margin-top: 12px;
}

.progress__track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--yellow-500);
  border-radius: 99px;
  transition: width 0.3s ease;
}

.progress__label {
  margin-top: 6px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  justify-content: space-between;
}

.progress__step { font-weight: 700; color: var(--white); }

/* 本文 ---------------------------------------------------------------- */

.main {
  flex: 1 1 auto;
  padding: 18px 16px 24px;
}

.step { display: none; }
.step.is-active { display: block; animation: fade 0.22s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.step__heading {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
  color: var(--navy-800);
  letter-spacing: -0.01em;
}

.step__lead {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--gray-600);
}

/* フィールド ----------------------------------------------------------- */

.field { margin-bottom: 20px; }

.field__label {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.field__hint {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 400;
  margin-left: 6px;
}

.req {
  color: var(--danger);
  font-size: 12px;
  margin-left: 4px;
  font-weight: 700;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--navy-900);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.6;
}

.select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2313306e' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 40px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(28, 65, 147, 0.14);
}

.input.is-invalid,
.select.is-invalid {
  border-color: var(--danger);
}

.field__error {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--danger);
  font-weight: 600;
}
.field__error.is-visible { display: block; }

/* 選択チップ（チェックボックス / ラジオ） -------------------------------- */

.choices {
  display: grid;
  gap: 9px;
}

.choices--2col { grid-template-columns: repeat(2, 1fr); }
.choices--3col { grid-template-columns: repeat(3, 1fr); }

/* 3列チップは幅が狭いので文字を少し詰める */
.choices--3col .choice {
  justify-content: center;
  padding: 11px 6px;
  font-size: 13.5px;
  text-align: center;
}
.choices--3col .choice .choice__box { display: none; }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 11px 13px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy-800);
  transition: border-color 0.14s ease, background 0.14s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.choice__box {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid var(--gray-400);
  border-radius: 6px;
  background: var(--white);
  display: grid;
  place-items: center;
  transition: all 0.14s ease;
}

.choice__box::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2.5px solid var(--navy-900);
  border-bottom: 2.5px solid var(--navy-900);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.14s ease;
  margin-top: -2px;
}

.choice:has(input:checked) {
  border-color: var(--navy-700);
  background: var(--navy-050);
}

.choice:has(input:checked) .choice__box {
  background: var(--yellow-500);
  border-color: var(--yellow-600);
}

.choice:has(input:checked) .choice__box::after { transform: rotate(-45deg) scale(1); }

.choice input:focus-visible ~ .choice__box {
  box-shadow: 0 0 0 3px rgba(28, 65, 147, 0.3);
}

/* :has() 未対応ブラウザ向けフォールバック（JS が is-checked を付ける） */
.choice.is-checked {
  border-color: var(--navy-700);
  background: var(--navy-050);
}
.choice.is-checked .choice__box {
  background: var(--yellow-500);
  border-color: var(--yellow-600);
}
.choice.is-checked .choice__box::after { transform: rotate(-45deg) scale(1); }

/* 選択数カウンタ */
.choices-meta {
  margin-top: 9px;
  font-size: 12.5px;
  color: var(--gray-600);
  font-weight: 600;
}

/* 小見出し付きサブセクション（AI社員の設定） ------------------------------ */

.subsection {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 2px dashed var(--gray-200);
}

.subsection__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy-800);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.subsection__title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--yellow-500);
  border-radius: 2px;
}

.field__note {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-600);
}

/* 結果画面の音声AI社員カード -------------------------------------------- */

.voice-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border-left: 5px solid var(--blue-500);
  padding: 15px;
  margin-bottom: 22px;
}

.voice-card__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy-800);
  margin: 0 0 6px;
}

.voice-card__demo {
  background: var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--navy-700);
  margin: 0 0 12px;
  white-space: pre-line;
}

/* 下部ナビゲーション ---------------------------------------------------- */

/* hidden 属性より display 指定のほうが強いので、明示的に打ち消す。
   これが無いと結果画面でナビが残り、存在しないステップへ進めてしまう。 */
.nav[hidden] { display: none; }

.nav {
  position: sticky;
  bottom: 0;
  background: rgba(246, 247, 250, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gray-200);
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 20;
}

.btn {
  min-height: var(--tap);
  padding: 13px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.985); }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  flex: 1 1 auto;
  background: var(--yellow-500);
  color: var(--navy-900);
  box-shadow: 0 3px 0 var(--yellow-600);
}
.btn--primary:hover:not(:disabled) { background: var(--yellow-600); }

.btn--ghost {
  flex: 0 0 auto;
  background: transparent;
  color: var(--navy-700);
  border: 2px solid var(--gray-200);
  font-weight: 700;
  padding: 13px 18px;
}

.btn--block { width: 100%; flex: 1 1 100%; }

.btn--navy {
  background: var(--navy-700);
  color: var(--white);
}
.btn--navy:hover:not(:disabled) { background: var(--navy-800); }

/* 結果画面 ------------------------------------------------------------- */

.result__hero {
  background: var(--navy-800);
  color: var(--white);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 18px;
  text-align: center;
}

.result__badge {
  display: inline-block;
  background: var(--yellow-500);
  color: var(--navy-900);
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.result__company {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--yellow-500);
}

.result__headline {
  font-size: 19px;
  font-weight: 800;
  margin: 0;
  line-height: 1.45;
}

.result__savings {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.result__savings-num {
  font-size: 34px;
  font-weight: 800;
  color: var(--yellow-500);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.result__savings-unit {
  font-size: 15px;
  font-weight: 700;
  margin-left: 3px;
}

.result__savings-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 3px;
}

/* 時間価値の換算（営業プレゼン スライド03 準拠） --------------------------
   数字は必ず注記とセットで出すこと。過大な期待を持たせないため。 */

.value-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.value-grid__item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 9px 8px;
}

.value-grid__label {
  display: block;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 2px;
}

.value-grid__amount {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.01em;
}

.value-grid__note {
  margin: 9px 0 0;
  font-size: 10px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.62);
  text-align: left;
}

.section-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy-800);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 17px;
  background: var(--yellow-500);
  border-radius: 2px;
}

.cards { display: grid; gap: 12px; margin-bottom: 22px; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow-card);
  border-left: 5px solid var(--yellow-500);
}

.card--rank1 {
  border-left-color: var(--yellow-500);
  box-shadow: var(--shadow-lift);
}
.card--rank2, .card--rank3 { border-left-color: var(--navy-600); }

.card__head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 7px;
}

.card__rank {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: var(--navy-800);
  color: var(--yellow-500);
  font-size: 13px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.card--rank1 .card__rank { background: var(--yellow-500); color: var(--navy-900); }

.card__name {
  font-size: 17px;
  font-weight: 800;
  color: var(--navy-800);
  margin: 0;
}

.card__tagline {
  font-size: 13.5px;
  color: var(--navy-700);
  font-weight: 700;
  margin: 0 0 6px;
}

.card__detail {
  font-size: 13px;
  color: var(--gray-600);
  margin: 0 0 10px;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--navy-050);
  color: var(--navy-700);
}

.tag--saving {
  background: var(--yellow-100);
  color: #7a5c00;
}

/* おすすめプラン（チラシ「04 プラン例」準拠） ---------------------------- */

.plan {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 22px;
  background: var(--white);
  border: 2px solid var(--blue-200);
}

.plan__head {
  padding: 11px 16px;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* チラシのプラン帯の色をそのまま踏襲 */
.plan--light    .plan__head { background: #7fb5e3; color: var(--white); }
.plan--standard .plan__head { background: #e0a93b; color: var(--white); }
.plan--pro      .plan__head { background: var(--navy-800); color: var(--white); }

.plan__body { padding: 14px 16px; }

.plan__contents {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
  margin: 0 0 6px;
}

.plan__why {
  font-size: 12.5px;
  color: var(--gray-600);
  margin: 0;
}

.plan__note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-200);
  font-size: 11.5px;
  color: var(--gray-600);
}

/* 導入の流れ（チラシ「03」準拠） --------------------------------------- */

.flow {
  display: flex;
  gap: 6px;
  margin-bottom: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.flow__item {
  flex: 1 0 auto;
  min-width: 78px;
  background: var(--blue-100);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy-700);
  position: relative;
}

.flow__item.is-done { background: var(--yellow-100); }

.flow__num {
  display: block;
  width: 21px;
  height: 21px;
  margin: 0 auto 5px;
  border-radius: 50%;
  background: var(--blue-500);
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  line-height: 21px;
}

.flow__item.is-done .flow__num { background: var(--yellow-600); color: var(--navy-900); }

.note {
  background: var(--white);
  border: 1px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 18px;
}

.note strong { color: var(--navy-700); }

.summary {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 20px;
}

.summary__row {
  display: flex;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13.5px;
}
.summary__row:last-child { border-bottom: none; }

.summary__key {
  flex: 0 0 38%;
  color: var(--gray-600);
  font-weight: 700;
}
.summary__val {
  flex: 1 1 auto;
  color: var(--navy-900);
  font-weight: 600;
  word-break: break-word;
}

/* 補助表示 ------------------------------------------------------------- */

.banner {
  font-size: 12px;
  padding: 9px 14px;
  background: var(--yellow-100);
  color: #6b5200;
  text-align: center;
  font-weight: 600;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--navy-900);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 20px;
  border-radius: 99px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
  max-width: 88%;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.footer {
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
}

/* 動きを抑える設定を尊重する */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
