/* LassDesign System Core — Design Tokens centralisés (spec Vol. 10).
 *
 * FONDATION partagée par toutes les applications de la suite.
 * Chaque app référence ce fichier puis utilise les variables --ld-*.
 * Dark mode via [data-theme="dark"] sur <html> ou <body>.
 *
 * Usage :
 *   <link rel="stylesheet" href="/lassdesign-tokens.css">
 *   puis : background: var(--ld-surface); color: var(--ld-text);
 */

/* ============================================================
 * PALETTE OFFICIELLE "LASSDESIGN" (Vol. 10 §2.1)
 * ============================================================ */
:root {
  /* Couleurs de marque (rôles sémantiques). */
  --ld-brand: #0B0BE2;          /* Action primaire / marque / en-têtes */
  --ld-brand-hover: #0A09C8;
  --ld-secondary: #3A5FCD;      /* Navigation / cartes / hovers */
  --ld-success: #1BA97B;        /* Validation / succès / vérifié */
  --ld-accent: #00D4AA;         /* Actions IA / badges premium / promos */
  --ld-danger: #E53935;         /* Suspension / révocation / bannissement */
  --ld-warning: #d97706;        /* Avertissements / en attente */

  /* Surfaces et textes (mode clair par défaut). */
  --ld-text: #0f172a;
  --ld-text-strong: #000000;
  --ld-muted: #797D87;
  --ld-surface: #ffffff;
  --ld-surface-alt: #F8F9FA;
  --ld-border: #e5e9f2;
  --ld-overlay: rgba(15, 23, 42, .55);

  /* Typographie (Vol. 10 §2.2). */
  --ld-font: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  --ld-h1-size: 1.75rem;
  --ld-h1-weight: 700;
  --ld-h2-size: 1.25rem;
  --ld-h2-weight: 600;
  --ld-h3-size: 1.05rem;
  --ld-h3-weight: 500;
  --ld-body-size: 0.9rem;
  --ld-caption-size: 0.78rem;
  --ld-line-height: 1.5;

  /* Rayons, ombres, espacements. */
  --ld-radius-sm: 8px;
  --ld-radius: 12px;
  --ld-radius-lg: 16px;
  --ld-shadow: 0 6px 20px rgba(15, 23, 42, .06);
  --ld-shadow-lg: 0 18px 40px rgba(11, 11, 226, .14);
  --ld-shadow-brand: 0 6px 20px rgba(11, 11, 226, .25);
  --ld-space-1: 4px;
  --ld-space-2: 8px;
  --ld-space-3: 12px;
  --ld-space-4: 16px;
  --ld-space-5: 24px;
  --ld-space-6: 32px;

  /* Transitions. */
  --ld-transition: 150ms ease;
}

/* ============================================================
 * DARK MODE (Vol. 10 §5) — inverse surfaces et textes
 * ============================================================ */
[data-theme="dark"] {
  --ld-text: #e8ebf5;
  --ld-text-strong: #ffffff;
  --ld-muted: #9aa1b3;
  --ld-surface: #161a2e;
  --ld-surface-alt: #0f1226;
  --ld-border: #2a3050;
  --ld-overlay: rgba(0, 0, 0, .7);

  --ld-brand: #4a4cff;          /* bleu un peu plus lumineux pour le dark */
  --ld-brand-hover: #5c5cff;
  --ld-secondary: #5a7ee8;
  --ld-success: #2dcc94;
  --ld-accent: #1ee6bd;
  --ld-danger: #f0554f;
  --ld-warning: #f0a73a;

  --ld-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  --ld-shadow-lg: 0 18px 40px rgba(0, 0, 0, .55);
  --ld-shadow-brand: 0 6px 20px rgba(74, 76, 255, .35);
}

/* ============================================================
 * COMPOSANTS UTILITAIRES (Vol. 10 §3) — optionnels
 * Toute app peut utiliser ces classes prêtes à l'emploi.
 * ============================================================ */

/* Bouton action IA (gradient turquoise). */
.ld-btn-ai {
  background: linear-gradient(135deg, var(--ld-accent), var(--ld-success));
  color: #fff; border: 0; padding: 10px 16px; border-radius: var(--ld-radius-sm);
  cursor: pointer; font-weight: 600; transition: var(--ld-transition);
}
.ld-btn-ai:hover { filter: brightness(1.08); }

/* Badge IA / Premium (turquoise). */
.ld-badge-ai {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  background: rgba(0, 212, 170, .15); color: var(--ld-accent);
  border: 1px solid rgba(0, 212, 170, .35);
}

/* Badge vérifié (vert). */
.ld-badge-verified {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  background: rgba(27, 169, 123, .12); color: var(--ld-success);
  border: 1px solid rgba(27, 169, 123, .3);
}

/* Badge danger (rouge). */
.ld-badge-danger {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .74rem; font-weight: 700;
  background: rgba(229, 57, 53, .12); color: var(--ld-danger);
  border: 1px solid rgba(229, 57, 53, .3);
}

/* Carte property standard (Vol. 10 §3.2). */
.ld-card {
  background: var(--ld-surface); border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius); padding: var(--ld-space-4);
  box-shadow: var(--ld-shadow); transition: transform var(--ld-transition), box-shadow var(--ld-transition);
}
.ld-card:hover { transform: translateY(-2px); box-shadow: var(--ld-shadow-lg); }

/* Statut sync (Vol. 10 §3.3). */
.ld-sync-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--ld-muted);
}
.ld-sync-status::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ld-success); box-shadow: 0 0 0 3px rgba(27,169,123,.2);
}
.ld-sync-status.offline::before { background: var(--ld-danger); box-shadow: 0 0 0 3px rgba(229,57,53,.2); }
.ld-sync-status.syncing::before { background: var(--ld-warning); box-shadow: 0 0 0 3px rgba(217,119,6,.2); }

/* Toggle switch No-Code (Vol. 04/10). */
.ld-switch {
  position: relative; display: inline-block; width: 44px; height: 24px;
}
.ld-switch input { opacity: 0; width: 0; height: 0; }
.ld-switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--ld-border); border-radius: 999px; transition: var(--ld-transition);
}
.ld-switch-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: var(--ld-surface); border-radius: 50%; transition: var(--ld-transition);
}
.ld-switch input:checked + .ld-switch-slider { background: var(--ld-accent); }
.ld-switch input:checked + .ld-switch-slider::before { transform: translateX(20px); }

/* Préférence système : dark auto si l'utilisateur le demande. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Par défaut on reste en clair (chaque app décide). Décommenter pour dark auto :
    --ld-text: #e8ebf5; --ld-surface: #161a2e; --ld-surface-alt: #0f1226; --ld-border: #2a3050;
    */
  }
}
