body.site-auth-open { overflow: hidden; }

.site-header .account-auth-trigger {
  box-sizing: border-box;
  width: 207rem;
  height: 50rem;
  min-height: 50rem;
  flex: 0 0 207rem;
  margin: 0;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11rem 21rem;
  border: 0;
  border-radius: 6rem;
  color: #101010;
  background: #f0f0f0;
  font-family: var(--font-body);
  font-size: clamp(14rem, 1.0417vw, 20rem);
  font-weight: 600;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease;
}

.site-header .account-auth-trigger:hover,
.site-header .account-auth-trigger:focus-visible {
  color: #fff;
  background: #e63d3d;
}

.site-header .account-auth-trigger.is-signed-in {
  color: #f0f0f0;
  background: #202020;
}

.site-auth-panel[hidden] { display: none !important; }

.site-auth-panel {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: grid;
  place-items: center;
  padding: 20px;
}

.site-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2,2,2,.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-auth-dialog {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  width: 850px;
  height: auto;
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 40px;
  border: 0;
  border-radius: 12px;
  color: #f0f0f0;
  background: #121212;
  background-image:
    radial-gradient(circle at 15% 0, rgba(220,44,31,.12), transparent 544px),
    linear-gradient(145deg, #171515, #090909 58%, #120c0b);
  box-shadow: none;
  scrollbar-width: none;
}

.site-auth-dialog::-webkit-scrollbar { display: none; }

.site-auth-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(240,240,240,.16);
  border-radius: 50%;
  color: #f0f0f0;
  background: #202020;
  box-shadow: none;
  font-size: 25px;
  line-height: 1;
}

.site-auth-close:hover,
.site-auth-close:focus-visible {
  border-color: #f0f0f0;
  background: #2b2b2b;
}

.site-auth-kicker {
  display: none;
}

.site-auth-dialog h2 {
  max-width: calc(100% - 70px);
  min-height: 60px;
  margin: 8px 0 52px;
  font-family: 'DrukCyr-Heavy', 'Druk Cyr', sans-serif;
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  text-transform: uppercase;
}

.site-auth-description {
  margin: 0 0 16px;
  color: rgba(240,240,240,.62);
  font-size: 18px;
  line-height: 1.45;
}

.site-auth-providers {
  display: grid;
  gap: 12px;
}

.site-auth-provider {
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border: 0;
  border-radius: 7px;
  color: #f0f0f0;
  background: rgba(32,32,32,.78);
  box-shadow: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.site-auth-provider:hover,
.site-auth-provider:focus-visible {
  color: #fff;
  background: rgba(41,41,41,.88);
  box-shadow: none;
  outline: 1px solid rgba(230,61,61,.72);
  outline-offset: 0;
}

.site-auth-provider:disabled {
  cursor: wait;
  opacity: .55;
  transform: none;
}

.site-auth-provider > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  font-weight: 800;
}

.site-auth-provider > span img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.site-auth-provider.is-yandex > span img { width: 30px; height: 30px; }
.site-auth-provider.is-admin {
  color: #f0f0f0;
  background: rgba(32,32,32,.52);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.site-auth-provider.is-admin:hover,
.site-auth-provider.is-admin:focus-visible { background: rgba(41,41,41,.68); }
.site-auth-provider strong { font-size: 18px; font-weight: 600; }

.site-auth-account {
  grid-template-columns: 54px minmax(0,1fr);
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 0;
  border-radius: 7px;
  background: #202020;
  box-shadow: none;
}

.site-auth-account:not([hidden]) { display: grid; }

.site-auth-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #202020;
}

.site-auth-account > div { min-width: 0; }
.site-auth-account strong,
.site-auth-account span {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-auth-account strong { font-size: 18px; }
.site-auth-account span { margin-top: 4px; color: #a99a96; font-size: 13px; }

.site-auth-logout {
  grid-column: 1 / -1;
  min-height: 64px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #e63d3d;
  box-shadow: none;
  font-family: 'DrukCyr-Heavy', 'Druk Cyr', sans-serif;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-auth-notice {
  min-height: 20px;
  margin: 16px 0 0;
  color: #a99a96;
  font-size: 13px;
  line-height: 1.35;
}

.site-auth-notice:empty {
  min-height: 0;
  margin: 0;
}

.site-auth-notice[data-type="error"] { color: #ff7b68; }
.site-auth-notice[data-type="success"] { color: #78d99a; }

@media (max-width: 1500px) {
  .site-header .account-auth-trigger {
    min-height: 44rem;
    padding: 9rem 15rem;
  }
}

@media (max-width: 720px) {
  .site-header .account-auth-trigger {
    width: 118rem;
    min-height: 36rem;
    flex-basis: 118rem;
    padding: 8rem 10rem;
    font-size: 11rem;
  }
  .site-auth-panel { padding: 10px; }
  .site-auth-dialog {
    width: calc(100vw - 20px);
    height: auto;
    max-width: none;
    max-height: calc(100dvh - 20px);
    padding: 24px 18px;
    border-radius: 8px;
  }
  .site-auth-close { top: 12px; right: 12px; width: 38px; height: 38px; font-size: 22px; }
  .site-auth-dialog h2 {
    max-width: calc(100% - 50px);
    min-height: 0;
    margin: 4px 0 28px;
    font-size: 42px;
  }
  .site-auth-description { margin-bottom: 14px; font-size: 14px; }
  .site-auth-provider {
    min-height: 56px;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    padding: 10px 14px;
  }
  .site-auth-provider > span { width: 34px; height: 34px; font-size: 17px; }
  .site-auth-provider strong { font-size: 15px; }
}

@media (min-width: 721px) and (max-height: 669px) {
  .site-auth-panel { padding: 10px; }
  .site-auth-dialog {
    height: auto;
    max-height: calc(100dvh - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-auth-provider { transition: none; }
}
