/* ================================================
   DiDi Business LP - CF7追加CSS
   既存のstyle.cssに追記してください
   ※ style.cssに既存のフォームスタイルが含まれている前提
   ================================================ */

/* =========================
   CF7出力のwrapper・pタグリセット
========================= */

.wpcf7-form p {
  margin: 0;
}

.wpcf7-form .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

.form-agree .wpcf7-form-control-wrap {
  width: auto;
  display: flex;
  align-items: center;
}

.form-agree .wpcf7-list-item {
  margin: 0;
  display: flex;
  align-items: center;
}

/* =========================
   CF7入力欄を既存スタイルに合わせる
========================= */

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"] {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;
  background: #f5f5f5;
  padding: 0 14px;
  font-size: 1rem;
  color: #333;
  outline: none;
  font-family: inherit;
}

.wpcf7-form select {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;
  background: #f5f5f5;
  padding: 0 14px 0 14px;
  font-size: 14px;
  color: #333;
  outline: none;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
}

.wpcf7-form textarea {
  width: 100%;
  height: 120px;
  border: none;
  border-radius: 8px;
  background: #f5f5f5;
  padding: 14px;
  font-size: 1rem;
  color: #333;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder {
  color: #aaa;
}

/* =========================
   CF7セレクトの矢印
   （select-wrapで囲んでいない場合の対応）
========================= */

.wpcf7-form-control-wrap[data-name="companylocation"],
.wpcf7-form-control-wrap[data-name="referralsource"] {
  position: relative;
  display: block;
}

.wpcf7-form-control-wrap[data-name="companylocation"]::after,
.wpcf7-form-control-wrap[data-name="referralsource"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* =========================
   CF7 acceptanceチェックボックス
========================= */

.wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border: 1px solid #bbb;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: #eee;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.wpcf7-form .wpcf7-acceptance input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #fc4d02;
  border-bottom: 2px solid #fc4d02;
  transform: rotate(45deg);
}

/* =========================
   CF7送信ボタン
========================= */

.wpcf7-form input[type="submit"],
.wpcf7-submit {
  width: 220px;
  height: 56px;
  border-radius: 999px;
  border: none;
  background: #fc4d02;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: block;
  margin: 28px auto 0;
  transition: opacity 0.2s;
  -webkit-appearance: none;
}

.wpcf7-form input[type="submit"]:hover,
.wpcf7-submit:hover {
  opacity: 0.85;
}

/* =========================
   CF7バリデーションエラー
========================= */

.wpcf7-not-valid-tip {
  font-size: 0.85rem;
  color: #b42318;
  margin-top: 4px;
  display: block;
}

.wpcf7-response-output {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: none !important;
}

.wpcf7-form.invalid .wpcf7-response-output {
  background: #fff3f1;
  color: #b42318;
  border: 1px solid #f5c7c2 !important;
}

.wpcf7-form.sent .wpcf7-response-output {
  background: #eefaf3;
  color: #13653a;
  border: 1px solid #ccefd9 !important;
}

.wpcf7-form input[type="text"].wpcf7-not-valid,
.wpcf7-form input[type="email"].wpcf7-not-valid,
.wpcf7-form input[type="tel"].wpcf7-not-valid,
.wpcf7-form select.wpcf7-not-valid,
.wpcf7-form textarea.wpcf7-not-valid {
  background: #fff8f7;
  border: 1px solid #f0a59b;
}

/* =========================
   CF7 プライバシーポリシー同意
========================= */

.form-agree p {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.form-agree .wpcf7-form-control-wrap {
  width: auto;
  display: flex;
  align-items: center;
}

.form-agree .wpcf7-list-item {
  margin: 0;
  display: flex;
  align-items: center;
}

.form-agree a {
  text-decoration: underline;
}

/* =========================
   送信ボタン・スピナー
========================= */

.form-submit {
  display: flex;
  justify-content: center;
  align-items: center;
}

.form-submit p {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.form-submit .wpcf7-submit {
  margin: 0 !important;
}

.form-submit .wpcf7-spinner {
  position: absolute;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  margin: 0;
}

/* =========================
   認証完了画面
========================= */

.auth-complete {
  width: 100%;
  text-align: center;
  padding: 200px 40px 150px;
}

.auth-complete__title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.auth-complete__text {
  font-size: 1rem;
  line-height: 1.8;
  color: #333;
}

.auth-complete__btn {
  display: inline-block;
  margin-top: 40px;
  padding: 16px 48px;
  background: #fc4d02;
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity 0.2s;
}

.auth-complete__btn:hover {
  opacity: 0.85;
}

/* =========================
   モバイル
========================= */

@media screen and (max-width: 896px) {
  .wpcf7-form input[type="submit"],
  .wpcf7-submit {
    width: 100%;
    max-width: 300px;
  }

  .form-submit p {
    justify-content: center;
    width: 90%;
  }

  .auth-complete {
    padding: 120px 30px 100px;
  }

  .auth-complete__title {
    font-size: 1.4rem;
  }
}