/* Shared form layout and controls for every frontend template. */
.fenix-home-form {
  box-sizing: border-box;
  width: 580px;
  max-width: 100%;
  min-height: 796px;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  align-content: start;
  gap: 24px 16px;
  margin: 0;
  padding: 40px 32px;
  background: var(--fenix-white);
  border: 0;
  border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--fenix-neutral-200), 0 10px 25px rgb(41 19 100 / 12%);
}

.fenix-home-form__field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.fenix-home-form__wide { grid-column: 1 / -1; }

.fenix-home-form__field > label,

.fenix-careers-field > span:first-child {
  margin: 0;
  color: var(--fenix-input-text);
  font-size: var(--fenix-text-body-size);
  font-weight: var(--fenix-weight-bold);
  line-height: var(--fenix-text-body-line-height);
}

.fenix-input,

.fenix-home-form__textarea-wrap,

.fenix-careers-input-wrap,

.fenix-resources-search,

.fenix-testimonials-search {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: var(--fenix-input-height);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--fenix-input-padding-inline);
  background: var(--fenix-input-background);
  border: 0;
  border-radius: var(--fenix-input-radius);
  box-shadow: inset 0 0 0 1px var(--fenix-input-border);
  color: var(--fenix-input-text);
}

.fenix-input,

.fenix-home-form__textarea-wrap { width: 100%; }

.fenix-input > input,

.fenix-input > select,

.fenix-careers-input-wrap > input,

.fenix-careers-input-wrap > select,

.fenix-resources-search > input,

.fenix-testimonials-search > input,

.fenix-home-form__textarea-wrap > textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  color: var(--fenix-input-text);
  font-family: var(--fenix-font);
  font-size: var(--fenix-text-body-size);
  font-weight: var(--fenix-text-body-weight);
  line-height: var(--fenix-text-body-line-height);
  letter-spacing: var(--fenix-letter-spacing);
}

:is(.fenix-input, .fenix-careers-input-wrap, .fenix-resources-search, .fenix-testimonials-search) > :is(input, select) {
  height: var(--fenix-input-height);
}

:is(.fenix-input, .fenix-home-form__textarea-wrap, .fenix-careers-input-wrap, .fenix-resources-search, .fenix-testimonials-search) :is(input, textarea)::placeholder {
  color: var(--fenix-input-placeholder);
  opacity: 1;
}

:is(.fenix-input, .fenix-home-form__textarea-wrap, .fenix-careers-input-wrap, .fenix-resources-search, .fenix-testimonials-search):focus-within {
  box-shadow: inset 0 0 0 1.5px var(--fenix-input-focus);
}

:is(.fenix-input, .fenix-home-form__textarea-wrap, .fenix-careers-input-wrap):has([aria-invalid="true"]) {
  box-shadow: inset 0 0 0 1px var(--fenix-input-error);
}

:is(.fenix-input, .fenix-home-form__textarea-wrap, .fenix-careers-input-wrap):has(:disabled) {
  background: var(--fenix-neutral-100);
  opacity: 0.65;
  cursor: not-allowed;
}

.fenix-input select,

.fenix-careers-input-wrap select { appearance: none; cursor: pointer; }

:is(.fenix-input, .fenix-careers-input-wrap) select:has(option:first-child:checked) {
  color: var(--fenix-input-placeholder);
}

.fenix-input:has(select)::after {
  content: "";
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: var(--fenix-input-icon);
  mask: url('../../images/design-system/chevron-down.svg') center / 24px 24px no-repeat;
  pointer-events: none;
}

.fenix-home-form__textarea-wrap {
  height: var(--fenix-textarea-height);
  min-height: var(--fenix-textarea-height);
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 12px 12px 8px;
}

.fenix-home-form__textarea-wrap > textarea {
  height: 120px;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: var(--fenix-neutral-300) transparent;
}

.fenix-home-form__textarea-wrap > textarea::placeholder { color: var(--fenix-neutral-600); }

.fenix-home-form__textarea-wrap:focus-within:has(.fenix-field-clear:not([hidden])) > textarea { padding-right: 30px; }

.fenix-home-form__textarea-wrap > small {
  flex: 0 0 var(--fenix-text-caption-line-height);
  align-self: stretch;
  display: block;
  height: var(--fenix-text-caption-line-height);
  color: var(--fenix-input-placeholder);
  font-size: var(--fenix-text-caption-size);
  font-weight: var(--fenix-text-caption-weight);
  line-height: var(--fenix-text-caption-line-height);
  text-align: right;
}

.fenix-field-clear {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  display: none;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.fenix-field-clear[hidden] { display: none; }
:focus-within > .fenix-field-clear:not([hidden]) { display: grid; }
.fenix-field-clear:focus-visible { outline: 2px solid var(--fenix-input-focus); outline-offset: 2px; }
.fenix-field-clear > span {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--fenix-input-icon);
  mask: url("../../images/input-circle-x.svg") center / 20px 20px no-repeat;
}
.fenix-home-form__textarea-wrap > .fenix-field-clear { position: absolute; top: 12px; right: 12px; }
input[type="search"]::-webkit-search-cancel-button { appearance: none; }

.fenix-home-form > .fenix-home-button {
  grid-column: 1 / -1;
  width: 200px;
  min-width: 0;
  margin: 0;
  display: inline-flex;
}

body.fenix-figma-contact-page .fenix-contact-form .fenix-home-form__field:has(input[name="email"]) {
  margin-bottom: -8px;
}

body.fenix-figma-contact-page .fenix-contact-form label {
  font-size: 14px;
}

@media (max-width: 767px) {
  body.fenix-figma-contact-page .fenix-contact-form {
    --fenix-input-height: 52px;
    --fenix-textarea-height: 172px;
    width: 100%;
    min-height: 764px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 40px 20px;
  }

  body.fenix-figma-contact-page .fenix-contact-form label {
    line-height: 20px;
  }

  .fenix-home-form { width: 100%; min-height: 0; grid-template-columns: 1fr; padding: 32px 20px; }
  .fenix-home-form > .fenix-home-button { max-width: 100%; }

  /* Homepage mobile instance 2291:10647 keeps surname/given name side by side. */
  html body:is(.home, .fenix-figma-services-page).fenix-figma-shell-page .fenix-home-form {
    --fenix-input-height: 52px;
    --fenix-textarea-height: 172px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 764px;
    padding: 40px 20px;
  }

  html body:is(.home, .fenix-figma-services-page).fenix-figma-shell-page .fenix-home-form__field:has(input[name="email"]) { margin-bottom: -8px; }
}

/* Homepage and Services reuse form instance 2290:9841 on tablet. */
@media (min-width: 768px) and (max-width: 1279px) {
  body.fenix-figma-contact-page .fenix-contact-form {
    --fenix-input-height: 54px;
    --fenix-textarea-height: 170px;
    width: 100%;
    min-height: 780px;
  }

  body.fenix-figma-contact-page .fenix-contact-form label {
    line-height: 22px;
  }

  html body:is(.home, .fenix-figma-services-page).fenix-figma-shell-page .fenix-home-form {
    --fenix-input-height: 54px;
    --fenix-textarea-height: 170px;
    width: 100%;
    min-height: 780px;
  }

  html body:is(.home, .fenix-figma-services-page).fenix-figma-shell-page .fenix-home-form__field:has(input[name="email"]) { margin-bottom: -8px; }
}

/* Services PC instance I2192:4906;2256:8300 has a 16px email/phone gap. */
@media (min-width: 1280px) {
  html body.fenix-figma-services-page .fenix-home-form__field:has(input[name="email"]) { margin-bottom: -8px; }
}
