/* =========================================================
   薬師堂すがわら歯科 お問い合わせフォーム
   Contact Form 7用
   ========================================================= */

#under-page .contact-page {
  padding-top: 90px;
}

#under-page .contact-page__inner {
  box-sizing: border-box;
  width: min(100%, 1000px);
  margin: 0 auto;
}

#under-page .contact-page__lead {
  margin: 0;
  color: #4b4b4b;
  font-size: 15px;
  line-height: 2;
  letter-spacing: 0.05em;
}

#under-page .contact-page__required-note {
  margin: 26px 0 4px;
  color: #4b4b4b;
  font-size: 14px;
  line-height: 1.8;
}

#under-page .contact-page__required-note span {
  color: #e85454;
}

#under-page .contact-page__form {
  width: 100%;
}

/* フォームの2列レイアウト */
#under-page .contact-form {
  width: 100%;
  margin: 0 auto;
  border: 0;
  border-collapse: separate;
  border-spacing: 0 40px;
  table-layout: fixed;
}

#under-page .contact-form tr,
#under-page .contact-form td {
  border: 0;
  background: transparent;
}

#under-page .contact-form td {
  box-sizing: border-box;
  padding: 0;
  vertical-align: middle;
}

#under-page .contact-form .contact-form-ttl {
  width: 285px;
  padding-right: 44px;
}

#under-page .form-label {
  display: flex;
  align-items: center;
  gap: 12px;
}

#under-page .form-ttl {
  color: #454545;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.04em;
}

#under-page .form-reqd {
  display: inline-flex;
  order: -1;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 32px;
  padding: 3px 5px;
  border-radius: 4px;
  background-color: #5bb8ae;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  box-sizing: border-box;
}

/* 入力欄 */
#under-page .contact-page__form input[type="text"],
#under-page .contact-page__form input[type="email"],
#under-page .contact-page__form input[type="tel"],
#under-page .contact-page__form textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #b8b8b8;
  border-radius: 0;
  outline: 0;
  background-color: #ffffff;
  color: #333333;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#under-page .contact-page__form input[type="text"],
#under-page .contact-page__form input[type="email"],
#under-page .contact-page__form input[type="tel"] {
  height: 44px;
  padding: 8px 12px;
}

#under-page .contact-page__form textarea {
  display: block;
  min-height: 230px;
  padding: 12px;
  resize: vertical;
}

#under-page .contact-page__form input::placeholder,
#under-page .contact-page__form textarea::placeholder {
  color: #a4a4a4;
  opacity: 1;
}

#under-page .contact-page__form input[type="text"]:focus,
#under-page .contact-page__form input[type="email"]:focus,
#under-page .contact-page__form input[type="tel"]:focus,
#under-page .contact-page__form textarea:focus {
  border-color: #5bb8ae;
  box-shadow: 0 0 0 3px rgba(91, 184, 174, 0.16);
}

/* 分割した電話番号 */
#under-page .phone-row {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
}

#under-page .phone-row .wpcf7-form-control-wrap {
  flex: 1 1 0;
  min-width: 0;
}

#under-page .phone-row .input-tel {
  width: 100%;
  text-align: center;
}

#under-page .phone-row__separator {
  flex: 0 0 auto;
  color: #555555;
}

/* 確認チェック */
#under-page .form-check {
  margin: 2px auto 28px;
  text-align: center;
}

#under-page .form-check .wpcf7-list-item {
  margin: 0;
}

#under-page .form-check label {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: #555555;
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
  cursor: pointer;
}

#under-page .form-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 4px 0 0;
  accent-color: #5bb8ae;
}

/* 送信ボタン */
#under-page .form-submit {
  position: relative;
  text-align: center;
}

#under-page .contact-page__form input[type="submit"],
#under-page .contact-page__form .wpcf7-submit {
  display: block;
  width: min(100%, 250px);
  min-height: 52px;
  margin: 0 auto;
  padding: 13px 24px;
  border: 0;
  border-radius: 3px;
  background-color: #5bb8ae;
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.06em;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

#under-page .contact-page__form input[type="submit"]:hover,
#under-page .contact-page__form .wpcf7-submit:hover {
  background-color: #459f96;
}

#under-page .contact-page__form input[type="submit"]:focus-visible,
#under-page .contact-page__form .wpcf7-submit:focus-visible {
  outline: 3px solid rgba(91, 184, 174, 0.32);
  outline-offset: 3px;
}

#under-page .contact-page__form .wpcf7-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Contact Form 7のエラー・完了メッセージ */
#under-page .contact-page__form .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  color: #d63638;
  font-size: 13px;
  line-height: 1.6;
}

#under-page .contact-page__form .wpcf7-response-output {
  box-sizing: border-box;
  max-width: 715px;
  margin: 28px auto 0;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

#under-page .contact-page__form .wpcf7-spinner {
  display: block;
  margin: 12px auto 0;
}

@media screen and (max-width: 767px) {
  #under-page .contact-page {
    padding-top: 60px;
  }

  #under-page .contact-page__lead {
    font-size: 14px;
    line-height: 1.9;
  }

  #under-page .contact-page__lead br {
    display: none;
  }

  #under-page .contact-page__required-note {
    margin-top: 22px;
    font-size: 13px;
  }

  #under-page .contact-form {
    display: block;
    margin-top: 28px;
    border-spacing: 0;
  }

  #under-page .contact-form tbody,
  #under-page .contact-form tr,
  #under-page .contact-form td {
    display: block;
    width: 100%;
  }

  #under-page .contact-form tr {
    margin-bottom: 28px;
  }

  #under-page .contact-form .contact-form-ttl {
    width: 100%;
    margin-bottom: 12px;
    padding-right: 0;
  }

  #under-page .form-label {
    gap: 10px;
  }

  #under-page .form-ttl {
    font-size: 15px;
  }

  #under-page .form-reqd {
    min-width: 34px;
    min-height: 28px;
    font-size: 11px;
  }

  #under-page .contact-page__form textarea {
    min-height: 180px;
  }

  #under-page .phone-row {
    gap: 6px;
  }

  #under-page .phone-row__separator {
    font-size: 13px;
  }

  #under-page .form-check {
    margin-top: 0;
    margin-bottom: 24px;
    text-align: left;
  }

  #under-page .form-check label {
    font-size: 13px;
  }

  #under-page .contact-page__form input[type="submit"],
  #under-page .contact-page__form .wpcf7-submit {
    width: 100%;
    max-width: 320px;
  }

  #under-page .contact-page__form .wpcf7-response-output {
    margin-top: 24px;
    text-align: left;
  }
}
