/* ============================================
   Contact Form 7 カスタムスタイル
   既存CSSと競合しないオリジナルクラス使用
   ============================================ */

/* ============================================
   ページ全体のレイアウト
   ============================================ */

/* ページ全体 */
.cf7-page-contact {
  width: 100%;
  background: #fff;
  padding-top: 130px;
}

@media only screen and (max-width: 768px) {
  .cf7-page-contact {
    padding-top: 70px;
  }
}

/* コンテナ */
.cf7-container-large {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 30px;
}

.cf7-container-medium {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

@media only screen and (max-width: 1024px) {
  .cf7-container-large,
  .cf7-container-medium {
    padding: 0 20px;
  }
}

@media only screen and (max-width: 768px) {
  .cf7-container-large,
  .cf7-container-medium {
    padding: 0 15px;
  }
}

/* ページヘッダー */
.cf7-page-header {
  padding: 50px 0 60px;
  text-align: center;
  /* background: #fafafa; */
}

@media only screen and (max-width: 768px) {
  .cf7-page-header {
    padding: 30px 0 40px;
  }
}

/* ヘッダー内の説明文 */
.cf7-page-header .cf7-form-desc {
  margin-top: 30px;
  margin-bottom: 0;
  font-size: 1.4rem;
  line-height: 1.8;
  color: #666;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

@media only screen and (max-width: 768px) {
  .cf7-page-header .cf7-form-desc {
    margin-top: 20px;
    font-size: 1.4rem;
    line-height: 1.7;
  }
}

.cf7-page-header .cf7-form-desc br {
  display: block;
}

@media only screen and (max-width: 768px) {
  .cf7-page-header .cf7-form-desc br {
    display: none;
  }
}

/* コンテンツラッパー */
.cf7-content-wrapper {
  padding-bottom: 80px;
  background: #fff;
}

@media only screen and (max-width: 768px) {
  .cf7-content-wrapper {
    padding: 40px 0 50px;
  }
}

/* パンくずリスト */
.cf7-breadcrumb-section {
  padding: 0 0 40px;
}

@media only screen and (max-width: 768px) {
  .cf7-breadcrumb-section {
    padding: 0 0 30px;
  }
}

.cf7-breadcrumb {
  font-size: 1.4rem;
}

.cf7-breadcrumb ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.cf7-breadcrumb li {
  display: flex;
  align-items: center;
}

.cf7-breadcrumb li::after {
  content: ">";
  margin: 0 10px;
  color: #999;
}

.cf7-breadcrumb li:last-child::after {
  display: none;
}

.cf7-breadcrumb a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s;
}

.cf7-breadcrumb a:hover {
  color: #666;
  text-decoration: underline;
}

/* ============================================
   フォーム部分
   ============================================ */

/* フォーム全体の背景 */
.cf7-form-inner {
  width: 100%;
  background: #f5f5f5;
  padding: 50px 40px 0;
}

@media only screen and (max-width: 768px) {
  .cf7-form-inner {
    padding: 30px 20px;
  }
}

/* テーブル */
.cf7-form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

.cf7-form-table tbody {
  display: table-row-group;
}

.cf7-form-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.cf7-form-table tr:first-child {
  border-top: none;
}

.cf7-form-table tr:last-child {
  border-bottom: none;
}

/* テーブルセル */
.cf7-label-cell {
  width: 28%;
  padding: 30px 10px 30px 0;
  vertical-align: middle;
  font-weight: 500;
  font-size: 1.5rem;
  color: #333;
  background: transparent;
}

.cf7-form-table tbody tr:first-child .cf7-label-cell,
.cf7-form-table tbody tr:first-child .cf7-input-cell {
  padding-top: 0;
}

.cf7-label-cell.cf7-valign-top {
  vertical-align: top;
  padding-top: 33px;
}

.cf7-input-cell {
  padding: 30px 0;
  background: transparent;
}

@media only screen and (max-width: 1024px) {
  .cf7-label-cell {
    width: 35%;
    padding: 25px 20px 25px 0;
  }

  .cf7-label-cell.cf7-valign-top {
    padding-top: 28px;
  }

  .cf7-input-cell {
    padding: 25px 0;
  }
}

@media only screen and (max-width: 768px) {
  .cf7-form-table,
  .cf7-form-table tbody,
  .cf7-form-table tr,
  .cf7-form-table td {
    display: block;
    width: 100%;
  }

  .cf7-form-table tr {
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .cf7-label-cell,
  .cf7-input-cell {
    padding: 0;
    background: transparent;
  }

  .cf7-label-cell {
    width: 100%;
    margin-bottom: 12px;
  }

  .cf7-label-cell.cf7-valign-top {
    padding-top: 0;
  }
}

/* 必須マーク */
.cf7-required {
  display: inline-flex;
  align-items: center;
}

.cf7-required::after {
  content: "必須";
  font-size: 1.1rem;
  color: #fff;
  background: #d32f2f;
  padding: 3px 10px;
  border-radius: 3px;
  margin-left: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

/* 基本フォームコントロール */
.wpcf7-form-control-wrap {
  display: block;
}

/* テキスト入力、セレクト、テキストエリア */
.cf7-input,
.cf7-select,
.cf7-textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.5rem;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.3s;
  font-family: inherit;
  box-sizing: border-box;
}

.cf7-input::placeholder,
.cf7-textarea::placeholder {
  color: #999;
}

.cf7-input:focus,
.cf7-select:focus,
.cf7-textarea:focus {
  outline: none;
  border-color: #333;
}

.cf7-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1.41 0L6 4.59 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  padding-right: 40px;
}

.cf7-textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.6;
}

@media only screen and (max-width: 768px) {
  .cf7-input,
  .cf7-select,
  .cf7-textarea {
    padding: 12px 14px;
    font-size: 1.6rem;
  }
}

/* ラジオボタン */
.cf7-radio-wrapper {
  background: #fff;
  padding: 25px 30px;
  border-radius: 4px;
  display: flex;
  gap: 50px;
  border: 1px solid #e0e0e0;
}

@media only screen and (max-width: 1024px) {
  .cf7-radio-wrapper {
    gap: 40px;
  }
}

@media only screen and (max-width: 768px) {
  .cf7-radio-wrapper {
    flex-direction: column;
    gap: 18px;
    padding: 20px;
  }
}

.wpcf7-radio .wpcf7-list-item {
  margin: 0;
  margin-right: 10px;
  display: inline-block;
}

.wpcf7-radio .wpcf7-list-item label {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  padding-left: 24px;
  min-height: 24px;
}

.wpcf7-radio .wpcf7-list-item input[type="radio"] {
  position: absolute;
  left: 0;
  opacity: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.wpcf7-radio .wpcf7-list-item label::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: border-color 0.2s;
}

.wpcf7-radio .wpcf7-list-item label::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #333;
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  opacity: 0;
  transition: all 0.2s;
}

.wpcf7-radio .wpcf7-list-item input[type="radio"]:checked ~ ::before,
.wpcf7-radio .wpcf7-list-item label:has(input[type="radio"]:checked)::before {
  border-color: #333;
}

.wpcf7-radio .wpcf7-list-item input[type="radio"]:checked ~ ::after,
.wpcf7-radio .wpcf7-list-item label:has(input[type="radio"]:checked)::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* チェックボックス */
.cf7-checkbox-container {
  background: #fff;
  padding: 30px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

@media only screen and (max-width: 768px) {
  .cf7-checkbox-container {
    padding: 20px;
  }
}

.cf7-checkbox-container .wpcf7-form-control {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
}

.wpcf7-checkbox .wpcf7-list-item {
  margin: 0;
  flex: 0 0 calc(33.333% - 14px);
  max-width: calc(33.333% - 14px);
}

@media only screen and (max-width: 768px) {
  .cf7-checkbox-container .wpcf7-form-control {
    flex-direction: column;
    gap: 6px;
  }

  .cf7-checkbox-container .wpcf7-list-item {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
  }
}

.wpcf7-checkbox .wpcf7-list-item label {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  padding-left: 22px;
  min-height: 20px;
  word-break: break-word;
}

.wpcf7-checkbox .wpcf7-list-item input[type="checkbox"] {
  position: absolute;
  left: 0;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.wpcf7-checkbox .wpcf7-list-item label::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-radius: 3px;
  background: #fff;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.2s;
}

.wpcf7-checkbox .wpcf7-list-item label::after {
  content: "";
  width: 10px;
  height: 10px;
  background: url(../img/common/form_check.svg) no-repeat center;
  background-size: contain;
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  opacity: 0;
  transition: all 0.2s;
}

.wpcf7-checkbox .wpcf7-list-item input[type="checkbox"]:checked ~ ::before,
.wpcf7-checkbox
  .wpcf7-list-item
  label:has(input[type="checkbox"]:checked)::before {
  background: #333;
  border-color: #333;
}

.wpcf7-checkbox .wpcf7-list-item input[type="checkbox"]:checked ~ ::after,
.wpcf7-checkbox
  .wpcf7-list-item
  label:has(input[type="checkbox"]:checked)::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* その他フィールド */
.cf7-other-wrapper {
  margin-top: 15px;
}

/* 住所フィールドグループ */
.cf7-address-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cf7-postal-row {
  display: flex;
  gap: 30px;
}

@media only screen and (max-width: 768px) {
  .cf7-postal-row {
    flex-direction: column;
    gap: 20px;
  }
}

.cf7-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf7-field-label {
  font-size: 1.4rem;
  font-weight: 500;
}

.cf7-field-input {
  flex: 1;
}

.cf7-address-row,
.cf7-building-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf7-postcode {
  max-width: 200px;
}

/* 建築予定地 */
.cf7-planned-group {
  background: #fff;
  padding: 25px 30px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

@media only screen and (max-width: 768px) {
  .cf7-planned-group {
    padding: 20px;
  }
}

.cf7-planned-group .cf7-radio-wrapper {
  background: transparent;
  padding: 0;
  margin-bottom: 20px;
  border: none;
}

.cf7-planned-input {
  background: #fff;
}

/* 送信セクション */
.cf7-submit-section {
  /* margin-top: 50px; */
  padding: 40px 0;
  background: #f5f5f5;
}

@media only screen and (max-width: 768px) {
  .cf7-submit-section {
    margin-top: 40px;
    padding: 30px 0;
  }
}

.cf7-submit-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 30px;
}

@media only screen and (max-width: 768px) {
  .cf7-submit-inner {
    padding: 0 20px;
  }
}

.cf7-policy-text {
  font-size: 1.5rem;
  line-height: 1.9;
  margin-bottom: 25px;
  text-align: center;
  color: #555;
}

@media only screen and (max-width: 768px) {
  .cf7-policy-text {
    font-size: 1.4rem;
    line-height: 1.8;
  }
}

.cf7-policy-link {
  color: #333;
  text-decoration: underline;
  font-weight: 500;
}

/* Acceptance（同意チェックボックス） */
.cf7-acceptance-wrapper {
  text-align: center;
  margin-bottom: 30px;
}

.cf7-acceptance-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 500;
  color: #333;
}

@media only screen and (max-width: 768px) {
  .cf7-acceptance-label {
    font-size: 1.4rem;
  }
}

.wpcf7-acceptance .wpcf7-list-item label {
  display: flex;
  align-items: center;
}

.wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.wpcf7-acceptance input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  margin-right: 10px;
  cursor: pointer;
  accent-color: #333;
}

.cf7-acceptance-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
}

/* 送信ボタン */
.cf7-button-wrapper {
  text-align: center;
  position: relative;
  display: inline-block;
  width: 100%;
}

.cf7-submit-btn {
  min-width: 320px;
  padding: 16px 50px;
  font-size: 1.6rem;
  font-family: var(--cor-font, "Cormorant", serif);
  color: #fff;
  background: #333;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cf7-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #999;
}

@media only screen and (max-width: 768px) {
  .cf7-submit-btn {
    min-width: 280px;
    padding: 14px 40px;
    font-size: 1.5rem;
  }
}

/* バリデーションエラー */
.wpcf7-not-valid-tip {
  color: #d32f2f;
  font-size: 1.3rem;
  margin-top: 5px;
  display: block;
}

.wpcf7-form-control.wpcf7-not-valid {
  border-color: #d32f2f;
}

/* レスポンスメッセージ */
.wpcf7-response-output {
  margin: 20px 0;
  padding: 15px 20px;
  border: 2px solid;
  border-radius: 4px;
  text-align: center;
  font-size: 1.5rem;
}

.wpcf7-validation-errors {
  border-color: #d32f2f;
  background: #ffebee;
  color: #c62828;
  border: 1px solid #d32f2f !important;
}

.wpcf7-mail-sent-ok {
  border-color: #4caf50;
  background: #e8f5e9;
  color: #2e7d32;
}

.wpcf7-mail-sent-ng {
  border-color: #d32f2f;
  background: #ffebee;
  color: #c62828;
}

/* スピナー */
.wpcf7-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin-left: 180px;
  width: 20px;
  height: 20px;
  display: none;
}

.cf7-button-wrapper .wpcf7-spinner.is-active {
  display: block;
}

@media only screen and (max-width: 768px) {
  .wpcf7-spinner {
    margin-left: 160px;
  }
}

/* フォームコントロールラッパー */
.wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* ============================================
   モーダル確認画面
   ============================================ */

/* モーダル全体 */
.cf7-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

/* オーバーレイ */
.cf7-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

/* モーダルコンテンツ */
.cf7-modal-content {
  position: relative;
  background: #fff;
  max-width: 800px;
  max-height: 80vh;
  margin: 10vh auto;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-content {
    max-width: 95%;
    margin: 10vh auto;
    max-height: 80vh;
  }
}

/* モーダルヘッダー */
.cf7-modal-header {
  padding: 25px 30px;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
  text-align: center;
}

.cf7-modal-header h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
  color: #333;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-header {
    padding: 20px;
  }

  .cf7-modal-header h2 {
    font-size: 1.8rem;
  }
}

/* モーダルボディ */
.cf7-modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-body {
    padding: 20px;
  }
}

.cf7-modal-description {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 25px;
  text-align: center;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-description {
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: left;
  }
}

/* モーダルテーブル */
.cf7-modal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.cf7-modal-table tr {
  border-bottom: 1px solid #e0e0e0;
}

.cf7-modal-table tr:last-child {
  border-bottom: none;
}

.cf7-modal-table th {
  width: 30%;
  padding: 15px;
  text-align: left;
  font-weight: 500;
  font-size: 1.4rem;
  color: #333;
  background: #fafafa;
  vertical-align: top;
  vertical-align: middle;
  border-bottom: 1px solid #e0e0e0;
}

.cf7-modal-table td {
  padding: 15px;
  font-size: 1.5rem;
  color: #333;
  vertical-align: top;
  line-height: 1.6;
  vertical-align: middle;
  border-bottom: 1px solid #e0e0e0;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-table,
  .cf7-modal-table tbody,
  .cf7-modal-table tr,
  .cf7-modal-table th,
  .cf7-modal-table td {
    display: block;
    width: 100%;
  }

  .cf7-modal-table tr {
    padding: 15px 0;
  }

  .cf7-modal-table th {
    padding: 0 0 8px 0;
    background: transparent;
    font-size: 1.3rem;
    color: #666;
    border: none;
  }

  .cf7-modal-table td {
    padding: 0;
    font-size: 1.4rem;
    border: none;
  }
}

/* モーダルフッター */
.cf7-modal-footer {
  padding: 25px 30px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: center;
  gap: 20px;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-footer {
    padding: 20px;
    flex-direction: column;
    gap: 15px;
  }
}

/* モーダルボタン */
.cf7-modal-btn {
  min-width: 180px;
  padding: 14px 30px;
  font-size: 1.6rem;
  font-family: var(--cor-font, "Cormorant", serif);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.cf7-modal-back {
  color: #333;
  background: #fff;
  border: 1px solid #333;
}

.cf7-modal-submit {
  color: #fff;
  background: #333;
}

@media only screen and (max-width: 768px) {
  .cf7-modal-btn {
    width: 100%;
    min-width: auto;
  }
}

/* body固定 */
body.cf7-modal-open {
  overflow: hidden;
}
