.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 8px);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover, rgba(255, 255, 255, 0.2));
  background: var(--hover-bg, rgba(255, 255, 255, 0.04));
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-icon {
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(-12deg);
}

[data-theme="dark"] .theme-icon-moon,
[data-theme="light"] .theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-sun,
[data-theme="light"] .theme-icon-moon {
  display: block;
}

html[data-theme-switching] .theme-icon {
  transform: rotate(180deg) scale(0.85);
  opacity: 0.5;
}

.auth-theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 20;
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle:active,
  .theme-toggle:hover .theme-icon,
  html[data-theme-switching] .theme-icon {
    transform: none;
  }
}
