.home-auth-sms.bxmaker-authuserphone-login {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

.home-auth-sms .bxmaker-authuserphone-login__title,
.home-auth-sms .bxmaker-authuserphone-login__change-form,
.home-auth-sms .bxmaker-authuserphone-login__restore-email {
  display: none !important;
}

.home-auth-sms__fields {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Always keep the second field row visible so SMS ↔ Email switch does not resize the popup */
.home-auth-sms .bxmaker-authuserphone-login-row.home-auth-sms__field--code {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.home-auth-sms__enter {
  display: none !important;
}

.home-auth-sms__captcha.bxmaker-authuserphone-login-captcha,
.home-auth-sms .bxmaker-authuserphone-login-captcha {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0 0 10px;
  border-bottom: 1px solid #000;
}

.home-auth-sms.home-auth-sms--captcha .bxmaker-authuserphone-login-captcha {
  display: flex !important;
}

.home-auth-sms .bxmaker-authuserphone-login-captcha img {
  display: block;
  height: 40px;
  width: auto;
  border: 0;
  cursor: pointer;
}

.home-auth-sms .bxmaker-authuserphone-login-captcha__reload {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  background: url(images/reload_30.png) center / contain no-repeat;
  cursor: pointer;
}

.home-auth-sms .bxmaker-authuserphone-login-captcha__reload:hover {
  background-image: url(images/reload_30_hover.png);
}

.home-auth-sms .bxmaker-authuserphone-login-captcha input.captchaCode,
.home-auth-sms .bxmaker-authuserphone-login-captcha input[name="captchaCode"] {
  flex: 1 1 140px;
  min-width: 120px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #000;
  font-family: var(--font-main, "CoFo Gothic", Arial, sans-serif);
  font-size: 16px;
  line-height: 1.3;
  outline: none;
}

.home-auth-sms .bxmaker-authuserphone-login-row.home-auth-sms__field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0 0 10px;
  border: 0;
  border-bottom: 1px solid #000;
  box-sizing: border-box;
  min-height: 40px;
}

.home-auth-sms .bxmaker-authuserphone-login-row.home-auth-sms__field.is-invalid,
.home-auth-sms__captcha.bxmaker-authuserphone-login-captcha.is-invalid {
  border-bottom-color: #d53251;
}

.home-auth-sms__label {
  flex: 0 0 auto;
  min-width: 120px;
  color: #b3b3b3;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
}

.home-auth-sms__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.home-auth-sms .home-auth-sms__input,
.home-auth-sms input.phone,
.home-auth-sms input.password {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #000;
  font-family: var(--font-main, "CoFo Gothic", Arial, sans-serif);
  font-size: 16px;
  line-height: 1.3;
  outline: none;
}

.home-auth-sms .bxmaker-authuserphone-login-row__flag {
  position: relative;
  left: auto;
  top: auto;
  display: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  z-index: 1;
  cursor: pointer;
  line-height: 0;
  background-repeat: no-repeat;
  background-image: url(/bitrix/js/main/phonenumber/flag/sprite-16.png);
}

.home-auth-sms .bxmaker-authuserphone-login-row.bxmaker-authuserphone-login-row--flag .bxmaker-authuserphone-login-row__flag {
  display: inline-block !important;
  vertical-align: middle;
}

.home-auth-sms .bxmaker-authuserphone-login-row__flag.bx-flag-16 {
  display: inline-block !important;
  width: 16px !important;
  height: 16px !important;
  background-image: url(/bitrix/js/main/phonenumber/flag/sprite-16.png) !important;
  background-repeat: no-repeat !important;
}

.home-auth-sms .bxmaker-authuserphone-login-row.bxmaker-authuserphone-login-row--flag .home-auth-sms__control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-auth-sms .bxmaker-authuserphone-login-row.bxmaker-authuserphone-login-row--flag input.phone {
  padding-left: 0;
}

.home-auth-sms__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 0;
  margin-bottom: 52px;
}

.home-auth-sms__remember {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.home-auth-sms__remember-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.home-auth-sms__switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 44px;
  border-radius: 999px;
  background: #e8e8e8;
  transition: background .2s ease;
}

.home-auth-sms__switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #cfcfcf;
  transition: transform .2s ease, background .2s ease;
}

.home-auth-sms__remember-input:checked + .home-auth-sms__switch {
  background: #f7cfe6;
}

.home-auth-sms__remember-input:checked + .home-auth-sms__switch::after {
  background: #e1429f;
  transform: translateX(20px);
}

.home-auth-sms__remember-text {
  color: #000;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.home-auth-sms__resend-note {
  display: none;
  max-width: 55%;
  color: #b3b3b3;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .4px;
  text-transform: uppercase;
  text-align: right;
}

.home-auth-sms__resend-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #000;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.home-auth-sms__resend-link:hover,
.home-auth-sms__resend-link:focus {
  color: #e1429f;
}

.home-auth-sms__btn--primary.timeout {
  opacity: .7;
  pointer-events: none;
}

/* Step 2: primary is Login — keep it clickable during resend timer */
.home-auth-sms--code-sent .home-auth-sms__btn--primary.timeout {
  opacity: 1;
  pointer-events: auto;
  cursor: pointer;
  background: #ffdee2;
  color: #000;
}

.home-auth-sms__actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: auto;
  margin-left: 0;
  margin-bottom: 0;
  padding-left: 0;
  padding-bottom: 0;
}

.home-auth-sms__actions .home-auth-sms__btn,
.home-auth-sms__actions .bxmaker-authuserphone-login-link {
  flex: 0 0 auto;
}

.home-auth-sms .bxmaker-authuserphone-login-msg {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #000;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

.home-auth-sms .bxmaker-authuserphone-login-msg--error,
.home-auth-sms .bxmaker-authuserphone-login-msg--success {
  display: block;
  border: 0;
  background: transparent;
}

.home-auth-sms .bxmaker-authuserphone-login-msg--error {
  color: #d53251;
}

.home-auth-sms .bxmaker-authuserphone-login-msg--success {
  color: #000;
}

.home-auth-sms__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  color: #000;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 12px;
  line-height: 1;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  text-align: center;
  transition: background-color .25s ease, color .25s ease;
}

.home-auth-sms__btn--primary,
.home-auth-sms .bxmaker-authuserphone-login-link.home-auth-sms__btn--primary {
  background: #ffdee2;
  border: 0;
}

.home-auth-sms__btn--primary.timeout {
  background: #f2f1f0;
  color: #b3b3b3;
  cursor: default;
  pointer-events: none;
}

.home-auth-sms--code-sent .home-auth-sms__btn--primary.timeout {
  background: #ffdee2;
  color: #000;
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
}

.home-auth-sms__btn--secondary {
  background: #f2f1f0;
}

.home-auth-sms__btn:hover:not(.timeout),
.home-auth-sms__btn:focus:not(.timeout) {
  background: #e1429f;
  color: #fff;
  text-decoration: none;
  filter: none;
}

.home-auth-sms__enter {
  margin-top: 12px;
}

.home-auth-sms__enter .bxmaker-authuserphone-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 24px;
  border-radius: 999px;
  background: transparent;
  color: #b3b3b3;
  font-family: var(--font-buttons, "CoFo Gothic", Arial, sans-serif);
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
}
