:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --text: #1d1b1e;
  --muted: #6e6a70;
  --line: #e7e3e6;
  --accent: #c2185b;
  --accent-soft: #fbe7ef;
  --ok: #1b7f4b;
  --ok-soft: #e3f4ea;
  --warn: #a15c00;
  --warn-soft: #fdf0dc;
  --bad: #b3261e;
  --bad-soft: #fbe6e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141215;
    --card: #1e1b1f;
    --text: #f1edf1;
    --muted: #a49ea6;
    --line: #322d33;
    --accent: #f06292;
    --accent-soft: #3a1f2a;
    --ok: #5fd08f;
    --ok-soft: #173225;
    --warn: #f2b05e;
    --warn-soft: #3a2c16;
    --bad: #ff8a80;
    --bad-soft: #3b1c1a;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.campo { margin-bottom: 14px; }

button { font: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primario:hover { filter: brightness(1.06); }
.btn.perigo { color: var(--bad); }
.btn.link { border: 0; background: none; color: var(--muted); padding: 6px 8px; font-weight: 500; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.bloco { width: 100%; }

.erro-msg { color: var(--bad); font-size: .9rem; min-height: 1.3em; margin: 4px 0 0; }

.pill {
  display: inline-block; font-size: .78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.neutro { background: var(--line); color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-weight: 600;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 50;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.visivel { opacity: 1; transform: translateX(-50%) translateY(0); }
