:root {
  /* colours */
  --sage: #8FB39A;
  --sage-soft: #DCE6D8;
  --blush: #F4C6D0;
  --butter: #F7E7A6;
  --periwinkle: #C9D3EE;
  --beige: #D8C8B0;
  --glow: #F29B38;
  --page: #FAFAF7;
  --card: #FFFFFF;
  --ink: #1E1E1E;
  --muted: #7A716A;
  --navy: #243B5A;

  --font-heading: "Lexend", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 2px 4px rgba(36, 59, 90, .06), 0 10px 24px -12px rgba(36, 59, 90, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
}

body.checking {
  visibility: hidden;
}

.switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: var(--sage-soft);
  border-radius: 999px;
}

.switch-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px;
  background: transparent;
  color: var(--navy);
  font: 500 15px var(--font-heading);
  cursor: pointer;
}

.switch-btn.on {
  background: #fff;
  box-shadow: 0 1px 3px rgba(36, 59, 90, .15);
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--sage-soft);
  border-radius: 12px;
  background: var(--page);
  font: 16px var(--font-body);
  color: var(--ink);
}

.field input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(143, 179, 154, .3);
}

.password {
  position: relative;
}

.password input {
  padding-right: 64px;
}

.show-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 13px var(--font-body);
  cursor: pointer;
  padding: 6px;
}

.form-message {
  min-height: 1.4em;
  margin: 0;
  font-size: 14px;
  color: #B5475C;
}

.form-message.ok {
  color: #3F7A55;
}

.btn-primary:disabled {
  opacity: .6;
  cursor: default;
}

.btn-primary {
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  font: 600 16px var(--font-heading);
  cursor: pointer;
}

.btn-primary:hover {
  background: #2F4B70;
}

button:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* avatars */
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  color: var(--navy);
  font-family: var(--font-heading);
  font-weight: 600;
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(36, 59, 90, .2);
}

.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-md { width: 44px; height: 44px; font-size: 18px; }
.avatar-lg { width: 64px; height: 64px; font-size: 26px; }
.avatar-xl { width: 112px; height: 112px; font-size: 44px; }

/* onboarding */
.step-label {
  margin: 20px 0 0;
  font: 600 12px var(--font-heading);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.avatar-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.btn-soft {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--sage-soft);
  color: var(--navy);
  font: 500 14px var(--font-heading);
  cursor: pointer;
}

.btn-soft:hover {
  background: #CFDCCA;
}

.link-btn {
  border: 0;
  background: none;
  color: var(--muted);
  font: 600 14px var(--font-body);
  text-decoration: underline;
  cursor: pointer;
}

.hint {
  font-weight: 400;
  color: var(--muted);
}

.hint.good { color: #3F7A55; }
.hint.bad { color: #B5475C; }

fieldset.field {
  border: 0;
  margin: 0;
  padding: 0;
}

fieldset.field legend {
  padding: 0;
  margin-bottom: 8px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.chip {
  min-width: 44px;
  border: 1.5px solid var(--sage-soft);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  color: var(--navy);
  font: 500 14px var(--font-heading);
  cursor: pointer;
}

.chip.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--periwinkle);
  color: var(--navy);
  font: 500 13px var(--font-heading);
}

.tag button {
  border: 0;
  background: none;
  color: var(--navy);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.tag-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.tag-add input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1.5px solid var(--sage-soft);
  border-radius: 12px;
  background: var(--page);
  font: 15px var(--font-body);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--sage);
}

[hidden] {
  display: none !important;
}

/* edit profile */
.profile-title {
  margin-top: 24px;
}

.cancel-link {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}


/* theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.theme-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 10px;
  border: 2px solid var(--sage-soft);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover {
  border-color: var(--sage);
}

.theme-option.on {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(36, 59, 90, .15);
}

.theme-mini {
  display: grid;
  grid-template-columns: 16px 1fr;
  height: 78px;
  margin-bottom: 6px;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, .06);
}

.mini-main {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}

.mini-banner {
  height: 20px;
  border-radius: 5px;
}

.mini-cards {
  display: flex;
  flex: 1;
  gap: 5px;
}

.mini-card {
  flex: 1;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, .06);
}

.mini-btn {
  width: 28px;
  height: 7px;
  border-radius: 3px;
}

.theme-name {
  font: 600 14px var(--font-heading);
  color: var(--ink);
}

.theme-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
