/* Form styles for admissions/apply-now/ (extracted from landing style.css, scoped to .apply-now-form) */
.apply-now-form {
  --page-width: 1440px;
  --color-red: #D2232A;
  --color-white: #fff;
  --color-black: #000;
  color: #151515;
  max-width: var(--page-width);
  width: 100%;
  margin: 0 auto;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  z-index: 900;
}

.apply-now-form .form_bg {
  position: static;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  height: auto;
  left: auto;
  right: auto;
  margin-left: 0;
  margin-right: 0;
  overflow: visible;
}

/* Only hide decorative hero background, not campus photos in the form */
.apply-now-form .form_bg > img {
  display: none;
}

.apply-now-form .form_hover {
  padding: 0;
}

.apply-now-form .form_hover_step2 {
  padding-top: 40px;
  padding-bottom: 40px;
  padding-left: clamp(15px, 3vw, 20px);
  padding-right: clamp(15px, 3vw, 20px);
}

/* Single-page apply-now: hide step1, always show step2 (no JS required for layout) */
.apply-now-form .apply-now-step1,
.apply-now-form .form_hover > .alt_text {
  display: none !important;
}

.apply-now-form .apply-now-form__step2,
.apply-now-form #formStep2_apply_now {
  display: flex !important;
  visibility: visible !important;
}

.apply-now-form__message {
  display: block;
  width: 100%;
  margin-top: 12px;
  text-align: center;
}

.apply-now-form__message .form_success_message {
  color: #198754;
  display: block;
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  background: rgba(25, 135, 84, 0.08);
  border-radius: 8px;
}

.apply-now-form__message .form_error_message {
  color: #dc3545;
  display: block;
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  background: rgba(220, 53, 69, 0.08);
  border-radius: 8px;
}

.apply-now-form .form_step2_submit {
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
}

.apply-now-form .form_step2_bottom {
  position: relative;
  z-index: 4;
}

.apply-now-form .form_step2_campus_image_wrapper {
  pointer-events: none;
}

.form_bg {
  position: relative;
  width: 100vw;
  max-width: none;
  min-height: 300px;
  height: auto;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: visible;
}

.form_bg img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

@media (min-width: 1440px) {
  .form_bg img {
    object-fit: cover;
    object-position: center;
  }
}

/* Медиа-запросы для адаптивности */
@media (max-width: 1023px) {
  
  .form_bg {
    width: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
  }
  
  .form_hover {
    padding: clamp(20px, 4vw, 30px) 24px !important;
  }
  
  /* Убираем .block20 .form_hover отсюда, так как для него есть отдельные правила в 402px и 373px */
  
  .form_hover_step2 {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  
  .input_group {
    max-width: 100%;
    gap: clamp(10px, 2vw, 20px);
  }
}

/* Дополнительное правило для 768px */
@media (max-width: 768px) {
  .form_hover {
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box;
  }
  
  
  .form_hover_step2 {
    padding-left: 24px !important;
    padding-right: 24px !important;
    box-sizing: border-box;
  }
  
  /* Исправление для input_group - чтобы не выходил за рамки form_hover и form_content */
  .form_content .input_group,
  .form_hover .input_group,
  .block20 .form_hover .input_group,
  .block18 .form_hover .input_group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    min-width: 0; /* Позволяет grid-элементам сжиматься */
    grid-template-columns: max-content 1fr; /* Две колонки - как в оригинале */
    align-items: start; /* Выравнивание элементов по верху */
  }

  .apply-now-form .form_content .input_group,
  .apply-now-form .form_hover .input_group {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
    grid-template-columns: max-content 1fr;
    align-items: end; /* Поля в одну линию по нижнему краю */
  }
  
  /* Исправление для колонок внутри input_group */
  .form_content .input_group .input_column_left,
  .form_content .input_group .input_column_right,
  .form_hover .input_group .input_column_left,
  .form_hover .input_group .input_column_right,
  .apply-now-form .form_hover .input_group .input_column_left,
  .apply-now-form .form_hover .input_group .input_column_right,
  .apply-now-form .form_content .input_group .input_column_left,
  .apply-now-form .form_content .input_group .input_column_right {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
  }
}


.form_hover {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: clamp(20px, 4vw, 40px) clamp(15px, 3vw, 20px);
  box-sizing: border-box;
  overflow: visible;
}

.form_txt {
  font-family: Lora, serif;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 32px);
  line-height: 1.2;
  color: var(--color-black);
  margin-bottom: 24px;
  text-align: center;
  width: 100%;
}

.input_group {
  display: grid;
  justify-content: center;
  grid-template-columns: max-content 1fr;
  gap: clamp(15px, 3vw, 20px);
  margin-bottom: clamp(20px, 3vw, 30px);
  width: 100%;
  max-width: min(750px, 100%);
  box-sizing: border-box;
}

.input_column_left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  min-width: max-content;
  max-width: 100%;
}

.input_column_right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  width: 100%;
}

.input_submit_wrapper {
  display: flex;
  gap: 0;
  width: 100%;
}

.number {
  font-weight: 400;
  font-size: 16px;
  color: var(--color-black);
  display: block;
  margin-bottom: 8px;
}

.required {
  color: #dc3545 !important;
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Универсальное правило для всех звездочек */
span.required,
.required {
  color: #dc3545 !important;
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  background: transparent !important;
  text-shadow: none !important;
}

/* Специфичный стиль для звездочек в form_hover_step2 */
/* Специфичный стиль для звездочек в form_hover_step2 - максимальная специфичность */
.form_step2_input_wrapper label .required,
.form_step2_input_wrapper label span.required,
.form_hover_step2 label .required,
.form_hover_step2 label span.required,
.apply-now-form .form_step2_input_wrapper label .required,
.apply-now-form .form_step2_input_wrapper label span.required,
.apply-now-form .form_hover_step2 label .required,
.apply-now-form .form_hover_step2 label span.required,
.apply-now-form .form_step2_input_wrapper label .required,
.apply-now-form .form_step2_input_wrapper label span.required,
.apply-now-form .form_hover_step2 label .required,
.apply-now-form .form_hover_step2 label span.required,
.apply-now-form .form_step2_input_wrapper label .required,
.apply-now-form .form_step2_input_wrapper label span.required,
.apply-now-form .form_hover_step2 label .required,
.apply-now-form .form_hover_step2 label span.required,
.block18 .form_step2_input_wrapper label .required,
.block18 .form_step2_input_wrapper label span.required,
.block18 .form_hover_step2 label .required,
.block18 .form_hover_step2 label span.required,
label .required,
label span.required,
.number .required,
.number span.required,
label.number .required,
label.number span.required,
span.required {
  color: #dc3545 !important;
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  background: transparent !important;
  text-shadow: none !important;
}

.phone_wrapper {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  height: 48px;
  background: #fff;
  border: 1px solid #fff;
  border-radius: 8px;
  overflow: visible;
  position: relative;
}

/* phone_modal_wrapper всегда выравнивается по левому краю phone_wrapper */
.phone_wrapper .phone_flag_selector .phone_modal_wrapper {
  left: 0 !important;
  transform: none !important;
}

.phone_flag_selector_wrapper {
  position: relative;
  display: block;
  flex-shrink: 0;
  min-width: 75px; /* Фиксируем ширину под +998 */
  width: 75px; /* Фиксируем ширину под +998 */
}

.phone_flag_selector {
  padding: 0 8px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  height: 48px;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.huesos {
  display: flex;
}


.phone_flag_selector .phoneFlagImg,
.phone_flag_selector .flag {
  position: relative;
  width: 22px !important;
  height: 22px !important;
  display: block !important;
  flex-shrink: 0;
  object-fit: contain;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  align-self: center;
}

.phone_flag_selector .phone-code {
  font-size: 16px;
  color: var(--color-black);
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  display: inline-block;
  align-self: center;
}

.phone_flag_selector .flag-arrow {
  color: #D2232A;
  font-size: 17px;
  margin-left: auto;
  transition: transform 0.2s;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  align-self: center;
}

.phone_flag_selector.active .flag-arrow {
  transform: rotate(180deg);
}

/* Выпадающее окно для выбора кода страны */
.phone_flag_selector .phone_modal_wrapper {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  transform: none;
  z-index: 10000;
  pointer-events: none;
}

.phone_flag_selector.active .phone_modal_wrapper {
  pointer-events: auto;
}

/* Главная (block3): модалка выбора кода должна быть выше карточек следующего блока */
.apply-now-form .form_hover .phone_flag_selector .phone_modal_wrapper,
.apply-now-form .form_hover .phone_flag_selector .phone_modal_wrapper .phone_modal {
  z-index: 99999 !important;
}

@media (max-width: 768px) {
  .phone_wrapper {
    position: relative;
  }

  .phone_flag_selector .phone_modal_wrapper {
    position: absolute;
    left: 0;
    right: auto;
    transform: none;
    width: min(280px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 0;
    box-sizing: border-box;
  }

  .phone_flag_selector .phone_modal_wrapper .phone_modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

.phone_modal {
  width: min(280px, calc(100vw - 40px));
  max-width: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s ease;
}

.phone_modal.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.phone_modal_header {
  padding: 20px 24px;
  padding-right: 60px; /* Добавляем место для кнопки закрытия */
  font-size: 15px;
  line-height: 1.5;
  color: #000000;
  border-bottom: 1px solid #eee;
  text-transform: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.phone_country_options {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  flex-wrap: wrap;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #ccc #f5f5f5;
}

.phone_country_options::-webkit-scrollbar {
  width: 6px;
}

.phone_country_options::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

.phone_country_options::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.phone_country_options::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.phone_country_option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
  flex: 0 0 calc(50% - 6px);
  min-width: 0;
  box-sizing: border-box;
  width: calc(50% - 6px);
}

.phone_country_option:hover {
  background: #f9f9f9;
}

.phone_country_option .flag {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  align-self: center;
  position: relative;
}

.phone_country_option span {
  font-size: 16px;
  font-weight: 500;
  color: #000000;
  line-height: 1.5;
  white-space: nowrap;
  margin: 0;
  padding: 0;
  display: inline-block;
  align-self: center;
}

/* Если браузер/расширение пытается отрисовать fallback alt-текст вместо иконки флага */
.phone_country_option .flag[alt] {
  color: transparent;
  font-size: 0;
}

.phone_close_btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 24px;
  color: #999;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  padding: 0;
  margin: 0;
  z-index: 10;
}

.phone_close_btn:hover {
  background: #f0f0f0;
  color: #666;
}



.phone_number {
  display: inline-flex;
  width: auto;
  flex: 1;
  min-width: 0;
  background: transparent;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
}

input[type="tel"] {
  width: 12ch;
  border: none;
  padding: 12.5px 10px 9px 30px;
  font-size: 16px;
  outline: none;
  box-sizing: content-box;
  background: transparent;
  border-radius: 0 8px 8px 0;
}

input[type="tel"]::placeholder {
  color: #adb5bd;
}

.capcha {
  font-weight: 400;
  font-size: 16px;
  color: var(--color-black);
  display: block;
  margin-bottom: 8px;
}

.comment {
  flex: 1;
  min-width: 0;
  height: 49px;
  font-size: 16px;
  border: 1px solid #fff;
  border-radius: 8px 0 0 8px;
  border-right: none;
  padding: 14px 16px;
  outline: none;
}

.submit {
  background: #dc3545;
  color: white;
  border: none;
  min-width: 99px;
  width: 99px;
  height: 49px;
  font-size: 17px;
  font-weight: 500;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  opacity: 1 !important;
}

/* Кнопка в block20 - увеличиваем ширину для текста "Подписаться" */
.block20 .submit {
  min-width: 140px;
  width: auto;
  padding: 0 16px;
  white-space: nowrap;
}

.submit:hover:not(:disabled) {
  background: #c82333;
}

.submit:disabled {
  opacity: 1 !important;
  cursor: not-allowed;
  background: #dc3545;
}

.alt_text {
  font-weight: 400;
  font-size: 16px;
  color: var(--color-black);
  margin-top: 30px;
  text-align: left;
}

.alt_text a {
  color: #dc3545;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}

.alt_text a:hover {
  text-decoration: underline;
}

/* ============================================
   ВТОРАЯ СТРАНИЦА ФОРМЫ (STEP 2)
   ============================================ */
.form_hover_step2 {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding-top: 65px;
  padding-bottom: 90px;
  padding-left: clamp(15px, 3vw, 20px);
  padding-right: clamp(15px, 3vw, 20px);
  box-sizing: border-box;
  overflow: visible;
}

.form_step2_content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 30px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.form_step2_left {
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
}

.form_step2_content_wrapper {
  display: flex;
  flex-direction: column;
  gap: 35px;
  flex: 1;
  min-width: 0;
}

.form_step2_fields_wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

/* По умолчанию показываем старые row на десктопе */
.form_step2_row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch !important; /* Все ячейки растягиваются по высоте */
}

/* Скрываем новые колонки по умолчанию */
.form_step2_left_column,
.form_step2_right_column {
  display: none;
}

.form_step2_campus_image_wrapper {
  display: none;
}

/* На десктопе (769px+) - порядок полей: Телефон, Родитель, Email | Ребенок, Дата, Кампус */
@media (min-width: 769px) {
  .form_step2_row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    align-items: stretch !important; /* Все ячейки растягиваются по высоте */
  }
  
  .form_step2_field_parent {
    order: 2;
  }
  
  .form_step2_field_phone {
    order: 1;
  }
  
  .form_step2_field_email {
    order: 3;
  }
  
  .form_step2_field_child {
    order: 4;
  }
  
  .form_step2_field_birth {
    order: 5;
  }
  
  .form_step2_field_campus {
    order: 6;
  }
  
  .form_step2_left_column,
  .form_step2_right_column {
    display: none !important;
  }
  
  .form_step2_campus_image_wrapper {
    display: none !important;
  }
}

.form_step2_row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch !important; /* Все ячейки растягиваются по высоте */
}

.form_step2_input_wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%; /* Занимаем всю высоту ячейки grid */
}

/* Выравниваем инпуты и селекторы по низу блока */
.form_step2_input_wrapper input,
.form_step2_input_wrapper select,
.form_step2_input_wrapper .phone_wrapper,
.form_step2_input_wrapper .form_step2_select_container {
  margin-top: auto !important; /* Прижимаем к низу */
}

.form_step2_input_wrapper label {
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #000000;
  text-align: left;
}

/* Убеждаемся, что звездочки видны и красные - как в block7 */
.form_step2_input_wrapper label[for="phone_step2_1"] .required,
.form_step2_input_wrapper label[for="phone_step2_2"] .required,
.form_step2_input_wrapper label[for="phone_step2_3"] .required,
.form_step2_input_wrapper label[for="phone_step2_4"] .required,
.form_step2_input_wrapper label[for="parent_name_1"] .required,
.form_step2_input_wrapper label[for="parent_name_2"] .required,
.form_step2_input_wrapper label[for="parent_name_3"] .required,
.form_step2_input_wrapper label[for="parent_name_4"] .required,
.form_step2_input_wrapper label[for="email_1"] .required,
.form_step2_input_wrapper label[for="email_2"] .required,
.form_step2_input_wrapper label[for="email_3"] .required,
.form_step2_input_wrapper label[for="email_4"] .required,
.form_step2_input_wrapper label[for="campus_1"] .required,
.form_step2_input_wrapper label[for="campus_2"] .required,
.form_step2_input_wrapper label[for="campus_3"] .required,
.form_step2_input_wrapper label[for="campus_4"] .required,
.form_hover_step2 label .required,
.form_hover_step2 label span.required {
  color: #dc3545 !important;
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  text-indent: 0 !important;
  clip: auto !important;
  overflow: visible !important;
}

.form_step2_input_wrapper input,
.form_step2_input_wrapper select {
  width: 100%;
  height: 49px;
  font-size: 16px;
  border: 1px solid #fff;
  border-bottom: 2px solid #D2232A;
  border-radius: 8px;
  padding: 0px 10px 2px 45px;
  outline: none;
  background: #fff;
  box-sizing: border-box;
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  color: #000000;
  line-height: 21px;
  vertical-align: middle;
}


.form_step2_input_wrapper input:read-only {
  background: #f5f5f5;
  cursor: not-allowed;
}

.form_step2_select_wrapper {
  position: relative;
}

.form_step2_select_container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 49px;
  border: 1px solid #fff;
  border-bottom: 2px solid #D2232A;
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}

.form_step2_select_container select {
  flex: 1;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  border: none;
  outline: none;
  padding: 0px 16px;
  padding-right: 10px;
  cursor: pointer;
  background: transparent;
  font-size: 16px;
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  color: #000000;
  line-height: 21px;
  height: 100%;
  box-sizing: border-box;
}

.form_step2_select_container select option {
  padding: 0 20px;
  font-family: "Roboto", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.171875em;
  color: #231F20;
  min-height: 36px;
  height: 36px;
  background: #fff;
}

.form_step2_select_container select option:checked {
  background: #EFEFEF;
  font-weight: 700;
}

.form_step2_select_container select option:hover {
  background: #f9f9f9;
}

.form_step2_select_arrow {
  color: #D2232A;
  font-size: 17px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  align-self: center;
  padding-right: 16px;
  pointer-events: none;
}

#campus_1,
#campus_2 {
  width: 100%;
}

.form_step2_input_wrapper .phone_wrapper {
  width: 100%;
  height: 49px;
  border-bottom: 2px solid #D2232A;
}

.form_step2_input_wrapper .phone_number {
  padding-left: 30px;
}

.form_step2_input_wrapper .phone_number input {
  height: 49px;
  font-size: 16px;
  font-family: Roboto, Arial, sans-serif;
  font-weight: 400;
  color: #000000;
  border-bottom: none;
  padding-left: 10px !important;
  padding-right: 10px;
  padding-top: 12.5px;
  padding-bottom: 9px;
}


.form_step2_input_wrapper input:focus,
.form_step2_input_wrapper select:focus {
  border-color: #dc3545;
}

/* Скрываем placeholder при focus для всех инпутов в формах */
.form_step2_input_wrapper input:focus::placeholder,
.download_form input:focus::placeholder,
.form_group input:focus::placeholder {
  opacity: 0;
}

.form_step2_input_wrapper input.error,
.form_step2_input_wrapper select.error {
  border-color: #dc3545;
}

.form_step2_bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

/* На десктопе (769px+) делаем grid layout: submit слева (1 колонка), text справа (2 колонки) */
@media (min-width: 769px) {
  .form_step2_bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: center;
  }
  
  .form_step2_submit {
    grid-column: 1;
    width: 100% !important;
    min-width: 0;
  }
  
  .form_step2_alt_text {
    grid-column: 2 / 4;
    width: 100% !important;
    min-width: 0;
  }
}

.form_step2_submit {
  background: #dc3545;
  color: white;
  border: none;
  border-bottom: 2px solid #D2232A;
  width: calc((100% - 40px) / 3);
  height: 39px;
  font-size: 16px;
  font-weight: 400;
  font-family: Roboto, Arial, sans-serif;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0 30px;
  box-sizing: border-box;
  line-height: 21px;
  flex-shrink: 0;
  opacity: 1 !important;
}

.form_step2_submit:hover {
  background: #c82333;
}

.form_step2_alt_text {
  font-weight: 400;
  font-size: 16px;
  color: var(--color-black);
  margin: 0;
  text-align: left;
}

.form_step2_alt_text a {
  color: #dc3545;
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
}

.form_step2_alt_text a:hover {
  text-decoration: underline;
}

.form_step2_image {
  flex-shrink: 0;
  width: 233px;
  height: 261px;
  z-index: 2;
  display: block;
  position: relative;
  align-self: flex-start;
  margin-top: 0;
}

.form_step2_image img {
  width: 233px !important;
  height: 261px !important;
  border-radius: 12px;
  /* filter: brightness(1.4) contrast(1.25) !important; */
  display: block;
}

.form_step2_caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  border-radius: 0 0 12px 12px;
  font-family: Roboto, Arial, sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 16px;
  color: #FFFFFF;
  text-align: center;
  z-index: 3;
  /* Тёмная полупрозрачная подложка для читаемости текста */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 1024px) {
  
  .form_step2_row {
    grid-template-columns: 1fr;
    gap: 15px;
    align-items: stretch !important; /* Все ячейки растягиваются по высоте */
  }
  
  .form_step2_bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form_step2_submit {
    width: 100%;
  }
  
  .form_step2_image {
    width: 100%;
    max-width: 233px;
    height: 261px;
    margin: 20px auto 0;
  }
  
  .form_step2_image img {
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

@media (max-width: 768px) {
  /* Скрываем фото во всех блоках с form_hover_step2 */
  .form_hover_step2 .form_step2_image,
  .block18 .form_hover_step2 .form_step2_image,
  .apply-now-form .form_hover_step2 .form_step2_image,
  .apply-now-form .form_hover_step2 .form_step2_image,
  .apply-now-form .form_hover_step2 .form_step2_image {
    display: none !important;
  }
  
  /* Новая структура полей: 2 колонки (3 слева, 3 справа) */
  .form_step2_fields_wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .form_step2_row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
    align-items: stretch !important; /* Все ячейки растягиваются по высоте */
  }
  
  /* Padding для всех блоков в form_step2_row */
  
  /* Порядок полей на мобильных: Родитель, Телефон, Email | Ребенок, Дата, Кампус */
  .form_step2_field_parent {
    order: 1;
  }
  
  .form_step2_field_phone {
    order: 2;
    justify-content: space-between;
  }
  
  .form_step2_field_email {
    order: 3;
  }
  
  .form_step2_field_child {
    order: 4;
  }
  
  .form_step2_field_birth {
    order: 5;
  }
  
  .form_step2_field_campus {
    order: 6;
    justify-content: space-between;
  }
  
  /* Убираем padding-left у phone_number */
  .form_step2_input_wrapper .phone_number {
    padding-left: 0 !important;
  }
  
  /* Изменяем внутренний отступ у инпутов и кнопок в form_step2_row с 45px на 10px */
  .form_step2_row input[type="text"],
  .form_step2_row input[type="email"],
  .form_step2_row input[type="tel"],
  .form_step2_row select {
    padding-left: 10px !important;
  }
  
  .form_step2_row .form_step2_submit {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  /* Белый цвет текста для label в form_step2_row в block18 */
  .block18 .form_step2_row .form_step2_input_wrapper label {
    color: #FFFFFF !important;
  }
  
  /* Обновляем лейблы для мобильных */
  .form_step2_field_parent label {
    content: "Фамилия Имя Родителя";
  }
  
  .form_step2_left_column,
  .form_step2_right_column {
    display: none !important;
  }
  
  /* Показываем новое фото кампуса на мобильных - усиленная специфичность */
  .form_step2_bottom .form_step2_campus_image_wrapper,
  .form_hover_step2 .form_step2_campus_image_wrapper,
  .form_step2_content_wrapper .form_step2_campus_image_wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin-top: 20px !important;
    height: auto !important;
    min-height: 269px !important;
  }
  
  .form_step2_campus_image {
    width: 100%;
    height: 269px;
    object-fit: cover;
    display: block;
  }
  
  .form_step2_campus_image_overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 27px;
    /* Тёмная полупрозрачная подложка для читаемости текста */
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .form_step2_campus_name {
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    line-height: 1.2857142857142858em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
  
  .form_step2_campus_info_icon {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #FFFFFF;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  
  .form_step2_campus_info_icon:hover {
    opacity: 0.8;
    transform: scale(1.05);
  }
  
  .form_step2_campus_info_icon:active {
    transform: scale(0.95);
  }
  
  .form_step2_campus_info_icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
  }
  
  /* Убеждаемся, что form_step2_alt_text внизу */
  .form_step2_bottom {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: stretch !important;
  }
  
  /* Убеждаемся, что фото кампуса видно */
  .form_step2_bottom .form_step2_campus_image_wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    position: relative !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    margin-top: 20px !important;
    height: auto !important;
    min-height: 269px !important;
  }
  
  .form_step2_alt_text {
    order: 3;
    margin-top: 0;
  }
}

/* ============================================
   Apply-now page form (inner page, no hero bg)
   ============================================ */
@media (max-width: 1023px) {
  .apply-now-form .form_hover {
    padding: 0;
  }

  .apply-now-form .input_group {
    gap: clamp(10px, 2vw, 20px);
    align-items: end;
  }
}

/* Apply-now: visible borders on white background + aligned controls */
.apply-now-form {
  --apply-now-input-border: #ced4da;
  --apply-now-input-height: 49px;
}

.apply-now-form .form_txt {
  display: block;
  font-family: Lora, serif;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 32px);
  line-height: 1.2;
  color: var(--color-black);
  margin: 0 0 24px;
  text-align: center;
  width: 100%;
}

.apply-now-step1__title {
  margin: 0 0 16px;
  font-size: 28px;
  font-weight: 700;
  text-align: left;
}

.apply-now-step1 {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 30px;
}

.apply-now-step1__grid {
  display: grid;
  grid-template-columns: minmax(240px, 380px) minmax(280px, 1fr);
  gap: 20px;
  align-items: end;
}

.apply-now-step1__field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.apply-now-step1__label,
.apply-now-antibot-label {
  display: block;
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  color: #151515;
  text-align: left;
  margin: 0;
  min-height: 22px;
  visibility: visible;
  opacity: 1;
}

.apply-now-step1__field .phone_wrapper,
.apply-now-step1__field .input_submit_wrapper {
  width: 100%;
}

@media (max-width: 768px) {
  .apply-now-step1__grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.apply-now-form .form_hover .input_group,
.apply-now-form .form_content .input_group {
  align-items: end;
}

.apply-now-form .number,
.apply-now-form .capcha {
  min-height: 24px;
  line-height: 1.25;
  color: #151515 !important;
  font-size: 16px !important;
  white-space: normal;
  visibility: visible !important;
  opacity: 1 !important;
}

@font-face {
  font-family: "Twemoji Country Flags";
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1.8/dist/TwemojiCountryFlags.woff2") format("woff2");
  font-display: swap;
}

/* Флаги: SVG для RU/UZ, emoji + Twemoji для остальных стран */
.apply-now-form .phone_country_option .flag-emoji,
.apply-now-form .phone_flag_selector .flag-emoji {
  font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 20px;
  line-height: 1;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.apply-now-form .phone_flag_selector .phone-flag-icon,
.apply-now-form .phone_country_option .phone-flag-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin-right: 6px;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.apply-now-form .form_hover .capcha::before,
.apply-now-form .form_hover .capcha::after {
  content: none !important;
  display: none !important;
}

.apply-now-form .form_step2_input_wrapper .phone_wrapper {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  height: var(--apply-now-input-height);
  border: 1px solid var(--apply-now-input-border);
  box-sizing: border-box;
  overflow: visible;
}

.apply-now-form .form_step2_input_wrapper .phone_flag_selector_wrapper {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex-shrink: 0;
  width: auto;
  min-width: 0;
}

.apply-now-form .form_step2_input_wrapper .phone_flag_selector {
  height: 100%;
  min-height: 0;
  width: 100%;
  gap: 4px;
  padding: 0 6px;
  box-sizing: border-box;
}

.apply-now-form .form_step2_input_wrapper .phone_flag_selector .flag-arrow {
  margin-left: 0;
  flex-shrink: 0;
  font-size: 12px;
}

.apply-now-form .form_step2_input_wrapper .phone_number {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding-left: 0 !important;
}

.apply-now-form .form_step2_input_wrapper .phone_number input[type="tel"] {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  box-sizing: border-box;
}

/* Detect browser autofill so JS can re-validate the phone field */
@keyframes onAutoFillStart {
  from { opacity: 1; }
  to { opacity: 1; }
}

@keyframes onAutoFillCancel {
  from { opacity: 1; }
  to { opacity: 1; }
}

.apply-now-form .phone_number input[type="tel"]:-webkit-autofill {
  animation-name: onAutoFillStart;
  animation-duration: 0.01s;
}

.apply-now-form .comment {
  height: var(--apply-now-input-height);
  border: 1px solid var(--apply-now-input-border);
  border-right: none;
  box-sizing: border-box;
}

.apply-now-form .submit {
  height: var(--apply-now-input-height);
  box-sizing: border-box;
}

.apply-now-form .submit:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed;
}

.apply-now-form .submit:not(:disabled) {
  opacity: 1 !important;
  cursor: pointer;
}

.apply-now-form .input_submit_wrapper {
  align-items: stretch;
}

/* Single border per control (avoid double borders on selects/phone) */
.apply-now-form .form_step2_input_wrapper > input[type="text"],
.apply-now-form .form_step2_input_wrapper > input[type="email"],
.apply-now-form .form_step2_field_antibot > input[type="text"] {
  border: 1px solid var(--apply-now-input-border);
  border-bottom: 2px solid #D2232A;
  padding-left: 12px;
  padding-right: 12px;
}

.apply-now-form .form_step2_select_container {
  border: 1px solid var(--apply-now-input-border);
  border-bottom: 2px solid #D2232A;
}

.apply-now-form .form_step2_select_container select {
  border: none !important;
  border-bottom: none !important;
  padding-left: 12px;
  padding-right: 32px;
  height: 100%;
  background: transparent;
}

.apply-now-form .form_step2_input_wrapper .phone_wrapper {
  border: 1px solid var(--apply-now-input-border);
  border-bottom: 2px solid #D2232A;
}

.apply-now-form .form_step2_input_wrapper .phone_number input[type="tel"] {
  border: none !important;
  border-bottom: none !important;
  padding-left: 8px !important;
}

@media (min-width: 769px) {
  .apply-now-form .form_step2_image,
  .apply-now-form .form_step2_image img {
    display: block;
  }
}

.apply-now-form .form_step2_image img,
.apply-now-form .form_step2_campus_image {
  object-fit: cover;
}

@media (min-width: 769px) {
  .apply-now-form .form_step2_field_phone {
    order: 1;
  }

  .apply-now-form .form_step2_field_parent {
    order: 2;
  }

  .apply-now-form .form_step2_field_email {
    order: 3;
  }

  .apply-now-form .form_step2_field_request_kind {
    order: 4;
  }

  .apply-now-form .form_step2_field_child {
    order: 5;
  }

  .apply-now-form .form_step2_field_birth {
    order: 6;
  }

  .apply-now-form .form_step2_field_campus {
    order: 7;
  }

  .apply-now-form .form_step2_field_antibot {
    order: 8;
  }

  .apply-now-form .form_step2_image {
    display: block !important;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .apply-now-form .form_hover_step2 {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 32px;
    padding-bottom: 32px;
  }

  /* Как на главной: равные колонки, 14px в полях */
  .apply-now-form .form_step2_row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .apply-now-form .form_step2_input_wrapper label,
  .apply-now-form .form_step2_input_wrapper input,
  .apply-now-form .form_step2_input_wrapper select,
  .apply-now-form .form_step2_input_wrapper button,
  .apply-now-form .form_step2_input_wrapper .phone_number input,
  .apply-now-form .phone_flag_selector .phone-code,
  .apply-now-form .phone_flag_selector .flag-arrow,
  .apply-now-form .form_step2_select_arrow,
  .apply-now-form .form_step2_alt_text {
    font-family: Roboto, Arial, sans-serif !important;
    font-weight: 400 !important;
    font-size: 14px !important;
    line-height: 1.286em !important;
  }

  .apply-now-form .form_step2_input_wrapper .phone_flag_selector {
    padding: 0 4px !important;
  }

  .apply-now-form .form_step2_input_wrapper .phone_flag_selector_wrapper {
    max-width: 68px;
  }

  .apply-now-form .form_step2_field_parent {
    order: 1;
  }

  .apply-now-form .form_step2_field_phone {
    order: 2;
  }

  .apply-now-form .form_step2_field_email {
    order: 3;
  }

  .apply-now-form .form_step2_field_request_kind {
    order: 4;
  }

  .apply-now-form .form_step2_field_child {
    order: 5;
  }

  .apply-now-form .form_step2_field_birth {
    order: 6;
  }

  .apply-now-form .form_step2_field_campus {
    order: 7;
  }

  .apply-now-form .form_step2_field_antibot {
    order: 8;
    grid-column: 1 / -1;
  }

  /* Модалка кода страны: якорь — вся ячейка телефона, не узкий флаг (иначе уезжает вправо). */
  .apply-now-form .form_step2_field_phone {
    position: relative;
    overflow: visible !important;
  }

  .apply-now-form .form_step2_field_phone .phone_wrapper {
    overflow: visible !important;
  }

  .apply-now-form .form_step2_field_phone .phone_flag_selector {
    position: static !important;
    width: fit-content !important;
  }

  .apply-now-form .form_step2_field_phone .phone_flag_selector .phone_modal_wrapper {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(280px, calc(100vw - 40px)) !important;
    max-width: calc(100vw - 40px) !important;
    min-width: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    z-index: 10050 !important;
  }

  .apply-now-form .form_step2_field_phone .phone_flag_selector.active .phone_modal_wrapper {
    pointer-events: auto !important;
  }

  .apply-now-form .form_step2_field_phone .phone_flag_selector .phone_modal_wrapper .phone_modal {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
  }
}

@media (max-width: 620px) {
  .apply-now-form .form_hover_step2 .phone_flag_selector .phone_modal_wrapper {
    left: 50% !important;
    right: auto !important;
    transform: translateX(calc(-50% - 10px)) !important;
    max-width: calc(100vw - 48px) !important;
  }

  .apply-now-form .form_hover_step2 .phone_flag_selector .phone_modal_wrapper .phone_modal {
    width: min(280px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
  }
}

.apply-now-form .phone_wrapper,
.apply-now-form .phone_flag_selector_wrapper,
.apply-now-form .phone_flag_selector {
  overflow: visible;
}

.apply-now-form .form_hover,
.apply-now-form .form_content,
.apply-now-form .form_bg {
  overflow: visible;
}

.apply-now-form .form_step2_input_wrapper .phone_flag_selector.active .phone_modal_wrapper,
.apply-now-form .form_step2_input_wrapper .phone_modal.open {
  z-index: 10050;
}
