/* Shared UI components: buttons, cards, chips, inputs, toggles, progress, avatars. */

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.btn--dark { background: var(--ink); color: #FFFFFF; }
.btn--dark:hover { background: var(--navy-2); color: #FFFFFF; }

.btn--teal { background: var(--teal); color: #FFFFFF; }
.btn--teal:hover { background: var(--teal-hover); color: #FFFFFF; }

.btn--outline { background: var(--card); border: 1px solid var(--border-2); color: var(--ink); }
.btn--outline:hover { background: var(--surface-3); color: var(--ink); }

.btn--cream { background: var(--canvas); color: var(--ink); }
.btn--cream:hover { background: #FFFFFF; color: var(--ink); }

.btn--ghost { color: var(--ink); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn--lg { height: 52px; padding: 0 30px; font-size: 16px; }
.btn--xl { height: 54px; padding: 0 34px; font-size: 16.5px; }
.btn--sm { height: 34px; padding: 0 15px; font-size: 13px; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.card--lg { border-radius: var(--r-lg); }

/* ---- Chips / badges ---- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
}

.chip--tint { background: var(--teal-tint); border-color: var(--teal-border); color: var(--teal-ink); }

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
}

.tag-pill--teal { background: var(--teal-tint); color: var(--teal-ink); }
.tag-pill--coral { background: #FCEAE4; color: var(--trap); }
.tag-pill--gold { background: #F9E9C8; color: var(--warn-ink); }
.tag-pill--navy { background: var(--ink); color: #FFFFFF; }

/* ---- Form fields ---- */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-label { font-size: 12.5px; font-weight: 600; color: var(--slate); }

.input, .textarea {
  border-radius: var(--r-xs);
  border: 1px solid var(--border-2);
  padding: 0 13px;
  font-size: 14px;
  background: var(--card);
  outline: none;
  width: 100%;
}

.input { height: 42px; }

.textarea { min-height: 120px; resize: vertical; padding: 11px 13px; line-height: 1.55; }

.input:focus, .textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 123, .12);
  outline: none;
}

/* ---- Segmented control ---- */
.seg {
  display: inline-flex;
  background: var(--sand);
  border-radius: var(--r-xs);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 27, 25, .08); }

/* ---- Toggle switch ---- */
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: var(--r-pill);
  transition: background .15s ease;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2.5px; left: 2.5px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(28, 27, 25, .18);
  transition: transform .15s ease;
}
.switch input:checked + .switch-track { background: var(--teal); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }

/* ---- Progress bars ---- */
.pbar { height: 4px; background: var(--cream-line); border-radius: var(--r-pill); overflow: hidden; }
.pbar-fill { height: 100%; background: var(--teal); border-radius: var(--r-pill); }

/* ---- Avatars ---- */
.avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--canvas);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar svg { width: 100%; height: 100%; display: block; }

.avatar--initials {
  background: var(--ink);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.avatar-stack { display: flex; }
.avatar-stack > * + * { margin-left: -9px; }

/* ---- Empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

/* ---- ReziDay logo lockup --------------------------------------------------
   ONE definition for the whole app (components.css is loaded by base.html, so
   it reaches every page). Mark = 30px (the `size` arg of partials/icons/logo.html),
   wordmark = 19px Sora, gap = 10px. Page stylesheets may only POSITION the
   lockup (padding / justify), never resize it — that's how it stayed
   inconsistent before. Exceptions, both deliberate: the mobile chrome scales it
   down (.m-header-brand / .com-topbar-brand) and the auth pages use a large
   centered hero mark (.brand-word--auth). */
.brand-lockup { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-lockup:hover { color: var(--ink); }
.brand-lockup svg { flex: none; }

.brand-word {
  font-family: var(--font-logo);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.brand-word span { color: var(--teal); }

/* ---- Knowledge-map preview header (partials/map_preview.html) -------------
   Shared by the dashboard map and the lessons-index "Hartă", so it lives here
   rather than in either page's stylesheet. Hidden until a cell is clicked. */
.map-sel {
  display: flex;
  align-items: center;
  gap: 16px 22px;
  flex-wrap: wrap;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.map-sel[hidden] { display: none; }
.map-sel-swatch {
  width: 15px; height: 15px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(15, 34, 48, .12);
  flex: none;
}
.map-sel-main { flex: 1; min-width: 170px; }
.map-sel-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
}
.map-sel-meta { margin-top: 3px; font-size: 12px; color: var(--muted-2); }

.map-sel-stats { display: flex; gap: 22px; flex: none; }
.map-sel-stats[hidden] { display: none; }
.map-sel-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.map-sel-stat-val {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
}

.map-sel-go {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--teal);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 9px;
}
.map-sel-go:hover { background: var(--teal-hover); color: #FFFFFF; }
.map-sel-close {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: var(--r-pill);
  background: var(--sand);
  color: var(--muted);
}
.map-sel-close:hover { background: var(--border); color: var(--ink); }

@media (max-width: 767px) {
  /* The two stat tiles are the first thing to go when the row wraps. */
  .map-sel-stats { display: none; }
  .map-sel-go { flex: 1; justify-content: center; }
}
