/* Tactik — charte « Tactik vivant »
   Tout est servi depuis notre propre domaine : police, icônes, styles.
   Aucune ressource tierce (règle Tactik : notre propre diagnostic doit nous noter A).

   Concept de mise en page : blanc lumineux, une colonne de lecture de 68ch,
   le dégradé violet → rose du logo réservé aux moments forts (logo, bouton principal, un mot du titre),
   les couleurs de statut (menthe / corail / ardoise) portent l'information de juridiction. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Marque (logo Tactik) */
  --violet: #818CF8;
  --rose: #FB7185;
  --mint: #34D399;
  --lavender: #A5B4FC;
  --gradient: linear-gradient(135deg, var(--violet) 0%, var(--rose) 100%);

  /* Neutres : ardoise légèrement tirée vers l'indigo */
  --bg: #FFFFFF;
  --surface: #F6F7FC;
  --surface-2: #EDEFFA;
  --line: #E3E5F1;
  --ink: #1C2033;
  --ink-2: #474D66;
  --muted: #6A7090;

  /* Accents lisibles en texte sur fond clair */
  --accent-text: #5457D6;
  --accent-soft: #EEF0FF;

  /* Statuts de juridiction */
  --ok-bg: #E2F7EE;   --ok-fg: #0B7550;   --ok-dot: #34D399;
  --risk-bg: #FFE7EB; --risk-fg: #BE2F4C; --risk-dot: #FB7185;
  --unk-bg: #EEF0F5;  --unk-fg: #565C78;  --unk-dot: #A0A5BD;

  --shadow-sm: 0 1px 2px rgba(28, 32, 51, .06), 0 1px 1px rgba(28, 32, 51, .04);
  --shadow-md: 0 12px 28px -12px rgba(84, 87, 214, .28), 0 2px 6px rgba(28, 32, 51, .06);

  /* Typographie */
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --fs-xs: .78rem;
  --fs-sm: .9rem;
  --fs-md: 1.05rem;
  --fs-lg: 1.3rem;
  --fs-xl: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
  --fs-2xl: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11121B; --surface: #181A27; --surface-2: #212437; --line: #2B2E45;
    --ink: #ECEDF6; --ink-2: #BABDD2; --muted: #8B90AB;
    --accent-text: #A5B4FC; --accent-soft: #23264A;
    --ok-bg: rgba(52, 211, 153, .14); --ok-fg: #6EE7B7;
    --risk-bg: rgba(251, 113, 133, .15); --risk-fg: #FDA4AF;
    --unk-bg: #24273A; --unk-fg: #A9ADC6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 14px 30px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11121B; --surface: #181A27; --surface-2: #212437; --line: #2B2E45;
  --ink: #ECEDF6; --ink-2: #BABDD2; --muted: #8B90AB;
  --accent-text: #A5B4FC; --accent-soft: #23264A;
  --ok-bg: rgba(52, 211, 153, .14); --ok-fg: #6EE7B7;
  --risk-bg: rgba(251, 113, 133, .15); --risk-fg: #FDA4AF;
  --unk-bg: #24273A; --unk-fg: #A9ADC6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 14px 30px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--fs-2xl); font-weight: 800; }
h2 { font-size: var(--fs-xl); font-weight: 750; }
h3 { font-size: var(--fs-lg); font-weight: 700; }
p { margin: 0; max-width: var(--measure); color: var(--ink-2); }
a { color: var(--accent-text); text-underline-offset: 3px; }
code, .mono { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 2px; border-radius: 6px; }

.wrap {
  max-width: 1120px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.lead { font-size: var(--fs-md); color: var(--ink-2); }
.muted { color: var(--muted); }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent-text);
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Logo (reconstruit en SVG pour les deux thèmes) ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; color: var(--ink); }
.brand-sub { font-weight: 500; color: var(--muted); font-size: var(--fs-sm); }

/* ---------- Icônes ---------- */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.icon-chip {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent-text);
  transition: transform .3s ease;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.25rem; border-radius: 12px; border: 1px solid transparent;
  font: 650 var(--fs-sm)/1 var(--font); text-decoration: none; cursor: pointer;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease, background-color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-md); }
.btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.input, .select {
  min-height: 46px; padding: .65rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: 500 var(--fs-md)/1.3 var(--font); width: 100%;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Formulaire domaine : champ + bouton sur une ligne, empilés sur mobile */
.domain-form { display: flex; gap: .6rem; flex-wrap: wrap; }
.domain-form .input { flex: 1 1 220px; min-width: 0; font-family: var(--mono); }

/* ---------- Cartes ---------- */
.card {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.card-soft { background: var(--surface); border-color: transparent; box-shadow: none; }
.tile { transition: transform .3s ease, box-shadow .3s ease; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tile:hover .icon-chip { transform: scale(1.08); }

/* ---------- Badges de juridiction ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
  padding: .22rem .65rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700;
}
.badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge-risk { background: var(--risk-bg); color: var(--risk-fg); }
.badge-unk { background: var(--unk-bg); color: var(--unk-fg); }

/* ---------- Note A–E ---------- */
.grade {
  display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  font-weight: 800; font-size: 1.9rem; color: #fff; flex: none;
}
.grade-A { background: #10B981; }
.grade-B { background: #34D399; color: #063B2A; }
.grade-C { background: #FBBF24; color: #3B2A03; }
.grade-D { background: #FB923C; color: #3D1A04; }
.grade-E { background: #F43F5E; }

/* ---------- Tableau de relevé ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 700; background: var(--surface); padding: .7rem 1rem;
}
.table td { padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.table td:first-child { font-weight: 650; color: var(--ink); }
.table .mono { color: var(--ink-2); word-break: break-all; }

/* ---------- Bandeaux ---------- */
.callout {
  display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: var(--radius);
  background: var(--risk-bg); color: var(--risk-fg);
}
.callout p { color: var(--ink-2); }
.callout-ok { background: var(--ok-bg); color: var(--ok-fg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
