/* No.24 やわらかいお問い合わせフォーム */

.sf-stage {
  padding: clamp(26px, 5vw, 62px) clamp(16px, 4vw, 48px) clamp(40px, 6vw, 78px);
  background:
    radial-gradient(circle at 84% 6%, rgba(140, 172, 136, 0.12), transparent 42%),
    var(--surface-1);
}
.sf-wrap { position: relative; width: min(560px, 100%); margin-inline: auto; }

.sf-lead { margin: 0 0 24px; color: var(--text-2); font-size: 14.9px; line-height: 1.85; }

.sf-form {
  padding: clamp(24px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 22px 22px 22px;
  box-shadow: 0 20px 46px rgba(40, 107, 112, 0.1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.sf-form.is-sent { opacity: 0; transform: scale(0.98); pointer-events: none; }

.sf-field { position: relative; margin-bottom: 26px; }

.sf-input {
  width: 100%;
  padding: 22px 14px 9px;
  color: var(--text);
  background: var(--surface-1);
  border: 1px solid rgba(83, 169, 175, 0.3);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  transition: border-color 0.28s ease, background-color 0.28s ease, box-shadow 0.28s ease;
}
.sf-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(83, 169, 175, 0.16);
}
.sf-textarea { resize: vertical; min-height: 108px; }

/* 見出しは、入力があるかフォーカス中のとき上へ逃げる */
.sf-label {
  position: absolute;
  top: 17px;
  left: 15px;
  color: #526061;
  font-size: 15px;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1), color 0.26s ease;
}
.sf-input:focus + .sf-label,
.sf-input:not(:placeholder-shown) + .sf-label {
  transform: translateY(-11px) scale(0.72);
  color: var(--brand-deep);
}

.sf-msg {
  display: block;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  color: #b4553f;
  font-size: 12.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease, margin-top 0.3s ease;
}
.sf-field.is-bad .sf-msg {
  max-height: 3em;
  margin-top: 7px;
  opacity: 1;
  transform: none;
}
.sf-field.is-bad .sf-input {
  border-color: rgba(180, 85, 63, 0.6);
  background: rgba(180, 85, 63, 0.04);
}
.sf-field.is-good .sf-input { border-color: rgba(140, 172, 136, 0.75); }

.sf-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: #707c7c;
  font-family: var(--font-ui);
  font-size: 12px;
}

.sf-choice {
  margin: 0 0 26px;
  padding: 0;
  border: 0;
}
.sf-choice legend {
  padding: 0;
  margin-bottom: 10px;
  color: #526061;
  font-size: 13px;
  font-weight: 700;
}
.sf-radio { display: inline-flex; align-items: center; margin: 0 8px 8px 0; cursor: pointer; }
.sf-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sf-radio span {
  display: inline-block;
  padding: 8px 17px;
  color: #526061;
  background: var(--surface-1);
  border: 1px solid rgba(83, 169, 175, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.sf-radio input:checked + span {
  color: var(--surface);
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  transform: translateY(-1px);
}
.sf-radio input:focus-visible + span {
  outline: 3px solid rgba(83, 169, 175, 0.45);
  outline-offset: 3px;
}

.sf-submit {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 54px;
  color: var(--surface);
  background: var(--brand-deep);
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: width 0.45s cubic-bezier(0.6, 0, 0.2, 1), background-color 0.3s ease, transform 0.2s ease;
}
.sf-submit:hover { background: #1f585d; }
.sf-submit:active { transform: scale(0.99); }
.sf-submit > span { grid-area: 1 / 1; transition: opacity 0.25s ease; }
.sf-submit-check { opacity: 0; display: grid; place-items: center; }
.sf-submit.is-loading { width: 54px; margin-inline: auto; border-radius: 50%; }
.sf-submit.is-loading .sf-submit-text { opacity: 0; }
.sf-submit.is-ok .sf-submit-check { opacity: 1; }
.sf-submit.is-ok { background: #4e7f5c; }

.sf-note { margin: 16px 0 0; color: #707c7c; font-size: 12.5px; line-height: 1.7; }

/* hidden属性はUA既定の display:none だが、下の display:flex に負けてしまう。
   打ち消しを書かないと、透明なまま前面に残ってフォームのクリックを全部吸ってしまう。 */
.sf-done[hidden] { display: none; }

.sf-done {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px 22px 22px 22px;
  box-shadow: 0 20px 46px rgba(40, 107, 112, 0.1);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.sf-done.is-in { opacity: 1; transform: none; pointer-events: auto; }
.sf-done-mark { color: #4e7f5c; }
.sf-done h2 { margin: 8px 0 0; color: var(--text); font-size: 1.15rem; }
.sf-done p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.sf-again {
  margin-top: 18px;
  padding: 9px 20px;
  color: var(--brand-deep);
  background: transparent;
  border: 1px solid rgba(83, 169, 175, 0.45);
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.sf-again:hover { background: var(--surface-2); }
