.auth-v2[hidden] {
  display: none !important;
}

.auth-v2 {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 14px;
  pointer-events: none;
  font-family: Arial, "Segoe UI", sans-serif;
}

.auth-v2__shade {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 23, .68);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}

.auth-v2__panel {
  position: relative;
  z-index: 1;
  isolation: isolate;
  width: min(460px, 100%);
  max-height: calc(100dvh - 28px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 28px;
  border: 1px solid #d7ddd1;
  border-radius: 22px;
  background: #fffdf8;
  color: #242826;
  box-shadow: 0 28px 90px rgba(22, 31, 25, .35), inset 0 4px 0 #b9d03c;
  pointer-events: auto;
}

.auth-v2__panel * {
  box-sizing: border-box;
}

.auth-v2__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 21px;
}

.auth-v2__eyebrow {
  display: block;
  margin: 1px 0 7px;
  color: #7c8f1c;
  font: 700 9px ui-monospace, Consolas, monospace;
  letter-spacing: .14em;
}

.auth-v2__header h2 {
  margin: 0;
  color: #202421;
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -.045em;
}

.auth-v2__close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 1px solid #dbe0d6;
  border-radius: 50%;
  background: #f2f4ed;
  color: #465247;
  font: 400 25px/1 Arial, sans-serif;
  cursor: pointer;
}

.auth-v2__intro {
  margin: 0 0 18px;
  color: #68736c;
  font-size: 13px;
  line-height: 1.55;
}

.auth-v2__form {
  display: grid;
  gap: 14px;
}

.auth-v2__field {
  display: grid;
  gap: 7px;
}

.auth-v2__field > label,
.auth-v2__provider-label {
  color: #53605a;
  font: 700 10px ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-v2__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.auth-v2__input-wrap input {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 13px;
  border: 1px solid #cfd6cc;
  border-radius: 8px;
  background: #fff;
  color: #202823;
  font: 16px Arial, "Segoe UI", sans-serif;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: text;
  -webkit-user-select: text;
}

.auth-v2__input-wrap input::placeholder {
  color: #8a938d;
}

.auth-v2__input-wrap input[aria-invalid="true"] {
  border-color: #a7493d;
  background: #fff9f7;
}

.auth-v2__field-error {
  min-height: 0;
  color: #99473b;
  font-size: 11px;
  line-height: 1.4;
}

.auth-v2__field-error:empty {
  display: none;
}

.auth-v2__password-toggle {
  position: absolute;
  z-index: 2;
  right: 7px;
  min-height: 36px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: #eef1e9;
  color: #4f614d;
  font: 600 11px Arial, "Segoe UI", sans-serif;
  cursor: pointer;
}

.auth-v2__input-wrap:has(.auth-v2__password-toggle) input {
  padding-right: 82px;
}

.auth-v2__consent {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #657068;
  font-size: 11px;
  line-height: 1.55;
  cursor: pointer;
}

.auth-v2__consent input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: #748d14;
  cursor: pointer;
}

.auth-v2__consent a {
  color: #344e38;
  text-underline-offset: 3px;
}

.auth-v2__form-error {
  min-height: 0;
  margin: 0;
  color: #98483c;
  font-size: 12px;
  line-height: 1.5;
}

.auth-v2__form-error:empty {
  display: none;
}

.auth-v2__submit,
.auth-v2__return {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: 1px solid #161817;
  border-radius: 8px;
  background: #161817;
  color: #fff;
  font: 700 14px Arial, "Segoe UI", sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.auth-v2__submit.is-busy span {
  opacity: .45;
}

.auth-v2__submit.is-busy::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-v2-spin .7s linear infinite;
}

.auth-v2__submit:disabled {
  cursor: wait;
}

.auth-v2__submit.is-disabled {
  border-color: #b9c0b7;
  background: #c9cec7;
  color: #667068;
  cursor: not-allowed;
}

.auth-v2__social {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e1e5dd;
}

.auth-v2__provider-label {
  margin-bottom: 1px;
}

.auth-v2__telegram-one-tap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid #168bd2;
  border-radius: 7px;
  background: #229ed9;
  color: #fff;
  font: 700 14px Arial, "Segoe UI", sans-serif;
  cursor: pointer;
}

.auth-v2__telegram-one-tap svg {
  width: 21px;
  height: 21px;
  flex: none;
  fill: currentColor;
}

.auth-v2__telegram-one-tap.is-busy span {
  opacity: .55;
}

.auth-v2__telegram-one-tap.is-busy::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-v2-spin .7s linear infinite;
}

.auth-v2__telegram-one-tap:disabled {
  cursor: wait;
}

.auth-v2__telegram-one-tap:not(:disabled):hover {
  background: #178bc3;
}

.auth-v2__telegram-terms {
  margin: -2px 2px 4px;
  color: #7b857f;
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.auth-v2__telegram-terms a {
  color: #49634a;
  text-underline-offset: 2px;
}

.auth-v2__vk-widget,
.auth-v2__yandex-widget {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 46px;
}

.auth-v2__vk-widget iframe,
.auth-v2__yandex-widget iframe {
  display: block;
  max-width: 100%;
  border: 0;
}

.auth-v2__status {
  margin: 0;
  color: #657168;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.auth-v2__status:empty {
  display: none;
}

.auth-v2__status.is-error {
  color: #99473b;
}

.auth-v2__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 15px;
  margin-top: 18px;
}

.auth-v2__footer[hidden] {
  display: none;
}

.auth-v2__link {
  min-height: 38px;
  padding: 7px 3px;
  border: 0;
  background: transparent;
  color: #4f6749;
  font: 13px Arial, "Segoe UI", sans-serif;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.auth-v2__result {
  display: grid;
  gap: 12px;
  margin: 2px 0 18px;
  padding: 18px;
  border: 1px solid #dce5ca;
  border-radius: 10px;
  background: #f0f4e8;
  color: #354037;
  font-size: 14px;
  line-height: 1.6;
}

.auth-v2__result > span {
  color: #748d14;
  font-size: 28px;
  line-height: 1;
}

.auth-v2__confirmation {
  display: grid;
  gap: 15px;
}

.auth-v2__confirmation .auth-v2__intro {
  margin-bottom: 0;
}

.auth-v2__confirmation-summary {
  display: grid;
  margin: 0;
  border: 1px solid #dce2d7;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.auth-v2__confirmation-row {
  display: grid;
  grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr);
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e9e1;
}

.auth-v2__confirmation-row:last-child {
  border-bottom: 0;
}

.auth-v2__confirmation-row dt {
  color: #68736c;
  font: 700 9px ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-v2__confirmation-row dd {
  min-width: 0;
  margin: 0;
  color: #202823;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.auth-v2__confirmation-state {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid #dce5ca;
  border-radius: 8px;
  background: #f0f4e8;
  color: #4f5d52;
  font-size: 12px;
  line-height: 1.5;
}

.auth-v2__confirmation-state.is-error {
  border-color: #ead0cb;
  background: #fff6f4;
  color: #8f4137;
}

.auth-v2__confirmation-pulse {
  width: 10px;
  height: 10px;
  flex: none;
  margin-top: 4px;
  border-radius: 50%;
  background: #94ae2d;
  box-shadow: 0 0 0 0 rgba(148, 174, 45, .35);
  animation: auth-v2-pulse 1.8s ease-out infinite;
}

.auth-v2__confirmation-state.is-error .auth-v2__confirmation-pulse {
  background: #a4473e;
  box-shadow: none;
  animation: none;
}

.auth-v2__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.auth-v2__suggestions button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid #c9d3bc;
  border-radius: 20px;
  background: #fffdf8;
  color: #40583d;
  font-weight: 600;
  cursor: pointer;
}

.auth-v2__close:hover,
.auth-v2__password-toggle:hover {
  background: #e9ede4;
}

.auth-v2__submit:not(.is-disabled):hover {
  background: #292d2a;
}

.auth-v2 button:focus-visible,
.auth-v2 a:focus-visible,
.auth-v2 input:focus-visible,
.auth-v2 iframe:focus-visible {
  outline: 3px solid #b9d03c;
  outline-offset: 2px;
}

.auth-v2-open {
  overflow: hidden;
}

.auth-v2__return[hidden] {
  display: none;
}

.account-actions.signed-in {
  flex-wrap: nowrap;
  max-width: 100%;
}

.auth-v2 .account-button {
  border-radius: 8px;
}

@keyframes auth-v2-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes auth-v2-pulse {
  70%, 100% {
    box-shadow: 0 0 0 9px rgba(148, 174, 45, 0);
  }
}

@media (max-width: 520px) {
  .auth-v2 {
    place-items: start center;
    padding: 8px;
  }

  .auth-v2__panel {
    width: 100%;
    max-height: calc(100dvh - 16px);
    margin-top: max(0px, env(safe-area-inset-top));
    padding: 24px 18px calc(22px + env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  .auth-v2__header {
    margin-bottom: 18px;
  }

  .auth-v2__header h2 {
    font-size: 25px;
  }

  .auth-v2__close {
    width: 40px;
    height: 40px;
  }

  .auth-v2__input-wrap input {
    min-height: 51px;
  }

  .auth-v2__confirmation-row {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 12px;
  }

  .auth-v2__footer {
    margin-top: 15px;
  }

  .account-actions {
    gap: 10px;
  }

  .account-button {
    width: 100%;
    max-width: 330px;
  }
}

@media (max-height: 650px) {
  .auth-v2 {
    place-items: start center;
  }

  .auth-v2__panel {
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-v2__submit.is-busy::after,
  .auth-v2__confirmation-pulse {
    animation: none;
  }
}
