.popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}

.popup.active {
  display: block;
}

.popup__area {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.popup__body {
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup__content {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  max-width: 560px;
  background: #fff;
  border-radius: 18px;
  padding: 34px 28px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.popup__content-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.popup__item,
.popup__wrap-form {
  display: none;
}

.popup__item.active,
.popup__wrap-form.active {
  display: block;
}

.popup__item-title {
  margin-bottom: 20px;
  color: #1f1f1f;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
}

.popup__item-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popup__item-group label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #1f1f1f;
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.popup__item-group input[type="radio"] {
  flex: 0 0 auto;
  margin-top: 3px;
}

.popup__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  margin: 20px auto 0;
  border: none;
  border-radius: 6px;
  background: #0c40a0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
}

.popup__btn:hover {
  background: #2ecc71;
}

.popup__wrap-form button {
  width: 100%;
  height: 56px;
  margin-top: 20px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: #0b3d9b;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: not-allowed;
  transition: .2s ease;
}

.popup__wrap-form button:not(:disabled) {
  background: #0c40a0;
  cursor: pointer;
}

.popup__wrap-form button:not(:disabled):hover {
  background: #2ecc71;
}

.popup__wrap-form button:disabled {
  background: #bcd3ff;
  cursor: not-allowed;
}

.popup__wrap-form .form-item {
  display: block;
  margin-bottom: 14px;
}

.popup__item-group input[type="text"],
.popup__wrap-form input[type="text"],
.popup__wrap-form input[type="email"],
.popup__wrap-form input[type="tel"],
.phone-field .country-picker {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 16px;
}

.phone-wrap.phone-field {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.phone-field .country-picker {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 9px;
  background: #f3f7ff;
}

.country-picker::after {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-left: auto;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}

.country-picker .flagIcon {
  flex: 0 0 24px;
  object-fit: cover;
  border-radius: 2px;
}

.country-picker .countrySelect {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 23px 0 40px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  appearance: none;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  cursor: pointer;
}

.country-picker .countrySelect:focus {
  outline: none;
}

.country-picker:focus-within,
.popup__item-group input[type="text"]:focus,
.popup__wrap-form .form-item input:focus,
#form .t-input:focus {
  outline: 2px solid var(--field-focus-color, #155eef);
  outline-offset: -2px;
}

@supports (appearance: base-select) and selector(::picker(select)) {
  @media (hover: hover) and (pointer: fine) {
    .country-picker .countrySelect,
    .country-picker .countrySelect::picker(select) {
      appearance: base-select;
    }

    .country-picker .countrySelect {
      display: flex;
      align-items: center;
    }

    .country-picker:has(.countrySelect:open) {
      outline: 2px solid #155eef;
      outline-offset: -2px;
    }

    .country-picker .countrySelect::picker-icon {
      display: none;
    }

    .country-picker .countrySelect::picker(select) {
      box-sizing: border-box;
      inline-size: anchor-size(width);
      min-inline-size: 0;
      max-block-size: min(260px, 42vh);
      margin-block: 4px;
      padding: 4px;
      border: 1px solid #d8d8d8;
      border-radius: 10px;
      background: #fff;
      color: #1f1f1f;
      box-shadow: 0 8px 24px rgb(0 0 0 / 16%);
    }

    .country-picker .countrySelect option {
      padding: 7px 8px;
      border-radius: 6px;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .country-picker .countrySelect option:is(:hover, :focus-visible, :checked) {
      background: #edf4ff;
    }

    .country-picker .countrySelect option:focus-visible {
      outline: 2px solid #155eef;
      outline-offset: -2px;
    }
  }
}

#form .phone-field #phone {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
}

.popup__btn[hidden] {
  display: none;
}

.popup-form input[aria-invalid="true"],
.popup__wrap-form input.invalid,
#form input.invalid,
.phone-field.invalid .phoneInput {
  box-shadow: inset 0 0 0 1px #d93025;
  --field-focus-color: #d93025;
}

.error {
  display: none;
  margin-top: 6px;
  color: #d93025;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
}

.popup__item.invalid .error {
  display: block;
}

.consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.consent__input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #1b57f8;
}

.consent__text {
  display: block;
  color: #1f1f1f;
  text-align: left;
}

.text {
  display: block;
  margin-top: 12px;
  color: #555;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.cookie {
  position: fixed;
  z-index: 999999999;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  width: calc(100% - 24px);
  max-width: 700px;
  padding: 16px 20px;
  border-radius: 14px;
  background: #0b222c;
  color: #fff;
  box-shadow: 0 8px 26px rgb(0 0 0 / 22%);
  font: 15px/1.4 Arial, sans-serif;
}

.cookie p {
  margin: 0;
}

.cookie__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.cookie button {
  padding: 9px 14px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.cookie .agreeBtnn {
  background: #fff;
  color: #0b222c;
}

@media (max-width: 640px) {
  .popup__content {
    padding: 50px 14px;
  }

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

  .cookie { flex-wrap: wrap; }
  .cookie__actions { margin-left: auto; }
}
