/* WYMBE — design system. Marca (legacy): âmbar #F8A61A, carvão #31312F/#1C1C1A,
   branco, cinza #7F7F7F, tipografia Roboto. Dark-first, com variante light derivada. */

/* Roboto self-hospedado (sem Google Fonts — privacidade/RGPD; ficheiros do legacy). */
@font-face {
  font-family: "Roboto"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/roboto-regular.woff") format("woff");
}
@font-face {
  font-family: "Roboto"; font-style: normal; font-weight: 300; font-display: swap;
  src: url("/assets/fonts/roboto-thin.woff") format("woff");
}

:root {
  /* light (derivada da marca) */
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #efede8;
  --border: #e2e0d9;
  --text: #26251f;
  --muted: #7f7f7f;
  --accent: #F8A61A;          /* âmbar WYMBE */
  --accent-ink: #26251f;      /* texto escuro sobre âmbar */
  --accent-soft: #fdeccb;
  --lime: #F8A61A;            /* progresso usa o âmbar da marca */
  --danger: #d1495b;
  --warn: #e0a458;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(28,28,26,.06), 0 6px 20px rgba(28,28,26,.07);
  --font: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"], :root:not([data-theme="light"]) {
  /* dark = identidade original da WYMBE */
  --bg: #1c1c1a; --surface: #26251f; --surface-2: #31312f; --border: #3a3a36;
  --text: #ffffff; --muted: #9a9a95; --accent: #F8A61A; --accent-ink: #1c1c1a;
  --accent-soft: #3a2f18; --lime: #F8A61A;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:#f5f4f1;--surface:#fff;--surface-2:#efede8;--border:#e2e0d9;--text:#26251f;
    --muted:#7f7f7f;--accent:#F8A61A;--accent-ink:#26251f;--accent-soft:#fdeccb;--lime:#F8A61A;
    --shadow:0 1px 2px rgba(28,28,26,.06),0 6px 20px rgba(28,28,26,.07);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
h1,h2,h3 { line-height: 1.2; margin: 0 0 .4em; }
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth__card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.brand { font-weight: 800; letter-spacing: .06em; color: var(--accent); font-size: 26px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; grid-template-rows: 56px 1fr;
  grid-template-areas: "brand top" "nav main"; min-height: 100vh; }
.topbar { grid-area: top; display: flex; align-items: center; gap: 12px; padding: 0 18px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.sidebrand { grid-area: brand; display: flex; align-items: center; padding: 0 18px; background: var(--surface);
  border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); font-weight: 800; color: var(--accent); letter-spacing:.06em; }
.nav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.main { grid-area: main; padding: 22px; max-width: 900px; width: 100%; }

.spacer { flex: 1; }
.groupsel { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.iconbtn { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; width: 38px; height: 38px; cursor: pointer; }
.badge { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 6px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 700; font-size: 13px; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
textarea { resize: vertical; min-height: 70px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--soft { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: default; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; }
.pill--accent { background: var(--accent-soft); color: var(--accent); }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--lime); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.stat { text-align: center; }
.stat b { font-size: 26px; display: block; color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: 0; }

/* likes/comments */
.pub__actions { display: flex; gap: 16px; margin-top: 10px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; font-weight: 600; }
.linkbtn.on { color: var(--accent); }

/* wheel */
.wheel-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: center; }
.slider-row { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 10px; margin: 6px 0; }
input[type=range] { width: 100%; accent-color: var(--accent); }

/* toasts */
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: .28s; }
.toast--show { opacity: 1; transform: none; }
.toast--error { background: var(--danger); color: #fff; }
.toast--ok { background: var(--accent); color: var(--accent-ink); }

/* responsive: sidebar → bottom nav */
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 56px 1fr 58px; grid-template-areas: "top" "main" "nav"; }
  .sidebrand { display: none; }
  .nav { grid-area: nav; flex-direction: row; border-right: 0; border-top: 1px solid var(--border);
    justify-content: space-around; padding: 6px; position: sticky; bottom: 0; }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 4px 8px; }
  .nav a span.label { font-size: 11px; }
  .main { padding: 16px; }
  .wheel-wrap { grid-template-columns: 1fr; }
  .slider-row { grid-template-columns: 100px 1fr 28px; }
}
