/* ==========================================================
   PATHREST EMAIL AUTH WIDGET — STEP 36 — MOBILE FIXED CARD / INTERNAL SCROLL
   Tilda field: registration_login
   Mobile 360+: centered popup vertically + manual submit only, no autofill hint
   ========================================================== */

.pathrest-auth-widget {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  font-family: inherit;
  color: #2a6583;
}

.pathrest-auth-widget * {
  box-sizing: border-box;
}

.pathrest-auth-card {
  position: relative;
  width: 100%;
  padding: 34px 24px 24px;
  border: 1px solid rgba(42, 101, 131, 0.18);
  border-radius: 30px;
  background: #f5fdff;
  box-shadow: 0 12px 34px rgba(42, 101, 131, 0.08);
}

.pathrest-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(42, 101, 131, 0.18);
  border-radius: 50%;
  background: #ffffff;
  color: #2a6583;
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.pathrest-auth-close:hover {
  background: #ff8b21;
  border-color: #ff8b21;
  color: #ffffff;
  transform: rotate(90deg);
}

.pathrest-auth-title {
  margin: 0 42px 24px;
  text-align: center;
  color: #2a6583;
  font-size: 28px;
  line-height: 1.22;
  font-weight: 700;
}

.pathrest-auth-account-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.pathrest-auth-account-type__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid rgba(42, 101, 131, 0.22);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    color 0.2s ease;
}

.pathrest-auth-account-type__item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 139, 33, 0.6);
}

.pathrest-auth-account-type__item input {
  position: absolute !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  pointer-events: none !important;
}

.pathrest-auth-account-type__text {
  display: block;
  color: #2a6583;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}

.pathrest-auth-account-type__item.is-active {
  border-color: #ff8b21;
  background: #fff8f1;
  box-shadow: 0 0 0 4px rgba(255, 139, 33, 0.12);
}

.pathrest-auth-account-type__item.is-active .pathrest-auth-account-type__text {
  color: #ff8b21;
}

.pathrest-auth-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.pathrest-auth-field {
  position: relative;
}

.pathrest-auth-input {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid rgba(42, 101, 131, 0.34);
  border-radius: 30px;
  background: #ffffff;
  color: #2a6583;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.25;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.pathrest-auth-input::placeholder {
  color: rgba(42, 101, 131, 0.50);
}

.pathrest-auth-input:focus {
  border-color: #ff8b21;
  box-shadow: 0 0 0 4px rgba(255, 139, 33, 0.14);
}

.pathrest-auth-password-wrap {
  position: relative;
}

.pathrest-auth-password-wrap .pathrest-auth-input {
  padding-right: 52px;
}

/* ==========================================================
   Код подтверждения:
   одно поле, слева ввод кода, справа кнопка отправки
   ========================================================== */

.pathrest-auth-code-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(42, 101, 131, 0.34);
  border-radius: 30px;
  background: #ffffff;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.pathrest-auth-code-wrap:focus-within {
  border-color: #ff8b21;
  box-shadow: 0 0 0 4px rgba(255, 139, 33, 0.14);
}

.pathrest-auth-code-wrap .pathrest-auth-input {
  min-height: 54px;
  padding: 0 16px 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pathrest-auth-code-wrap .pathrest-auth-input:focus {
  border: 0;
  box-shadow: none;
}

.pathrest-auth-send-code {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 8px 14px;
  border: 0;
  border-left: 1px solid rgba(255, 139, 33, 0.34);
  border-radius: 0;
  background: #ff8b21;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.pathrest-auth-send-code:hover {
  background: #ff7a00;
}

.pathrest-auth-send-code:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pathrest-auth-toggle-password {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(42, 101, 131, 0.72);
  cursor: pointer;
  transition: color 0.2s ease;
}

.pathrest-auth-toggle-password:hover {
  color: #ff8b21;
}

.pathrest-auth-toggle-password svg {
  display: block;
  width: 20px;
  height: 20px;
}

.pathrest-auth-code-field {
  display: none;
}

.pathrest-auth-code-field.is-visible {
  display: block;
}

.pathrest-auth-register-only-field {
  display: none;
}

.pathrest-auth-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.pathrest-auth-forgot {
  display: inline-flex;
  color: #2a6583;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pathrest-auth-forgot:hover {
  color: #ff8b21;
}

.pathrest-auth-forgot.is-hidden {
  display: none;
}

.pathrest-auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: #2a6583;
  cursor: pointer;
  user-select: none;
}

.pathrest-auth-agree input {
  position: absolute !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 0 !important;
  height: 0 !important;
  pointer-events: none !important;
}

.pathrest-auth-agree__box {
  position: relative;
  width: 20px;
  min-width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid rgba(42, 101, 131, 0.38);
  border-radius: 6px;
  background: #ffffff;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.pathrest-auth-agree__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
}

.pathrest-auth-agree input:checked + .pathrest-auth-agree__box {
  border-color: #ff8b21;
  background: #ff8b21;
  box-shadow: 0 0 0 4px rgba(255, 139, 33, 0.12);
}

.pathrest-auth-agree input:checked + .pathrest-auth-agree__box::after {
  transform: rotate(45deg) scale(1);
}

.pathrest-auth-agree__text {
  display: block;
  color: rgba(42, 101, 131, 0.86);
  font-size: 13px;
  line-height: 1.42;
}

.pathrest-auth-agree__text a {
  color: #ff8b21 !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 139, 33, 0.35);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.pathrest-auth-agree__text a:hover {
  color: #ff7a00 !important;
  border-bottom-color: rgba(255, 122, 0, 0.75);
}

.pathrest-auth-agree,
.pathrest-auth-agree *,
.pathrest-auth-agree__text,
.pathrest-auth-agree__text a {
  -webkit-tap-highlight-color: transparent;
}

.pathrest-auth-agree__text {
  -webkit-user-select: none;
  user-select: none;
}

.pathrest-auth-agree__text a {
  -webkit-touch-callout: none;
  outline: none;
}

.pathrest-auth-agree__text a:focus,
.pathrest-auth-agree__text a:active {
  color: #ff7a00 !important;
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none;
  border-bottom-color: rgba(255, 122, 0, 0.75);
}

.pathrest-auth-submit {
  width: 100%;
  min-height: 56px;
  margin-top: 18px;
  padding: 12px 20px;
  border: 1px solid #ff8b21;
  border-radius: 999px;
  background: #ff8b21;
  color: #ffffff;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.pathrest-auth-submit:hover {
  background: #ff7a00;
  border-color: #ff7a00;
  box-shadow: 0 8px 18px rgba(255, 139, 33, 0.18);
  transform: translateY(-1px);
}

.pathrest-auth-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.pathrest-auth-bottom {
  margin-top: 18px;
  text-align: center;
  color: #2a6583;
  font-size: 15px;
  line-height: 1.35;
}

.pathrest-auth-bottom button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ff8b21;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.pathrest-auth-bottom button:hover {
  text-decoration: underline;
}

.pathrest-auth-error {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff4f2;
  color: #c03a2b;
  font-size: 13px;
  line-height: 1.4;
}

.pathrest-auth-error.is-visible {
  display: block;
}

.pathrest-auth-status {
  margin-top: 14px;
  color: rgba(42, 101, 131, 0.74);
  font-size: 13px;
  line-height: 1.35;
}

.pathrest-auth-status.is-success {
  color: #1f7a4d;
  font-weight: 700;
}

.pathrest-auth-status.is-error {
  color: #c03a2b;
  font-weight: 700;
}

/* Скрываем технический select Tilda */
.t-input-group[data-field-name="registration_login"] .t-select__wrapper {
  display: none !important;
}

.t-input-group[data-field-name="registration_login"] .t-input-block {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 0 !important;
}

/* ==========================================================
   Mobile
   Делаем форму нежнее: меньше текст, ниже поля, мягче отступы
   ========================================================== */

@media (max-width: 640px) {
  .pathrest-auth-card {
    padding: 30px 15px 18px;
    border-radius: 24px;
    box-shadow: 0 10px 28px rgba(42, 101, 131, 0.07);
  }

  .pathrest-auth-close {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  .pathrest-auth-title {
    margin: 0 34px 18px;
    font-size: 22px;
    line-height: 1.22;
  }

  .pathrest-auth-account-type {
    gap: 8px;
    margin-bottom: 14px;
  }

  .pathrest-auth-account-type__item {
    min-height: 46px;
    padding: 9px 12px;
  }

  .pathrest-auth-account-type__text {
    font-size: 14px;
  }

  .pathrest-auth-fields {
    gap: 11px;
  }

  .pathrest-auth-input {
    min-height: 48px;
    padding: 0 15px;
    border-radius: 24px;
    font-size: 14px;
  }

  .pathrest-auth-password-wrap .pathrest-auth-input {
    padding-right: 46px;
  }

  .pathrest-auth-toggle-password {
    right: 12px;
    width: 28px;
    height: 28px;
  }

  .pathrest-auth-toggle-password svg {
    width: 18px;
    height: 18px;
  }

  .pathrest-auth-code-wrap {
    grid-template-columns: 1fr 1fr;
    min-height: 48px;
    border-radius: 24px;
  }

  .pathrest-auth-code-wrap .pathrest-auth-input {
    min-height: 46px;
    padding: 0 10px 0 14px;
    font-size: 13.5px;
  }

  .pathrest-auth-send-code {
    min-height: 46px;
    padding: 7px 8px;
    font-size: 12px;
    line-height: 1.15;
  }

  .pathrest-auth-meta {
    margin-top: 7px;
  }

  .pathrest-auth-forgot {
    font-size: 13px;
  }

  .pathrest-auth-agree {
    gap: 9px;
    margin-top: 14px;
  }

  .pathrest-auth-agree__box {
    width: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 6px;
  }

  .pathrest-auth-agree__box::after {
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
  }

  .pathrest-auth-agree__text {
    font-size: 12px;
    line-height: 1.38;
  }

  .pathrest-auth-submit {
    min-height: 48px;
    margin-top: 15px;
    padding: 10px 18px;
    font-size: 16px;
  }

  .pathrest-auth-bottom {
    margin-top: 15px;
    font-size: 13px;
  }

  .pathrest-auth-error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    font-size: 12px;
  }

  .pathrest-auth-status {
    margin-top: 12px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .pathrest-auth-card {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pathrest-auth-title {
    font-size: 20px;
  }

  .pathrest-auth-input {
    font-size: 13.5px;
  }

  .pathrest-auth-code-wrap .pathrest-auth-input {
    font-size: 12.5px;
  }

  .pathrest-auth-send-code {
    font-size: 11.5px;
    padding-left: 6px;
    padding-right: 6px;
  }
}

.pathrest-auth-input:placeholder-shown {
  color: #2a6583;
}

.pathrest-auth-input::placeholder {
  opacity: 1;
  color: rgba(42, 101, 131, 0.50);
}

.pathrest-auth-input::-webkit-input-placeholder {
  opacity: 1;
  color: rgba(42, 101, 131, 0.50);
}

.pathrest-auth-input::-moz-placeholder {
  opacity: 1;
  color: rgba(42, 101, 131, 0.50);
}


/* ==========================================================
   STEP 31 — mobile auth popup 360px
   Делаем модалку компактной и прокручиваемой внутри экрана.
   ========================================================== */

html body .t-popup[data-tooltip-hook="#account"] .t-popup__container,
html body .t-popup[data-tooltip-hook="#account"] .t-popup__container.t-popup__container-static {
  box-sizing: border-box !important;
}

html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget,
html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget * {
  box-sizing: border-box;
}

@media (max-width: 765px) {
  html body .t-popup[data-tooltip-hook="#account"] {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container,
  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container.t-popup__container-static {
    width: calc(100vw - 20px) !important;
    max-width: 430px !important;
    min-width: 0 !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 10px auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container .t-rec,
  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container .t396__artboard,
  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container .t396__elem,
  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container .tn-atom {
    max-width: 100% !important;
  }

  .pathrest-auth-card {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 22px 14px 15px;
    border-radius: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .pathrest-auth-close {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    font-size: 19px;
  }

  .pathrest-auth-title {
    margin: 0 32px 14px;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 600;
  }

  .pathrest-auth-account-type {
    gap: 7px;
    margin-bottom: 11px;
  }

  .pathrest-auth-account-type__item {
    min-height: 40px;
    padding: 8px 10px;
  }

  .pathrest-auth-account-type__text {
    font-size: 13px;
    font-weight: 500;
  }

  .pathrest-auth-fields {
    gap: 9px;
  }

  .pathrest-auth-input {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 22px;
    font-size: 13px;
    line-height: 1.2;
  }

  .pathrest-auth-password-wrap .pathrest-auth-input {
    padding-right: 42px;
  }

  .pathrest-auth-toggle-password {
    right: 9px;
    width: 28px;
    height: 28px;
  }

  .pathrest-auth-toggle-password svg {
    width: 17px;
    height: 17px;
  }

  .pathrest-auth-code-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  .pathrest-auth-code-wrap:focus-within {
    border-color: transparent;
    box-shadow: none;
  }

  .pathrest-auth-code-wrap .pathrest-auth-input {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(42, 101, 131, 0.34);
    border-radius: 22px;
    background: #ffffff;
    font-size: 13px;
  }

  .pathrest-auth-code-wrap .pathrest-auth-input:focus {
    border-color: #ff8b21;
    box-shadow: 0 0 0 4px rgba(255, 139, 33, 0.14);
  }

  .pathrest-auth-send-code {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.15;
  }

  .pathrest-auth-meta {
    margin-top: 6px;
  }

  .pathrest-auth-forgot {
    font-size: 12.5px;
  }

  .pathrest-auth-agree {
    gap: 8px;
    margin-top: 10px;
    font-size: 12.2px;
    line-height: 1.34;
  }

  .pathrest-auth-agree__box {
    width: 18px;
    min-width: 18px;
    height: 18px;
    border-radius: 5px;
  }

  .pathrest-auth-agree__box::after {
    left: 5px;
    top: 2px;
  }

  .pathrest-auth-submit {
    min-height: 44px;
    margin-top: 12px;
    padding: 10px 14px;
    font-size: 14.5px;
    font-weight: 600;
  }

  .pathrest-auth-bottom {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.3;
  }

  .pathrest-auth-error,
  .pathrest-auth-status {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 15px;
    font-size: 12.5px;
    line-height: 1.35;
  }
}

@media (min-width: 360px) and (max-width: 420px) {
  .pathrest-auth-card {
    padding: 20px 13px 14px;
    border-radius: 22px;
  }

  .pathrest-auth-title {
    margin-bottom: 12px;
    font-size: 19px;
  }

  .pathrest-auth-account-type__item {
    min-height: 38px;
  }

  .pathrest-auth-input {
    min-height: 42px;
    font-size: 12.8px;
  }

  .pathrest-auth-submit {
    min-height: 42px;
    font-size: 14px;
  }
}

@media (max-height: 600px) and (max-width: 765px) {
  .pathrest-auth-card {
    max-height: calc(100dvh - 16px);
    padding-top: 18px;
    padding-bottom: 12px;
  }

  .pathrest-auth-title {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .pathrest-auth-account-type {
    margin-bottom: 9px;
  }

  .pathrest-auth-fields {
    gap: 8px;
  }

  .pathrest-auth-agree,
  .pathrest-auth-submit,
  .pathrest-auth-bottom {
    margin-top: 9px;
  }
}

html.pathrest-auth-redirecting .t-popup[data-tooltip-hook="#account"],
html.pathrest-auth-redirecting .t-popup[data-tooltip-hook="#account"] .t-popup__bg,
html.pathrest-auth-redirecting .t-popup[data-tooltip-hook="#account"] .t-popup__container {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================
   STEP 36 — mobile fixed auth card / internal scroll
   ----------------------------------------------------------
   ВАЖНО:
   Визуальная карточка auth больше НЕ зависит от фиксированной
   высоты Zero Block / .t-popup__container.

   Сам widget остаётся физически внутри исходной Tilda <form>,
   поэтому hidden-поля, регистрация и Tilda submit не ломаются.

   На мобильном:
   - popup остаётся фиксированным overlay;
   - .pathrest-auth-widget позиционируется по viewport;
   - Login центрируется автоматически;
   - Registration при увеличении высоты остаётся по центру;
   - если Registration выше экрана, скролл идёт ВНУТРИ card.
   ========================================================== */

@media (max-width: 765px) {
  html body .t-popup[data-tooltip-hook="#account"].t-popup_show,
  html body .t-popup[data-tooltip-hook="#account"].t-popup_showed {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container,
  html body .t-popup[data-tooltip-hook="#account"] .t-popup__container.t-popup__container-static,
  html body .t-popup[data-tooltip-hook="#account"] .t-rec,
  html body .t-popup[data-tooltip-hook="#account"] .t396,
  html body .t-popup[data-tooltip-hook="#account"] .t396__artboard,
  html body .t-popup[data-tooltip-hook="#account"] .t396__carrier,
  html body .t-popup[data-tooltip-hook="#account"] .t396__filter,
  html body .t-popup[data-tooltip-hook="#account"] .t-input-group[data-field-name="registration_login"],
  html body .t-popup[data-tooltip-hook="#account"] .t-input-group[data-field-name="registration_login"] .t-input-block {
    overflow: visible !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget {
    position: fixed !important;
    z-index: 2147483000 !important;

    left: 50% !important;
    top: 50% !important;
    right: auto !important;
    bottom: auto !important;

    transform: translate(-50%, -50%) !important;

    width: min(360px, calc(100vw - 20px)) !important;
    max-width: min(360px, calc(100vw - 20px)) !important;
    max-height: var(--pathrest-auth-visible-height, calc(100dvh - 20px)) !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: visible !important;
    pointer-events: auto !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-card {
    width: 100% !important;
    max-width: 360px !important;
    max-height: var(--pathrest-auth-visible-height, calc(100dvh - 20px)) !important;
    min-height: 0 !important;

    margin: 0 !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;

    scrollbar-width: thin;
    scroll-padding-top: 16px;
    scroll-padding-bottom: 24px;
  }

  html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-status:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 765px) {
    html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget,
    html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-card {
      max-height: var(--pathrest-auth-visible-height, calc(100vh - 20px)) !important;
    }
  }
}

/* ==========================================================
   PATHREST AUTH — STEP 36 — FINAL MOBILE OVERRIDE
   PLACE AS THE LAST CSS/T123 BLOCK ON THE PAGE.

   Причина:
   ниже/другие универсальные Tilda-коды используют общие селекторы
   .t-popup_show / .t-popup__container и могут снова менять overflow.

   Этот блок касается ТОЛЬКО popup #account.
   ========================================================== */

@media (max-width: 765px) {
  html body .t-popup[data-tooltip-hook="#account"].t-popup_show,
  html body .t-popup[data-tooltip-hook="#account"].t-popup_showed {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget {
    position: fixed !important;
    z-index: 2147483000 !important;
    max-height: var(--pathrest-auth-visible-height, calc(100dvh - 20px)) !important;
    overflow: visible !important;
    pointer-events: auto !important;
  }

  html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-card {
    max-height: var(--pathrest-auth-visible-height, calc(100dvh - 20px)) !important;
    min-height: 0 !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 765px) {
    html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-widget,
    html body .t-popup[data-tooltip-hook="#account"] .pathrest-auth-card {
      max-height: var(--pathrest-auth-visible-height, calc(100vh - 20px)) !important;
    }
  }
}
