/*
 * Composants du site public (assets/js/components.js), reproduits d'après la maquette.
 * Classes préfixées nx- et tokens --nx- uniquement : aucune interférence avec les styles de la console.
 */

/* Accessibilité */
.nx-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.nx-btn:focus-visible,
.nx-chip:focus-visible,
.nx-logo:focus-visible,
.nx-card--interactive:focus-visible {
  outline: var(--nx-focus-ring);
  outline-offset: 3px;
}

/* Button */
.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nx-space-2);
  font-family: var(--nx-font-body);
  font-weight: var(--nx-weight-bold);
  font-size: var(--nx-text-base);
  line-height: 1.2;
  border: 0;
  border-radius: var(--nx-radius-pill);
  padding: 13px 22px;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--nx-duration-fast), box-shadow var(--nx-duration-base), background var(--nx-duration-base);
}
.nx-btn--primary {
  background: var(--nx-gradient-primary);
  color: var(--nx-on-accent);
  box-shadow: var(--nx-shadow-primary);
}
.nx-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--nx-shadow-primary-hover);
}
.nx-btn--ghost {
  background: transparent;
  color: var(--nx-fg);
  box-shadow: 0 0 0 1px var(--nx-line-2) inset;
}
.nx-btn--ghost:hover {
  background: var(--nx-surface);
}
.nx-btn--sm {
  padding: 9px 16px;
  font-size: 14px;
}
.nx-btn:disabled,
.nx-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}
.nx-btn--ghost:disabled,
.nx-btn--ghost[aria-disabled="true"] {
  box-shadow: 0 0 0 1px var(--nx-line) inset;
  background: transparent;
}
.nx-btn.is-loading {
  cursor: progress;
  opacity: 0.85;
}
.nx-btn__spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: nx-spin 0.8s linear infinite;
}
@keyframes nx-spin {
  to { transform: rotate(360deg); }
}

/* Card */
.nx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--nx-space-3);
  padding: 18px;
  min-width: 0;
  border: 1px solid var(--nx-line);
  border-radius: var(--nx-radius-lg);
  background: var(--nx-gradient-card);
  color: var(--nx-fg);
  transition: border-color var(--nx-duration-base), box-shadow var(--nx-duration-base);
}
.nx-card--interactive:hover {
  border-color: var(--nx-line-2);
}
.nx-card.is-selected {
  border-color: var(--nx-blue);
  box-shadow: var(--nx-shadow-selected);
}

/* Chip */
.nx-chip {
  font-family: var(--nx-font-body);
  font-weight: var(--nx-weight-semibold);
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--nx-radius-pill);
  border: 1px solid var(--nx-line-2);
  background: transparent;
  color: var(--nx-muted);
  cursor: pointer;
  transition: background var(--nx-duration-base), border-color var(--nx-duration-base), color var(--nx-duration-base);
}
.nx-chip:hover {
  color: var(--nx-fg);
}
.nx-chip[aria-pressed="true"] {
  background: var(--nx-blue-strong);
  border-color: var(--nx-blue-strong);
  color: var(--nx-on-accent);
}
.nx-chip small {
  opacity: 0.7;
  margin-left: var(--nx-space-1);
  font-size: inherit;
  font-variant-numeric: tabular-nums;
}
.nx-chip[aria-pressed="true"] small {
  opacity: 1;
}

/* AgentAvatar : petite (listes, 36 px), moyenne (cartes, 62 px), grande (fiches, 120 px) */
.nx-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 50%;
  background: var(--nx-gradient-avatar);
  box-shadow: var(--nx-shadow-avatar);
  color: #cfe3ff;
  font-family: var(--nx-font-display);
  font-weight: var(--nx-weight-bold);
  line-height: 1;
}
.nx-avatar--sm { width: 36px; height: 36px; font-size: 16px; }
.nx-avatar--md { width: 62px; height: 62px; font-size: 26px; }
.nx-avatar--lg { width: 120px; height: 120px; font-size: 50px; box-shadow: 0 0 0 3px var(--nx-blue), 0 0 28px var(--nx-glow); }
.nx-avatar__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* SectionHeader */
.nx-section-header {
  display: grid;
  gap: var(--nx-space-3);
  margin-bottom: var(--nx-space-8);
}
.nx-eyebrow {
  font-family: var(--nx-font-display);
  font-weight: var(--nx-weight-semibold);
  font-size: var(--nx-text-sm);
  letter-spacing: var(--nx-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--nx-cyan);
}
.nx-heading {
  margin: 0;
  font-family: var(--nx-font-display);
  font-weight: var(--nx-weight-extrabold);
  font-size: var(--nx-text-h2);
  line-height: var(--nx-leading-heading);
  letter-spacing: var(--nx-tracking-heading);
  text-transform: uppercase;
  text-wrap: balance;
}
.nx-heading em {
  font-style: normal;
  color: var(--nx-blue);
}
.nx-lead {
  margin: 0;
  max-width: 60ch;
  color: var(--nx-muted);
  font-size: var(--nx-text-md);
}

/* Logo : hauteur fixe (attribut height), largeur déduite du ratio, jamais étiré */
.nx-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--nx-fg);
  text-decoration: none;
  border-radius: var(--nx-radius-xs);
}
.nx-logo__img {
  display: block;
  width: auto;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .nx-btn,
  .nx-card,
  .nx-chip {
    transition: none;
  }
  .nx-btn--primary:hover {
    transform: none;
  }
  .nx-btn__spinner {
    animation: none;
    border-right-color: currentColor;
    opacity: 0.6;
  }
}
