:root {
  --auth-deep: #271f2a;
  --auth-copy: #625761;
  --auth-paper: #fffdfd;
  --auth-wash: #f7f3f5;
  --auth-rose: #bd4d79;
  --auth-rose-dark: #95315e;
  --auth-line: #e7d9df;
}

.auth-body {
  min-width: 320px;
  height: 100vh;
  min-height: 100dvh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  color: var(--auth-deep);
  background: var(--iv-surface);
}

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

.auth-body::before {
  content: none;
}

.auth-header {
  width: min(calc(100% - 40px), 1120px);
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
}

.auth-brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-rose-dark);
  font-size: 20px;
  font-weight: 780;
  text-decoration: none;
}

.auth-link-button {
  min-width: 72px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--auth-copy);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}

.auth-main {
  width: min(calc(100% - 40px), 1120px);
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  gap: clamp(32px, 6vw, 80px);
  margin: 0 auto;
  padding: clamp(24px, 4vh, 40px) 0;
  overflow: hidden;
}

.auth-intro {
  min-width: 0;
  max-width: 590px;
}

.auth-panel {
  min-width: 0;
}

.auth-panel__kicker {
  margin: 0 0 10px;
  color: var(--auth-rose-dark);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-intro h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(33px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.02;
}

.auth-lead {
  max-width: 44ch;
  margin: 20px 0 0;
  color: var(--auth-copy);
  font-size: 17px;
  line-height: 1.45;
}

.auth-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 22px 0 0;
  padding: 0;
  color: var(--auth-copy);
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}

.auth-benefits li::before {
  margin-right: 9px;
  color: var(--auth-rose);
  content: "•";
}

.auth-panel {
  position: relative;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-panel h2 {
  margin: 0;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.06;
}

.auth-panel__copy {
  margin: 10px 0 18px;
  color: var(--auth-copy);
  font-size: 17px;
  line-height: 1.45;
}

.auth-loading {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--auth-copy);
  font-weight: 650;
}

.auth-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--auth-line);
  border-top-color: var(--auth-rose);
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

.auth-provider-list {
  display: grid;
  gap: 10px;
}

.auth-provider {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 9px 18px 9px 10px;
  border: 0;
  border-radius: var(--iv-control-radius);
  color: var(--auth-deep);
  background: var(--iv-surface-soft);
  font-size: 17px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.auth-provider:hover {
  background: var(--iv-surface-brand);
}

.auth-provider:active {
  transform: scale(0.99);
}

.auth-provider:disabled {
  color: #766a71;
  background: #f4f0f2;
  cursor: not-allowed;
  transform: none;
}

.auth-provider__mark {
  width: 40px;
  height: 40px;
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 13px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 820;
}

.auth-provider--vk .auth-provider__mark {
  background: #2787f5;
}

.auth-provider--yandex .auth-provider__mark {
  color: #ffffff;
  background: #fc3f1d;
}

.auth-consent {
  margin: 16px 0 0;
  color: #766a71;
  font-size: 13px;
  line-height: 1.55;
}

.auth-consent a {
  color: var(--auth-rose-dark);
}

.auth-identities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.auth-link-providers {
  margin: 0 0 24px;
}

.auth-link-providers > p {
  margin: 0 0 10px;
  color: var(--auth-copy);
  font-size: 13px;
  font-weight: 700;
}

.auth-link-provider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-link-provider-list .auth-provider {
  min-height: 50px;
  padding-right: 10px;
  font-size: 13px;
}

.auth-link-provider-list .auth-provider__mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 11px;
  font-size: 12px;
}

.auth-identity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--auth-copy);
  background: var(--auth-wash);
  font-size: 13px;
  font-weight: 700;
}

.auth-identity::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9b69;
  content: "";
}

.auth-actions {
  margin: 0 0 34px;
}

.auth-primary-action {
  width: 100%;
}

.auth-sites {
  padding-top: 24px;
  border-top: 1px solid var(--auth-line);
}

.auth-sites__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.auth-sites h3 {
  margin: 0;
  font-size: 18px;
}

.auth-sites__head span {
  color: var(--auth-copy);
  font-size: 13px;
}

.auth-site-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.auth-site,
.auth-empty {
  padding: 14px 0;
  border-top: 1px solid #eee5e9;
}

.auth-site:first-child,
.auth-empty:first-child {
  border-top: 0;
}

.auth-site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-site__title {
  display: block;
  margin-bottom: 4px;
  font-weight: 730;
}

.auth-site__meta,
.auth-empty {
  color: var(--auth-copy);
  font-size: 13px;
  line-height: 1.45;
}

.auth-site__link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--auth-rose-dark);
  background: #faedf2;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.auth-site__link--secondary {
  padding-inline: 8px;
  background: transparent;
}

.auth-site__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.auth-message {
  margin-top: 18px;
  padding: 13px 15px;
  border: 0;
  border-radius: 14px;
  color: var(--auth-copy);
  background: #fbf1f5;
  font-size: 14px;
  line-height: 1.45;
}

.auth-message[data-kind="error"] {
  color: #7c2727;
  background: #fff1f1;
}

.auth-noscript {
  margin: 20px;
  color: #7c2727;
  text-align: center;
}

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

@media (max-width: 820px) {
  .auth-main {
    grid-template-columns: 1fr;
    align-content: center;
    align-items: center;
    gap: 24px;
    padding: 20px 0 28px;
  }

  .auth-intro h1 {
    max-width: 16ch;
    font-size: clamp(30px, 8.5vw, 34px);
  }

  .auth-lead {
    margin-top: 16px;
  }

  .auth-benefits {
    margin-top: 18px;
  }

  .auth-panel {
    min-height: 0;
  }
}

@media (max-width: 520px) {
  .auth-header,
  .auth-main {
    width: min(calc(100% - 28px), 1120px);
  }

  .auth-header {
    min-height: 58px;
  }

  .auth-main {
    height: calc(100vh - 58px);
    height: calc(100dvh - 58px);
    gap: clamp(16px, 3vh, 24px);
    padding: 8px 0 18px;
  }

  .auth-benefits {
    gap: 4px 14px;
    margin-top: 12px;
    font-size: 12px;
  }

  .auth-intro h1 {
    font-size: clamp(28px, 8.5vw, 34px);
  }

  .auth-lead {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.4;
  }

  .auth-panel__kicker {
    margin-bottom: 6px;
    font-size: 11px;
  }

  .auth-panel h2 {
    font-size: 26px;
  }

  .auth-panel__copy {
    margin: 8px 0 14px;
    font-size: 14px;
  }

  .auth-provider-list {
    gap: 8px;
  }

  .auth-provider {
    min-height: 50px;
    font-size: 15px;
  }

  .auth-provider__mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .auth-consent {
    margin-top: 12px;
    font-size: 11px;
    line-height: 1.4;
  }

  .auth-site {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-site__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .auth-link-provider-list {
    grid-template-columns: 1fr;
  }
}

.auth-body[data-auth-view="signed-in"] .auth-main {
  max-width: 880px;
  grid-template-columns: 1fr;
  align-items: stretch;
}

.auth-body[data-auth-view="signed-in"] .auth-intro {
  display: none;
}

.auth-body[data-auth-view="signed-in"] .auth-panel,
.auth-body[data-auth-view="signed-in"] [data-signed-in]:not([hidden]) {
  min-height: 0;
  height: 100%;
}

.auth-body[data-auth-view="signed-in"] [data-signed-in]:not([hidden]) {
  display: grid;
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
}

.auth-body[data-auth-view="signed-in"] .auth-panel__copy {
  margin: 6px 0 12px;
}

.auth-body[data-auth-view="signed-in"] .auth-identities,
.auth-body[data-auth-view="signed-in"] .auth-link-providers {
  margin-bottom: 14px;
}

.auth-body[data-auth-view="signed-in"] .auth-actions {
  margin-bottom: 20px;
}

.auth-body[data-auth-view="signed-in"] .auth-sites {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding-top: 16px;
}

.auth-body[data-auth-view="signed-in"] .auth-site-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 520px) and (max-height: 700px) {
  .auth-header {
    min-height: 54px;
  }

  .auth-main {
    height: calc(100vh - 54px);
    height: calc(100dvh - 54px);
    gap: 12px;
    padding: 4px 0 10px;
  }

  .auth-benefits {
    display: none;
  }

  .auth-panel h2 {
    font-size: 24px;
  }

  .auth-provider {
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
