/* Основной контейнер формы */
.form__container {
  position: relative;
  width: 100%;
  border-radius: 40px;
}

.form__container-bg {
  background-image: url(/upload/form__bg.png);
  background-size: cover;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 40px;
  z-index: 1;
}

.form__container-man {
  position: absolute;
  right: 0;
  bottom: 0;
  object-fit: contain;
  height: 100%;
  z-index: 2;
}

.form__container-content {
  display: flex;
  flex-direction: column;
  z-index: 3;
  padding: 40px;
  max-width: 760px;
  width: 100%;
  height: 100%;
  position: relative;
}

.form__content-title {
  color: #fff;
  font-size: 30px;
  font-weight: 500;
  font-family: Manrope;
  margin: 0 0 10px 0;
  line-height: 100%;
}

.form__content-text {
  color: #FFFFFFB2;
  font-size: 16px;
  font-weight: 400;
  line-height: 130%;
  margin: 0 0 30px 0;
}

/* Форма */
.komm__form {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 10px;
  margin-bottom: 20px;
}

.komm__form-row {
  display: flex;
  gap: 10px;
}

.komm__input-box {
  max-width: calc(50% - 5px);
  width: 100%;
  height: 49px;
  position: relative;
}

.komm__form-row input {
  max-width: 100%;
  width: 100%;
  height: 100%;
  outline: none;
  border: 2px solid transparent;
  position: relative;
  border-radius: 8px;
  background: #FFFFFF66;
  padding: 14px 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  line-height: 130%;
  transition: all .4s;
}

.komm__input-box::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(140.25deg, #FFFFFF 13.18%, rgba(255, 255, 255, 0) 28.73%, rgba(255, 255, 255, 0) 75.37%, #FFFFFF 90.92%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.komm__form-row input:focus {
  border: 2px solid #fff;
}

/* Незаполненное обязательное поле при попытке отправки */
.komm__input-box.is-invalid input {
  border-color: #FF5A5A;
}

.komm__form-row input::placeholder {
  color: #FFFFFFB2;
  font-size: 16px;
  font-weight: 400;
  line-height: 130%;
}

/* Кастомный селект */
.komm__input-box--select {
  max-width: calc(50% - 5px);
}

.komm__select {
  position: relative;
  width: 100%;
  height: 100%;
}

.komm__select-trigger {
  width: 100%;
  height: 100%;
  background: #FFFFFF66;
  border-radius: 8px;
  padding: 14px 20px 14px 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: all .4s;
  border: 2px solid transparent;
  gap: 10px;
}

.komm__select-trigger::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  margin: auto;
  background-image: url(/upload/form_loc.png);
  background-size: contain;
  width: 16px;
  height: 16px;
}

.komm__input-box--select::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  padding: 1px;
  background: linear-gradient(140.25deg, #FFFFFF 13.18%, rgba(255, 255, 255, 0) 28.73%, rgba(255, 255, 255, 0) 75.37%, #FFFFFF 90.92%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

.komm__select-trigger:hover {
  background: #FFFFFF80;
}

.komm__select-trigger.is-active {
  border: 2px solid #fff;
  border-radius: 8px 8px 0 0;
}

.komm__select-placeholder {
  color: #FFFFFFB2;
  font-size: 16px;
  font-weight: 400;
  line-height: 130%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.komm__select-placeholder.is-selected {
  color: #fff;
}

.komm__select-arrow {
  flex-shrink: 0;
  transition: transform .3s ease;
}

.komm__select-arrow.is-open {
  transform: rotate(180deg);
}

/* Выпадающий список */
.komm__select-dropdown {
  position: absolute;
  top: 55px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  border: 2px solid #fff;
  border-top: none;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  z-index: 10;
  border-radius: 8px;
}

.komm__select-dropdown.is-open {
  max-height: 245px;
  opacity: 1;
  visibility: visible;
}

.komm__select-options {
  max-height: 245px;
  overflow-y: auto;
  padding: 10px;
}

/* Кастомный скроллбар для WebKit (Chrome, Safari, Edge) */
.komm__select-options::-webkit-scrollbar {
  width: 6px;
}

.komm__select-options::-webkit-scrollbar-track {
  background: #F5F7FB;
  border-radius: 8px;
}

.komm__select-options::-webkit-scrollbar-thumb {
  background: #064A69;
  border-radius: 8px;
}

.komm__select-options::-webkit-scrollbar-thumb:hover {
  background: #053a52;
}

/* Кастомный скроллбар для Firefox */
.komm__select-options {
  scrollbar-width: thin;
  scrollbar-color: #064A69 #F5F7FB;
}

.komm__select-option {
  padding: 8px 14px;
  color: #2B2B2B;
  font-size: 18px;
  font-weight: 500;
  line-height: 100%;
  cursor: pointer;
  transition: all .4s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.komm__select-option:hover {
  background: #F5F7FB;
  color: #064A69;
  border-radius: 8px;
}

.komm__select-option.is-selected {
  background: #F5F7FB;
  color: #064A69;
  border-radius: 8px;
}

.komm__form-row.agree {
  margin-top: 10px;
  align-items: center;
}

.komm__form-row.agree div,
.komm__form-row.agree label,
.komm__form-row.agree button {
  max-width: calc(50% - 5px);
}

/* Кастомный чекбокс согласия */
.komm__agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.komm__agreement input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.komm__agreement-box {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid #F5F7FB;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: background .2s, border-color .2s;
}

.komm__agreement-check {
  opacity: 0;
  transition: opacity .15s;
}

.komm__agreement input:checked+.komm__agreement-box {
  background: #77B94C;
  border-color: #77B94C;
}

.komm__agreement input:checked+.komm__agreement-box .komm__agreement-check {
  opacity: 1;
}

/* Подсветка, если попытались отправить без галочки */
.komm__agreement.is-invalid .komm__agreement-box {
  border-color: #FF5A5A;
}

/* Кнопка отправки */
.komm__form-submit {
  width: 100%;
  height: 49px;
  background: #77B94C;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all .3s ease;
  padding: 14px 20px;
}

.komm__form-submit:hover {
  background: #053a52;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(6, 74, 105, 0.4);
}

.komm__form-submit:active {
  transform: translateY(0);
}

/* Соглашение (текст рядом с чекбоксом) */
.form__agreement {
  color: #FFFFFFB2;
  font-size: 12px;
  font-weight: 400;
  line-height: 130%;
}

.form__agreement a {
  color: #FFFFFFB2;
  text-decoration: underline;
  transition: color .3s ease;
}

.form__agreement a:hover {
  color: #fff;
}

/* Маска телефона (класс, не id - таких форм на странице может быть несколько) */
.komm__phone-input {
  letter-spacing: 0.5px;
}

/* Подсветка невыбранного города при попытке отправки */
.komm__select.is-invalid .komm__select-trigger {
  border-color: #FF5A5A;
}

/* honeypot - скрыт от людей, но остаётся в разметке для ботов */
.komm__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Плашка "для розничной покупки" */
.form__retail {
  max-width: 100%;
  width: 100%;
  border-radius: 8px;
  background: #FFFFFF33;
  padding: 8px 14px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.form__retail-icon {
  object-fit: contain;
  width: 40px;
  height: 40px;
}

.form__retail-text-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form__retail-text-title {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  color: #FFFFFF;
  line-height: 100%;
  font-family: 'Manrope';
}

.form__retail-text-subtitle {
  margin: 0;
  font-size: 16px;
  font-weight: 300;
  color: #FFFFFFB2;
  line-height: 130%;
}

.form__retail-btn {
  flex: 0 0 auto;
  border-radius: 8px;
  background: #179BD7;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 22px;
  transition: background .3s;
}

.form__retail-btn:hover {
  color: #fff;
  background: #064A69;
}

/* Адаптивность */
@media screen and (max-width: 1280px) {
  .form__container-man {
    max-width: 380px;
    height: auto;
  }
}

@media screen and (max-width: 1024px) {
  .form__container-man {
    display: none;
  }

  .form__container-content {
    max-width: 100%;
  }
}

@media screen and (max-width: 768px) {
  .form__retail {
    flex-wrap: wrap;
  }

  .form__retail-btn {
    max-width: 100%;
    width: 100%;
    text-align: center;
  }

  .komm__form-row.agree label,
  .komm__form-row.agree button {
    max-width: 100%;
  }

  .form__retail-icon {
    max-width: 40px;
  }

  .form__retail-text-box {
    max-width: 85%;
  }

  .form__container {
    min-height: auto;
  }

  .form__container-content {
    padding: 25px;
    max-width: 100%;
  }

  .form__content-title {
    font-size: 24px;
  }

  .komm__form-row {
    flex-direction: column;
  }

  .komm__input-box,
  .komm__input-box--select {
    max-width: 100%;
  }

  .form__container-man {
    display: none;
  }

  .form__container-bg {
    min-height: auto;
    border-radius: 20px;
  }

  .form__container {
    border-radius: 20px;
  }
}

@media screen and (max-width: 480px) {
  .form__container-content {
    padding: 20px;
  }

  .form__content-title {
    font-size: 20px;
  }

  .form__content-text {
    font-size: 14px;
  }
}

@media screen and (max-width: 450px) {
  .form__retail-text-title {
    font-size: 16px;
  }

  .form__retail-text-subtitle {
    font-size: 14px;
  }

  .form__retail {
    align-items: flex-start;
  }

  .form__retail-text-box {
    max-width: 78%;
  }

  .form__container-content {
    padding: 20px 10px;
  }
}
