/* gestion_licences v2 — jetons de design et composants communs (brief §1, §4).
   Teintes en OKLCH ; accent ambre #C79100 = oklch(0.69 0.142 82), sarcelle #0d9488 = oklch(0.60 0.104 185).
   Thème : data-theme="clair" | "sombre" sur l'élément racine .gl. */

.gl {
  --fond: oklch(0.975 0.004 85);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.955 0.006 85);
  --texte: oklch(0.22 0.01 80);
  --texte-2: oklch(0.47 0.012 80);
  --bordure: oklch(0.87 0.008 85);
  --bordure-champ: oklch(0.62 0.01 80);
  --accent: oklch(0.69 0.142 82);
  --accent-texte: oklch(0.5 0.105 75);
  --sur-accent: oklch(0.2 0.02 75);
  --sarcelle: oklch(0.5 0.09 182);
  --succes: oklch(0.5 0.11 150);
  --succes-fond: oklch(0.95 0.04 150);
  --info: oklch(0.5 0.09 182);
  --info-fond: oklch(0.95 0.03 182);
  --avert: oklch(0.52 0.12 60);
  --avert-fond: oklch(0.95 0.05 82);
  --erreur: oklch(0.52 0.18 27);
  --erreur-fond: oklch(0.95 0.03 27);
  --sur-erreur: oklch(1 0 0);
  --focus: oklch(0.55 0.15 82);
  --ombre: 0 1px 2px oklch(0.2 0.01 80 / 0.06), 0 4px 16px oklch(0.2 0.01 80 / 0.06);

  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --police-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-xs: 12px; --t-s: 13px; --t-m: 15px; --t-l: 18px; --t-xl: 22px; --t-xxl: 28px;
  --e-1: 4px; --e-2: 8px; --e-3: 12px; --e-4: 16px; --e-5: 24px; --e-6: 32px; --e-7: 48px;
  --r-1: 4px; --r-2: 8px; --r-3: 12px;

  font-family: var(--police);
  font-size: var(--t-m);
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
}

.gl[data-theme="sombre"] {
  --fond: oklch(0.18 0.006 80);
  --surface: oklch(0.225 0.007 80);
  --surface-2: oklch(0.26 0.008 80);
  --texte: oklch(0.94 0.006 85);
  --texte-2: oklch(0.74 0.01 85);
  --bordure: oklch(0.35 0.008 80);
  --bordure-champ: oklch(0.56 0.01 80);
  --accent: oklch(0.76 0.145 82);
  --accent-texte: oklch(0.8 0.13 80);
  --sur-accent: oklch(0.2 0.02 75);
  --sarcelle: oklch(0.74 0.11 182);
  --succes: oklch(0.76 0.13 150);
  --succes-fond: oklch(0.28 0.04 150);
  --info: oklch(0.74 0.11 182);
  --info-fond: oklch(0.28 0.03 182);
  --avert: oklch(0.8 0.13 75);
  --avert-fond: oklch(0.29 0.05 82);
  --erreur: oklch(0.72 0.15 25);
  --erreur-fond: oklch(0.28 0.05 27);
  --sur-erreur: oklch(0.2 0.02 27);
  --focus: oklch(0.8 0.14 82);
  --ombre: 0 1px 2px oklch(0 0 0 / 0.3);
}

.gl *, .gl *::before, .gl *::after { box-sizing: border-box; }
.gl h1, .gl h2, .gl h3, .gl p, .gl ul, .gl dl, .gl dd { margin: 0; }
.gl ul { padding: 0; list-style: none; }
.gl a { color: var(--accent-texte); text-underline-offset: 2px; }
.gl a:hover { color: var(--texte); }
.gl :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Titres */
.gl .titre-1 { font-size: var(--t-xxl); font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.gl .titre-2 { font-size: var(--t-xl); font-weight: 650; line-height: 1.25; }
.gl .titre-3 { font-size: var(--t-l); font-weight: 600; line-height: 1.3; }
.gl .discret { color: var(--texte-2); font-size: var(--t-s); }

/* Champs */
.gl .champ { display: flex; flex-direction: column; gap: 6px; }
.gl .champ label, .gl .champ .label { font-size: 14px; font-weight: 600; }
.gl .champ .facultatif { font-weight: 400; color: var(--texte-2); }
.gl .champ input, .gl .champ select {
  height: 44px; padding: 0 12px; width: 100%;
  border: 1px solid var(--bordure-champ); border-radius: var(--r-2);
  background: var(--surface); color: var(--texte); font: inherit;
}
.gl .champ input[readonly] { background: var(--surface-2); color: var(--texte-2); }
.gl .champ input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.gl .champ .aide { font-size: var(--t-s); color: var(--texte-2); }
.gl .champ .err { font-size: var(--t-s); color: var(--erreur); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.gl .champ.invalide input { border: 2px solid var(--erreur); padding: 0 11px; }
.gl .saisie-mdp { position: relative; display: flex; }
.gl .saisie-mdp input { padding-right: 96px; }
.gl .saisie-mdp .basculer {
  position: absolute; right: 4px; top: 2px; height: 40px; padding: 0 10px;
  border: 0; background: none; color: var(--accent-texte); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: var(--r-1);
}

/* Boutons */
.gl .btn {
  min-height: 44px; padding: 0 18px; border-radius: var(--r-2); border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.gl .btn-p { background: var(--accent); color: var(--sur-accent); }
.gl .btn-p:hover { background: color-mix(in oklch, var(--accent), var(--texte) 12%); color: var(--sur-accent); }
.gl .btn-s { background: var(--surface); color: var(--texte); border-color: var(--bordure-champ); }
.gl .btn-s:hover { background: var(--surface-2); color: var(--texte); }
.gl .btn-d { background: var(--erreur); color: var(--sur-erreur); }
.gl .btn-d-s { background: var(--surface); color: var(--erreur); border-color: var(--erreur); }
.gl .btn-lien { background: none; border: 0; padding: 0 4px; min-height: 40px; color: var(--accent-texte); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.gl .btn-bloc { width: 100%; }
.gl .btn-petit { min-height: 36px; padding: 0 12px; font-size: 14px; }
.gl .btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Bandeaux de message */
.gl .bandeau {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: var(--r-2); border: 1px solid; font-size: 14px; color: var(--texte);
}
.gl .bandeau svg { flex: none; margin-top: 2px; }
.gl .bandeau .corps { display: flex; flex-direction: column; gap: 8px; }
.gl .bandeau.succes { background: var(--succes-fond); border-color: var(--succes); }
.gl .bandeau.succes svg { color: var(--succes); }
.gl .bandeau.info { background: var(--info-fond); border-color: var(--info); }
.gl .bandeau.info svg { color: var(--info); }
.gl .bandeau.avert { background: var(--avert-fond); border-color: var(--avert); }
.gl .bandeau.avert svg { color: var(--avert); }
.gl .bandeau.erreur { background: var(--erreur-fond); border-color: var(--erreur); }
.gl .bandeau.erreur svg { color: var(--erreur); }

/* Badges */
.gl .badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; border: 1px solid; font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
}
.gl .badge.verifie { color: var(--succes); border-color: var(--succes); background: var(--succes-fond); }
.gl .badge.attente { color: var(--avert); border-color: var(--avert); background: var(--avert-fond); }
.gl .badge.desactive { color: var(--texte-2); border-color: var(--bordure-champ); background: var(--surface-2); }
.gl .badge.free { color: var(--texte-2); border-color: var(--bordure-champ); background: var(--surface); }
.gl .badge.pro { color: var(--accent-texte); border-color: var(--accent); background: var(--avert-fond); }
.gl .badge.entreprise { color: var(--sarcelle); border-color: var(--sarcelle); background: var(--info-fond); }

/* Surfaces */
.gl .carte { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-3); box-shadow: var(--ombre); }
.gl .section { background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--r-3); padding: var(--e-5); display: flex; flex-direction: column; gap: var(--e-4); }
.gl .section.danger { border-color: var(--erreur); }
.gl .separateur { display: flex; align-items: center; gap: 12px; color: var(--texte-2); font-size: var(--t-s); }
.gl .separateur::before, .gl .separateur::after { content: ""; flex: 1; height: 1px; background: var(--bordure); }

/* Jauge de quota */
.gl .jauge { display: flex; flex-direction: column; gap: 6px; }
.gl .jauge .ligne { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.gl .jauge .piste { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--bordure); overflow: hidden; }
.gl .jauge .remplissage { display: block; height: 100%; background: var(--sarcelle); border-radius: 999px; }
.gl .jauge.haute .remplissage { background: var(--avert); }

/* Tableaux */
.gl .tableau-boite { overflow-x: auto; border: 1px solid var(--bordure); border-radius: var(--r-2); }
.gl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gl th { text-align: left; font-weight: 600; color: var(--texte-2); background: var(--surface-2); padding: 8px 12px; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.gl td { padding: 8px 12px; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.gl tr:last-child td { border-bottom: 0; }
.gl td.num, .gl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Chargement */
.gl .spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--bordure); border-top-color: var(--accent);
  animation: gl-rotation 0.9s linear infinite;
}
@keyframes gl-rotation { to { transform: rotate(360deg); } }

/* Gabarit des pages de compte (interface A) */
.gl .page-compte { min-height: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--e-5); padding: var(--e-5) var(--e-4); }
.gl .page-compte > .entete, .gl .page-compte > .carte, .gl .page-compte > .pied { width: 100%; max-width: 440px; }
.gl .entete { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--texte-2); }
.gl .entete strong { color: var(--texte); font-weight: 650; font-size: var(--t-m); }
.gl .page-compte > .carte { padding: var(--e-5); display: flex; flex-direction: column; gap: var(--e-4); }
.gl .pied { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; font-size: var(--t-s); color: var(--texte-2); margin-top: auto; }
.gl .liens { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.gl .politique { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-s); padding: 10px 12px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--bordure); }
.gl .politique li { display: flex; gap: 8px; align-items: center; color: var(--texte-2); }
.gl .politique li.ok { color: var(--succes); font-weight: 500; }
.gl .leurre { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
