/* ------------------------------------------------------------------
   Форма «Подберём идеального преподавателя» (архив преподавателей)
   ------------------------------------------------------------------ */

.teacher-form-section {
  padding: 30px 0 60px;
}

.teacher-form {
  align-items: center;
  background: linear-gradient(97deg, #efe1ff 0%, #f4e9ff 52%, #f0e4ff 100%);
  border-radius: 24px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.42fr) minmax(0, 1.12fr);
  overflow: hidden;
  padding: 26px 36px;
  position: relative;
}

/* --- левая колонка --- */

.teacher-form__caption {
  color: #4b3f63;
  display: block;
  font-size: 14px;
  line-height: 130%;
  margin-bottom: 10px;
}

.teacher-form__title {
  color: #1b0f33;
  font-size: 22px;
  font-weight: 700;
  line-height: 128%;
  margin: 0 0 16px;
}

.teacher-form__list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.teacher-form__list li {
  align-items: center;
  color: #2f2545;
  display: flex;
  font-size: 14px;
  gap: 10px;
  line-height: 130%;
}

.teacher-form__list svg {
  flex-shrink: 0;
}

/* --- изображение --- */

.teacher-form__img {
  align-self: stretch;
  min-height: 200px;
  position: relative;
}

.teacher-form__img img {
  display: block;
  height: 400px;
  left: 50%;
  max-width: none;
  position: absolute;
  top: -26px;
  transform: translateX(-64%);
  width: auto;
}

.teacher-form__doodle {
  left: -30px;
  position: absolute;
  top: 38%;
}

/* --- форма --- */

.teacher-form__fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 10px;
}

.teacher-form__field input,
.teacher-form__field select {
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #1b0f33;
  font-family: lato, sans-serif;
  font-size: 15px;
  height: 46px;
  outline: none;
  padding: 0 18px;
  transition: border-color 0.2s ease;
  width: 100%;
}

.teacher-form__field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231B0F33' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 18px center;
  background-repeat: no-repeat;
  cursor: pointer;
  padding-right: 42px;
}

/* Пока не выбрано значение — текст как у плейсхолдера */
.teacher-form__field select:required:invalid {
  color: #8a819c;
}

.teacher-form__field select option {
  color: #1b0f33;
}

.teacher-form__field input::placeholder {
  color: #8a819c;
  opacity: 1;
}

/* В теме есть глобальное input:required:valid { border-color: green }
   и input:focus:required:invalid { border-color: red } — здесь подсветку
   полей задаём сами, поэтому перебиваем их той же специфичностью */
.teacher-form__field input:required:valid,
.teacher-form__field input:required:invalid {
  border-color: transparent;
}

.teacher-form__field input:focus:required:valid,
.teacher-form__field input:focus:required:invalid,
.teacher-form__field select:focus {
  border-color: #8b5cf6;
}

.teacher-form__field.invalid input:required:valid,
.teacher-form__field.invalid input:required:invalid,
.teacher-form__field.invalid select {
  border-color: #e84722;
}

/* --- согласие --- */

.teacher-form__agree {
  align-items: center;
  color: #4b3f63;
  cursor: pointer;
  display: flex;
  font-size: 12px;
  gap: 8px;
  line-height: 130%;
  margin-bottom: 12px;
}

.teacher-form__agree input {
  accent-color: #8b5cf6;
  cursor: pointer;
  flex-shrink: 0;
  height: 15px;
  margin: 0;
  width: 15px;
}

.teacher-form__agree a {
  color: inherit;
  text-decoration: underline;
}

.teacher-form__agree.invalid {
  color: #e84722;
}

.teacher-form__agree.invalid input {
  outline: 1px solid #e84722;
  outline-offset: 2px;
}

/* --- кнопка --- */

.teacher-form__submit {
  align-items: center;
  background-color: #e84722;
  border-radius: 10px;
  display: flex;
  font-size: 16px;
  font-weight: 700;
  gap: 14px;
  height: 50px;
  justify-content: center;
  padding: 0 24px;
  position: relative;
  transition: background-color 0.2s ease;
  width: 100%;
}

.teacher-form__submit:hover {
  background-color: #d63d1a;
}

.teacher-form__submit svg {
  position: absolute;
  right: 24px;
}

.teacher-form__submit:disabled {
  cursor: no-drop;
  opacity: 0.6;
}

.teacher-form__error {
  color: #e84722;
  font-size: 13px;
  line-height: 130%;
  margin: 10px 0 0;
}

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ------------------------------------------------------------------
   Адаптив
   ------------------------------------------------------------------ */

@media (max-width: 1219px) {
  .teacher-form {
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 0.5fr) minmax(0, 1.15fr);
    padding: 28px 28px;
  }

  .teacher-form__title {
    font-size: 22px;
  }

  .teacher-form__img {
    min-height: 180px;
  }

  .teacher-form__img img {
    height: 340px;
    top: -22px;
  }

  .teacher-form__doodle {
    display: none;
  }
}

@media (max-width: 991px) {
  .teacher-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 24px;
  }

  .teacher-form__content {
    grid-column: 1 / -1;
  }

  .teacher-form__img {
    min-height: 210px;
  }

  .teacher-form__img img {
    height: 300px;
  }

  /* Колонки уже — ужимаем поля, чтобы плейсхолдер не наезжал на стрелку */
  .teacher-form__field input,
  .teacher-form__field select {
    font-size: 14px;
    padding: 0 14px;
  }

  .teacher-form__field select {
    background-position: right 14px center;
    padding-right: 34px;
  }
}

@media (max-width: 767px) {
  .teacher-form-section {
    padding: 20px 0 40px;
  }

  .teacher-form {
    border-radius: 18px;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 20px;
  }

  .teacher-form__title {
    font-size: 20px;
    margin-bottom: 18px;
  }

  .teacher-form__title br {
    display: none;
  }

  .teacher-form__img {
    display: none;
  }

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

  .teacher-form__submit {
    font-size: 16px;
    height: 52px;
  }

  .teacher-form__submit svg {
    position: static;
  }
}
