/**
 * ==========================================================
 *  Contact Form 7 フォーム共通スタイル（forms.css）
 * ==========================================================
 *  お問い合わせ・精神科専用相談・採用エントリーの 3 フォームで共通。
 *  入力欄そのもの（.form-input / .form-label 等）は各ページのインライン CSS、
 *  CF7 が出力する要素（ラジオ・同意チェック・エラー・送信結果）と
 *  確認画面・完了表示はこのファイルで定義しています。
 *  CF7 標準の CSS より後に読み込みます（inc/forms.php）。
 * ==========================================================
 */

@keyframes soraFormFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ラジオ・チェックボックス（CF7 の [radio] / [checkbox] に class:form-choice） */
.form-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.form-choice .wpcf7-list-item {
  position: relative;
  margin: 0;
}
.form-choice input[type="radio"],
.form-choice input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.form-choice .wpcf7-list-item-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.15rem;
  background: #F5FAFD;
  border: 1.5px solid transparent;
  border-radius: 9999px;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #1F2D3D;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.form-choice .wpcf7-list-item-label:hover {
  background: #EAF5FC;
}
.form-choice input:checked + .wpcf7-list-item-label {
  background: #0C82C9;
  color: #FFFFFF;
  border-color: #0C82C9;
  box-shadow: 0 8px 20px -8px rgba(12,130,201,0.4);
}
.form-choice input:focus-visible + .wpcf7-list-item-label {
  outline: 2px solid #0C82C9;
  outline-offset: 2px;
}

/* プライバシー同意（CF7 の [acceptance]） */
.form-agree {
  padding: 1rem 1.15rem;
  background: #F5FAFD;
  border: 1px solid #EAF5FC;
  border-radius: 14px;
}
.form-agree .wpcf7-list-item { margin: 0; }
.form-agree label {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
}
.form-agree input[type="checkbox"] {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border: 1.5px solid #CBD5E1;
  border-radius: 6px;
  background: #FFFFFF;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  cursor: pointer;
  margin: 2px 0 0;
  transition: background-color .2s ease, border-color .2s ease;
}
.form-agree input[type="checkbox"]:checked {
  background: #0C82C9;
  border-color: #0C82C9;
}
.form-agree input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #FFFFFF;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.form-agree input[type="checkbox"]:focus-visible {
  outline: 2px solid #0C82C9;
  outline-offset: 2px;
}
.form-agree .wpcf7-list-item-label {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #1F2D3D;
  line-height: 1.75;
}
.form-agree .wpcf7-list-item-label a {
  color: #0C82C9;
  text-decoration: underline;
}


.form-submit:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
}
.form-submit-arrow::after {
  content: "";
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ========================================================= */
/* Contact Form 7：入力 → 確認 → 完了                         */
/* ========================================================= */
.sora-form .sora-step-confirm { display: none; }
.sora-form.is-confirm .sora-step-input { display: none; }
.sora-form.is-confirm .sora-step-confirm { display: block; animation: soraFormFadeUp .4s ease both; }

/* 入力エラー */
.wpcf7-form-control-wrap { display: block; }
.sora-form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 0.5rem;
  font-size: 12px;
  font-weight: 500;
  color: #DC2626;
}
.sora-form .form-input.wpcf7-not-valid,
.sora-form .form-textarea.wpcf7-not-valid,
.sora-form .form-select.wpcf7-not-valid {
  background-color: #FEF2F2;
  border-color: #F87171;
}

/* 送信結果メッセージ（CF7 の標準CSSより後に読み込むため同じ詳細度で上書き） */
.wpcf7 form.sora-form .wpcf7-response-output {
  margin: 1.5rem 0 0;
  padding: 0.9rem 1.15rem;
  border: 1px solid #EAF5FC;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.8;
  color: #1F2D3D;
  background: #F5FAFD;
}
.wpcf7 form.sora-form.invalid .wpcf7-response-output,
.wpcf7 form.sora-form.unaccepted .wpcf7-response-output,
.wpcf7 form.sora-form.failed .wpcf7-response-output,
.wpcf7 form.sora-form.aborted .wpcf7-response-output,
.wpcf7 form.sora-form.spam .wpcf7-response-output {
  border-color: #FCA5A5;
  background: #FEF2F2;
  color: #B91C1C;
}

/* 確認画面 */
.confirm-lead {
  font-size: 14px;
  line-height: 1.9;
  color: #1F2D3D;
  margin-bottom: 1.5rem;
}
.confirm-list {
  border-top: 1px solid #EAF5FC;
  margin-bottom: 2rem;
}
.confirm-list dt {
  padding-top: 1rem;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 12.5px;
  color: #0C82C9;
  letter-spacing: 0.04em;
}
.confirm-list dd {
  margin: 0.35rem 0 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid #EAF5FC;
  font-size: 14.5px;
  line-height: 1.85;
  color: #1F2D3D;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.confirm-list dd.is-empty { color: #94A3B8; }
@media (min-width: 640px) {
  .confirm-list {
    display: grid;
    grid-template-columns: 11rem 1fr;
  }
  .confirm-list dt,
  .confirm-list dd {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid #EAF5FC;
  }
}
.confirm-actions {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
}
@media (min-width: 640px) {
  .confirm-actions { flex-direction: row; }
}
.form-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.05rem 2rem;
  background: #FFFFFF;
  color: #0C82C9;
  border: 1.5px solid #0C82C9;
  border-radius: 9999px;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background-color .2s ease;
}
.form-back:hover { background: #F5FAFD; }
@media (min-width: 640px) {
  .form-back { width: auto; min-width: 200px; }
}
.sora-form .wpcf7-spinner { display: block; margin: 0.75rem auto 0; }
@media (min-width: 640px) {
  .sora-form .wpcf7-spinner { display: inline-block; margin: 0 0 0 0.5rem; }
}

/* 完了メッセージ */
.form-notice { text-align: center; }
.form-notice:focus { outline: none; }
.form-notice-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #1F2D3D;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}
.form-notice-text {
  font-size: 14px;
  line-height: 2;
  color: #1F2D3D;
}
.form-notice-note {
  margin-top: 1.25rem;
  font-size: 12px;
  line-height: 1.8;
  color: #64748B;
}
.form-notice a { color: #0C82C9; text-decoration: underline; }
