/* ==========================================================================
   Design System : PacteNumérique.ca (pactenumerique.ca)
   Souveraineté numérique & Confidentialité zéro-connaissance
   Thème clair (Light Theme)
   ========================================================================== */

:root {
  /* Palette de couleurs en mode clair */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-active: rgba(225, 29, 72, 0.5);

  --text-main: #0f172a;       /* slate-900: texte principal haute lisibilité */
  --text-muted: #475569;      /* slate-600 */
  --text-dim: #64748b;        /* slate-500 */

  --accent-red: #e11d48;      /* rouge érable éclatant */
  --accent-red-hover: #be123c;
  --accent-red-glow: rgba(225, 29, 72, 0.15);
  --accent-red-bg: rgba(225, 29, 72, 0.08);

  --accent-indigo: #4f46e5;   /* indigo moderne */
  --accent-indigo-hover: #4338ca;
  --accent-indigo-glow: rgba(79, 70, 229, 0.15);
  --accent-indigo-bg: rgba(79, 70, 229, 0.08);

  --accent-emerald: #059669;  /* émeraude / succès */
  --accent-emerald-glow: rgba(5, 150, 105, 0.15);
  --accent-emerald-bg: rgba(5, 150, 105, 0.08);

  --gradient-maple: linear-gradient(135deg, #e11d48 0%, #ea580c 100%);
  --gradient-aurora: linear-gradient(135deg, #4f46e5 0%, #0891b2 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);

  /* Typographie & Espacement */
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 4px 20px rgba(225, 29, 72, 0.12);
  --shadow-indigo: 0 4px 20px rgba(79, 70, 229, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(225, 29, 72, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(79, 70, 229, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 55%);
  background-attachment: fixed;
}

/* Liens & Boutons */
a {
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--accent-red);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.2s ease;
}

/* Barre de navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-emblems {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 1.35rem;
  line-height: 1;
  animation: pulse-emblems 4s ease-in-out infinite;
}

.brand-emblems .emblem-qc {
  filter: drop-shadow(0 1px 2px rgba(30, 64, 175, 0.35));
  transition: transform 0.2s ease;
}

.brand-emblems .emblem-ca {
  filter: drop-shadow(0 1px 2px rgba(225, 29, 72, 0.35));
  transition: transform 0.2s ease;
}

.brand-logo:hover .emblem-qc {
  transform: rotate(-10deg) scale(1.15);
}

.brand-logo:hover .emblem-ca {
  transform: rotate(10deg) scale(1.15);
}

@keyframes pulse-emblems {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.brand-suffix {
  color: var(--accent-red);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-links a {
  color: var(--text-muted);
}

.nav-links a:hover {
  color: var(--accent-red);
}

.btn-lang {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.btn-lang:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-bg);
  color: var(--accent-red);
  transform: translateY(-1px);
}

/* Bannière d'invitation privée */
.invite-alert {
  max-width: 850px;
  margin: 1.5rem auto 0;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.06) 0%, rgba(225, 29, 72, 0.05) 100%);
  border: 1px solid rgba(79, 70, 229, 0.25);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.invite-badge {
  background: var(--accent-indigo);
  color: #fff;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  white-space: nowrap;
}

.invite-text h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.2rem;
}

.invite-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Section Héro */
.hero-section {
  max-width: 1000px;
  margin: 3.5rem auto 2.5rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.gradient-text {
  background: var(--gradient-maple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
}

/* Compteurs en temps réel */
.hero-counters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto 3rem;
}

.counter-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 1.25rem 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.counter-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.counter-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.counter-label {
  font-size: 0.825rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Formulaire d'engagement */
.form-section {
  max-width: 760px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.pact-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.form-group-block {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group-block:focus-within {
  border-color: rgba(225, 29, 72, 0.4);
  background: #ffffff;
}

.block-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.input-field {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  color: var(--text-main);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px var(--accent-red-glow);
  outline: none;
}

.input-field::placeholder {
  color: #94a3b8;
}

.input-help {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.45rem;
}

.geo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: #047857;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

.geo-badge.mtl {
  background: rgba(234, 29, 45, 0.08);
  border: 1px solid rgba(234, 29, 45, 0.3);
  color: #c81e2b;
}

.geo-badge.qc {
  background: rgba(30, 64, 175, 0.08);
  border: 1px solid rgba(30, 64, 175, 0.3);
  color: #1e40af;
}

.geo-badge.ca {
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: #be123c;
}

/* Choix de seuil de cercle */
.threshold-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.threshold-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 1rem 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.threshold-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.threshold-btn.active {
  background: rgba(225, 29, 72, 0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
  box-shadow: 0 0 0 2px var(--accent-red-glow);
}

.threshold-btn span {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.threshold-btn.active span {
  color: var(--accent-red-hover);
  font-weight: 500;
}

/* Bloc Push */
.push-toggle-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(79, 70, 229, 0.05);
  border: 1px solid rgba(79, 70, 229, 0.2);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.push-info h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1b4b;
}

.push-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.btn-toggle-push {
  background: var(--accent-indigo);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-toggle-push:hover {
  background: var(--accent-indigo-hover);
  box-shadow: 0 2px 10px var(--accent-indigo-glow);
}

.btn-toggle-push.active {
  background: var(--accent-emerald);
}

/* Bouton principal de soumission */
.btn-submit {
  width: 100%;
  background: var(--gradient-maple);
  color: #fff;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 4px 15px var(--accent-red-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(225, 29, 72, 0.35);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.legal-notice {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1.25rem;
}

/* Modal de succès (Lien d'invitation privé) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), 0 20px 40px rgba(15, 23, 42, 0.12);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.show .modal-dialog {
  transform: scale(1);
}

.modal-dialog h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-align: center;
  color: var(--text-main);
}

.modal-dialog p {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.invite-link-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.invite-input {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #0369a1;
  font-family: monospace;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.btn-copy {
  background: var(--accent-red);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--accent-red-hover);
}

.circle-progress-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.progress-track {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-maple);
  width: 20%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-privacy-callout {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-indigo);
  margin-bottom: 1.5rem;
}

.btn-modal-close {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.btn-modal-close:hover {
  background: #e2e8f0;
}

/* Dashboard Territorial */
.dashboard-section {
  max-width: 1100px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title h2 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.section-title p {
  color: var(--text-muted);
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.dash-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.dash-panel h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-main);
}

.province-list, .fsa-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.stat-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: var(--gradient-aurora);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* Écosystème Souverain */
.ecosystem-section {
  max-width: 1100px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.eco-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.eco-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.4);
  box-shadow: var(--shadow-indigo);
}

.eco-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.eco-card h4 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.eco-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Puces de sélection Big Tech */
.networks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

.network-chip {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.network-chip:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.network-chip.active {
  background: rgba(225, 29, 72, 0.08);
  border-color: var(--accent-red);
  color: var(--accent-red);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--accent-red-glow);
}

.network-chip-icon {
  font-size: 1.15rem;
}

/* Boîte de recommandation souveraine dans le formulaire */
.recommendations-box {
  background: rgba(79, 70, 229, 0.04);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.recom-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #312e81;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.recom-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recom-qc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(30, 64, 175, 0.09);
  color: #1e40af;
  border: 1px solid rgba(30, 64, 175, 0.25);
}

.recom-qc-badge.mtl {
  background: rgba(234, 29, 45, 0.09);
  color: #c81e2b;
  border: 1px solid rgba(234, 29, 45, 0.25);
}

.recom-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.recom-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.recom-card.mtl-card {
  border-left: 3px solid #ea1d2d;
}

.recom-card.qc-card {
  border-left: 3px solid #1e40af;
}

.recom-card.ca-card {
  border-left: 3px solid #be123c;
}

.recom-card:hover {
  border-color: var(--accent-indigo);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.recom-card.selected {
  border-color: var(--accent-emerald);
  background: rgba(5, 150, 105, 0.05);
  box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

.recom-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.recom-name {
  font-weight: 700;
}

.recom-badges-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.recom-host-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}

.recom-host-pill.mtl {
  background: rgba(234, 29, 45, 0.09);
  color: #c81e2b;
  border: 1px solid rgba(234, 29, 45, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.recom-host-pill.qc {
  background: rgba(30, 64, 175, 0.09);
  color: #1e40af;
  border: 1px solid rgba(30, 64, 175, 0.2);
}

.recom-host-pill.ca {
  background: rgba(225, 29, 72, 0.08);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.2);
}

.recom-lang-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-full);
}

.recom-lang-badge.fr {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.recom-lang-badge.bilingual {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.recom-lang-badge.en {
  background: rgba(100, 116, 139, 0.1);
  color: #334155;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.recom-card-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

.recom-card-host {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recom-card-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(79, 70, 229, 0.08);
  color: var(--accent-indigo);
  font-weight: 600;
}

/* Répertoire interactif des réseaux souverains */
.directory-section {
  max-width: 1200px;
  margin: 0 auto 5rem;
  padding: 0 1.5rem;
}

.directory-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-bar-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 0.9rem 1.25rem 0.9rem 2.85rem;
  color: var(--text-main);
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  pointer-events: none;
}

.filter-pills-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.filter-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-pill:hover {
  color: var(--text-main);
  border-color: #cbd5e1;
}

.filter-pill.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
  box-shadow: 0 2px 8px var(--accent-indigo-glow);
}

/* Rosace officielle de la Ville de Montréal */
.mtl-rosette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
}

.svg-mtl-rosette {
  width: 1em;
  height: 1em;
  fill: #ea1d2d;
  display: inline-block;
  vertical-align: -0.125em;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-pill:hover .svg-mtl-rosette {
  transform: rotate(45deg);
}

.filter-pill.active .svg-mtl-rosette {
  fill: #ffffff;
}

.instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.instance-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.instance-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-lg);
}

.instance-card.mtl-card {
  border-top: 3px solid #ea1d2d;
}

.instance-card.qc-card {
  border-top: 3px solid #1e40af;
}

.instance-card.ca-card {
  border-top: 3px solid #be123c;
}

.instance-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.65rem;
}

.instance-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.instance-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.badge-tag {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-tag.mtl {
  background: rgba(234, 29, 45, 0.08);
  color: #c81e2b;
  border: 1px solid rgba(234, 29, 45, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tag.qc {
  background: rgba(30, 64, 175, 0.09);
  color: #1e40af;
  border: 1px solid rgba(30, 64, 175, 0.25);
}

.badge-tag.ca {
  background: rgba(225, 29, 72, 0.08);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.25);
}

.badge-tag.mtl-host {
  background: #fff1f2;
  color: #c81e2b;
  border: 1px solid #fecdd3;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-tag.qc-host {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-tag.ca-host {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.badge-tag.proto {
  background: #f8fafc;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-lang.fr {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-lang.bilingual {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-lang.en {
  background: rgba(100, 116, 139, 0.1);
  color: #334155;
  border: 1px solid rgba(100, 116, 139, 0.25);
}

.lang-check {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  color: #0f172a;
  margin-left: 0.35rem;
}

.instance-replaces {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.instance-replaces span {
  color: var(--accent-red);
}

.instance-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.instance-meta {
  font-size: 0.775rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.meta-link-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.2s ease;
  vertical-align: middle;
}

.meta-link-badge.open {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.meta-link-badge.open:hover {
  background: #047857;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(4, 120, 87, 0.25);
}

.meta-link-badge.source {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.meta-link-badge.source:hover {
  background: #4338ca;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
}

.meta-text-muted {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}

.instance-actions {
  display: flex;
  gap: 0.65rem;
}

.btn-instance-visit {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
}

.btn-instance-visit:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-instance-choose {
  background: var(--accent-indigo);
  color: #fff;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-instance-choose:hover {
  background: var(--accent-indigo-hover);
  box-shadow: 0 2px 10px var(--accent-indigo-glow);
}

/* Pied de page */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  background: #ffffff;
}

.footer p {
  margin-bottom: 0.5rem;
}

/* Toast de notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slide-toast 0.3s ease;
}

@keyframes slide-toast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-counters {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .threshold-options {
    grid-template-columns: 1fr;
  }
  .networks-grid {
    grid-template-columns: 1fr 1fr;
  }
  .instances-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    display: none;
  }
}
