@import url("./tokens.css");

:root {
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 0 1rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.loading {
  color: var(--text-muted);
}

.button,
button {
  /* Without this, some browser/OS combinations paint native button chrome
     over an explicit background: transparent (seen for real on
     button.secondary in login-ui's dark mode) — reset it everywhere so
     variants without their own solid background never inherit it. */
  appearance: none;
  -webkit-appearance: none;
  display: inline-block;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

button.secondary,
.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field span {
  font-size: 0.875rem;
  font-weight: 600;
}

.field input {
  font-size: 1rem;
  padding: 0.5rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.field input[readonly] {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--border) 25%, transparent);
}

.field small {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.avatar-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.actions {
  display: flex;
  gap: 0.75rem;
}

.status.error,
.error {
  color: var(--danger);
}

.app-version {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--tint-weak);
}

.app-version-fixed {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 15;
}

.theme-switch {
  display: flex;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 999px;
  background: var(--tint-weak);
}

.theme-switch-fixed {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 15;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.theme-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.theme-switch-btn:hover { color: var(--text); }

.theme-switch-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

/* Explicit, not just relied-on inheritance of currentColor from the
   button's `color` -- without this the icons rendered fully invisible
   (verified from a screenshot: the whole toggle looked like one blank
   pill with only the active button's border showing, no glyphs at all). */
.theme-switch-btn svg {
  display: block;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}
