/* Auth gate: shown while logged out, hides the rest of the app while any
   non-"ready" auth stage is active (checking session / showing the login
   form). #authView itself lives outside .views so it's independent of the
   ExerciseList/SingleExercise page-switching machinery. */

#authView {
  display: none;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#app[data-auth-stage='login'] #authView {
  display: flex;
}

#app:not([data-auth-stage='ready']) #mainHeader,
#app:not([data-auth-stage='ready']) .views,
#app:not([data-auth-stage='ready']) #mainFooter {
  display: none;
}

#authForm {
  width: 100%;
  max-width: 360px;
}

.mode-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-menu {
  position: relative;
}

.header-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background-color: var(--surface-2);
  border: 1px solid var(--surface-4);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow);
  overflow: hidden;
  z-index: 20;
  min-width: 200px;
}

.header-menu-item .btn {
  width: 100%;
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  border-radius: 0;
}

.header-menu-item .btn .label {
  white-space: nowrap;
}

.header-menu-item .btn .icon {
  width: 20px;
  height: 20px;
}

.header-menu-item .btn.horizontal .label {
  flex: 1;
}

.switch {
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background-color: var(--surface-4);
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.switch.on {
  background-color: var(--accent);
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--text-primary);
  transition: transform 0.2s;
}

.switch.on .switch-knob {
  transform: translateX(16px);
}

.header-menu-email {
  padding: 0.5rem 1rem 0.75rem;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-3);
  word-break: break-all;
}
