/* Authorization and personal cabinet entry */
.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.account-login-button {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.account-login-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.account-login-button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.38);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

.account-login-button.is-authorized {
  color: var(--white);
  background: rgba(201,120,45,0.22);
  border-color: rgba(201,120,45,0.85);
  box-shadow: 0 0 0 3px rgba(201,120,45,0.15), 0 0 22px rgba(201,120,45,0.42);
}

.auth-indicator {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e02f2f;
  border: 2px solid var(--dark);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.account-login-button.is-authorized .auth-indicator {
  opacity: 1;
  transform: scale(1);
}

.auth-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-dialog h2 {
  margin-bottom: 10px;
  font-size: 25px;
}

.auth-dialog p {
  margin-bottom: 18px;
  color: var(--muted);
}

.auth-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(24,24,24,0.06);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.auth-close:hover {
  background: rgba(24,24,24,0.12);
  transform: rotate(4deg);
}

#authModal.auth-modal--message .auth-close,
#authModal.auth-modal--logout .auth-close {
  display: none !important;
}

.auth-form {
  margin-top: 0;
}

.auth-nowrap {
  white-space: nowrap;
  font-size: 14px;
}

@media (max-width: 390px) {
  .auth-nowrap {
    white-space: normal;
  }
}

.auth-pin-single {
  width: 132px;
  height: 44px;
  display: block;
  margin: 14px auto 10px;
  border: 1px solid #d5d5d5;
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 8px;
  outline: none;
}

.auth-pin-single:focus {
  border-color: var(--accent-dark);
}

.auth-timer {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.2;
  color: #777;
  text-align: center;
}

.auth-resend {
  margin-top: 12px;
  width: 100%;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.auth-actions .btn {
  width: 100%;
  min-width: 0;
  padding-left: 12px;
  padding-right: 12px;
}

.auth-logout-view .btn {
  min-height: 54px;
}


/* Unified topbar protected navigation */
.site-topbar,
.docs-site-topbar {
  min-height: 70px;
  padding: 12px 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.topbar-protected {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.topbar-protected.is-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity .22s ease, transform .22s ease, visibility 0s;
}

.topbar-icon-link,
.account-login-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.76);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.topbar-icon-link svg,
.account-login-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.topbar-icon-link:hover,
.account-login-button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.38);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

.topbar-phone-icon span {
  display: none;
}

.topbar-phone-icon svg {
  width: 18px;
  height: 18px;
}

.topbar-object .topbar-link {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

@media (min-width: 761px) {
  .site-topbar,
  .docs-site-topbar {
    min-height: 76px;
    padding: 14px 28px;
  }

  .topbar-phone-icon {
    width: auto;
    min-width: 48px;
    padding: 0 16px;
  }

  .topbar-phone-icon span {
    display: inline;
  }

  .topbar-phone-icon svg {
    display: none;
  }
}

@media (max-width: 520px) {
  .site-topbar,
  .docs-site-topbar {
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-actions,
  .topbar-protected {
    gap: 8px;
  }

  .brand-name {
    font-size: 10px;
    line-height: 1.05;
  }

  .brand-stripes {
    height: 30px;
  }

  .topbar-object .topbar-link {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.auth-dev-pin {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(201,120,45,0.12);
  color: #6d3a0a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
