body.modal-open {
  overflow: hidden;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 24px;
  align-items: center;
  justify-content: center;
}

.contact-modal.is-open {
  display: flex;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--landing-color-overlay);
  backdrop-filter: blur(4px);
}

.contact-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow-y: auto;
  border: 1px solid var(--landing-color-border);
  border-radius: 16px;
  background: var(--landing-color-surface);
  box-shadow: var(--landing-shadow-modal);
}

.contact-modal__head {
  display: flex;
  margin-bottom: 22px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.contact-modal__head h3 {
  margin: 0;
  color: var(--landing-color-text-heading);
  font-size: 26px;
  line-height: 1.2;
}

.contact-modal__head p {
  margin: 7px 0 0;
  color: var(--landing-color-text-body);
  line-height: 1.5;
}

.contact-modal__close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--landing-color-border-control);
  border-radius: 10px;
  color: var(--landing-color-text-body);
  background: var(--landing-color-surface-muted);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.contact-modal__close:hover {
  color: var(--landing-color-action);
  background: var(--landing-color-surface-warm);
}

.contact-modal__form {
  display: grid;
  gap: 16px;
}

.contact-modal__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.contact-modal__field label {
  display: block;
  margin-bottom: 7px;
  color: var(--landing-color-text-body);
  font-size: 14px;
  font-weight: 600;
}

.contact-modal__field input,
.contact-modal__field textarea {
  width: 100%;
  border: 1px solid var(--landing-color-border-control);
  border-radius: 8px;
  color: var(--landing-color-text-heading);
  background: var(--landing-color-surface);
  font: inherit;
}

.contact-modal__field input {
  min-height: 48px;
  padding: 10px 13px;
}

.contact-modal__field textarea {
  min-height: 116px;
  padding: 12px 13px;
  resize: vertical;
}

.contact-modal__field input:focus,
.contact-modal__field textarea:focus {
  border-color: var(--landing-color-focus);
  outline: 3px solid var(--landing-color-focus-ring);
  outline-offset: 1px;
}

.contact-modal__privacy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--landing-color-text-body);
  font-size: 13px;
  line-height: 1.45;
}

.contact-modal__privacy input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 16px;
}

.contact-modal__privacy a {
  color: var(--landing-color-link);
}

.contact-modal__status {
  display: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}

.contact-modal__status.is-visible {
  display: block;
}

.contact-modal__status.is-success {
  color: var(--landing-color-success);
  background: var(--landing-color-success-soft);
}

.contact-modal__status.is-error {
  color: var(--landing-color-error);
  background: var(--landing-color-error-soft);
}

.contact-modal__submit {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: var(--landing-color-text-on-action);
  background: var(--landing-color-action);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.contact-modal__submit:hover {
  background: var(--landing-color-action-hover);
}

.contact-modal__submit:disabled {
  cursor: wait;
  opacity: .65;
}

.contact-modal__close:focus-visible,
.contact-modal__submit:focus-visible {
  outline: 3px solid var(--landing-color-focus);
  outline-offset: 3px;
}

@media (max-width: 639px) {
  .contact-modal {
    padding: 12px;
  }

  .contact-modal__panel {
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .contact-modal__head h3 {
    font-size: 23px;
  }

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