/* ==========================================================================
   終活アンケート（資料請求）フォーム（フェーズ1）— 高齢者向けモバイルファースト
   ベース 18px、ボタン・入力 50px 以上、やさしい淡グリーン基調の配色
   ========================================================================== */

/* --- カラー設定 --- */
:root {
  --color-main-green: #e8f3e6;
  --color-heading-green: #6fa86b;
  --color-soft-yellow: #f6e9b3;
  --color-page: #fbfaf6;
  --color-cta: #e7a152;
  --color-cta-dark: #c87f2e;
  --color-text: #444444;
  --color-white: #ffffff;
  --color-border: #c9dec6;
  --color-error: #b33a3a;
}

/* --- リセット・ベース --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 1.125rem; /* 18px */
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-page);
}

.container {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

/* --- スキップリンク（キーボード利用者向け） --- */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-heading-green);
  color: var(--color-white);
  text-decoration: none;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.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;
}

/* --- ヘッダー --- */
.site-header {
  background: var(--color-main-green);
  border-bottom: 4px solid var(--color-soft-yellow);
  padding: 1.75rem 0 1.35rem;
  margin-bottom: 1rem;
}

.site-header__label {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--color-heading-green);
  font-weight: 600;
}

.site-header__title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text);
}

.site-header__lead {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
}

/* --- フォームセクション --- */
.form-section {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.25rem 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 0.2rem 0.75rem rgba(111, 168, 107, 0.14);
}

.form-section__title {
  margin: 0 0 1.25rem;
  padding: 0.4rem 0.75rem;
  font-size: 1.2rem;
  font-weight: 700;
  border-left: 0.45rem solid var(--color-heading-green);
  border-bottom: none;
  border-radius: 0.35rem;
  color: var(--color-text);
  background: var(--color-main-green);
}

.form-section--consent {
  border-color: var(--color-soft-yellow);
  background: #fffdf2;
}

/* --- フィールド --- */
.field {
  margin-bottom: 1.35rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field label,
.field legend {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
}

.field--fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1.35rem;
}

.field--fieldset legend {
  padding: 0;
}

.required-mark {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--color-heading-green);
  border-radius: 0.2rem;
}

/* テキスト入力 */
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  min-height: 3.125rem; /* 50px */
  padding: 0.65rem 0.85rem;
  font-size: 1.125rem;
  line-height: 1.5;
  border: 2px solid var(--color-border);
  border-radius: 0.35rem;
  background: var(--color-white);
  color: var(--color-text);
}

.field textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.field select {
  background-color: var(--color-white);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--color-heading-green) 50%),
    linear-gradient(135deg, var(--color-heading-green) 50%, transparent 50%),
    linear-gradient(to right, var(--color-main-green), var(--color-main-green));
  background-position:
    calc(100% - 1.55rem) 50%,
    calc(100% - 1.05rem) 50%,
    100% 0;
  background-size:
    0.55rem 0.55rem,
    0.55rem 0.55rem,
    3.25rem 100%;
  background-repeat: no-repeat;
  padding-right: 4rem;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 3px solid var(--color-soft-yellow);
  outline-offset: 2px;
  border-color: var(--color-heading-green);
}

.field input.field-input--error,
.field select.field-input--error,
.field textarea.field-input--error {
  border-color: #b33a3a;
}

.field-hint {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #666666;
}

.field-hint--warning {
  color: #7a5a2a;
}

.field-error {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-error);
}

/* --- ラジオ・チェックボックス（大きなタップ領域） --- */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-height: 3.125rem;
  padding: 0.75rem 0.85rem;
  font-size: 1.05rem;
  font-weight: 500;
  background: #fffdf2;
  border: 2px solid #eadfae;
  border-radius: 0.35rem;
  cursor: pointer;
}

.choice:has(input:focus-visible) {
  outline: 3px solid var(--color-soft-yellow);
  outline-offset: 2px;
}

.choice input {
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--color-heading-green);
}

.choice--consent {
  background: var(--color-white);
  border-color: var(--color-heading-green);
}

.consent-note {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--color-text);
}

.consent-note a {
  color: var(--color-heading-green);
  font-weight: 700;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.2em;
}

/* --- 送信ボタン --- */
.form-actions {
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.25rem; /* 52px */
  padding: 0.85rem 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  border-radius: 0.4rem;
  cursor: pointer;
  box-shadow: 0 0.25rem 0 #c87f2e;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn--primary {
  color: var(--color-white);
  background-color: var(--color-cta);
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-cta-dark);
}

.btn--primary:active:not(:disabled) {
  box-shadow: 0 0.1rem 0 var(--color-cta-dark);
  transform: translateY(0.15rem);
}

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

.btn--secondary {
  color: var(--color-heading-green);
  background-color: var(--color-white);
  border: 2px solid var(--color-heading-green);
}

.btn--secondary:hover {
  background-color: var(--color-main-green);
}

/* --- フォーム全体のメッセージ --- */
.form-global-error {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--color-error);
  background: #fdf5f5;
  border: 1px solid #e8c4c4;
  border-radius: 0.35rem;
}

.form-status {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #666666;
  min-height: 1.5rem;
}

/* --- 送信完了ページ --- */
.thanks-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--color-page);
}

.thanks {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.thanks__card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-top: 0.6rem solid var(--color-soft-yellow);
  border-radius: 0.5rem;
  padding: 2rem 1.25rem;
  text-align: center;
  box-shadow: 0 0.2rem 0.75rem rgba(111, 168, 107, 0.14);
}

.thanks__label {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-heading-green);
}

.thanks__title {
  margin: 0 0 1.35rem;
  font-size: 1.5rem;
  line-height: 1.45;
  color: var(--color-cta);
}

.thanks-illustration {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 360 / 385;
  display: block;
  margin: 32px auto 0;
  background-image: url("../images/dandelion.webp");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  pointer-events: none;
  user-select: none;
}

.thanks-illustration img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.thanks__message {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  text-align: center;
  color: var(--color-text);
}

.thanks__group {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  font-size: 0.95rem;
  color: #666666;
  border-top: 1px solid var(--color-border);
}

.thanks__actions {
  margin: 1.75rem 0 0;
}

/* --- タブレット以上 --- */
@media (min-width: 48rem) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .site-header__title {
    font-size: 1.75rem;
  }

  .form-section {
    padding: 1.5rem 1.35rem 1.75rem;
  }

  .thanks__card {
    padding: 2.5rem 2rem;
  }

  .thanks__title {
    font-size: 1.75rem;
  }

  .btn {
    max-width: 22rem;
    margin: 0 auto;
  }

  .form-actions .btn--primary {
    display: flex;
    margin-left: auto;
    margin-right: auto;
  }
}
