/* Final layout fixes for the contract builder base step. */
body[data-page="builder"] #tenantResidencyModeField {
  width: min(100%, calc(24ch + 46px)) !important;
  max-width: calc(24ch + 46px) !important;
  justify-self: start !important;
}

body[data-page="builder"] #tenantResidencyModeField select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body[data-page="builder"] .representative-fields {
  display: block !important;
  grid-template-rows: none !important;
}

body[data-page="builder"] .representative-fields.is-hidden {
  display: none !important;
}

body[data-page="builder"] .representative-fields__title {
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--brand);
}

body[data-page="builder"] .representative-fields__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: end;
}

body[data-page="builder"] .representative-fields__grid .field {
  margin: 0 !important;
}

body[data-page="builder"] #landlordRepresentativeLastNameField,
body[data-page="builder"] #tenantRepresentativeLastNameField {
  grid-column: span 6;
}

body[data-page="builder"] #landlordRepresentativeFirstNameField,
body[data-page="builder"] #landlordRepresentativeMiddleNameField,
body[data-page="builder"] #tenantRepresentativeFirstNameField,
body[data-page="builder"] #tenantRepresentativeMiddleNameField {
  grid-column: span 3;
}

body[data-page="builder"] #landlordRepresentativePowerNumberField,
body[data-page="builder"] #tenantRepresentativePowerNumberField {
  grid-column: span 3;
  width: min(100%, calc(13ch + 42px)) !important;
  max-width: calc(13ch + 42px) !important;
  justify-self: start !important;
}

body[data-page="builder"] #landlordRepresentativePowerNumberField input,
body[data-page="builder"] #tenantRepresentativePowerNumberField input {
  width: 100% !important;
  max-width: 100% !important;
}

body[data-page="builder"] #landlordRepresentativePowerIssuedAtField,
body[data-page="builder"] #tenantRepresentativePowerIssuedAtField {
  grid-column: 5 / span 4;
  width: min(100%, calc(11ch + 74px)) !important;
  max-width: calc(11ch + 74px) !important;
  justify-self: end !important;
}

body[data-page="builder"] #landlordRepresentativePowerExpiresAtField,
body[data-page="builder"] #tenantRepresentativePowerExpiresAtField {
  grid-column: 9 / span 4;
  width: min(100%, calc(11ch + 74px)) !important;
  max-width: calc(11ch + 74px) !important;
  justify-self: end !important;
}

body[data-page="builder"] #landlordRepresentativePowerIssuedAtField input[type="date"],
body[data-page="builder"] #landlordRepresentativePowerExpiresAtField input[type="date"],
body[data-page="builder"] #tenantRepresentativePowerIssuedAtField input[type="date"],
body[data-page="builder"] #tenantRepresentativePowerExpiresAtField input[type="date"] {
  width: min(100%, calc(11ch + 74px)) !important;
  min-width: calc(11ch + 74px) !important;
  max-width: calc(11ch + 74px) !important;
  padding-right: 48px !important;
  font-variant-numeric: tabular-nums;
}

body[data-page="builder"] .representative-text-field {
  display: block !important;
}

body[data-page="builder"] .representative-text-field.is-hidden {
  display: none !important;
}

body[data-page="builder"] .representative-text-field__input {
  margin: 0 !important;
}

body[data-page="builder"] .representative-verification {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 14px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(23, 79, 63, 0.14);
  background: rgba(220, 233, 226, 0.52);
}

body[data-page="builder"] .representative-verification__copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

body[data-page="builder"] .representative-verification__copy strong {
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
}

body[data-page="builder"] .representative-verification__copy span {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
}

body[data-page="builder"] .representative-verification__link {
  justify-self: start;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 860px) {
  body[data-page="builder"] #tenantResidencyModeField {
    width: min(100%, calc(24ch + 46px)) !important;
    max-width: 100% !important;
  }

  body[data-page="builder"] .representative-fields__grid {
    grid-template-columns: 1fr;
  }

  body[data-page="builder"] .representative-fields__grid .field {
    grid-column: 1 / -1 !important;
    max-width: none !important;
  }

  body[data-page="builder"] #landlordRepresentativePowerIssuedAtField,
  body[data-page="builder"] #landlordRepresentativePowerExpiresAtField,
  body[data-page="builder"] #tenantRepresentativePowerIssuedAtField,
  body[data-page="builder"] #tenantRepresentativePowerExpiresAtField {
    width: min(100%, calc(11ch + 74px)) !important;
    max-width: calc(11ch + 74px) !important;
    justify-self: end !important;
  }

  body[data-page="builder"] .representative-verification {
    grid-template-columns: 1fr;
  }

  body[data-page="builder"] .representative-verification__link {
    width: 100%;
  }
}
