@charset "UTF-8";

/* ==========================================================================
   contact-form.css  ―  お問い合わせフォームの「入力 → 内容確認 → 送信完了」の表示
   --------------------------------------------------------------------------
   ・すべてのルールは .lw .contact__form-wrap（お問い合わせフォーム）配下、または .cf-* に限定しています。
     ヒーロー・写真・他セクション・ヘッダー・フッターには一切触れません。
   ・色・罫線・角丸（2px）は、既存の下層セクションの変数（--lw-*）をそのまま使います。
   ・動きは「ごく短いフェード」と「完了カードの 10px の上昇（0.6秒）」だけ。動きを減らす設定では上昇なし。
   ・JavaScriptが無い場合、ステップ表示・補助文は hidden のままで、通常のHTMLフォーム送信がそのまま使えます。
   ========================================================================== */

.lw .contact__form-wrap {
  --cf-error: #8a372d;
  --cf-error-tint: #f9efec;
  --cf-todo: #5f6d5c;                       /* 未到達：薄いグレーグリーン（文字は約4.9:1） */
  --cf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  scroll-margin-top: calc(var(--header-h, 4.5rem) + 1.5rem);
}
.lw .contact__form-wrap [hidden] { display: none !important; }
.lw .contact__form-wrap .cf-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* ---------- 進行状況（01 入力 / 02 内容確認 / 03 送信完了） ---------- */
.lw .cf-steps {
  display: flex;
  align-items: center;
  margin: 0 0 clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  padding: 0;
  list-style: none;
}
.lw .cf-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cf-todo);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  line-height: 1.4;
  white-space: nowrap;
}
.lw .cf-step + .cf-step { flex: 1 1 auto; }
.lw .cf-step + .cf-step::before {            /* ステップ間の細いライン */
  content: "";
  flex: 1 1 auto;
  min-width: 0.75rem;
  height: 1px;
  margin-inline: 0.7rem;
  background-color: var(--lw-rule-strong);
}
.lw .cf-step__mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 2.125rem;
  height: 2rem;
  padding-inline: 0.35rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  line-height: 1;
}
.lw .cf-step__no { grid-area: 1 / 1; }
.lw .cf-step__check {
  grid-area: 1 / 1;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
/* 現在：深いグリーン（塗り＋太めの文字）。完了：控えめなチェック。未到達：薄いグレーグリーン */
.lw .cf-step[data-state="current"] { color: var(--lw-moss-deep); font-weight: 600; }
.lw .cf-step[data-state="current"] .cf-step__mark { background-color: var(--lw-moss-deep); border-color: var(--lw-moss-deep); color: var(--c-paper); }
.lw .cf-step[data-state="done"] { color: var(--lw-moss); }
.lw .cf-step[data-state="done"] .cf-step__no { opacity: 0; }
.lw .cf-step[data-state="done"] .cf-step__check { opacity: 1; }
.lw .cf-step[data-state="done"] + .cf-step::before,
.lw .cf-step[data-state="current"] + .cf-step[data-state="todo"]::before { background-color: var(--lw-rule-strong); }
.lw .cf-step[data-state="done"] + .cf-step[data-state="done"]::before,
.lw .cf-step[data-state="done"] + .cf-step[data-state="current"]::before { background-color: var(--lw-moss); }
@media (max-width: 420px) {
  .lw .cf-step { gap: 0.4rem; font-size: 0.8125rem; letter-spacing: 0.03em; }
  .lw .cf-step + .cf-step::before { margin-inline: 0.45rem; }
  .lw .cf-step__mark { min-width: 2rem; padding-inline: 0.25rem; }
}

/* ---------- 入力画面：補助文・エラー ---------- */
.lw .cf-note {
  margin-top: 0.9rem;
  color: var(--lw-text-soft);
  font-size: 0.875rem;
  line-height: 1.8;
  letter-spacing: 0.05em;
}
.lw .cf-summary {
  margin: 0 0 1.75rem;
  padding: 0.9rem 1.1rem;
  background-color: var(--cf-error-tint);
  border: 1px solid #d9b9b2;
  border-left: 3px solid var(--cf-error);
  border-radius: 2px;
  color: #5c221b;
  font-size: 0.9375rem;
  line-height: 1.8;
  letter-spacing: 0.04em;
}
.lw .cf-summary:focus { outline: none; }
.lw .cf-summary:focus-visible { outline: 2px solid var(--lw-moss); outline-offset: 3px; }
.lw .cf-summary__title { display: block; font-weight: 600; }
/* エラー文：色だけに頼らず、記号と文言で示す */
.lw .form__error {
  display: flex;
  gap: 0.5em;
  align-items: flex-start;
  color: var(--cf-error);
  font-weight: 500;
}
.lw .form__error::before {
  content: "!";
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  margin-top: 0.3em;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
}
.lw .form__input[aria-invalid="true"] { border-width: 2px; border-color: var(--cf-error); background-color: var(--cf-error-tint); }
.lw .form__choice:has(input[aria-invalid="true"]) { border-color: var(--cf-error); background-color: var(--cf-error-tint); }
.lw .contact__form-title:focus,
.lw .cf-panel__title:focus,
.lw .cf-done__title:focus { outline: none; }
.lw .contact__form-title:focus-visible,
.lw .cf-panel__title:focus-visible,
.lw .cf-done__title:focus-visible { outline: 2px solid var(--lw-moss); outline-offset: 4px; }

/* ---------- 入力内容の確認 ---------- */
.lw .cf-panel__title {
  margin-bottom: 1rem;
  color: var(--lw-heading);
  font-family: var(--f-mincho);
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.6;
}
.lw .cf-panel__lead {
  margin-bottom: 1.75rem;
  color: var(--lw-text-soft);
  font-size: 0.9375rem;
  line-height: 1.9;
}
/* 確認カード：淡い生成りの面と細い罫線。入力欄には見えない（枠のない文字だけの一覧） */
.lw .cf-card {
  margin: 0;
  padding: clamp(0.5rem, 0.3rem + 0.8vw, 1rem) clamp(1.1rem, 0.8rem + 1.2vw, 1.75rem);
  background-color: var(--c-paper);
  border: 1px solid var(--lw-rule);
  border-radius: 2px;
}
.lw .cf-card__row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 9rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--lw-rule);
}
.lw .cf-card__row:last-child { border-bottom: 0; }
.lw .cf-card__label { margin: 0; color: var(--lw-text-soft); font-size: 0.8125rem; letter-spacing: 0.08em; line-height: 1.8; }
.lw .cf-card__value {
  margin: 0;
  color: var(--lw-heading);
  font-size: 1rem;
  line-height: 1.85;
  white-space: pre-wrap;         /* 相談内容の改行をそのまま表示 */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.lw .cf-card__value.is-empty { color: #6d766a; }
@media (max-width: 599px) {
  .lw .cf-card__row { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; padding: 0.95rem 0; }
}

.lw .cf-alert {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  background-color: var(--c-paper);
  border: 1px solid var(--lw-rule-strong);
  border-left: 3px solid var(--cf-error);
  border-radius: 2px;
}
.lw .cf-alert:focus { outline: none; }
.lw .cf-alert:focus-visible { outline: 2px solid var(--lw-moss); outline-offset: 3px; }
.lw .cf-alert__title { color: var(--cf-error); font-size: 1rem; font-weight: 600; line-height: 1.7; }
.lw .cf-alert__text { margin-top: 0.3rem; color: var(--lw-text); font-size: 0.9375rem; line-height: 1.85; }

.lw .cf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem 1rem;
  margin-top: 2rem;
}
.lw .cf-actions .btn { flex: 1 1 14rem; min-height: 3.5rem; padding-inline: 1rem; }   /* 幅は固定基準（文言が変わっても跳ねない） */
@media (max-width: 599px) {
  .lw .cf-actions { flex-direction: column-reverse; }
  .lw .cf-actions .btn { flex: none; width: 100%; }
}

/* 送信中：ボタンは無効化（aria-disabled）。細い円弧をゆっくり回す */
.lw .cf-actions .btn[aria-disabled="true"] { cursor: default; pointer-events: none; }
.lw .cf-actions [data-cf-back][aria-disabled="true"] { opacity: 0.55; }
.lw .cf-actions [data-cf-send][aria-disabled="true"] { opacity: 0.88; }   /* 送信中の文言・円弧が読める濃さを保つ */
.lw .cf-actions .btn.is-sending::before {
  content: "";
  flex: none;
  width: 1em;
  height: 1em;
  margin-right: 0.7em;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cf-spin 1.2s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }
.lw .cf-status { margin-top: 1rem; color: var(--lw-text-soft); font-size: 0.9375rem; line-height: 1.8; min-height: 1.8em; }
.lw .cf-status:empty { display: none; }

/* ---------- 送信完了カード ---------- */
.lw .cf-done {
  padding: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem) clamp(1.5rem, 1rem + 2.4vw, 3rem);
  background-color: var(--c-paper);
  border: 1px solid var(--lw-rule-strong);
  border-radius: 2px;
  box-shadow:
    0 12px 32px rgba(42, 54, 44, 0.09),
    0 2px 8px rgba(42, 54, 44, 0.05);
  text-align: center;
}
.lw .cf-done:focus { outline: none; }
.lw .cf-done__mark {
  display: block;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.5rem;
  fill: none;
  stroke: var(--lw-moss-deep);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lw .cf-done__title {
  color: var(--lw-heading);
  font-family: var(--f-mincho);
  font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.6;
}
.lw .cf-done__text { max-width: 30em; margin: 1.25rem auto 0; color: var(--lw-text); font-size: 1rem; line-height: 2; }
.lw .cf-done__note { margin-top: 1rem; color: var(--lw-moss-deep); font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.06em; }
.lw .cf-done__action { margin-top: 2rem; }
.lw .cf-done__action .btn { min-width: min(18rem, 100%); }

/* ---------- 表示の切り替え：短いフェード／完了カードは 10px の上昇（0.6秒） ---------- */
@media (prefers-reduced-motion: no-preference) {
  .lw .cf-panel.cf-enter, .lw .form.cf-enter { animation: cf-fade 0.3s var(--cf-ease) both; }
  .lw .cf-done.cf-enter { animation: cf-rise 0.6s var(--cf-ease) both; }
  .lw .cf-done.cf-enter .cf-done__mark { animation: cf-fade 0.55s var(--cf-ease) 0.1s both; }
}
@media (prefers-reduced-motion: reduce) {
  .lw .cf-panel.cf-enter, .lw .form.cf-enter, .lw .cf-done.cf-enter { animation: cf-fade 0.15s linear both; }
  .lw .cf-actions .btn.is-sending::before { animation: none; border-right-color: currentColor; border-bottom-color: transparent; }
}
@keyframes cf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cf-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 1025px) {
  /* CONTACT：ボタン下の注記を、ボタンの中央軸に合わせて中央揃えにする
     （文字サイズ・色・上下余白は既存のまま。フォーム全体・入力欄の位置には影響しない） */
  .lw .cf-note {
    width: 100%;
    max-width: min(26rem, 100%);
    text-align: center;
  }
}

@media (max-width: 767px) {
  /* CONTACT：ボタン下の注記を、ボタン（.btn--wide と同じ幅）の中央軸に合わせて中央揃え */
  .lw .cf-note {
    width: 100%;
    max-width: min(26rem, 100%);
    margin-inline: auto;
    text-align: center;
  }
}
