@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* === Dark (results/embed) === */
  --color-dark-bg:       #0A1628;
  --color-dark-surface:  #131F38;
  --color-dark-surface2: #1A2A47;
  --color-dark-border:   #243556;

  /* === Light (voter/admin) === */
  --color-light-bg:      #F6F8FC;
  --color-light-surface: #FFFFFF;
  --color-light-border:  #E2E8F2;

  /* === Primary accent (magenta — overridable via /api/config) === */
  --color-primary:       #E91E8C;
  --color-primary-hover: #C71678;
  --color-primary-light: #FDF0F7;
  --color-primary-dark:  #9D1260;

  /* === Gradient === */
  --gradient-primary: linear-gradient(135deg, #E91E8C 0%, #9B27AF 100%);
  --gradient-hero:    linear-gradient(135deg, #0A1628 0%, #1A1040 50%, #0D1E3A 100%);

  /* === Status === */
  --color-success: #10B981;
  --color-danger:  #EF4444;
  --color-warning: #F59E0B;

  /* === Text === */
  --color-text-dark:  #F1F5F9;
  --color-text-light: #1A2340;
  --color-text-muted: #8A9BB8;

  /* === Chart bars === */
  --chart-1: #E91E8C;
  --chart-2: #9B27AF;
  --chart-3: #06B6D4;
  --chart-4: #10B981;
  --chart-5: #F59E0B;
  --chart-6: #6366F1;

  /* === Typography === */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* === Shape === */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-pill: 9999px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.20);
  --shadow-glow: 0 0 40px rgba(233,30,140,.35);
  --tap-min:    48px;

  /* === Transitions === */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease-out;
  --transition-slow: 600ms ease-out;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Buttons === */
button {
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.625rem 1.375rem;
  min-height: var(--tap-min);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
button:active { transform: scale(.97); }

input, textarea, select {
  font-family: inherit;
  font-size: var(--text-base);
  border: 2px solid var(--color-light-border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  width: 100%;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background: var(--color-light-surface);
  color: var(--color-text-light);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(233,30,140,.15);
}

/* Button variants */
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233,30,140,.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(233,30,140,.45); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-light-border);
  color: var(--color-text-light);
  border-radius: var(--radius-pill);
}
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-pill);
}
.btn-ghost:hover { background: var(--color-primary-light); color: var(--color-primary); }

.btn-danger {
  background: transparent;
  border: 2px solid var(--color-danger);
  color: var(--color-danger);
  border-radius: var(--radius-pill);
}
.btn-danger:hover { background: #FEF2F2; }

/* Card */
.card {
  background: var(--color-light-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-light-border);
  padding: 1.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.badge-success { background: #ECFDF5; color: var(--color-success); }
.badge-muted   { background: var(--color-light-border); color: var(--color-text-muted); }

.text-muted { color: var(--color-text-muted); font-size: var(--text-sm); }

/* === Animations === */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(1.08); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--color-primary); }
  50%       { box-shadow: 0 0 60px var(--color-primary), 0 0 80px rgba(155,39,175,.5); }
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-in { animation: float-in 300ms ease-out both; }
