/* =====================================================================
   RECHARGE by Next Cloud — THÈME CENTRALISÉ
   ---------------------------------------------------------------------
   Toutes les couleurs, polices, tailles, espacements, rayons et ombres
   sont définis ICI et uniquement ici. Les autres feuilles de style
   n'utilisent que ces variables.
   Pour changer la couleur principale : modifier --color-primary
   (et sa variante sombre plus bas).
   ===================================================================== */

:root {
  /* Palette de marque */
  --color-primary: #1f6fff;          /* bleu électrique */
  --color-primary-strong: #0b3fa8;   /* bleu nuit */
  --color-primary-contrast: #ffffff; /* texte posé sur la couleur principale */
  --color-primary-soft: #e8f0ff;     /* fond léger (menu actif, badges) */
  --color-primary-soft-strong: #8aaeff; /* barres des mois non sélectionnés */
  --color-energy: #2fae5f;           /* vert énergie */
  --color-energy-strong: #1d7a42;
  --color-energy-soft: #e3f6ea;
  --color-on-brand: #ffffff;         /* texte sur le dégradé de marque */
  --gradient-brand: linear-gradient(150deg, #2f7bff 0%, #0b3fa8 70%, #082d78 100%);

  /* États (fond léger + texte foncé lisible) */
  --color-success: #1f9d55;
  --color-success-soft: #e3f6ea;
  --color-success-strong: #17663a;
  --color-warning: #d98b0b;
  --color-warning-soft: #fdf1dc;
  --color-warning-strong: #8a5300;
  --color-danger: #d93a3a;
  --color-danger-soft: #fde8e8;
  --color-danger-strong: #a01f1f;
  --color-focus: rgba(31, 111, 255, 0.45);

  /* Surfaces et texte — thème clair */
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-surface-muted: #eef1f6;
  --color-border: #e1e6ef;
  --color-border-strong: #c9d1de;
  --color-text: #12192b;
  --color-text-muted: #5b6478;

  /* Typographie : polices système (aucun téléchargement externe) */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;
  --font-weight-bold: 700;

  /* Espacements */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  /* Formes */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(18, 25, 43, 0.04), 0 8px 24px rgba(18, 25, 43, 0.06);

  /* Tactile : taille minimale d'une zone cliquable */
  --touch-target: 44px;
}

/* Thème sombre : automatique selon le système, sauf choix explicite « clair ».
   Le même bloc est répété plus bas pour le choix explicite « sombre ». */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-primary: #5b96ff;
    --color-primary-strong: #a9c7ff;
    --color-primary-contrast: #06132e;
    --color-primary-soft: rgba(91, 150, 255, 0.16);
    --color-primary-soft-strong: #3a5ea8;
    --color-energy-strong: #6fdc98;
    --color-energy-soft: rgba(47, 174, 95, 0.18);
    --color-success-soft: rgba(31, 157, 85, 0.18);
    --color-success-strong: #7be3a5;
    --color-warning-soft: rgba(217, 139, 11, 0.2);
    --color-warning-strong: #ffcc73;
    --color-danger-soft: rgba(217, 58, 58, 0.2);
    --color-danger-strong: #ff9d9d;
    --color-bg: #0c111d;
    --color-surface: #151c2c;
    --color-surface-muted: #1c2538;
    --color-border: #263149;
    --color-border-strong: #34415e;
    --color-text: #eef2fa;
    --color-text-muted: #9aa5bd;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

:root[data-theme="dark"] {
  --color-primary: #5b96ff;
  --color-primary-strong: #a9c7ff;
  --color-primary-contrast: #06132e;
  --color-primary-soft: rgba(91, 150, 255, 0.16);
  --color-primary-soft-strong: #3a5ea8;
  --color-energy-strong: #6fdc98;
  --color-energy-soft: rgba(47, 174, 95, 0.18);
  --color-success-soft: rgba(31, 157, 85, 0.18);
  --color-success-strong: #7be3a5;
  --color-warning-soft: rgba(217, 139, 11, 0.2);
  --color-warning-strong: #ffcc73;
  --color-danger-soft: rgba(217, 58, 58, 0.2);
  --color-danger-strong: #ff9d9d;
  --color-bg: #0c111d;
  --color-surface: #151c2c;
  --color-surface-muted: #1c2538;
  --color-border: #263149;
  --color-border-strong: #34415e;
  --color-text: #eef2fa;
  --color-text-muted: #9aa5bd;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
}
