:root {
  --bg: #F6F7F8;
  --surface: #FFFFFF;
  --text: #18181B;
  --text-sub: #6B7280;
  --border: #E2E5E9;
  --accent: #E60012;        /* TELLGRIT ブランドレッド */
  --accent-deep: #C30010;   /* バッジ/文字用の濃い赤（コントラスト確保） */
  --accent-soft: #FDECEE;
  --primary: #E60012;       /* 主CTA = ブランドレッド */
  --primary-hover: #C30010;
  --secondary: #18181B;     /* チップ選択時の黒 */
  --error: #D64545;

  --radius-card: 14px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 40px rgba(24, 24, 27, 0.08);
  --shadow-sel: 0 4px 14px rgba(230, 0, 18, 0.18);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
    system-ui, -apple-system, "Segoe UI", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

/* ===== Shell / Card ===== */
.form-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 480px) {
  .form-shell {
    align-items: center;
    padding: 32px 16px;
    background:
      radial-gradient(1200px 600px at 50% -10%, #fbe9eb 0%, var(--bg) 60%);
  }
  .card {
    min-height: auto;
    border-radius: 22px;
    box-shadow: var(--shadow-card);
    padding: 26px 26px 30px;
  }
}

/* ===== Header ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.progress__step {
  font-size: 14px;
  color: var(--text-sub);
  white-space: nowrap;
  letter-spacing: 0.04em;
}
.progress__step strong {
  font-size: 17px;
  color: var(--text);
  font-weight: 700;
}
.progress__bar {
  position: relative;
  height: 4px;
  flex: 1;
  max-width: 150px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress__fill {
  position: absolute;
  inset: 0 50% 0 0;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: right 0.35s ease;
}

.logo {
  height: 34px;
  width: auto;
  display: block;
  flex: none;
}

/* ===== Pages ===== */
.page { display: none; }
.page--active { display: block; animation: fade 0.28s ease; }
@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.title {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  margin: 4px 0 20px;
  letter-spacing: 0.01em;
}
.title--center { text-align: center; }

.lead {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.7;
  margin: -10px 0 20px;
}

/* ===== Field ===== */
.field { margin-bottom: 22px; }

.field__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.field__label-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.field__label-note {
  font-size: 12.5px;
  color: var(--text-sub);
  font-weight: 500;
}
.field__hint {
  font-size: 12.5px;
  color: var(--text-sub);
  margin: 0 0 10px;
}

.badge--required {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  letter-spacing: 0.02em;
}

/* ===== Cards (single select) ===== */
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.opt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 30px 14px 14px;
  min-height: 92px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.05s;
}
.opt-card:hover { border-color: #f0a6ad; }
.opt-card:active { transform: scale(0.99); }
.opt-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.opt-card__text {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
.opt-card__chevron {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: #b6c6d4;
  display: inline-flex;
  transition: color 0.18s;
}
.opt-card[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: var(--shadow-sel);
}
.opt-card[aria-checked="true"] .opt-card__icon {
  background: var(--accent);
  color: #fff;
}
.opt-card[aria-checked="true"] .opt-card__chevron { color: var(--accent); }

/* ===== Chips (multi select) ===== */
.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.05s;
}
.chip svg { color: var(--accent); flex: none; transition: color 0.18s; }
.chip:hover { border-color: #f0a6ad; }
.chip:active { transform: scale(0.98); }
.chip[aria-pressed="true"] {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #fff;
}
.chip[aria-pressed="true"] svg { color: #fff; }

/* ===== Inputs ===== */
.input,
.textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 13px 14px;
  font: inherit;
  font-size: 16px; /* avoid iOS zoom */
  color: var(--text);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.input::placeholder,
.textarea::placeholder { color: #aebccb; }
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(230, 0, 18, 0.16);
}
.input.is-error,
.textarea.is-error { border-color: var(--error); }

/* ===== Note ===== */
.note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-sub);
  margin: 4px 0 20px;
}
.note svg { color: var(--accent); flex: none; margin-top: 2px; }

/* ===== Error text ===== */
.error-text {
  color: var(--error);
  font-size: 12.5px;
  margin: 7px 0 0;
  font-weight: 600;
}
.error-text--center { text-align: center; }

/* ===== Buttons ===== */
.btn {
  width: 100%;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.18s, opacity 0.18s, transform 0.05s;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  padding: 16px 20px;
  position: relative;
  margin-top: 4px;
}
.btn--primary:hover { background: var(--primary-hover); }
.btn--primary:active { transform: scale(0.99); }
.btn--primary:disabled {
  background: #c3cdd8;
  cursor: not-allowed;
  opacity: 1;
}
.btn--primary .btn__chevron { position: absolute; right: 20px; }
#to-page-2 svg { position: absolute; right: 20px; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__chevron { display: none; }

.btn--ghost {
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 14px;
  margin-top: 6px;
}
.btn--ghost:hover { color: var(--text); }

/* ===== Thanks ===== */
.page--thanks { text-align: center; padding: 26px 0 10px; }
.thanks__icon {
  width: 64px;
  height: 64px;
  margin: 12px auto 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.thanks__body {
  font-size: 14px;
  color: var(--text-sub);
  margin: 12px 0 0;
}

/* ===== Narrow phones (≤400px: iPhone SE/標準幅) ===== */
@media (max-width: 400px) {
  .opt-card { padding: 13px 22px 13px 12px; }
  .opt-card__chevron { right: 6px; }
  .opt-card__text { font-size: 12px; }
  .chip { font-size: 11.5px; padding: 10px 9px; gap: 6px; }
  .chip svg { width: 15px; height: 15px; }
  .cards { gap: 10px; }
}

@media (max-width: 360px) {
  .card { padding: 20px 16px; }
  .title { font-size: 19px; }
  .chip { font-size: 11.5px; }
}
