/* Contact form */
.contact-content {
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100% - 128px));
  margin: 0 auto;
  padding: 80px 0 120px;
}

.contact-intro { order: 1; }
.contact-info { order: 2; }
.contact-form { order: 3; }

.contact-intro {
  margin-bottom: 32px;
  color: #2b2b2f;
}

.contact-intro h2 {
  margin: 0 0 12px;
  color: #172b45;
  font-size: 21px;
  line-height: 1.5;
}

.contact-intro h2::after {
  display: block;
  width: 120px;
  height: 3px;
  margin-top: 8px;
  background: linear-gradient(to right, #172b45 0 66.666%, #f9ad00 66.666% 100%);
  content: "";
}

.contact-intro p {
  margin: 0;
  font-size: var(--font-body);
  line-height: var(--line-body);
}

.contact-form {
  border-top: 1px solid #dedbd4;
}

.contact-form__row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid #dedbd4;
}

.contact-form__label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  color: #2b2b2f;
  font-size: var(--font-body);
  font-weight: 700;
  line-height: var(--line-body);
}

.contact-form__required {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  padding: 1px 5px;
  background: #f34242;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.contact-form__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
  padding: 10px 0;
}

/* Mailform Pro error messages sit above the field instead of beside it. */
.contact-form__control .mfp_err {
  order: -1;
  flex: 0 0 100%;
  box-sizing: border-box;
  margin: 0 0 6px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid #dedbd4;
  border-radius: 0;
  background: #fff;
  color: #2b2b2f;
  font: inherit;
  font-size: var(--font-body);
  line-height: var(--line-body);
  outline: none;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select {
  height: 50px;
  padding: 0 16px;
}

.contact-form textarea {
  min-height: 260px;
  padding: 16px;
  resize: vertical;
}

/* Keep short-answer fields compact while leaving longer fields room to breathe. */
#inquiry-type,
#company,
#department,
#name,
#role,
#email,
#phone { width: min(100%, 640px); }

/* Mailform Pro sets an inline width/height on the textarea, so the width needs !important. */
.contact-form #message { width: min(calc(100% - 4px), 640px) !important; }

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: #172b45;
}

.contact-form ::placeholder {
  color: #d2cec5;
}

.contact-form__row--message .contact-form__label {
  align-items: flex-start;
  padding-top: 20px;
}

.contact-form__message-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.contact-form__message-wrap .mfp_err {
  order: -1;
  margin: 0 0 6px;
}

.contact-form__note {
  margin: 6px 0 0;
  color: #f34242;
  font-size: 11px;
}

.contact-form__row--privacy .contact-form__control {
  gap: 8px;
  font-size: var(--font-body);
  line-height: var(--line-body);
}

.contact-form__control input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: #f9ad00;
}

.contact-form__control a,
.contact-info a {
  color: #f0a400;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact-form__actions {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.contact-form__submit {
  min-width: 280px;
  min-height: 56px;
  padding: 0 24px;
  border: 0;
  border-radius: 3px;
  background: #f9ad00;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: var(--font-body);
  font-weight: 700;
  transition: background-color .2s ease;
}

.contact-form__submit:hover {
  background: #df9700;
}

.contact-info {
  margin: 0 0 48px;
  padding: 28px 32px;
  border-radius: 6px;
  background: #f1eee8;
  color: #2b2b2f;
}

.contact-info h2 {
  margin: 0 0 12px;
  color: #172b45;
  font-size: 18px;
}

.contact-info p {
  margin: 0 0 14px;
  font-size: var(--font-body);
  line-height: var(--line-body);
}

.contact-info a {
  font-size: var(--font-body);
  font-weight: 700;
  line-height: var(--line-body);
}

@media (max-width: 1500px) {
  .contact-content {
    width: min(1080px, calc(100% - 80px));
    padding: 64px 0 96px;
  }
}

@media (max-width: 767px) {
  .contact-content {
    width: calc(100% - 32px);
    padding: 48px 0 72px;
  }

  .contact-form__row {
    display: block;
    padding: 12px 0;
  }

  .contact-intro {
    margin-bottom: 24px;
  }

  .contact-intro h2 {
    font-size: 18px;
  }

  .contact-form__label {
    padding: 0 0 8px;
    font-size: var(--font-body);
  }

  .contact-form__control {
    padding: 0;
  }

  #inquiry-type,
  #company,
  #department,
  #name,
  #role,
  #email,
  #phone {
    width: 100%;
  }

  .contact-form__row--message .contact-form__label {
    padding-top: 0;
  }

  .contact-form__row--privacy .contact-form__control {
    align-items: flex-start;
    line-height: var(--line-body);
  }

  /* Align the checkbox with the first line of the wrapped label text. */
  .contact-form__row--privacy .contact-form__control input[type="checkbox"] {
    margin: calc((var(--font-body) * var(--line-body) - 16px) / 2) 0 0;
  }

  .contact-form__actions {
    margin-top: 32px;
  }

  .contact-form__submit {
    width: 100%;
    min-width: 0;
  }

  .contact-info {
    margin-top: 32px;
    padding: 22px 20px;
  }
}

/* Mailform Pro's .mfp_element_submit adds a white text-shadow; keep the button text flat (JP and EN). */
.contact-form .contact-form__submit,
.contact-form .contact-form__submit:hover,
.contact-form .contact-form__submit:focus {
  text-shadow: none !important;
}

/* Thank-you view (?complete=1): the button sits directly in .contact-content (a flex column),
   so keep it after the intro text and center its label. */
.contact-content > .contact-form__actions { order: 4; }

.contact-form__submit--link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Mailform Pro confirmation table: drop the white/grey striping, use the site's body text size and more row padding. */
table#mfp_confirm_table tr.mfp_colored,
table#mfp_confirm_table tr.mfp_achroma {
  background-color: transparent;
}

table#mfp_confirm_table tr th,
table#mfp_confirm_table tr td {
  padding: 20px 24px;
  border-top: 1px solid #dedbd4;
  color: #2b2b2f;
  font-size: var(--font-body);
  line-height: var(--line-body);
}

table#mfp_confirm_table tr:last-child th,
table#mfp_confirm_table tr:last-child td {
  border-bottom: 1px solid #dedbd4;
}

table#mfp_confirm_table tr th {
  width: 280px;
  color: #172b45;
}

@media (max-width: 767px) {
  table#mfp_confirm_table tr th,
  table#mfp_confirm_table tr td {
    padding: 14px 12px;
  }

  table#mfp_confirm_table tr th {
    /* Mailform Pro stacks th above td on mobile, so the label takes the full row (38% wrapped long labels onto two lines). */
    width: 100%;
    white-space: normal;
  }
}

/* Mailform Pro leaves the consent label on one line; let it wrap beside the checkbox instead of running off-screen. */
form#mailformpro .contact-form__row--privacy .contact-form__control label {
  flex: 1 1 0;
  min-width: 0;
  white-space: normal;
}
