/* ═══════════════════════════════════════════════════════════════
   AlternativesLibres.fr — Design System
   ═══════════════════════════════════════════════════════════════ */

/* Inter — self-hosted (no third-party requests, RGPD-friendly) */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  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;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  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;
}

/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --bg:            #080d1a;
  --bg-alt:        #0b1225;
  --surface:       #0f1b35;
  --surface-2:     #152040;
  --surface-3:     #1b2a50;
  --border:        rgba(255,255,255,0.07);
  --border-hover:  rgba(96,165,250,0.35);

  --text:          #e2e8f4;
  --text-muted:    #7b8fa8;
  --text-dim:      #4a5568;

  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-light:  #60a5fa;
  --accent-glow:   rgba(37,99,235,0.18);

  /* Badge palette */
  --france:        #002395;
  --france-bg:     rgba(0,35,149,0.18);
  --eu:            #2d7d4e;
  --eu-bg:         rgba(45,125,78,0.18);
  --gdpr:          #6d28d9;
  --gdpr-bg:       rgba(109,40,217,0.18);
  --sill:          #b45309;
  --sill-bg:       rgba(180,83,9,0.18);
  --sponsor-c:     #b45309;
  --sponsor-bg:    rgba(180,83,9,0.12);

  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px;

  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 20px; --r-pill: 999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-mid: 250ms ease;
  --t-slow: 400ms ease;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 8px 32px rgba(37,99,235,0.25), 0 0 0 1px rgba(37,99,235,0.3);

  /* Sidebar width */
  --sidebar-w: 264px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* Focus ring for keyboard nav */
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ── Typography helpers ──────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ── Layout ──────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,13,26,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  /* French tricolor top accent */
  border-top: 3px solid;
  border-image: linear-gradient(90deg, #002395 33.3%, #fff 33.3% 66.6%, #ed2939 66.6%) 1 0 0 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-4) var(--sp-6);
  max-width: 1280px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo-text span { color: var(--accent-light); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  transition: color var(--t-fast), background var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav-link.active { color: var(--accent-light); }

.nav-cta {
  background: var(--accent);
  color: #fff !important;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.8125rem;
  transition: background var(--t-fast), box-shadow var(--t-fast);
  text-decoration: none;
}
.nav-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  text-decoration: none;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.mobile-menu-btn:hover { background: var(--surface-2); color: var(--text); }
.mobile-menu-btn svg { width: 20px; height: 20px; }

/* ── Hero section ────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--sp-16) 0 var(--sp-12);
  background: radial-gradient(ellipse 100% 80% at 60% -20%, rgba(37,99,235,0.14) 0%, transparent 70%),
              radial-gradient(ellipse 60% 60% at 10% 110%, rgba(109,40,217,0.08) 0%, transparent 60%),
              var(--bg);
}

/* Subtle grid pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 40%, transparent 100%);
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}

.hero h1 {
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, #fff 0%, #c7d7f5 60%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: var(--sp-10);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Search bar ──────────────────────────────────────────────── */
.search-wrap {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--sp-8);
}

.search-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 20px; height: 20px;
  transition: color var(--t-fast);
}

.search-input {
  width: 100%;
  padding: var(--sp-4) var(--sp-10) var(--sp-4) var(--sp-10);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  transition: border-color var(--t-mid), box-shadow var(--t-mid), background var(--t-mid);
}

.search-input::placeholder { color: var(--text-dim); }

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
}

.search-input:focus + .search-icon,
.search-wrap:focus-within .search-icon { color: var(--accent-light); }

.search-clear {
  position: absolute;
  right: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px; height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--t-fast), background var(--t-fast);
  padding: 2px;
}
.search-clear:hover { color: var(--text); background: var(--surface-3); }
.search-wrap.has-value .search-clear { display: flex; }
.search-clear svg { width: 14px; height: 14px; }

/* ── Category pills ──────────────────────────────────────────── */
.cat-pills {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.cat-pill:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface-2); }
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(37,99,235,0.35);
}
.cat-pill .cat-emoji { font-size: 1em; }

/* ── Stats bar ───────────────────────────────────────────────── */
.stats-bar {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-6);
  max-width: 1280px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.results-count {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.results-count strong { color: var(--accent-light); font-weight: 600; }

.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.filter-toggle-btn:hover { border-color: var(--border-hover); color: var(--text); }
.filter-toggle-btn .badge-count {
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-pill);
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
}
.filter-toggle-btn svg { width: 14px; height: 14px; }

.active-filters-list {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 2px var(--sp-3);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── App layout ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6);
  align-items: flex-start;
}

/* ── Sidebar / Filters ───────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: var(--sp-6);
}

.filter-section {
  margin-bottom: var(--sp-6);
}

.filter-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}

/* Custom checkboxes */
.filter-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
  user-select: none;
}
.filter-item:hover { background: var(--surface); }
.filter-item:has(input:checked) { background: var(--surface-2); }

.filter-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t-fast);
  position: relative;
}
.filter-item input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.filter-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 1px;
  width: 6px; height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.filter-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  flex: 1;
}
.filter-item:has(input:checked) .filter-label { color: var(--text); }
.filter-count {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: auto;
}

.filter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-france { background: var(--france); }
.dot-eu     { background: var(--eu); }
.dot-gdpr   { background: var(--gdpr); }
.dot-sill   { background: var(--sill); }

.filter-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-4) 0;
}

.reset-filters-btn {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--t-fast);
  text-align: center;
}
.reset-filters-btn:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface); }

/* ── Results area ────────────────────────────────────────────── */
.results-area {
  flex: 1;
  min-width: 0;
}

/* ── Featured sponsors ───────────────────────────────────────── */
.featured-section {
  margin-bottom: var(--sp-8);
}

.section-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sill);
  margin-bottom: var(--sp-4);
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.sponsor-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--t-mid), box-shadow var(--t-mid), transform var(--t-mid);
  position: relative;
  overflow: hidden;
}

.sponsor-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(180,83,9,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.sponsor-card:hover {
  border-color: rgba(180,83,9,0.4);
  box-shadow: 0 8px 32px rgba(180,83,9,0.12), 0 0 0 1px rgba(180,83,9,0.2);
  transform: translateY(-2px);
}

.sponsor-badge {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  background: var(--sponsor-bg);
  border: 1px solid rgba(180,83,9,0.3);
  border-radius: var(--r-pill);
  padding: 2px var(--sp-3);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sill);
}

.sponsor-logo {
  font-size: 2rem;
  line-height: 1;
}

.sponsor-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-top: var(--sp-1);
}

.sponsor-region {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.sponsor-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.sponsor-specialties {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.specialty-tag {
  background: var(--surface-3);
  border-radius: var(--r-sm);
  padding: 2px var(--sp-2);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sponsor-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--sill);
  text-decoration: none;
  transition: gap var(--t-fast);
}
.sponsor-link:hover { gap: var(--sp-3); text-decoration: none; }
.sponsor-link svg { width: 14px; height: 14px; }

/* ── Software cards grid ─────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}

.software-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: border-color var(--t-mid), box-shadow var(--t-mid), transform var(--t-mid);
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.software-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-3px);
  text-decoration: none;
  color: inherit;
}

.software-card:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* Card header row */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}

.card-cat {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-sill-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--sill-bg);
  border: 1px solid rgba(180,83,9,0.25);
  border-radius: var(--r-pill);
  padding: 2px var(--sp-2);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sill);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Card name */
.card-name {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

/* Card description */
.card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
}

/* Alternative-to chips */
.alt-to {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  align-items: center;
}
.alt-label { font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; }
.alt-chip {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 2px 7px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Badge row */
.badge-row {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* ── Badge component ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--r-sm);
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
  cursor: default;
  white-space: nowrap;
}

.badge-france {
  background: var(--france-bg);
  color: #6b8cfa;
  border: 1px solid rgba(0,35,149,0.3);
}
.badge-eu {
  background: var(--eu-bg);
  color: #4ade80;
  border: 1px solid rgba(45,125,78,0.3);
}
.badge-gdpr {
  background: var(--gdpr-bg);
  color: #c084fc;
  border: 1px solid rgba(109,40,217,0.3);
}

/* Tooltip */
.badge[data-tip] { cursor: help; }
.badge[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast), transform var(--t-fast);
  transform: translateX(-50%) translateY(4px);
  z-index: 10;
  box-shadow: var(--shadow-md);
}
.badge[data-tip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Card footer / CTA */
.card-cta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-top: var(--sp-1);
  transition: gap var(--t-fast);
}
.software-card:hover .card-cta { gap: var(--sp-3); }
.card-cta svg { width: 14px; height: 14px; }

/* Card header meta (license + SILL) */
.card-header-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.card-license {
  font-size: 0.6875rem;
  color: var(--text-dim);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.card-name-link {
  text-decoration: none;
  color: inherit;
}
.card-name-link:hover .card-name {
  color: var(--accent-light);
}

/* Card features preview */
.card-features {
  list-style: none;
  padding: 0;
  margin: var(--sp-1) 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card-features li {
  font-size: 0.775rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.45;
}
.card-features .feat-check {
  color: #4ade80;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* Card footer actions bar */
.card-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.card-btn-detail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-light);
  text-decoration: none;
  transition: gap var(--t-fast), color var(--t-fast);
}
.card-btn-detail:hover {
  gap: 10px;
  color: #93c5fd;
  text-decoration: none;
}
.card-btn-detail svg { width: 14px; height: 14px; }

.card-ext-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.725rem;
  font-weight: 500;
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--t-fast);
}
.card-ext-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-hover);
  text-decoration: none;
}
.card-ext-btn svg { width: 12px; height: 12px; }

/* Detail page - Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
}
.feature-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.feature-text {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.5;
}

/* Detail page - Deployment options */
.deploy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.deploy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-size: 0.8125rem;
  color: var(--text);
}

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
}
.empty-emoji { font-size: 3rem; margin-bottom: var(--sp-4); }
.empty-state h3 { margin-bottom: var(--sp-3); color: var(--text); }
.empty-state p { color: var(--text-muted); font-size: 0.9375rem; max-width: 400px; margin: 0 auto var(--sp-6); }
.empty-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--t-fast), box-shadow var(--t-fast);
}
.empty-reset-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(37,99,235,0.3); text-decoration: none; }

/* ── Loading skeleton ────────────────────────────────────────── */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.skel {
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
.skel-line { height: 12px; }
.skel-title { height: 20px; width: 65%; }
.skel-badge { height: 20px; width: 40%; border-radius: var(--r-pill); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ── Detail page ─────────────────────────────────────────────── */
.detail-hero {
  background: linear-gradient(135deg, var(--bg-alt) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-10) 0;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}
.detail-breadcrumb a { color: var(--accent-light); text-decoration: none; }
.detail-breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--text-dim); }

.detail-title-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-6);
  flex-wrap: wrap;
}

.detail-info { flex: 1; min-width: 280px; }
.detail-name { margin-bottom: var(--sp-3); }
.detail-alt {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}
.detail-desc {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 650px;
}

.detail-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--accent);
  color: #fff;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--t-fast);
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
  text-decoration: none;
}
.btn-primary svg, .btn-secondary svg { width: 15px; height: 15px; }

.detail-body {
  padding: var(--sp-10) 0;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--sp-8);
  align-items: flex-start;
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.detail-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-4);
}

.compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.compliance-item {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.compliance-item .ci-status {
  font-size: 1.25rem;
  line-height: 1;
}
.compliance-item .ci-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.compliance-item .ci-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}
.compliance-item.ok .ci-value { color: var(--success); }
.compliance-item.warn .ci-value { color: var(--warning); }

.meta-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  gap: var(--sp-4);
}
.meta-key { color: var(--text-muted); }
.meta-val { color: var(--text); font-weight: 500; text-align: right; }
.meta-val a { color: var(--accent-light); }

/* ESN cards on detail page */
.esn-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.esn-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: border-color var(--t-fast);
}
.esn-card:hover { border-color: var(--border-hover); }

.esn-name { font-weight: 600; font-size: 0.9375rem; }
.esn-region { font-size: 0.75rem; color: var(--text-dim); }
.esn-contact {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent-light);
  text-decoration: none;
}
.esn-contact:hover { text-decoration: underline; }

/* ── Prestataires page ───────────────────────────────────────── */
.page-hero {
  padding: var(--sp-10) 0 var(--sp-8);
  background: radial-gradient(ellipse 100% 80% at 60% -20%, rgba(37,99,235,0.1) 0%, transparent 70%), var(--bg);
}
.page-hero .container h1 { margin-bottom: var(--sp-3); }
.page-hero .container p { color: var(--text-muted); font-size: 1rem; max-width: 600px; }

.prest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-5);
  margin-top: var(--sp-8);
}

.prest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  transition: border-color var(--t-mid), box-shadow var(--t-mid), transform var(--t-mid);
}
.prest-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-2px);
}
.prest-card.featured {
  border-color: rgba(180,83,9,0.3);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
}
.prest-card.featured:hover { border-color: rgba(180,83,9,0.5); }

.prest-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.prest-logo-name { display: flex; align-items: center; gap: var(--sp-3); }
.prest-logo { font-size: 2.25rem; line-height: 1; }
.prest-name { font-weight: 700; font-size: 1.0625rem; }
.prest-region { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.tier-badge {
  background: var(--sponsor-bg);
  border: 1px solid rgba(180,83,9,0.25);
  border-radius: var(--r-pill);
  padding: 2px 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--sill);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier-badge.standard { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }

.prest-desc { font-size: 0.875rem; color: var(--text-muted); line-height: 1.55; flex: 1; }

.prest-meta {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
}
.prest-meta-row { display: flex; justify-content: space-between; align-items: center; }
.prest-meta-label { color: var(--text-dim); font-size: 0.75rem; }
.prest-meta-val { color: var(--text); font-weight: 500; font-size: 0.8125rem; }

.prest-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.prest-actions .btn-primary, .prest-actions .btn-secondary { flex: 1; justify-content: center; }

/* ── Legal & content pages ───────────────────────────────────── */
.content-page { padding: var(--sp-12) 0; }
.content-page .container { max-width: 760px; }
.content-page h1 { margin-bottom: var(--sp-6); }
.content-page h2 {
  font-size: 1.25rem;
  margin: var(--sp-10) 0 var(--sp-4);
  color: var(--text);
}
.content-page h3 { font-size: 1rem; margin: var(--sp-6) 0 var(--sp-3); }
.content-page p { color: var(--text-muted); line-height: 1.75; margin-bottom: var(--sp-4); }
.content-page ul { margin-bottom: var(--sp-4); padding-left: var(--sp-6); }
.content-page ul li { color: var(--text-muted); line-height: 1.75; margin-bottom: var(--sp-2); list-style: disc; }
.content-page a { color: var(--accent-light); }
.content-page strong { color: var(--text); }

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}

/* ── Contact form ────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: flex-start;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input, .form-select, .form-textarea {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: var(--sp-3) var(--sp-4);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-select { appearance: none; cursor: pointer; }
.form-textarea { resize: vertical; min-height: 140px; }

.form-submit {
  width: 100%;
  padding: var(--sp-4);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
}
.form-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-16);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-6) var(--sp-6);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--sp-8);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}

.footer-brand .logo-text { font-size: 1.0625rem; }
.footer-tagline {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: var(--sp-3);
  max-width: 260px;
}

.footer-col-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--text); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-5);
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.footer-copy { font-size: 0.8125rem; color: var(--text-dim); }
.footer-legal {
  display: flex;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.footer-legal a {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-legal a:hover { color: var(--text-muted); }

/* ── Filter drawer (mobile) ──────────────────────────────────── */
.filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  backdrop-filter: blur(4px);
}
.filter-drawer {
  display: none;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(320px, 90vw);
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  z-index: 201;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--t-slow);
  padding: var(--sp-6);
}
.filter-drawer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}
.filter-drawer-title h3 { font-size: 1.0625rem; }
.close-drawer-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.close-drawer-btn:hover { background: var(--surface); color: var(--text); }
.close-drawer-btn svg { width: 18px; height: 18px; }

body.filters-open .filter-backdrop { display: block; }
body.filters-open .filter-drawer {
  display: block;
  transform: translateX(0);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .app-layout { padding-top: var(--sp-6); }
  .filter-toggle-btn { display: flex; }
  .filter-drawer, .filter-backdrop { display: block; }
  /* Override with JS class */
}

@media (max-width: 768px) {
  :root { --sp-6: 16px; }
  .header-inner { padding: var(--sp-3) var(--sp-4); }
  .nav-link:not(.nav-cta):not(:last-child) { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: var(--sp-10) 0 var(--sp-8); }
  .cards-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .compliance-grid { grid-template-columns: 1fr; }
  .detail-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { justify-content: center; }
  .prest-grid { grid-template-columns: 1fr; }
  .stats-inner { gap: var(--sp-3); }
}

@media (max-width: 480px) {
  .cat-pills { gap: var(--sp-1); }
  .cat-pill { font-size: 0.75rem; padding: var(--sp-1) var(--sp-3); }
  .detail-title-row { flex-direction: column; }
  .prest-top { flex-direction: column; }
}

/* ── Utility animations ──────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

/* Staggered card animation */
.software-card { animation: fadeIn 0.3s ease both; }
.software-card:nth-child(2) { animation-delay: 0.04s; }
.software-card:nth-child(3) { animation-delay: 0.08s; }
.software-card:nth-child(4) { animation-delay: 0.12s; }
.software-card:nth-child(5) { animation-delay: 0.16s; }
.software-card:nth-child(n+6) { animation-delay: 0.2s; }

/* ── Notice/alert box ────────────────────────────────────────── */
.notice {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.notice-icon { font-size: 1rem; flex-shrink: 0; }
.notice.info { border-color: rgba(37,99,235,0.3); background: rgba(37,99,235,0.07); }
.notice.warn { border-color: rgba(180,83,9,0.3); background: rgba(180,83,9,0.07); }
.notice.success { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.07); }

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .sidebar, .filter-toggle-btn, .detail-actions { display: none !important; }
  body { background: #fff; color: #000; }
  .software-card, .prest-card { border: 1px solid #ddd; }
}
