/* ms-phone — phone input с флагом страны.
 * Перебивает тема-специфичные стили (.cta-form button, .partners-form button и пр.) через !important.
 */
.ms-phone{
  position:relative;
  display:inline-flex;
  align-items:stretch;
  width:100%;
  min-height:46px;
  border:1px solid var(--ms-phone-border, rgba(15,23,42,.12));
  border-radius:var(--ms-phone-radius, 10px);
  background:var(--ms-phone-bg, #fff);
  color:var(--ms-phone-fg, inherit);
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-sizing:border-box;
}
.ms-phone[data-shape="pill"]{ --ms-phone-radius:999px; }
.ms-phone:focus-within{
  border-color:var(--ms-phone-focus, #1B6E5C);
  background:var(--ms-phone-bg-focus, var(--ms-phone-bg, #fff));
}

/* Кнопка-флаг — перебивает тематические стили button (.cta-form button и т.п.) */
.ms-phone .ms-phone__btn{
  display:flex !important;
  align-items:center !important;
  gap:6px !important;
  padding:0 12px !important;
  margin:0 !important;
  border:0 !important;
  border-right:1px solid var(--ms-phone-border, rgba(15,23,42,.10)) !important;
  background:transparent !important;
  color:inherit !important;
  font:inherit !important;
  font-size:14.5px !important;
  font-weight:500 !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  cursor:pointer !important;
  user-select:none !important;
  white-space:nowrap !important;
  line-height:1 !important;
  width:auto !important;
  min-width:0 !important;
  flex:0 0 auto !important;
  box-shadow:none !important;
  border-radius:0 !important;
  height:auto !important;
  text-decoration:none !important;
}
.ms-phone .ms-phone__btn:hover{ background:var(--ms-phone-hover, rgba(15,23,42,.04)) !important; }
.ms-phone .ms-phone__btn:focus-visible{ outline:2px solid var(--ms-phone-focus, #1B6E5C); outline-offset:-2px; }

.ms-phone__flag{ font-size:18px; line-height:1; display:inline-block; }
.ms-phone__flag[hidden]{ display:none !important; }
.ms-phone__code{ font-feature-settings:"tnum"; opacity:.9; }
.ms-phone__chev{ opacity:.5; font-size:10px; margin-left:2px; }

/* Input — сбрасываем темные стили (.cta-form input, .demo-field input) */
.ms-phone > input[type="tel"]{
  flex:1 1 auto !important;
  min-width:0 !important;
  width:auto !important;
  border:0 !important;
  outline:0 !important;
  padding:11px 14px !important;
  margin:0 !important;
  background:transparent !important;
  color:inherit !important;
  font:inherit !important;
  font-size:14.5px !important;
  box-shadow:none !important;
  border-radius:0 !important;
  height:auto !important;
}
.ms-phone > input[type="tel"]::placeholder{ color:var(--ms-phone-placeholder, rgba(15,23,42,.32)); }

/* Меню стран */
.ms-phone__menu{
  position:absolute;
  top:calc(100% + 4px);
  left:0;
  min-width:240px;
  max-width:300px;
  z-index:200;
  background:var(--ms-phone-menu-bg, #fff);
  color:var(--ms-phone-menu-fg, #0F172A);
  border:1px solid var(--ms-phone-border, rgba(15,23,42,.12));
  border-radius:10px;
  box-shadow:0 14px 38px rgba(15,23,42,.18);
  max-height:280px;
  overflow:auto;
  padding:4px;
}
.ms-phone__item{
  display:flex !important;
  align-items:center !important;
  gap:10px !important;
  width:100% !important;
  padding:8px 10px !important;
  margin:0 !important;
  border:0 !important;
  background:transparent !important;
  text-align:left !important;
  cursor:pointer !important;
  font:inherit !important;
  font-size:14px !important;
  font-weight:400 !important;
  color:inherit !important;
  border-radius:6px !important;
  line-height:1.2 !important;
  text-transform:none !important;
  letter-spacing:normal !important;
  height:auto !important;
  text-decoration:none !important;
  box-shadow:none !important;
}
.ms-phone__item:hover{ background:var(--ms-phone-hover, rgba(15,23,42,.05)) !important; }
.ms-phone__item.is-selected{
  background:var(--ms-phone-selected, rgba(27,110,92,.10)) !important;
  font-weight:600 !important;
}
.ms-phone__item.is-selected .ms-phone__code{ opacity:.85; }
.ms-phone__item .ms-phone__name{ flex:1 1 auto; font-size:14px; }
.ms-phone__item .ms-phone__code{ opacity:.55; font-size:13px; flex-shrink:0; }

/* Тёмная тема (для тёмных форм: calimso/demo, svodno/partners, svodno/cta-form, svodno/demo-gate) */
.ms-phone[data-theme="dark"]{
  --ms-phone-border: rgba(255,255,255,.16);
  --ms-phone-bg: rgba(236,241,248,0.06);
  --ms-phone-bg-focus: rgba(236,241,248,0.10);
  --ms-phone-fg: #E7E9ED;
  --ms-phone-hover: rgba(255,255,255,.08);
  --ms-phone-focus: #7FE1C8;
  --ms-phone-menu-bg: #171A21;
  --ms-phone-menu-fg: #E7E9ED;
  --ms-phone-selected: rgba(127,225,200,.18);
  --ms-phone-placeholder: rgba(231,233,237,.42);
}
