/* Mobile overflow fixes for the contact page. */
.contact-layout > *,
.contact-form,
.form-section,
.form-section-title > *,
.form-grid,
.form-grid > label,
.file-label,
.check-grid,
.check-grid > label,
.consent,
.form-submit {
  min-width: 0;
  max-width: 100%;
}

.contact-direct a {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.contact-form input:not([type="checkbox"]),
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.contact-form input[type="file"] {
  display: block;
}

.check-grid input[type="checkbox"],
.consent input[type="checkbox"] {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 42px;
  }

  .form-grid,
  .check-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-section-title {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .file-label {
    padding: 14px;
  }

  .contact-form input[type="file"] {
    font-size: 12px;
  }

  .form-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .form-submit .button {
    width: 100%;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .contact-form {
    padding: 18px;
    border-radius: 14px;
  }

  .form-section-title {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .form-section-title h2 {
    font-size: 24px;
  }

  .contact-direct a {
    font-size: 17px;
  }
}
