.wpcf7 {
  border: 1px solid #ccc;
  font-size: 1rem;
  background: rgb(23 102 174 / 5%);
  padding: 2rem;
}

.wpcf7 form {
  margin: 0;
}

.wpcf7-form {
  display: flex;
  flex-direction: column;
}

.wpcf7-form > .contact-row:nth-child(2) {
  margin-top: 0;
}

.contact-row {
  padding: 0 0 1rem;
  position: relative;
  margin-top: 1rem;
}

.contact-row label {
  display: block;
  font-weight: bold;
  margin-bottom: .5rem;
  line-height: 1.5;  
}
.contact-row label .contact-required {
  font-size: .875rem;
  color: red;
  margin-left: .5rem;
  display: inline-block;
}

.contact-row input[type="text"],
.contact-row input[type="email"],
.contact-row input[type="tel"],
.contact-row input[type="number"],
.contact-row textarea {
  max-width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  box-sizing: border-box;
  background: #fff;
  font-family: inherit;
  line-height: 1.5;
}

.contact-row input[type="text"]:focus,
.contact-row input[type="email"]:focus,
.contact-row input[type="tel"]:focus,
.contact-row input[type="number"]:focus,
.contact-row textarea:focus,
.contact-row select:focus {
  box-shadow: 0 0 3px #1766AE;
  border-color: #1766AE;
  outline: none;
}

.contact-row select {
  max-width: 100%;
  padding: .5rem .75rem;
  border: 1px solid #ccc;
  font-size: 1rem;
  box-sizing: border-box;
  background: #fff;
  font-family: inherit;
  line-height: 1.5;
}

.contact-row input[type="radio"] {
  appearance: none;
  -webkit-appearance: none; /* Safari対応 */
  -moz-appearance: none;    /* Firefox対応 */
  width: 20px;
  height: 20px;
  border: 2px solid #1766AE; /* 外側の青 */
  border-radius: 50%;
  display: inline-block;
  position: relative;
  cursor: pointer;
  outline: none;
  background-color: #fff; /* 内側を白に */
  transition: border-color 0.2s, background-color 0.2s;
}

.contact-row input[type="radio"]:focus {
  box-shadow: none;
}

.contact-row input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: #1766AE; /* 中央の青 */
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.contact-radio {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.contact-radio .wpcf7-list-item label {
  display: flex; 
  align-items: center;
  gap: .5rem;
  margin-bottom: 0;
}

.contact-row .wpcf7-tel {
  width: 200px;
}

.contact-row .wpcf7-email {
  width: 300px;
}

.contact-row .wpcf7-number {
  width: 120px;
}

.contact-row .wpcf7-not-valid-tip {
  font-size: .875rem;
  display: block;
  font-weight: bold;
  margin-top: .25rem;
}

.wpcf7 .contact-row .wpcf7-not-valid {
  border-color: red;
  box-shadow: 0 0 3px red;
}

.contact-wrap {
  display: flex;
  align-items: baseline;
  gap: .5rem;
}

.wpcf7 textarea {
  height: auto;
}

.contact-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none; /* Safari対応 */
  -moz-appearance: none;    /* Firefox対応 */
  width: 20px;
  height: 20px;
  border: 2px solid #1766AE;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  cursor: pointer;
  outline: none;
  background-color: #fff;
  transition: border-color 0.2s, background-color 0.2s;
}

.contact-row input[type="checkbox"]:checked {
  background-color: #1766AE;
  border-color: #1766AE;
}

.contact-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.contact-agree .wpcf7-list-item label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 0;
}

.contact-agree a {
  display: block;
  margin-bottom: .5rem;
  color: #1a73e8 !important;
}

.contact-row .wpcf7-list-item {
  margin-left: 0;
}


.contact-confirm-row {
  display: flex;
  justify-content: center;
}

.contact-confirm-button {
  font-size: 1.5rem;
  background-color: rgb(247 147 30/ .15);
  border: 1px solid rgb(247, 147, 30);
  color: rgb(247, 147, 30);
  padding: 1rem 2rem;
  cursor: pointer;
  transition: .3s ease-in-out;
  font-weight: bold;
  min-width: 250px;
}

.contact-confirm-button:hover {
  background-color: rgb(247 147 30);
  color: #fff;
}

.contact-confirm-message {
  text-align: center;
}

.contact-submit-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.contact-back-button {
  font-size: 1.5rem;
  border: 1px solid #ccc;
  background-color: #f0f0f0;
  color: #333;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: .3s ease-in-out;
  font-weight: bold;
  min-width: 250px;
}

.contact-back-button:hover {
  background-color: #ccc;
}

.wpcf7 input.wpcf7-submit {
  margin: 0;
  font-size: 1.5rem;
  background-color: rgb(247 147 30/ .15);
  border: 1px solid rgb(247, 147, 30) !important;
  color: rgb(247, 147, 30);
  padding: 1rem 2rem;
  cursor: pointer;
  transition: .3s ease-in-out;
  font-weight: bold;
  min-width: 250px;
  height: auto;
  width: auto;
}

.wpcf7 input.wpcf7-submit:hover {
  background-color: rgb(247 147 30);
  color: #fff;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
  color: red;
  font-weight: bold;
}