/* تواصل معنا */

.contact {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 40px var(--page-gutter);
  overflow-x: clip;
}

.contact > * {
  position: relative;
}

/* ---------- Title and form ---------- */
.contact__main {
  display: flex;
  flex: 0 1 832px;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  min-width: 0;
  /* The design centres this column in a 704px frame. */
  padding-block: 49px;
}

.contact__intro {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  isolation: isolate;
}

/* The light backdrop behind the page title: full width, from the top of the
   page body to 16px below the intro text. */
.contact__intro::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -89px -100vw -16px;
  background: #f7fdf9;
}

.contact__lead a {
  color: var(--green-600);
}

.contact__title {
  font-size: 30px;
  font-weight: 700;
  line-height: 38px;
}

.contact__lead {
  max-width: 720px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
}

.contact-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.contact-form__row--full {
  grid-template-columns: minmax(0, 1fr);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field__label {
  display: flex;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.field__required {
  color: #b42318;
}

.field__control {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-neutral);
  color: var(--text-default);
  font-size: 16px;
  line-height: 24px;
}

.field__control::placeholder,
.field__control--phone input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.field__control:focus-visible,
.field__control--phone:focus-within {
  outline: 2px solid var(--text-default);
  outline-offset: 0;
}

.field__control[aria-invalid='true'],
.field__control--phone:has([aria-invalid='true']) {
  box-shadow: inset 0 -2px 0 #b42318;
}

.field__control--textarea {
  height: 96px;
  min-height: 96px;
  padding: 12px 16px;
  /* The design's grip sits inside the corner; the native one is hidden. */
  background: var(--bg-neutral) url('../img/contact/resize-handler.svg') left 2px bottom 2px / 12px 12px no-repeat;
  resize: vertical;
}

.field__control--textarea::-webkit-resizer {
  background: transparent;
}

.field__control--select {
  padding-inline-end: 40px;
  background: var(--bg-neutral) url('../img/contact/i-arrow-down-01.svg') left 20.4px center / 11.25px 6.25px
    no-repeat;
  appearance: none;
  cursor: pointer;
}

.field__control--select:has(option[value='']:checked) {
  color: var(--text-secondary);
}

.field__control--select option {
  color: var(--text-default);
}

.field__control--phone {
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.field__prefix {
  flex: none;
  padding: 0 16px 0 40px;
  border: 0;
  background: url('../img/contact/i-arrow-down-01.svg') left 20.4px center / 11.25px 6.25px no-repeat;
  color: var(--text-default);
  font-size: 16px;
  line-height: 24px;
  appearance: none;
  cursor: pointer;
}

.field__control--phone input {
  flex: 1 0 0;
  min-width: 0;
  padding: 0 16px 0 8px;
  border: 0;
  background: none;
  font-size: 16px;
  line-height: 24px;
  text-align: right;
}

.field__prefix:focus-visible,
.field__control--phone input:focus-visible {
  outline: none;
}

.field__error {
  color: #b42318;
  font-size: 14px;
  line-height: 20px;
}

.contact-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.contact-form__status {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.contact-form__status[data-state='success'] {
  color: var(--success-text);
}

.contact-form__status[data-state='error'] {
  color: #b42318;
}

/* ---------- Contact card ---------- */
.contact-card {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 24px;
  width: 416px;
  /* The design draws the stroke inside the 40px padding. */
  padding: 39px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-white);
}

.contact-card__group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card__divider {
  width: 100%;
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
  /* The design's rule is a zero-height line drawn above its position. */
  margin-top: -1px;
}

.contact-card__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
}

.contact-card__links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-default);
  font-weight: 600;
  text-decoration: none;
}

.contact-card__links a:hover {
  text-decoration: underline;
}

.contact-card__title {
  color: #1f2a37;
  font-size: 18px;
  font-weight: 700;
  line-height: 28px;
}

.contact-card__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.contact-card__item > .ico {
  margin-block: 2px;
}

.contact-card__content {
  display: flex;
  flex: 1 0 0;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.contact-card__label {
  color: #1f2a37;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
}

.contact-card__value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--green-600);
}

.contact-card__value a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-card__value a:hover {
  text-decoration: underline;
}

.contact-card__copy {
  display: inline-flex;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}

.contact-card__copy:hover {
  background: var(--bg-neutral);
}

.contact-card__copied {
  font-size: 14px;
  line-height: 20px;
}

.contact-card__copied:empty {
  display: none;
}

.contact-card__follow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.contact-card__social {
  display: flex;
  gap: 8px;
  margin: 0;
}

.contact-card__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.contact-card__social a:hover {
  background: var(--bg-neutral);
}

/* ---------- Narrow screens ---------- */
@media (max-width: 1100px) {
  .contact {
    flex-direction: column;
    align-items: stretch;
  }

  .contact__main {
    flex: none;
    padding-block: 9px 0;
  }

  .contact__intro::before {
    top: -49px;
  }

  .contact-card {
    width: auto;
  }
}

@media (max-width: 700px) {
  .contact {
    padding-block: 24px 32px;
  }

  .contact__intro::before {
    top: -33px;
  }

  .contact-form__row {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 23px;
  }
}

/* The high-contrast filter washes the grey field surface out to white: outline the fields. */
html[data-contrast='high'] .field__control {
  box-shadow: inset 0 0 0 1px var(--text-default);
}

html[data-contrast='high'] .field__control[aria-invalid='true'],
html[data-contrast='high'] .field__control--phone:has([aria-invalid='true']) {
  box-shadow: inset 0 0 0 2px #b42318;
}
