/* Open Collective design tokens.
 *
 * Every value here is copied from the platform's own stylesheet
 * (opencollective-frontend/public/static/styles/app.css), where they are defined
 * as Tailwind v4 `@theme` variables. Nothing here is invented or approximated.
 *
 * This is the one file to edit when changing the look. Every page loads it, so a
 * change here moves the whole system at once — which is the point of publishing it
 * this way rather than as a pile of separate mockups.
 */

:root {
  /* ---- Brand ------------------------------------------------------------ */
  /* The dark navy is the marketing colour; the bright blue is the product colour.
     They are not interchangeable — see system.html. */
  --oc: hsla(222, 78%, 22%, 1);
  --oc-blue: hsla(218, 92%, 53%, 1);
  --oc-primary-100: hsla(208, 100%, 95%, 1);
  --oc-blue-050: hsla(208, 100%, 97%, 1);
  --oc-blue-500: hsla(213, 100%, 59%, 1);
  --oc-blue-700: hsla(220, 85%, 45%, 1);
  --oc-blue-800: hsla(222, 80%, 40%, 1);
  --oc-blue-900: hsla(220, 71%, 33%, 1);

  /* ---- Semantic --------------------------------------------------------- */
  /* Components never reference a raw colour. They reference these. */
  --background: #fff;
  --foreground: oklch(0.208 0.042 265.755); /* slate-900 */
  --card: #fff;
  --card-foreground: oklch(0.208 0.042 265.755);
  --popover: #fff;
  --popover-foreground: oklch(0.208 0.042 265.755);
  --primary: oklch(0.546 0.245 262.881); /* blue-600 */
  --primary-foreground: oklch(0.984 0.003 247.858); /* slate-50 */
  --secondary: oklch(0.968 0.007 247.896); /* slate-100 */
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417); /* slate-500 */
  --accent: oklch(0.968 0.007 247.896);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.645 0.246 16.439); /* rose-500 */
  --destructive-foreground: oklch(0.984 0.003 247.858);
  --success: oklch(0.627 0.194 149.214); /* green-600 */
  --border: oklch(0.929 0.013 255.508); /* slate-200 */
  --input: oklch(0.929 0.013 255.508);
  --ring: oklch(0.546 0.245 262.881);

  /* ---- Supporting greys, used directly in page chrome ------------------- */
  --slate-50: oklch(0.984 0.003 247.858);
  --slate-100: oklch(0.968 0.007 247.896);
  --slate-200: oklch(0.929 0.013 255.508);
  --slate-300: oklch(0.869 0.022 252.894);
  --slate-400: oklch(0.704 0.04 256.788);
  --slate-500: oklch(0.554 0.046 257.417);
  --slate-600: oklch(0.446 0.043 257.281);
  --slate-700: oklch(0.372 0.044 257.287);

  /* ---- Status ----------------------------------------------------------- */
  --green-50: oklch(0.982 0.018 155.826);
  --green-700: oklch(0.527 0.154 150.069);
  --amber-100: oklch(0.962 0.059 95.617);
  --amber-700: oklch(0.555 0.163 48.998);
  --blue-50: oklch(0.97 0.014 254.604);
  --blue-700: oklch(0.488 0.243 264.376);

  /* ---- Shape ------------------------------------------------------------ */
  /* One radius drives three. Change --radius and everything follows. */
  --radius: 0.75rem;
  --radius-lg: var(--radius);
  --radius-md: calc(var(--radius) - 2px);
  --radius-sm: calc(var(--radius) - 6px);

  /* ---- Type ------------------------------------------------------------- */
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

/* ---- Base ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ---- Components ------------------------------------------------------- */
/* Class names and measurements match components/ui/*.tsx in the platform. Where
   a value looks arbitrary it is not: it is what the component actually renders. */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
  height: 2.5rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

.btn-default { background: var(--primary); color: var(--primary-foreground); }
.btn-default:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-outline { border-color: var(--input); background: var(--background); color: var(--foreground); }
.btn-outline:hover { background: var(--accent); }
.btn-outline-destructive { border-color: var(--destructive); background: var(--background); color: var(--destructive); }
.btn-outline-destructive:hover { background: var(--destructive); color: var(--primary-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-success { background: var(--success); color: var(--primary-foreground); }
.btn-outline-success { border-color: var(--success); background: var(--background); color: var(--success); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); }
.btn-link { background: transparent; color: var(--primary); text-underline-offset: 4px; }
.btn-link:hover { text-decoration: underline; }
.btn-marketing { background: var(--oc); color: var(--primary-foreground); }

.btn-xs { height: 2rem; padding: 0 0.625rem; letter-spacing: -0.01em; }
.btn-sm { height: 2.25rem; padding: 0 0.75rem; }
.btn-lg { height: 2.75rem; padding: 0 2rem; }
.btn-xl { height: 3.5rem; padding: 0 2rem; font-size: 1.25rem; border-radius: var(--radius-lg); }

.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-neutral { background: var(--slate-100); color: var(--slate-700); }
.badge-success { background: var(--green-50); color: var(--green-700); }
.badge-warning { background: var(--amber-100); color: var(--amber-700); }
.badge-info { background: var(--blue-50); color: var(--blue-700); }
.badge-error { background: color-mix(in oklch, var(--destructive) 12%, white); color: var(--destructive); }

.input {
  display: block;
  width: 100%;
  height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--foreground);
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
}
.input::placeholder { color: var(--muted-foreground); }
.input:focus { outline: 2px solid var(--ring); outline-offset: -1px; border-color: transparent; }

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.muted { color: var(--muted-foreground); }

/* Money. Always tabular so columns of figures line up — a ledger that does not
   align is a ledger nobody scans. */
.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.amount-credit { color: var(--success); }
.amount-debit { color: var(--foreground); }
