/* ===========================
   Aoyama Jisho — contact.css
   （/contact/, /contact-sell/ など “contact” 系ページだけ読み込まれる想定）
   ※ design-plus.css より前に読み込まれても勝てるよう、セレクタの詳細度を上げています
   =========================== */

/* --- TCD側の .wpcf7 装飾をスコープで打ち消し（!important なし） --- */
.post_content .wpcf7 {
  border: none;
  background: transparent;
  margin: 0 0 2.5em;
  padding: 0;
}

/* ===== 色・サイズの変数 ===== */
.wpcf7-form {
  /* TCDのCSS変数があればそれを採用。ない時は従来色にフォールバック */
  --primary-color: var(--tcd-key-color, #333333);   /* メイン */
  --accent-color:  var(--tcd-key-color-2, #78c2c4); /* アクセント */
  --bg-color:      #f9f9f9;
  --text-color:    #333333;
  --label-color:   #555555;
  --border-color:  #dddddd;
  --required-color:#D9534F;
  --field-height:  48px;
  --field-spacing: 28px;
}

/* リンク色だけTCDのリンク色を優先（なければメイン色→通常色） */
.wpcf7-form .privacy a {
  color: var(--accent-color);
}

/* ===== フォーム全体 ===== */
.post_content .wpcf7-form {
  background: var(--bg-color);
  padding: 40px 32px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.05);
  color: var(--text-color);
  box-sizing: border-box;
}

.wpcf7 form.wpcf7-form { margin: 0; }

/* ===== セクション ===== */
.post_content .wpcf7-form .cf7-section { margin-bottom: 48px; }

/* 共通：h2/h3 */
.post_content .wpcf7-form .cf7-section h2,
.post_content .wpcf7-form .cf7-section h3 {
  font-size: 1.5rem;
  margin: 0 0 24px;
  color: var(--primary-color);
  border-left: 5px solid var(--accent-color);
  padding-left: 12px;
  font-weight: 700;
  line-height: 1.4; /* 親の line-height に寄せる */
}

/* 個別：h3（共通の“後に”書いて小さく上書き） */
.post_content .wpcf7-form .cf7-section h3 {
  font-size: 1.1rem;
  margin-top: 36px;
  margin-bottom: 24px;
  border-left-width: 4px;
}

/* ===== ラベル ===== */
.post_content .wpcf7-form .field-label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--label-color);
  font-size: 1rem;
}
.post_content .wpcf7-form .field-label.required::after {
  content: "必須";
  color: #fff;
  background-color: var(--required-color);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 2px 6px;
  margin-left: 8px;
  border-radius: 3px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}

/* ===== 入力系（高さ統一） ===== */
.post_content .wpcf7-form select,
.post_content .wpcf7-form input[type="text"],
.post_content .wpcf7-form input[type="email"],
.post_content .wpcf7-form input[type="tel"] {
  width: 100%;
  height: var(--field-height);
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
  color: var(--text-color);
  transition: border-color .3s, box-shadow .3s;
  box-sizing: border-box;
  line-height: normal;
}

/* select の下向き矢印 */
.post_content .wpcf7-form .cf7-section select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555555' d='M6 8.5L1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 45px;
  cursor: pointer;
}

/* テキストエリア */
.post_content .wpcf7-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
  color: var(--text-color);
  transition: border-color .3s, box-shadow .3s;
  box-sizing: border-box;
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* フォーカス */
.post_content .wpcf7-form select:focus,
.post_content .wpcf7-form input:focus,
.post_content .wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(197, 160, 79, 0.2);
}

/* プレースホルダー */
.post_content .wpcf7-form input::placeholder,
.post_content .wpcf7-form textarea::placeholder {
  color: #aaa;
  opacity: 1;
}

/* フィールド間隔 */
.post_content .wpcf7-form .field-row { margin-bottom: var(--field-spacing); }

/* ===== ラジオ/チェック ===== */
.post_content .wpcf7-form span.wpcf7-form-control.wpcf7-radio {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.post_content .wpcf7-form .wpcf7-radio .wpcf7-list-item { margin: 0; }

.post_content .wpcf7-form .wpcf7-radio label,
.post_content .wpcf7-form .wpcf7-acceptance label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.post_content .wpcf7-form input[type="radio"],
.post_content .wpcf7-form input[type="checkbox"] {
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* ===== 住所2カラム ===== */
.post_content .wpcf7-form .address-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--field-spacing) 20px;
}
.post_content .wpcf7-form .address-grid .addr-item { margin-bottom: 0; }
.post_content .wpcf7-form .address-grid .addr-item.full { grid-column: 1 / -1; }
.post_content .wpcf7-form .address-grid + .field-row { margin-top: var(--field-spacing); }

/* ===== プライバシー ===== */
.post_content .wpcf7-form .privacy-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--label-color);
  margin: 0 0 16px;
}
.post_content .wpcf7-form .privacy-text a {
  color: var(--primary-color);
  text-decoration: underline;
}
.post_content .wpcf7-form .privacy-text a:hover { text-decoration: none; }
.post_content .wpcf7-form .wpcf7-acceptance { margin-top: 16px; }

/* ===== 送信ボタン ===== */
.post_content .wpcf7-form .cf7-submit-wrap { text-align: center; margin-top: 40px; }
.post_content .wpcf7-form .cf7-submit-wrap input[type="submit"] {
  background: var(--primary-color);
  color: #fff;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform .2s, filter .2s;
  box-shadow: 0 4px 10px rgba(14, 42, 92, 0.2);
  height: auto; /* ボタンは高さ自動 */
}
.post_content .wpcf7-form .cf7-submit-wrap input[type="submit"]:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}

/* ===== 送信アニメーション ===== */
/* 既定の小さなスピナーは非表示に */
.wpcf7-spinner { display: none !important; }

/* フルスクリーンのローディングオーバーレイ */
.cf7-loading-backdrop {
  position: fixed;
  inset: 0;
  display: none;              /* is-active で表示 */
  align-items: center;
  justify-content: center;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.35); /* #111827/90% */
  backdrop-filter: blur(2px);
}
.cf7-loading-backdrop.is-active { display: flex; }

.cf7-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

/* 今風スピナー（ドーナツ） */
.cf7-loader {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 6px solid #e5e7eb;          /* slate-200 */
  border-top-color: #0ea5e9;          /* sky-500 */
  animation: cf7-spin 0.9s linear infinite;
}
@keyframes cf7-spin { to { transform: rotate(360deg); } }

.cf7-loading-text {
  margin: 0;
  font-size: 0.95rem;
  color: #111827; /* gray-900 */
}


/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .post_content .wpcf7-form { padding: 32px 20px; }
  .post_content .wpcf7-form .address-grid {
    grid-template-columns: 1fr;
    gap: var(--field-spacing);
  }
  .post_content .wpcf7-form .address-grid .addr-item.full { grid-column: 1 / 2; }
}

@media (max-width: 480px) {
  .post_content .wpcf7-form .cf7-section h2,
  .post_content .wpcf7-form .cf7-section h3 { font-size: 1.2rem; }
  .post_content .wpcf7-form span.wpcf7-form-control.wpcf7-radio {
    gap: 16px; flex-direction: column; align-items: flex-start;
  }
  .post_content .wpcf7-form select,
  .post_content .wpcf7-form input[type="text"],
  .post_content .wpcf7-form input[type="email"],
  .post_content .wpcf7-form input[type="tel"] { font-size: 16px; } /* iOSズーム対策 */
}

section.cf7-section.privacy {
    text-align: center;
}