/**
 * Local phone country selector and split password identity fields.
 *
 * @author Xewex
 * @link https://xewex.ru
 */

.xewex-phone-field {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  width: 100%;
  border: 1px solid rgba(51, 51, 51, .18);
  border-radius: var(--xewex-otp-radius);
  background: #fff;
  overflow: visible;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.xewex-phone-field:focus-within {
  border-color: var(--xewex-otp-accent);
  box-shadow: 0 0 0 3px rgba(var(--xewex-otp-accent-rgb), .14);
}

.xewex-phone-country-wrap {
  position: relative;
  min-width: 0;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country,
body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country:hover,
body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country:focus,
.xewex-phone-country {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  width: 94px !important;
  min-width: 94px !important;
  height: 100% !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border: 0 !important;
  border-right: 1px solid rgba(51, 51, 51, .14) !important;
  border-radius: var(--xewex-otp-radius) 0 0 var(--xewex-otp-radius) !important;
  background: #f7f8fa !important;
  color: var(--xewex-otp-text) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country:focus-visible,
.xewex-phone-country:focus-visible {
  outline: 2px solid rgba(var(--xewex-otp-accent-rgb), .35) !important;
  outline-offset: -2px;
}

.xewex-phone-country-flag {
  display: inline-block;
  flex: 0 0 22px;
  width: 22px;
  height: 15px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 2px;
  background-color: #eee;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

.xewex-phone-country-flag[data-iso="ru"] {
  background: linear-gradient(to bottom, #fff 0 33.333%, #1751a5 33.333% 66.666%, #d52b1e 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="kz"] {
  background: radial-gradient(circle at 55% 50%, #f7cf35 0 20%, transparent 21%), #00afca;
}

.xewex-phone-country-flag[data-iso="by"] {
  background: linear-gradient(to bottom, #d22730 0 67%, #00af66 67% 100%);
}

.xewex-phone-country-flag[data-iso="am"] {
  background: linear-gradient(to bottom, #d90012 0 33.333%, #0033a0 33.333% 66.666%, #f2a800 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="ge"] {
  background:
    linear-gradient(to right, transparent 42%, #d40000 42% 58%, transparent 58%),
    linear-gradient(to bottom, transparent 37%, #d40000 37% 63%, transparent 63%),
    #fff;
}

.xewex-phone-country-flag[data-iso="az"] {
  background: linear-gradient(to bottom, #00b5e2 0 33.333%, #ef3340 33.333% 66.666%, #509e2f 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="kg"] {
  background: radial-gradient(circle, #ffd100 0 24%, transparent 25%), #e4002b;
}

.xewex-phone-country-flag[data-iso="uz"] {
  background: linear-gradient(to bottom, #0099b5 0 30%, #ce1126 30% 34%, #fff 34% 64%, #ce1126 64% 68%, #1eb53a 68% 100%);
}

.xewex-phone-country-flag[data-iso="tj"] {
  background: linear-gradient(to bottom, #cc0000 0 33.333%, #fff 33.333% 66.666%, #006600 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="md"] {
  background: linear-gradient(to right, #0046ae 0 33.333%, #ffd200 33.333% 66.666%, #cc092f 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="ua"] {
  background: linear-gradient(to bottom, #005bbb 0 50%, #ffd500 50% 100%);
}

.xewex-phone-country-flag[data-iso="pl"] {
  background: linear-gradient(to bottom, #fff 0 50%, #dc143c 50% 100%);
}

.xewex-phone-country-flag[data-iso="de"] {
  background: linear-gradient(to bottom, #000 0 33.333%, #dd0000 33.333% 66.666%, #ffce00 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="fr"] {
  background: linear-gradient(to right, #0055a4 0 33.333%, #fff 33.333% 66.666%, #ef4135 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="gb"] {
  background:
    linear-gradient(33deg, transparent 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(-33deg, transparent 42%, #fff 42% 47%, #c8102e 47% 53%, #fff 53% 58%, transparent 58%),
    linear-gradient(to right, transparent 40%, #fff 40% 60%, transparent 60%),
    linear-gradient(to bottom, transparent 35%, #fff 35% 65%, transparent 65%),
    linear-gradient(to right, transparent 46%, #c8102e 46% 54%, transparent 54%),
    linear-gradient(to bottom, transparent 43%, #c8102e 43% 57%, transparent 57%),
    #012169;
}

.xewex-phone-country-flag[data-iso="us"] {
  background: repeating-linear-gradient(to bottom, #b22234 0 8%, #fff 8% 16%);
}

.xewex-phone-country-flag[data-iso="ca"] {
  background: linear-gradient(to right, #d80621 0 25%, #fff 25% 75%, #d80621 75% 100%);
}

.xewex-phone-country-flag[data-iso="tr"] {
  background: radial-gradient(circle at 46% 50%, #fff 0 24%, transparent 25%), radial-gradient(circle at 52% 50%, #e30a17 0 22%, transparent 23%), #e30a17;
}

.xewex-phone-country-flag[data-iso="ae"] {
  background: linear-gradient(to right, #ff0000 0 25%, transparent 25%), linear-gradient(to bottom, #00732f 0 33.333%, #fff 33.333% 66.666%, #000 66.666% 100%);
}

.xewex-phone-country-flag[data-iso="il"] {
  background: linear-gradient(to bottom, #fff 0 18%, #0038b8 18% 29%, #fff 29% 71%, #0038b8 71% 82%, #fff 82% 100%);
}

.xewex-phone-country-dial {
  flex: 0 0 auto;
  white-space: nowrap;
}

.xewex-phone-country-chevron {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-left: 1px;
  border-right: 1.5px solid rgba(51, 51, 51, .58);
  border-bottom: 1.5px solid rgba(51, 51, 51, .58);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
}

.xewex-phone-country-wrap.is-open .xewex-phone-country-chevron {
  transform: rotate(225deg) translate(-1px, -1px);
}

.xewex-phone-country-menu {
  position: absolute;
  z-index: 100000;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  max-width: min(280px, calc(100vw - 32px));
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(51, 51, 51, .16);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.xewex-phone-country-menu[hidden] {
  display: none !important;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country-option,
body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country-option:hover,
body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country-option:focus,
.xewex-phone-country-option {
  display: grid !important;
  grid-template-columns: 22px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 8px 9px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: var(--xewex-otp-text) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  box-shadow: none !important;
  transform: none !important;
  cursor: pointer;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country-option:hover,
body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country-option.is-active,
.xewex-phone-country-option:hover,
.xewex-phone-country-option.is-active {
  background: rgba(var(--xewex-otp-accent-rgb), .08) !important;
  color: var(--xewex-otp-accent) !important;
}

.xewex-phone-country-name {
  min-width: 0;
}

.xewex-phone-country-option-dial {
  color: rgba(51, 51, 51, .62);
  white-space: nowrap;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card .xewex-phone-field input[type="tel"],
.xewex-phone-field input[type="tel"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  border: 0 !important;
  border-radius: 0 var(--xewex-otp-radius) var(--xewex-otp-radius) 0 !important;
  background: #fff;
  box-shadow: none !important;
}

body.woocommerce-account:not(.logged-in) .okhta-auth__card .xewex-phone-field input[type="tel"]:focus,
.xewex-phone-field input[type="tel"]:focus {
  outline: none;
  border: 0 !important;
  box-shadow: none !important;
}

.xewex-password-login__separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: rgba(51, 51, 51, .55);
  font-size: 13px;
  line-height: 1;
  text-transform: lowercase;
}

.xewex-password-login__separator::before,
.xewex-password-login__separator::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(51, 51, 51, .16);
}

.xewex-password-login__separator span {
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  .xewex-phone-field {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country,
  body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country:hover,
  body.woocommerce-account:not(.logged-in) .okhta-auth__card button.xewex-phone-country:focus,
  .xewex-phone-country {
    width: 90px !important;
    min-width: 90px !important;
    padding: 0 7px !important;
    gap: 4px !important;
  }

  .xewex-phone-country-flag {
    flex-basis: 20px;
    width: 20px;
    height: 14px;
  }
}
