/* Design tokens — une seule source de vérité pour les couleurs, l'espacement,
   la typographie et les ombres. Les variables --brand-* viennent de
   /css/branding.css, générée par le serveur à partir des couleurs du club :
   changer les couleurs du club retinte toute l'interface sans toucher au CSS.

   Deux thèmes : sombre par défaut (usage courant au bord du terrain, le soir),
   clair pour l'impression et les bureaux très éclairés. Le thème est posé sur
   <html data-theme="..."> par /js/components/theme.js. */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #080c14;
  --bg-elevated: #0d1420;
  --surface: #111a29;
  --surface-2: #162133;
  --surface-hover: #1b2942;
  --surface-inset: rgba(255, 255, 255, 0.04);

  /* Texte */
  --text: #eef3fa;
  --text-muted: #93a3ba;
  --text-subtle: #6b7c93;

  /* Traits */
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Statuts — indépendants des couleurs du club pour rester lisibles */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.16);
  --warning: #f5b027;
  --warning-soft: rgba(245, 176, 39, 0.16);
  --danger: #f2555a;
  --danger-soft: rgba(242, 85, 90, 0.16);
  --info: #56a8f5;
  --info-soft: rgba(86, 168, 245, 0.16);

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --shadow-brand: 0 10px 30px -12px rgb(var(--brand-primary-rgb) / 0.55);

  /* Voile des modales */
  --scrim: rgba(4, 8, 15, 0.72);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f6fa;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-hover: #eef2f8;
  --surface-inset: rgba(15, 23, 42, 0.04);

  --text: #101a2b;
  --text-muted: #55637a;
  --text-subtle: #7a8698;

  --border: rgba(16, 26, 43, 0.12);
  --border-strong: rgba(16, 26, 43, 0.22);

  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --warning: #a16207;
  --warning-soft: rgba(161, 98, 7, 0.12);
  --danger: #c0272d;
  --danger-soft: rgba(192, 39, 45, 0.12);
  --info: #1d6fd0;
  --info-soft: rgba(29, 111, 208, 0.12);

  --shadow-sm: 0 1px 2px rgba(16, 26, 43, 0.06);
  --shadow-md: 0 10px 26px -14px rgba(16, 26, 43, 0.35);
  --shadow-lg: 0 26px 60px -24px rgba(16, 26, 43, 0.35);
  --shadow-brand: 0 10px 26px -14px rgb(var(--brand-primary-rgb) / 0.5);

  --scrim: rgba(16, 26, 43, 0.45);
}

:root {
  /* Typographie — Barlow Condensed pour les titres (registre sportif),
     Inter pour le texte courant et les chiffres. */
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;

  /* Espacement — rythme de 4 px, densité orientée tableaux de gestion */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --container: 1320px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-height: 68px;
  --sidebar-w: 272px;
  --sidebar-w-collapsed: 84px;

  --transition: 180ms cubic-bezier(0.2, 0.8, 0.3, 1);
  --transition-slow: 280ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* Valeurs de repli : /css/branding.css est chargée après ce fichier et
   remplace ce bloc par les couleurs réelles du club. */
:root {
  --brand-primary: #16a34a;
  --brand-primary-rgb: 22 163 74;
  --brand-primary-strong: #12853c;
  --brand-primary-soft: #b9e3c8;
  --brand-secondary: #facc15;
  --brand-secondary-rgb: 250 204 21;
  --brand-secondary-strong: #cda711;
  --brand-on-primary: #0b121d;
  --brand-on-secondary: #0b121d;
  --brand-on-gradient: #0b121d;
  --brand-cta: linear-gradient(135deg, #16a34a 0%, #facc15 100%);
  --brand-on-cta: #0b121d;
  --brand-gradient: linear-gradient(135deg, #16a34a 0%, #facc15 100%);
  --brand-gradient-soft: linear-gradient(
    135deg,
    rgb(22 163 74 / 0.16) 0%,
    rgb(250 204 21 / 0.16) 100%
  );
}

/* Alias hérités : d'anciennes règles et quelques gabarits parlent encore
   d'--accent ou de --radius générique. */
:root {
  --accent: var(--brand-primary);
  --card-bg: var(--surface);
  --radius-default: var(--radius);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: 1ms linear;
    --transition-slow: 1ms linear;
  }
}
