/* Contact Form 7（チェックボックス・同意欄・確認画面）。読み込み条件は backend/inc/enqueue.php */

/* ============================================================
   CF7 Checkbox & Acceptance adapter for GIFTLs theme
   ============================================================ */

/* Disable container styles for checkboxes */
.main-form .form-row .box .i-list .wpcf7-form-control-wrap {
  width: 100%;
  display: block;
  margin: 0;
  padding: 0;
}

.main-form .form-row .box .i-list .wpcf7-checkbox.i-custom {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

.wpcf7-checkbox.i-custom {
  cursor: default;
  display: flex;
  margin: 0;
  padding: 0;
  position: static;
}

/* Stop container span and wrapper elements from getting checkbox pseudo-elements */
.wpcf7-checkbox.i-custom::before,
.wpcf7-checkbox.i-custom::after,
.wpcf7-checkbox.i-custom > span.wpcf7-list-item::before,
.wpcf7-checkbox.i-custom > span.wpcf7-list-item::after {
  content: none;
  display: none;
}

/* Style each list item as the custom checkbox item */
.wpcf7-checkbox.i-custom > span.wpcf7-list-item {
  padding: 0;
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin: 0 0 7.5px 0;
  width: 172.5px; /* PC layout width */
  box-sizing: border-box;
}

/* Make each checkbox width 50% on mobile */
@media only screen and (max-width: 767px) {
  .wpcf7-checkbox.i-custom > span.wpcf7-list-item {
    width: 50%;
    margin: 0 0 10px 0;
  }
}

/* Label wraps input and span */
.wpcf7-checkbox.i-custom .wpcf7-list-item label {
  display: inline-block;
  cursor: pointer;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Hide native input */
.wpcf7-checkbox.i-custom .wpcf7-list-item input {
  opacity: 0;
  position: absolute;
  width: auto;
  height: auto;
}

/* Style the span containing the text */
.wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label {
  padding: 0px 0 0 31.5px;
  position: relative;
  display: inline-block;
  margin: 0;
}
.i-custom .wpcf7-list-item-label::before,
.wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::before {
  background: #fff;
	border: 0.75px solid #ddd;
  width: 24px;
  height: 24px;
  left: 0;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  transition: all 0.3s ease;
}
@media screen and (max-width: 767px) {
  .i-custom .wpcf7-list-item-label::before,
.wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::before {
	border: 1px solid #ddd;
  width: 32px;
  height: 32px;
  }
}
.i-custom .wpcf7-list-item-label::after,
.wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::after {
	content: "";
  position: absolute;
 	left: 9px;
  top: 4.5px;
  width: 5.25px;
  height: 9.75px;
	background: transparent;
  border: solid white;
  border-width: 0 2.25px 2.25px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
	display: none;
}
@media screen and (max-width: 767px) {
  .i-custom .wpcf7-list-item-label::after,
.wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::after {
 	left: 12px;
  top: 6px;
  width: 7px;
  height: 13px;
  border-width: 0 3px 3px 0;
  }
}
.i-custom input:checked ~ .wpcf7-list-item-label:before{
	background: #005e36;
}
.wpcf7-checkbox.i-custom .wpcf7-list-item input:checked ~ .wpcf7-list-item-label::before {
  background: #005dad;
}
.i-custom input:checked ~ .wpcf7-list-item-label:after,
.wpcf7-checkbox.i-custom .wpcf7-list-item input:checked ~ .wpcf7-list-item-label::after {
  display: block;
}

/* Mobile responsive for checkbox label/span */
@media only screen and (max-width: 767px) {
  .wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label {
    padding: 1px 0 0 30px;
  }
  .wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::before {
    width: 22px;
    height: 22px;
  }
  .wpcf7-checkbox.i-custom .wpcf7-list-item .wpcf7-list-item-label::after {
    width: 5px;
		height: 10px;
		left: 8px;
		top: 3px;
  }
}

/* ============================================================
   CF7 Acceptance (Privacy Policy) checkbox adapter
   ============================================================ */

/* Disable container styles for acceptance wrapper */
.wpcf7-acceptance.i-custom {
  display: inline-block;
  margin: 0;
  position: relative;
}

/* Stop acceptance container span from getting checkbox pseudo-elements */
.wpcf7-acceptance.i-custom::before,
.wpcf7-acceptance.i-custom::after {
  content: none;
  display: none;
}

.wpcf7-acceptance.i-custom label {
  cursor: pointer;
  display: inline-block;
  margin: 0;
  position: relative;
}

/* Style the input inside acceptance */
.wpcf7-acceptance.i-custom input {
  opacity: 0;
  position: absolute;
  width: auto;
  height: auto;
}

/* Style the span (wpcf7-list-item-label) which contains the text */
.wpcf7-acceptance.i-custom .wpcf7-list-item-label {
  padding: 3.75px 0 0 31.5px;
  position: relative;
  display: inline-block;
}

/* Border variant */
.wpcf7-acceptance.i-custom.border .wpcf7-list-item-label::before {
  border: 0.75px solid #e0dfdf;
  box-sizing: border-box;
}
@media screen and (max-width: 767px) {
  .wpcf7-acceptance.i-custom.border .wpcf7-list-item-label::before {
  border: 1px solid #e0dfdf;
  }
}

.wpcf7-acceptance.i-custom .wpcf7-list-item-label::before {
  background: #fefefe;
  width: 24px;
  height: 24px;
  left: 0;
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  transition: all 0.3s ease;
}

.wpcf7-acceptance.i-custom .wpcf7-list-item-label::after {
  background: #fefefe;
  width: 15px;
  height: 15px;
  left: 4.5px;
  content: "";
  position: absolute;
  top: 4.5px;
  bottom: 4.5px;
  transition: all 0.3s ease;
  opacity: 0;
  background: #e0dfdf;
  transform: scale(0);
}
@media screen and (max-width: 767px) {
  .wpcf7-acceptance.i-custom .wpcf7-list-item-label::after {
  bottom: 6px;
  }
}

.wpcf7-acceptance.i-custom input:checked ~ .wpcf7-list-item-label::after {
  opacity: 1;
  transform: scale(1);
}

/* Mobile responsive for acceptance */
@media only screen and (max-width: 767px) {
  .wpcf7-acceptance.i-custom .wpcf7-list-item-label {
    padding: 1px 0 0 30px;
    line-height: 24px;
    text-align: left;
    font-size: 15px;
    width: 255px;
  }
  .wpcf7-acceptance.i-custom .wpcf7-list-item-label::before {
    width: 22px;
    height: 22px;
    top: 12px;
  }
  .wpcf7-acceptance.i-custom .wpcf7-list-item-label::after {
    width: 14px;
    height: 14px;
    left: 4px;
    top: 16px;
  }
}

.wpcf7 form .wpcf7-response-output {
  border: none;
}

.text-center {
  text-align: center;
}

.multiline {
  white-space: pre-wrap;
}

.cate-blog .cate-list li a.active {
  background: linear-gradient(90deg, #03567f 0%, #3c68c7 100%);
  color: #fff;
}

/* ============================================================
   Contact Form 7 Multi-Step Form Custom Styling & Overrides (Confirm Page Only)
   ============================================================ */

/* 1. Reset alignment of rows on confirmation page template */
.page-template-page-confirm-php .form-row .title.center {
  padding-top: 7.5px;
}
@media screen and (max-width: 767px) {
  .page-template-page-confirm-php .form-row .title.center {
  padding-top: 10px;
  }
}

.page-template-page-confirm-php .form-row .box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  min-height: 30px;
  word-break: break-all;
}

.page-template-page-confirm-php .form-row .box p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

/* Hide unwanted br tags inside the confirmation box (prevents layout jump without affecting email body!) */
.page-template-page-confirm-php .form-row .box br {
  display: none;
}

.page-template-page-confirm-php .form-row .box .number-note {
  top: 0;
  margin-left: 7.5px;
  display: inline-block;
}

/* 2. Position both buttons horizontally side-by-side on desktop confirmation page */
.page-template-page-confirm-php .submit-box {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 41.25px; /* Push buttons nicely below the table */
  padding-top: 0;
  width: 100%;
}

.page-template-page-confirm-php .submit-box .confirm-back-btn,
.page-template-page-confirm-php .submit-box .submit-btn {
  margin: 0;
  padding: 0;
  width: auto;
  height: auto;
  display: inline-flex;
}

/* 3. Style both buttons identically in shape and dimensions for a uniform premium look */
.page-template-page-confirm-php .submit-box .btn-back-confirm,
.page-template-page-confirm-php .submit-box input.wpcf7-previous,
.page-template-page-confirm-php .submit-box .wpcf7-submit,
.page-template-page-confirm-php .submit-box .submit-btn button {
  -webkit-appearance: none;
  appearance: none;
  width: 187.5px;
  height: 51px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  box-shadow: none;
  outline: none;
}
@media screen and (max-width: 767px) {
  .page-template-page-confirm-php .submit-box .btn-back-confirm,
.page-template-page-confirm-php .submit-box input.wpcf7-previous,
.page-template-page-confirm-php .submit-box .wpcf7-submit,
.page-template-page-confirm-php .submit-box .submit-btn button {
  border-radius: var(--radius-sm);
  }
}

/* Gold Theme Back Button Styles (reusing Request Info properties) */
.page-template-page-confirm-php .submit-box .btn-back-confirm,
.page-template-page-confirm-php .submit-box input.wpcf7-previous {
  background: #fff;
  color: #005dad;
  box-shadow: inset 0 0 0 1.5px #005dad;
  text-decoration: none;
}

.page-template-page-confirm-php .submit-box .btn-back-confirm:hover,
.page-template-page-confirm-php .submit-box input.wpcf7-previous:hover {
  background: #005dad;
  color: #FFF;
  opacity: 1;
}

/* Green Theme Send Button Styles */
.page-template-page-confirm-php .submit-box .wpcf7-submit,
.page-template-page-confirm-php .submit-box .submit-btn button {
  background: #e04e4e;
  color: #FFF;
}

.page-template-page-confirm-php .submit-box .wpcf7-submit:hover,
.page-template-page-confirm-php .submit-box .submit-btn button:hover {
  background: #c43a3a;
  opacity: 1;
}

/* 4. Hide duplicate confirmation buttons, spinner, and extra br tags if CF7 outputs them */
.page-template-page-confirm-php .submit-box input.wpcf7-previous + input.wpcf7-previous {
  display: none;
}

.page-template-page-confirm-php .submit-box .wpcf7-spinner {
  display: none;
}

.page-template-page-confirm-php .submit-box p br {
  display: none;
}

.page-template-page-confirm-php .wpcf7-form {
  width: 100%;
}

/* 5. Mobile responsive stacked layout */
@media only screen and (max-width: 767px) {
  .page-template-page-confirm-php .form-row .box {
    min-height: auto;
  }
  .page-template-page-confirm-php .form-row .box .number-note {
    margin-left: 5px;
    top: 0;
  }
  
  /* Stack buttons vertically on mobile: primary button on top, back button below */
  .page-template-page-confirm-php .submit-box {
    flex-direction: column-reverse;
    gap: 15px;
    margin-top: 35px;
    padding: 0 5vw;
  }

  /* 親の p が中身の幅に縮むとボタンの width: 100% が効かないため、p を全幅にする */
  .page-template-page-confirm-php .submit-box .confirm-back-btn,
  .page-template-page-confirm-php .submit-box .submit-btn {
    width: 100%;
  }

  .page-template-page-confirm-php .submit-box .btn-back-confirm,
  .page-template-page-confirm-php .submit-box input.wpcf7-previous,
  .page-template-page-confirm-php .submit-box .wpcf7-submit,
  .page-template-page-confirm-php .submit-box .submit-btn button {
    width: 100%;
    height: 50px;
    font-size: 18px;
    margin: 0 auto;
  }
}

/* 個人情報の同意チェック：枠が薄くて見えにくいので、濃い枠にして押せることが分かるようにする */
.submit-box .check .wpcf7-list-item-label::before {
  border: 2px solid #8a8a8a;
  border-radius: 4px;
}
.submit-box .check label {
  cursor: pointer;
}
.submit-box .check label:hover .wpcf7-list-item-label::before {
  border-color: #005e36;
}
.submit-box .check input:focus-visible ~ .wpcf7-list-item-label::before {
  outline: 2px solid #005dad;
  outline-offset: 2px;
}
.submit-box .check input:checked ~ .wpcf7-list-item-label::before {
  border-color: #005e36;
}

/* フォーム内の WOW アニメーション（CF7 のフォーム設定側に付いている）を止め、最初から表示する */
.wpcf7 .wow {
  visibility: visible !important;
  animation: none !important;
}
