/* ─── PHONE FIELD ─────────────────────────────────────────────────── */

.phone-field {
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.phone-label {
  margin-bottom: 7px !important;
}

.phone-field__required {
  margin-left: 2px;
}

/* Wrapper: border container */
.phone-field__wrapper {
  display: flex;
  align-items: stretch;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.18s, border-color 0.18s;
  border: 1px solid #ded5ca;
  border-width: 0 0 1px 0;
}

.phone-field__wrapper:focus-within {
  outline: none;
}

.phone-field__wrapper.is-error {
  /* Add your error border color here */
}

/* ─── COUNTRY SELECTOR ──────────────────────────────────────────── */

.phone-field__country {
  position: relative;
  flex-shrink: 0;
}

.phone-field__country-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 100%;
  background: transparent;
  border: none;
  border-right: 1px solid #d9d2c5;
  cursor: pointer;
  font-family: "Jost", sans-serif;
  font-size: inherit;
  white-space: nowrap;
  transition: background 0.14s;
  color: #0B1F3A;
}

.phone-field__country-btn:focus-visible {
  outline: 2px solid;
  outline-offset: -2px;
  border-radius: 6px 0 0 6px;
}

.phone-field__flag {
  font-size: 1.25rem;
  height: 33px;
}

.phone-field__dial {
  font-size: 0.9rem;
  font-weight: 600;
}

.phone-field__chevron {
  width: 13px;
  height: 13px;
  transition: transform 0.18s;
  flex-shrink: 0;
}

.phone-field__country-btn[aria-expanded="true"] .phone-field__chevron {
  transform: rotate(180deg);
}
/* ─── DROPDOWN ──────────────────────────────────────────────────── */

.phone-field__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: -1px;
  min-width: 270px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
  border: 1px solid #005282;
  background-color: #f5f5f5;
  border-radius: 8px;
  animation: phoneDropIn 0.16s ease;
}

.phone-field__dropdown.is-open {
  display: block;
}

@keyframes phoneDropIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.phone-field__search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid;
  position: sticky;
  top: 0;
  background-color: #f5f5f5;
}

.phone-field__search {
  width: 100%;
  border: 1px solid;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.14s;
}

.phone-field__list {
  padding: 4px 0;
}

.phone-field__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: background 0.1s;
}

.phone-field__option--selected {
  font-weight: 600;
}

.phone-field__option-name {
  flex: 1;
}

.phone-field__option-code {
  font-size: 0.82rem;
  font-weight: 500;
}

/* ─── PHONE INPUT ───────────────────────────────────────────────── */

.phone-field__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 12px;
  font-family: inherit;
  font-size: inherit;
  background: transparent;
  border-radius: 0 6px 6px 0;
  width: 100%;
}

/* ─── ERROR MESSAGE ─────────────────────────────────────────────── */

.phone-field__error {
  font-size: 0.8rem;
  min-height: 1rem;
}

.phone-field__error:empty {
  display: none;
}
