/* ===== Elejemais — Design System ===== */

:root {
  /* warm cream / civic palette */
  --bg: #faf8f3;
  --surface: #ffffff;
  --surface-2: #f3efe5;
  --ink: #14140f;
  --ink-2: #2c2c25;
  --muted: #76746a;
  --muted-2: #9c9a8e;
  --line: #e7e2d3;
  --line-2: #efeadc;

  /* electoral blue */
  --accent: oklch(0.46 0.13 250);
  --accent-strong: oklch(0.40 0.15 250);
  --accent-soft: oklch(0.95 0.03 250);
  --accent-ink: #ffffff;

  /* alerts */
  --warm: oklch(0.62 0.16 40);
  --warm-soft: oklch(0.96 0.04 60);
  --red: oklch(0.55 0.18 25);

  /* typography — Inter throughout */
  --display: "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Inter", ui-monospace, "SF Mono", Menlo, monospace;

  /* radii */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* shadows */
  --shadow-sm: 0 1px 0 rgba(20, 20, 15, 0.04), 0 1px 2px rgba(20, 20, 15, 0.04);
  --shadow: 0 1px 0 rgba(20, 20, 15, 0.04), 0 12px 28px -16px rgba(20, 20, 15, 0.18);
  --shadow-lg: 0 1px 0 rgba(20, 20, 15, 0.04), 0 32px 60px -28px rgba(20, 20, 15, 0.28);

  /* density */
  --pad: 20px;
  --gap: 16px;
}

[data-density="compact"] {
  --pad: 14px;
  --gap: 12px;
}

[data-theme="dark"] {
  --bg: #0f0f0c;
  --surface: #181815;
  --surface-2: #211f1b;
  --ink: #f3f0e6;
  --ink-2: #d6d2c4;
  --muted: #918d80;
  --muted-2: #67645a;
  --line: #2a2823;
  --line-2: #232220;
  --accent: oklch(0.74 0.14 250);
  --accent-strong: oklch(0.82 0.14 250);
  --accent-soft: oklch(0.28 0.07 250);
  --accent-ink: #0f0f0c;
  --warm: oklch(0.78 0.14 50);
  --warm-soft: oklch(0.3 0.06 50);
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv01", "cv11";
}

button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Reusable atoms ===== */

.serif { font-family: var(--display); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); }
.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 500;
}
.divider {
  height: 1px; background: var(--line); border: 0; margin: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: 120ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted-2); }
.btn:active { transform: translateY(0.5px); }
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn--danger { color: var(--red); border-color: color-mix(in oklab, var(--red) 30%, var(--line)); }
.btn--danger:hover { background: color-mix(in oklab, var(--red) 8%, var(--surface)); }
.btn--sm { padding: 6px 10px; font-size: 12.5px; }
.btn--lg { padding: 12px 18px; font-size: 15px; }
.btn--block { width: 100%; justify-content: center; }
.btn--icon { padding: 8px; }

/* Inputs */
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: 120ms ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
.input::placeholder { color: var(--muted-2); }
.label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.badge--accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: color-mix(in oklab, var(--accent) 25%, transparent);
}
.badge--warm {
  background: var(--warm-soft);
  color: var(--warm);
  border-color: color-mix(in oklab, var(--warm) 28%, transparent);
}
.badge--dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
}

/* Tabs row in shell */
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
}

/* Number ticker */
.fig {
  font-family: var(--display);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 400;
}

/* utility */
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }
.dim { color: var(--muted); }
.hairline { border-top: 1px solid var(--line); }

/* translate-only entrance — content stays visible if animation stalls */
@keyframes fadein {
  from { transform: translateY(4px); }
  to { transform: none; }
}
.fadein { animation: fadein 360ms cubic-bezier(.2,.7,.2,1); }
@keyframes slideup {
  from { transform: translateY(10px); }
  to { transform: none; }
}
.slideup { animation: slideup 420ms cubic-bezier(.2,.7,.2,1); }
