/* =========================================================
   International phone input — country selector + national
   number field. Matches .field/.input conventions in public.css.
   ========================================================= */

.phone-input { position: relative; display: flex; gap: 8px; }

.phone-input__country {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  min-width: 92px; height: 44px; padding: 0 10px 0 12px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.phone-input__country:hover { background: var(--bg-hover); }
.phone-input__country:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--brand-primary-100); }
.phone-input__flag { font-size: 1.1em; line-height: 1; }
.phone-input__dial { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-secondary); }
.phone-input__chevron { width: 14px; height: 14px; color: var(--text-tertiary); margin-left: auto; flex-shrink: 0; }

.phone-input__number { flex: 1; min-width: 0; height: 44px; }

.phone-input__panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  width: min(320px, 90vw); max-width: 90vw;
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  z-index: 60; overflow: hidden;
  display: flex; flex-direction: column;
}
.phone-input__panel[hidden] { display: none; }
.phone-input__search-wrap { padding: var(--sp-3); border-bottom: 1px solid var(--border-subtle); }
.phone-input__search { height: 40px; }

.phone-input__list { list-style: none; margin: 0; padding: var(--sp-2); max-height: 260px; overflow-y: auto; }
.phone-input__option {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: 44px; padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--fs-sm); color: var(--text-primary);
  transition: background var(--dur-fast) var(--ease-out);
}
.phone-input__option:hover, .phone-input__option.is-selected { background: var(--bg-subtle); }
.phone-input__option-flag { font-size: 1.15em; flex-shrink: 0; }
.phone-input__option-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-input__option-dial { color: var(--text-tertiary); font-size: var(--fs-xs); flex-shrink: 0; }
.phone-input__empty { padding: var(--sp-4); text-align: center; color: var(--text-tertiary); font-size: var(--fs-sm); }

.phone-input__meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: 4px; min-height: 15px;
}
.phone-input__status { font-size: var(--fs-2xs); color: var(--text-tertiary); }
.phone-input__status.is-valid { color: var(--color-success); }
.phone-input__status.is-invalid { color: var(--color-danger); }
.phone-input__count { font-size: var(--fs-2xs); color: var(--text-tertiary); flex-shrink: 0; }

@media (max-width: 480px) {
  .phone-input__country { min-width: 80px; }
  .phone-input__panel { left: auto; right: 0; }
}
