/*!
 * TireFlow - intl-tel-input Velzon kabatban.
 *
 * A minta a Velzon "Custom country select input": kereso mezos legordulo,
 * zaszlo, orszagnev, mellette halvany hivoszam. A beviteli mezo ugyanaz a
 * .fc / .form-control marad, mint barhol mashol a rendszerben.
 */

/* A burkolo ne torje meg az elrendezest: ugy viselkedjen, mint maga a mezo. */
.iti {
  display: block;
  width: 100%;
}

.iti > input,
.iti__tel-input {
  width: 100%;
}

/* A konyvtar sajat valtozoi a haz szineire allitva. */
.iti {
  --iti-border-color: var(--cb, #E9EBEC);
  --iti-hover-color: var(--soft, #F8F9FB);
  --iti-country-selector-bg: transparent;
  --iti-icon-color: var(--muted, #878A99);
  --iti-arrow-padding: 6px;
}

/* Orszagvalaszto: kitoltott elotag-doboz, mint a Velzon input-group-text. */
.iti__country-container {
  padding: 0;
}

.iti__selected-country,
.iti__selected-country-primary {
  height: 100%;
  background: var(--soft2, #EFF0F2);
  border: 0;
  border-right: 1px solid var(--cb, #E9EBEC);
  border-radius: 6px 0 0 6px;
  padding-inline: 10px 8px;
  gap: 6px;
}

.iti__selected-country:hover,
.iti__selected-country-primary:hover,
.iti__selected-country:focus-visible {
  background: var(--cb, #E9EBEC);
}

.iti__selected-dial-code {
  color: var(--text, #212529);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.iti__arrow { border-top-color: var(--muted, #878A99); }

/* Fokuszban a haz kek keretet kapja az elotag is. */
.iti:focus-within .iti__selected-country,
.iti:focus-within .iti__selected-country-primary {
  border-right-color: var(--brand, #405189);
}

/* ---- Legordulo: Velzon dropdown-menu ---- */

.iti__dropdown-content {
  background: var(--card, #fff);
  border: 1px solid var(--cb, #E9EBEC);
  border-radius: 4px;
  box-shadow: var(--sh2, 0 5px 20px rgba(30, 32, 37, .12));
  overflow: hidden;
  font-size: 13px;
  min-width: 290px;
}

/* Kereso: ugyanaz, mint egy .form-control-sm */
.iti__search-input-wrapper { padding: 8px 10px 6px; }

.iti__search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text, #212529);
  background: var(--card, #fff);
  border: 1px solid var(--cb, #E9EBEC);
  border-radius: 4px;
  outline: 0;
}

.iti__search-input:focus {
  border-color: var(--brand, #405189);
  box-shadow: 0 0 0 3px var(--ring, rgba(64, 81, 137, .16));
}

.iti__search-input::placeholder { color: var(--muted, #878A99); }

.iti__country-list {
  max-height: 264px;
  padding: 4px;
  scrollbar-width: thin;
}

/* Egy sor: zaszlo | orszagnev | jobbra tolt halvany hivoszam */
.iti__country {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--text, #212529);
}

.iti__country-name { flex: 1 1 auto; }

.iti__dial-code {
  margin-left: auto;
  color: var(--muted, #878A99);
  font-variant-numeric: tabular-nums;
}

.iti__country.iti__highlight,
.iti__country:hover {
  background: var(--soft, #F8F9FB);
}

.iti__country[aria-selected="true"] {
  background: var(--soft2, #EFF0F2);
  font-weight: 600;
}

.iti__no-results {
  padding: 14px 12px;
  color: var(--muted, #878A99);
}

/* ---- Hibas allapot es uzenet ---- */

.tf-rossz,
.iti:has(.tf-rossz) > input {
  border-color: var(--danger, #F06548) !important;
}

.tf-hiba {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger, #F06548);
}

.tf-javaslat {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--brand, #405189);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.tf-javaslat:hover { color: var(--primary, #27386D); }

/* ---- Telefon / tablet ---- */

@media (max-width: 640px) {
  .iti__tel-input,
  .iti > input,
  .iti__search-input { font-size: 16px; }

  .iti__dropdown-content { font-size: 15px; min-width: 0; }
  .iti__country { padding: 11px 12px; }
  .iti__country-list { max-height: 50vh; }
}

/* ............................................................
   Orszagvalaszto legordulo.

   Az intl-tel-input ketfele modban dolgozik:
     a) beagyazott (.iti--inline-country-selector) - a panel az input
        alatt, a .iti__country-selector-ben ul a kereso es a lista;
     b) levalasztott / teljes kepernyos (.iti--detached-country-selector,
        .iti--fullscreen-popup) - a konyvtar a <body> vegere teszi es
        sajat maga pozicionalja, ide NEM nyulunk.

   Ezert minden pozicionalo szabaly az (a) modra van szukitve, kulonben
   a mobil/alacsony ablakos teljes kepernyos valtozat osszelapulna.
   ............................................................ */

.iti__country-container {
  padding: 0;
}

.iti--inline-country-selector .iti__country-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
}

/* Nyitott legordulonel az egesz mezo feljebb kerul, hogy egy lebego
   urlap-lablec (pl. "Ugyfel letrehozasa" sav) ne loghasson a listara.
   A .tf-iti-nyit osztalyt a tf-mezok.js teszi ra, a :has() csak tartalek. */
.iti.tf-iti-nyit,
.iti--inline-country-selector:has(.iti__country-selector:not(.iti__hide)) {
  z-index: 1500;
}

/* (a) A beagyazott legordulo EGY darab lebego panel. */
.iti--inline-country-selector .iti__country-selector,
.iti--inline-country-selector .iti__dropdown-content {
  /* a szelesseget/magassagot a konyvtar meri be inline stilusban,
     az input szelessegehez igazitva - mi csak a kinezetet adjuk hozza */
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 260px;
  max-width: calc(100vw - 32px);
  max-height: 322px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--card, #fff);
  border: 1px solid var(--cb, #E9EBEC);
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, .20);
  overflow: hidden;
  z-index: 1400;
}

.iti--inline-country-selector .iti__country-selector.iti__hide,
.iti--inline-country-selector .iti__dropdown-content.iti__hide {
  display: none;
}

/* Kereso sor a panel tetejen. */
.iti--inline-country-selector .iti__search-input-wrapper {
  position: static;
  display: flex;
  align-items: center;
  gap: 6px;
  width: auto;
  margin: 0;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--cb, #E9EBEC);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.iti--inline-country-selector .iti__search-icon {
  position: static;
  inset: auto;
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  color: var(--muted, #878A99);
  font-size: 14px;
  line-height: 1;
}

.iti--inline-country-selector .iti__search-input {
  position: static;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 5px 2px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 13.5px;
  color: var(--text, #212529);
}

.iti--inline-country-selector .iti__search-clear {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--muted, #878A99);
  cursor: pointer;
  line-height: 1;
}

/* A gorgetheto orszaglista a panelen belul. */
.iti--inline-country-selector .iti__country-list {
  position: static;
  width: auto;
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  max-height: none;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* (b) Teljes kepernyos valtozat (telefon, alacsony ablak).
   A konyvtar a <body> vegere teszi a panelt. A rendszer torzse viszont
   flex-elrendezesu (oldalsav + tartalom), ezert a panel flex-elemkent
   0 szelessegre lapult. Itt visszakenyszeritjuk valodi fedoreteggé. */
.iti--fullscreen-popup {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  flex: none !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(10, 16, 30, .55);
  backdrop-filter: blur(3px);
  z-index: 2200;
}

.iti--fullscreen-popup .iti__country-selector {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  max-height: 100%;
  box-sizing: border-box;
  background: var(--card, #fff);
  border: 1px solid var(--cb, #E9EBEC);
  border-radius: 12px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, .40);
  overflow: hidden;
}

.iti--fullscreen-popup .iti__search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cb, #E9EBEC);
}

.iti--fullscreen-popup .iti__search-icon {
  flex: 0 0 auto;
  color: var(--muted, #878A99);
  line-height: 1;
}

.iti--fullscreen-popup .iti__search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text, #212529);
}

.iti--fullscreen-popup .iti__country-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Kozos apro finomsagok mindket modban. */
.iti__search-input::placeholder {
  color: var(--muted, #878A99);
}

.iti__country-list::-webkit-scrollbar {
  width: 8px;
}

.iti__country-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--cb, #E9EBEC);
  background-clip: content-box;
}

.iti__country {
  border-radius: 7px;
}

.iti__no-results {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--muted, #878A99);
  text-align: center;
}

@media (max-width: 640px) {
  .iti--inline-country-selector .iti__country-selector,
  .iti--inline-country-selector .iti__dropdown-content {
    min-width: 0;
    max-height: 56vh;
  }
}