/* ==========================================================================
   Contact Page — MW WP Form Styling + Responsive
   ========================================================================== */

/* ===== MW WP Form Container ===== */

.contact-form-mw {
  width: 880px;
  max-width: 100%;
  margin: 0 auto;
}

.contact-form-mw .mw_wp_form form {
  display: flex;
  flex-direction: column;
  gap: 70px;
}

.contact-form__radio-group {
  display: flex;
  align-items: flex-start;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0px 30px;
  width: auto;
  max-width: 100%;
}

/* ===== Form Field ===== */

.contact-form__field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* ===== Label ===== */

.contact-form__label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

.contact-form__label-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #000;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.contact-form__required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff0000;
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  line-height: 1;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* ===== Input / Textarea / Select ===== */

.contact-form__field input[type='text'],
.contact-form__field input[type='email'],
.contact-form__field input[type='tel'],
.contact-form__field textarea,
.contact-form__field select {
  width: 100%;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  color: #000;
  background: #f7f9faff;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.contact-form__field input::placeholder,
.contact-form__field textarea::placeholder {
  color: #aaa;
}

.contact-form__field textarea {
  min-height: 200px;
  resize: vertical;
}

.contact-form__field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23333'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 24px;
  padding-right: 40px;
}

/* ===== Radio Buttons ===== */

.contact-form__field .mwform-radio-field {
  display: flex;
  flex-direction: row;
  gap: 30px;
}

.contact-form__field .mwform-radio-field-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #000;
  cursor: pointer;
}

.contact-form__field .mwform-radio-field input[type='radio'] {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  vertical-align: middle;
  cursor: pointer;
}

/* ===== Checkbox (Consent) ===== */

.contact-form__consent-wrap {
  display: flex;
  align-items: center;
}

.contact-form__consent-wrap .mwform-checkbox-field input[type='checkbox'] {
  width: 22px;
  height: 22px;
  margin-right: 10px;
  vertical-align: middle;
  cursor: pointer;
}

/* MW WP Form が自動生成する「同意します」テキストを非表示（自前で再配置するため） */
.contact-form__consent-wrap .mwform-checkbox-field-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.contact-form__consent-link {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  color: #000;
  text-decoration: underline;
  padding-right: 4px;
}

.contact-form__consent-text {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  color: #000;
}

/* ===== Address Sub-fields ===== */

.contact-form__address {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-form__address-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.contact-form__address-row:nth-child(1) input,
.contact-form__address-row:nth-child(2) select {
  max-width: 200px;
  max-height: 48px;
}

.contact-form__address-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  white-space: nowrap;
  width: 84px;
  flex-shrink: 0;
}

/* ===== Postal Code Lookup Button ===== */

.contact-form__postal-btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 24px;
  background: #000;
  color: #fff;
  border: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.3s ease;
  height: 48px;
}

.contact-form__postal-btn:hover {
  opacity: 0.8;
}

.contact-form__postal-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ===== Submit Button ===== */

.contact-form__submit {
  width: 100%;
}

.contact-form__submit input[type='submit'] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  padding: 20px;
  background: #000;
  color: #fff;
  border: none;
  border-radius: 0;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
}

.contact-form__submit input[type='submit']:hover {
  opacity: 0.8;
}

/* ===== MW WP Form Validation Errors ===== */

.contact-form__field .error {
  color: #ff0000;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  margin-top: 4px;
}

/* ===== Custom Validation Errors ===== */

.contact-form__error {
  color: #ff0000;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  font-weight: 400;
  margin: 8px 0 0;
}

.contact-form__field--error input[type='text'],
.contact-form__field--error input[type='email'],
.contact-form__field--error input[type='tel'],
.contact-form__field--error textarea,
.contact-form__field--error select {
  border-color: #ff0000;
}

/* ===== MW WP Form Confirm/Complete Pages ===== */

.mw_wp_form_confirm .contact-form__field input,
.mw_wp_form_confirm .contact-form__field textarea,
.mw_wp_form_confirm .contact-form__field select {
  border: none;
  background: transparent;
  padding: 0;
}
.mw_wp_form_confirm .contact-form__field p {
  line-height: 1.8;
}

/* ===== Responsive: Tablet (≤768px) ===== */

@media screen and (max-width: 768px) {
  .contact-form-mw {
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
  }
}

/* ===== Responsive: Mobile (≤480px) ===== */

@media screen and (max-width: 480px) {
  .contact-form-mw .mw_wp_form {
    gap: 60px;
  }

  .contact-form__label-text {
    font-size: 20px;
  }

  .contact-form__required {
    padding: 2px 4px;
    font-size: 13px;
  }

  .contact-form__field .mwform-radio-field {
    flex-direction: column;
    gap: 20px;
  }

  .contact-form__field input[type='text'],
  .contact-form__field input[type='email'],
  .contact-form__field input[type='tel'],
  .contact-form__field textarea,
  .contact-form__field select {
    font-size: 16px;
    padding: 12px;
  }
}

@media screen and (max-width: 480px) {
  .contact-form-mw {
    padding: 0 !important;
  }
  .contact-form__radio-group {
    flex-direction: column !important;
    gap: 20px 30px !important;
  }
  .mwform-radio-field.horizontal-item {
    margin-left: 0 !important ;
  }
  .contact-form__address-row {
    flex-direction: column !important;
    width: 100% !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 0 !important;
  }
  .contact-form__address-row:nth-child(1) input,
  .contact-form__address-row:nth-child(2) select {
    max-width: 100%;
  }
}
