.banner-top-right {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-top-right .theme-pill-wrap {
  position: static !important;
}

.auth-slot-wrap {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.auth-slot-wrap.visible {
  opacity: 1;
  pointer-events: auto;
}

.auth-login-pill,
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.3s ease;
}

body.light-theme .auth-login-pill,
body.theme-morning .auth-login-pill,
body.light-theme .auth-user-pill,
body.theme-morning .auth-user-pill {
  background: rgba(249, 246, 254, 0.76);
  box-shadow: 0 4px 16px rgba(84, 54, 133, 0.1);
}

.auth-login-pill:hover,
.auth-user-pill:hover {
  transform: translate3d(0, -1px, 0);
  border-color: var(--violet-bright);
  box-shadow: 0 6px 22px var(--glow-color);
}

.auth-login-pill:active,
.auth-user-pill:active {
  transform: translate3d(0, 0, 0) scale3d(0.97, 0.97, 1);
}

.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9868e8 0%, #5b4bc4 100%);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Плавный оверлей без резких скачков */
#authModalOverlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 3, 10, 0.72);
  opacity: 0;
  contain: layout paint;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-theme #authModalOverlay,
body.theme-morning #authModalOverlay {
  background: rgba(226, 218, 242, 0.76);
}

#authModalOverlay.active {
  display: flex;
  opacity: 1;
}

.auth-modal {
  position: relative;
  width: 100%;
  max-width: 408px;
  border-radius: 26px;
  border: 1px solid var(--glass-border);
  background: #100b1a;
  padding: 26px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(191, 164, 247, 0.08) inset;
  will-change: transform, opacity;
  contain: layout style paint;
  overflow: hidden;
}

body.light-theme .auth-modal,
body.theme-morning .auth-modal {
  background: #faf8fe;
  box-shadow: 0 24px 60px rgba(84, 54, 133, 0.16), 0 0 0 1px rgba(84, 54, 133, 0.08) inset;
}

.auth-modal::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  width: 240px;
  height: 120px;
  transform: translate3d(-50%, 0, 0);
  background: radial-gradient(ellipse at center, var(--glow-color) 0%, transparent 72%);
  pointer-events: none;
  opacity: 0.65;
}

.auth-modal-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.auth-modal-brand {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  background: var(--logo-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.exp-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-dim);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease, border-color 0.2s ease;
}

.exp-close:hover {
  color: var(--text);
  border-color: var(--violet-bright);
  transform: rotate(90deg);
}

/* Фирменный свайп-переключатель как в разделе «Проекты» */
.auth-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 14px;
  background: rgba(154, 132, 199, 0.08);
  border: 1px solid var(--glass-border);
  margin-bottom: 18px;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.auth-tabs:active {
  cursor: grabbing;
}

.auth-tab-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: linear-gradient(135deg, #7c52d4 0%, #5848c2 100%);
  box-shadow: 0 4px 14px rgba(124, 82, 212, 0.36);
  will-change: transform;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-tab-btn {
  position: relative;
  z-index: 1;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.22s ease;
}

.auth-tab-btn.active {
  color: #ffffff;
}

/* Карусель двух панелей (Вход / Регистрация) со сдвигом влево-вправо */
.auth-carousel {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
}

.auth-track {
  display: flex;
  width: 200%;
  will-change: transform;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-pane {
  width: 50%;
  flex-shrink: 0;
  padding: 0 2px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

/* Рамки полей неподвижны, анимируются только символы и луч */
.auth-field-wrap {
  position: relative;
  width: 100%;
  border-radius: 13px;
  overflow: hidden;
}

.auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 13px;
  border: 1px solid var(--glass-border);
  background: rgba(154, 132, 199, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  outline: none;
  transition: border-color 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease;
}

body.light-theme .auth-input,
body.theme-morning .auth-input {
  background: rgba(84, 54, 133, 0.04);
}

.auth-input:focus {
  border-color: var(--violet-bright);
  background: rgba(154, 132, 199, 0.1);
  box-shadow: 0 0 0 3px rgba(191, 164, 247, 0.12);
}

body.light-theme .auth-input:focus,
body.theme-morning .auth-input:focus {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(84, 54, 133, 0.1);
}

.input-beam {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--violet-bright) 50%, transparent 100%);
  transform: translate3d(-100%, 0, 0);
  pointer-events: none;
  opacity: 0;
}

.type-spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--violet-bright);
  box-shadow: 0 0 8px var(--violet-bright);
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 5;
}

.pass-meter {
  height: 3px;
  width: 100%;
  border-radius: 99px;
  background: rgba(154, 132, 199, 0.14);
  overflow: hidden;
  margin-top: -3px;
}

.pass-meter-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #fb7185, #bfa4f7, #34d399);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-msg {
  min-height: 18px;
  font-size: 0.81rem;
  line-height: 1.4;
  color: #fb7185;
}

.auth-msg.ok {
  color: #10b981;
}

.auth-submit-btn {
  width: 100%;
  height: 44px;
  margin-top: 2px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #7c52d4 0%, #5848c2 100%);
  box-shadow: 0 8px 24px rgba(124, 82, 212, 0.3);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  will-change: transform;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, box-shadow 0.22s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 12px 28px rgba(124, 82, 212, 0.4);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translate3d(0, 0, 0) scale3d(0.98, 0.98, 1);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .banner-top-right {
    top: 14px;
    right: 14px;
    gap: 8px;
  }
  .auth-login-pill,
  .auth-user-pill {
    height: 32px;
    padding: 0 11px;
    font-size: 0.78rem;
  }
}
