.form-line--phone {
  position: relative;
  overflow: visible;
  z-index: 1;
}

.form-line--phone:has(.phone-input.is-open) {
  z-index: 100;
}

.phone-input {
  position: relative;
  width: 100%;
}

.phone-input__row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 41px;
  border-bottom: 1px solid #d9d9d9;
  background-color: #fff;
  transition: border-color 0.25s ease;
}

.phone-input__row:focus-within {
  border-color: #171717;
}

.phone-input button {
  box-shadow: none;
  border-radius: 0;
  text-transform: none;
  background: transparent;
  color: #171717;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.phone-input button:hover,
.phone-input button:focus,
.phone-input button:disabled {
  color: #171717;
  box-shadow: none;
  opacity: 1;
  cursor: pointer;
  background: #fff;
}

.phone-input__country-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  min-height: 41px;
  padding: 0 8px 0 0;
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  font-family: inherit;
  color: #171717;
  cursor: pointer;
  user-select: none;
  opacity: 1;
}

.phone-input__country-toggle,
.phone-input.error .phone-input__country-toggle,
.phone-input.is-open .phone-input__country-toggle,
.phone-input__row:focus-within .phone-input__country-toggle {
  opacity: 1;
  color: #171717;
}

.phone-input__country-toggle:hover,
.phone-input__country-toggle:focus {
  outline: none;
  background: transparent;
  opacity: 1;
  color: #171717;
}

.phone-input__flag {
  font-size: 20px;
  line-height: 1;
}

.phone-input__dial-code {
  white-space: nowrap;
}

.phone-input__chevron {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #171717;
  opacity: 0.6;
}

.phone-input__field {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  min-height: 41px;
  padding: 0;
  font-size: 18px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.2;
  color: #171717;
  background-color: transparent;
}

.phone-input__field:focus,
.phone-input__field:active {
  outline: none;
}

.phone-input__field::placeholder {
  color: #999;
  opacity: 0.5;
}

.phone-input__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  width: min(340px, 100vw - 30px);
  max-height: 280px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.phone-input.is-open .phone-input__dropdown {
  display: flex;
}

.phone-input__search {
  border: none;
  border-bottom: 1px solid #d9d9d9;
  min-height: 40px;
  padding: 0 12px;
  font-size: 16px;
  font-family: inherit;
  color: #171717;
  background: #fff;
}

.phone-input__search:focus {
  outline: none;
}

.phone-input__country-list {
  overflow-y: auto;
  max-height: 220px;
}

.phone-input__country-option {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: none;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  color: #171717;
}

.phone-input__country-option:hover,
.phone-input__country-option:focus,
.phone-input__country-option.is-active {
  color: #171717;
  background: #f5f5f5;
}

.phone-input__country-option-flag {
  font-size: 18px;
  line-height: 1;
}

.phone-input__country-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phone-input__country-option-dial {
  color: #666;
  white-space: nowrap;
}

.phone-input.error .phone-input__row {
  border-color: red;
}

.form-line--phone > .error[data-phone-error] {
  margin-top: 6px;
}
