/* AstraBot — Thème principal + Mode sombre */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ===== VARIABLES — MODE CLAIR ===== */
:root {
  /* Palette bleue */
  --blue-primary: #1565C0;
  --blue-light:   #1E88E5;
  --blue-vivid:   #42A5F5;
  --blue-pale:    #E3F2FD;
  --blue-dark:    #0D47A1;
  --accent:       #00B0FF;

  /* Accent "étoile" — réservé aux moments clés (logo, reveal, succès) */
  --gold:      #F0B429;
  --gold-dark: #C4901A;
  --gold-pale: #FEF3D6;

  /* Statuts */
  --danger:  #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;

  /* Surfaces sémantiques (overridées en dark mode) */
  --surface:           #FFFFFF;
  --surface-raised:    #FFFFFF;
  --surface-subtle:    #F8FAFC;
  --surface-muted:     #F1F5F9;
  --surface-sidebar:   #0D47A1;

  /* Texte */
  --text-primary:   #1E293B;
  --text-secondary: #475569;
  --text-muted:     #94A3B8;

  /* Bordures */
  --border:        #E2E8F0;
  --border-strong: #CBD5E1;

  /* Ombres */
  --shadow:    0 4px 24px rgba(21,101,192,0.10);
  --shadow-lg: 0 8px 40px rgba(21,101,192,0.16);
  --shadow-gold: 0 4px 20px rgba(240,180,41,0.35);

  /* Easings — motion délibéré, pas de "ease" générique */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Misc */
  --radius: 12px;
  --white:  #FFFFFF;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

/* ===== VARIABLES — MODE SOMBRE ===== */
[data-theme="dark"] {
  --surface:           #1e293b;
  --surface-raised:    #263348;
  --surface-subtle:    #0f172a;
  --surface-muted:     #172033;
  --surface-sidebar:   #0a1628;

  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  --border:        #334155;
  --border-strong: #475569;

  --shadow:    0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --blue-pale: rgba(21,101,192,0.18);
  --gold-pale: rgba(240,180,41,0.16);
}

/* ===== MOUVEMENT RÉDUIT — accessibilité ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { transition: background 0.25s, color 0.25s; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--surface-subtle);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--blue-vivid) 18%, transparent), transparent 28rem),
    radial-gradient(circle at 92% 18%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 24rem),
    radial-gradient(circle at 50% 110%, color-mix(in srgb, var(--blue-primary) 10%, transparent), transparent 32rem);
  opacity: .72;
  animation: none;
}
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(color-mix(in srgb, var(--blue-vivid) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--blue-vivid) 5%, transparent) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(500px) rotateX(58deg) translateY(18%);
  transform-origin: center;
  opacity: .22;
  animation: none;
}
.astra-motion-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.astra-motion-orb {
  position: absolute;
  width: clamp(9rem, 19vw, 22rem);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(0);
  opacity: .12;
  background: radial-gradient(circle at 35% 30%, var(--blue-vivid), transparent 68%);
  animation: none;
}
.astra-motion-orb:nth-child(1) { left: -5%; top: 12%; animation-delay: -3s; }
.astra-motion-orb:nth-child(2) { right: -4%; top: 36%; width: clamp(8rem, 16vw, 18rem); background: radial-gradient(circle at 35% 30%, var(--accent), transparent 68%); animation-duration: 23s; animation-delay: -9s; }
.astra-motion-orb:nth-child(3) { left: 38%; bottom: -15%; width: clamp(10rem, 22vw, 26rem); background: radial-gradient(circle at 35% 30%, var(--blue-primary), transparent 68%); animation-duration: 27s; animation-delay: -14s; }
.astra-motion-orb:nth-child(4) { left: 58%; top: -16%; width: clamp(6rem, 13vw, 15rem); opacity: .11; animation-duration: 16s; animation-delay: -6s; }
@keyframes astra-aurora {
  0% { background-position: 8% 0%, 92% 18%, 50% 110%; }
  50% { background-position: 24% 14%, 75% 42%, 36% 86%; }
  100% { background-position: 0% 30%, 100% 4%, 64% 105%; }
}
@keyframes astra-grid-drift { from { background-position: 0 0, 0 0; } to { background-position: 46px 46px, 46px 46px; } }
@keyframes astra-orb-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(7vw, -5vh, 0) scale(1.12); }
  66% { transform: translate3d(-5vw, 8vh, 0) scale(.88); }
}
body.astra-page-ready { animation: astra-page-enter .28s var(--ease-out) both; }
body.astra-page-leaving { animation: astra-page-leave .18s ease-in both; pointer-events: none; }
.astra-page-progress { position: fixed; top: 0; left: 0; z-index: 2000; width: 0; height: 3px; background: linear-gradient(90deg, var(--blue-primary), var(--blue-vivid), var(--accent)); opacity: 0; transition: width .2s var(--ease-out), opacity .2s; }
.astra-page-progress.loading { width: 78%; opacity: 1; animation: astra-progress-pulse 1s ease-in-out infinite alternate; }
.project-card, .profile-result, .stat-pill, .feature-card { transform: perspective(900px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: transform .25s var(--ease-out), border-color .2s, box-shadow .2s; }
.card-motion-active { box-shadow: 0 16px 34px rgba(21,101,192,.16) !important; }
.astra-ripple { position: absolute; width: 12px; height: 12px; border-radius: 50%; pointer-events: none; background: color-mix(in srgb, #fff 55%, var(--blue-vivid)); transform: translate(-50%, -50%) scale(0); animation: astra-ripple .55s ease-out forwards; }
.astra-reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
.astra-reveal.is-visible { opacity: 1; transform: translateY(0); }
.astra-reveal:nth-child(2) { transition-delay: 45ms; }
.astra-reveal:nth-child(3) { transition-delay: 90ms; }
.astra-reveal:nth-child(4) { transition-delay: 135ms; }
@keyframes astra-ripple { to { opacity: 0; transform: translate(-50%, -50%) scale(18); } }
@keyframes astra-page-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes astra-page-leave { from { opacity: 1; } to { opacity: 0; transform: translateY(-5px); } }
@keyframes astra-progress-pulse { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body.astra-page-ready, body.astra-page-leaving { animation: none; }
  .astra-page-progress { display: none; }
  .project-card, .profile-result, .stat-pill, .feature-card { transform: none; }
  body::before, body::after, .astra-motion-orb { animation: none; }
  .astra-motion-field { display: none; }
}

body.astra-page-hidden::before,
body.astra-page-hidden::after,
body.astra-page-hidden .astra-motion-orb {
  animation-play-state: paused;
}

body.astra-motion-enabled::before {
  animation: astra-aurora 38s ease-in-out infinite alternate;
}

body.astra-motion-enabled::after {
  animation: astra-grid-drift 52s linear infinite;
}

body.astra-motion-enabled .astra-motion-orb {
  animation: astra-orb-float 38s ease-in-out infinite;
}

@media (max-width: 700px), (prefers-reduced-motion: reduce), (update: slow) {
  body::before { animation: none; }
  body::after { animation: none; opacity: .14; }
  .astra-motion-orb { animation: none; opacity: .08; }
  .astra-motion-orb:nth-child(n + 3) { display: none; }
}

/* Widget global de personnalisation */
:root {
  --custom-background-light: #F1F5F9;
  --custom-background-dark: #172033;
  --custom-font-scale: 1;
  --custom-radius: 12px;
}
body {
  font-size: calc(1rem * var(--custom-font-scale));
  background: var(--custom-background-light);
}
[data-theme="dark"] body { background: var(--custom-background-dark); }
[data-custom-background="default"] body { background: var(--custom-background-light); }
[data-theme="dark"][data-custom-background="default"] body { background: var(--custom-background-dark); }
.btn, input, textarea, select, .card, .profile-card, .project-card { border-radius: var(--custom-radius); }
.astra-customizer-toggle {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 800; width: 46px; height: 46px;
  border: 1px solid var(--border); border-radius: 50%; background: var(--surface);
  color: var(--text-primary); box-shadow: var(--shadow-lg); cursor: pointer; font-size: 1.2rem;
  transition: transform .2s var(--ease-spring), border-color .2s;
}
.astra-customizer-toggle:hover { transform: rotate(15deg) scale(1.08); border-color: var(--blue-vivid); }
.astra-customizer {
  position: fixed; right: 1rem; bottom: 4.8rem; z-index: 801; width: min(320px, calc(100vw - 2rem));
  display: grid; gap: .85rem; padding: 1rem; border: 1px solid var(--border);
  border-radius: var(--custom-radius); background: var(--surface); color: var(--text-primary);
  box-shadow: var(--shadow-lg); animation: astra-customizer-in .2s var(--ease-out);
}
.astra-customizer[hidden] { display: none; }
.astra-customizer-header { display: flex; align-items: start; justify-content: space-between; gap: .75rem; }
.astra-customizer-header strong, .astra-customizer-header span { display: block; }
.astra-customizer-header span { margin-top: .15rem; color: var(--text-muted); font-size: .7rem; }
.astra-customizer-close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.astra-customizer label, .astra-customizer legend { color: var(--text-secondary); font-size: .78rem; font-weight: 700; }
.astra-customizer label { display: grid; gap: .35rem; }
.astra-customizer input, .astra-customizer select { width: 100%; min-height: 36px; padding: .35rem .5rem; border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text-primary); }
.astra-customizer input[type="color"] { height: 38px; padding: 2px; cursor: pointer; }
.astra-customizer fieldset { display: grid; gap: .5rem; border: 0; }
.astra-backgrounds { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.astra-backgrounds button { padding: .4rem .15rem; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-muted); color: var(--text-secondary); cursor: pointer; font-size: .65rem; }
.astra-backgrounds button.active, .astra-backgrounds button:hover { border-color: var(--blue-primary); color: var(--blue-primary); }
@keyframes astra-customizer-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .astra-customizer { animation: none; } }

h1, h2, h3,
.navbar-title, .hero h1, .auth-title, .panel-header h1,
.features-title, .legal-header h1, .stat-number,
.auth-card-title, .footer-brand-name {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Focus clavier visible partout (accessibilité) */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--blue-vivid);
  outline-offset: 2px;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(21,101,192,0.08);
  transition: background 0.25s, border-color 0.25s;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue-vivid);
}

.navbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blue-primary);
  letter-spacing: -0.3px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.navbar-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.navbar-nav a:hover { color: var(--blue-primary); }
.navbar-nav a.nav-current {
  color: var(--blue-primary);
  font-weight: 700;
  position: relative;
}
.navbar-nav a.nav-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.55rem;
  height: 2px;
  border-radius: 99px;
  background: var(--blue-vivid);
  transform-origin: left;
  animation: nav-current-in .28s var(--ease-out) both;
}
@keyframes nav-current-in { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: scaleX(1); } }

.nav-btn {
  background: var(--blue-primary);
  color: #fff !important;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 600 !important;
  transition: background 0.2s, transform 0.1s !important;
}

.nav-btn:hover {
  background: var(--blue-dark) !important;
  transform: translateY(-1px);
}

/* ===== BOUTON THÈME ===== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--blue-pale);
  color: var(--blue-primary);
  border-color: var(--blue-vivid);
  transform: rotate(15deg);
}

/* ===== BOUTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .2s, background .2s, border-color .2s, color .2s;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--blue-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(21,101,192,0.3);
}

.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(21,101,192,0.4);
}

.btn-outline {
  background: transparent;
  color: var(--blue-primary);
  border: 2px solid var(--blue-primary);
}

.btn-outline:hover { background: var(--blue-pale); }
.btn:active { transform: translateY(1px) scale(.985); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }

.btn-sm   { padding: 7px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* ===== FORMULAIRES ===== */
.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-vivid);
  box-shadow: 0 0 0 3px rgba(66,165,245,0.15);
}

.form-input::placeholder { color: var(--text-muted); }

/* Surfaces communes : donner une hiérarchie identique aux pages utilitaires. */
main > h1, main > h2 {
  color: var(--text-primary);
  text-wrap: balance;
}
main > p {
  color: var(--text-secondary);
}
.empty-state, .loading-state, .project-empty, .conversation-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 78%, var(--blue-pale));
  color: var(--text-muted);
  padding: 2rem 1rem;
  text-align: center;
}
table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
th { color: var(--text-secondary); background: var(--surface-muted); font-size: .78rem; text-align: left; }
td, th { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }

/* Indicateur de force du mot de passe */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pw-strength-bar {
  flex: 1;
  height: 5px;
  background: var(--surface-muted);
  border-radius: 3px;
  overflow: hidden;
}
.pw-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: width 0.25s var(--ease-out), background 0.25s;
}
.pw-strength-label {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

/* ===== CARTES ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: background 0.25s;
}

.card-sm { padding: 1.5rem; }

/* ===== ALERTES ===== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: none;
}

.alert.show { display: block; }

.alert-error {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.alert-success {
  background: #F0FDF4;
  color: #16A34A;
  border: 1px solid #BBF7D0;
}

[data-theme="dark"] .alert-error {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border-color: rgba(239,68,68,0.3);
}

[data-theme="dark"] .alert-success {
  background: rgba(34,197,94,0.12);
  color: #4ade80;
  border-color: rgba(34,197,94,0.3);
}

/* ===== FEEDBACK DE PRESSION SUR LES BOUTONS ===== */
.btn:active:not(:disabled) { transform: scale(0.97); }

/* ===== TOASTS ===== */
#toast-stack {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  background: var(--surface);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--blue-vivid);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toast-in 0.35s var(--ease-spring);
}

.toast.toast-leaving { animation: toast-out 0.25s var(--ease-out) forwards; }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error    { border-left-color: var(--danger); }
.toast.toast-gold      { border-left-color: var(--gold); }

.toast-icon { flex-shrink: 0; font-size: 1.1rem; line-height: 1; }
.toast-msg  { flex: 1; }

@keyframes toast-in {
  from { transform: translateX(24px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toast-out {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(24px); opacity: 0; max-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
}

/* ===== SKELETONS (chargement) ===== */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 8px;
  color: transparent !important;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: skeleton-sweep 1.4s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

@keyframes skeleton-sweep {
  100% { transform: translateX(100%); }
}

/* ===== REVEAL — une seule séquence orchestrée au chargement ===== */
.reveal-group > * {
  opacity: 0;
  animation: reveal-up 0.6s var(--ease-out) forwards;
}
.reveal-group > *:nth-child(1) { animation-delay: 0.03s; }
.reveal-group > *:nth-child(2) { animation-delay: 0.10s; }
.reveal-group > *:nth-child(3) { animation-delay: 0.17s; }
.reveal-group > *:nth-child(4) { animation-delay: 0.24s; }
.reveal-group > *:nth-child(5) { animation-delay: 0.31s; }
.reveal-group > *:nth-child(6) { animation-delay: 0.38s; }

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== APPARITION AU DÉFILEMENT ===== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.scroll-reveal.scroll-reveal-delay-1 { transition-delay: .06s; }
.scroll-reveal.scroll-reveal-delay-2 { transition-delay: .12s; }
.scroll-reveal.scroll-reveal-delay-3 { transition-delay: .18s; }
.scroll-reveal.scroll-reveal-delay-4 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal,
  .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Transition douce entre onglets du panel admin ===== */
.section-fade-in {
  animation: section-fade 0.32s var(--ease-out);
}
@keyframes section-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .section-fade-in { animation: none; }
}

/* ===== SECOUSSE — retour visuel sur erreur de formulaire ===== */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.shake { animation: shake 0.5s; }

/* ===== POP — petite célébration sur succès (logo de vérification) ===== */
.verify-success-pop { animation: success-pop 0.55s var(--ease-spring); }
@keyframes success-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18) rotate(-4deg); }
  70%  { transform: scale(0.95) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .verify-success-pop { animation: none; }
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 50%, var(--blue-vivid) 100%);
  color: #fff;
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

#hero-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero-logo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  margin: 0 auto 1.5rem;
  display: block;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 0 0 rgba(240,180,41,0.5);
  animation: float 3s ease-in-out infinite;
}

body.home-page::before,
body.home-page::after {
  animation: none !important;
}

body.home-page .astra-motion-field {
  display: none !important;
}

@keyframes float {
  0%, 100% { transform: translateY(0);   box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 0 24px 0 rgba(240,180,41,0.25); }
  50%      { transform: translateY(-8px); box-shadow: 0 16px 40px rgba(0,0,0,0.25), 0 0 36px 4px rgba(240,180,41,0.4); }
}

.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -1px; }

.hero p { font-size: 1.2rem; opacity: 0.85; max-width: 600px; margin: 0 auto 2rem; }

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== STATISTIQUES DU BOT ===== */
.bot-stats {
  padding: 4rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.bot-stats-inner { max-width: 1100px; margin: 0 auto; }
.bot-stats-heading { text-align: center; margin-bottom: 2rem; }
.bot-stats-heading .eyebrow {
  color: var(--blue-primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.bot-stats-heading h2 {
  color: var(--text-primary);
  font-size: 2rem;
  margin: .35rem 0 .45rem;
}
.bot-stats-heading p { color: var(--text-muted); font-size: .9rem; }
.bot-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.bot-stat-card {
  min-height: 150px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.bot-stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bot-stat-card-accent { border-color: var(--gold); background: var(--gold-pale); }
.bot-stat-icon { font-size: 1.35rem; line-height: 1; margin-bottom: .6rem; }
.bot-stat-number { color: var(--blue-primary); font-family: var(--font-display); font-size: 2rem; line-height: 1.1; }
.bot-stat-label { color: var(--text-secondary); font-size: .82rem; margin-top: .45rem; }

/* ===== FEATURES ===== */
.features { padding: 5rem 2rem; max-width: 1100px; margin: 0 auto; }

.features-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--blue-vivid);
  transition: transform 0.2s, box-shadow 0.2s, background 0.25s;
}

.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 0.5rem;
}

.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ===== PAGES LÉGALES ===== */
.legal-page { max-width: 860px; margin: 3rem auto; padding: 0 2rem 4rem; }

.legal-header {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue-primary));
  color: #fff;
  padding: 3rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  text-align: center;
}

.legal-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.legal-header .subtitle { opacity: 0.8; font-size: 0.9rem; }

.legal-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--blue-vivid);
  transition: background 0.25s;
}

.legal-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-section p, .legal-section li { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.8; }
.legal-section ul { padding-left: 1.5rem; margin-top: 0.75rem; }
.legal-section li { margin-bottom: 0.5rem; }

/* ===== AUTH ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 100%);
}

[data-theme="dark"] .auth-page {
  background: linear-gradient(135deg, #050d1a 0%, #0d47a1 100%);
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transition: background 0.25s;
}

.auth-logo {
  display: block;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid var(--blue-vivid);
}

.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.75rem;
}

.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-muted); }
.auth-footer a { color: var(--blue-primary); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

/* ===== PANEL ADMIN ===== */
.panel-layout { display: flex; min-height: calc(100vh - 64px); }

.panel-sidebar {
  width: 240px;
  background: var(--surface-sidebar);
  color: #fff;
  padding: 1.5rem 0;
  flex-shrink: 0;
  transition: background 0.25s;
}

.sidebar-menu { list-style: none; }

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 1.5rem;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-menu li a:hover,
.sidebar-menu li a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-left: 3px solid var(--accent);
}

.sidebar-section {
  padding: 0.75rem 1.5rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  margin-top: 0.5rem;
}

.panel-content {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
  background: var(--surface-subtle);
  transition: background 0.25s;
}

.panel-header { margin-bottom: 2rem; }
.panel-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.panel-header p  { color: var(--text-muted); font-size: 0.875rem; }

/* Transition douce entre les sections du panel */
.panel-section-enter {
  animation: reveal-up 0.4s var(--ease-out);
}

/* Compteurs de stats (nombres tabulaires pour éviter les sauts de largeur) */
.stat-number { font-variant-numeric: tabular-nums; }

/* Barre de recherche des tableaux */
.table-search {
  position: relative;
  max-width: 260px;
}
.table-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--surface-subtle);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s, width 0.25s var(--ease-out);
  font-family: 'Inter', sans-serif;
}
.table-search input:focus {
  border-color: var(--blue-vivid);
  box-shadow: 0 0 0 3px rgba(66,165,245,0.15);
  outline: none;
}
.table-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Lignes de tableau qui disparaissent en filtrant */
.data-table tbody tr { transition: opacity 0.15s, transform 0.15s; }
.data-table tbody tr.row-hidden { display: none; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: background 0.25s, transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-icon.blue   { background: #EFF6FF; }
.stat-icon.green  { background: #F0FDF4; }
.stat-icon.orange { background: #FFF7ED; }

[data-theme="dark"] .stat-icon.blue   { background: rgba(21,101,192,0.18); }
[data-theme="dark"] .stat-icon.green  { background: rgba(34,197,94,0.13); }
[data-theme="dark"] .stat-icon.orange { background: rgba(245,158,11,0.13); }

.stat-number { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.stat-label  { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* Graphique de croissance (barres SVG-like en pur CSS) */
.growth-chart {
  display: flex;
  align-items: flex-end;
  height: 120px;
  gap: 3px;
  padding-top: 8px;
  border-bottom: 1px solid var(--border);
}
.growth-bar-col {
  display: flex;
  align-items: flex-end;
  height: 100%;
}
.growth-bar {
  width: 100%;
  min-height: 3px;
  background: linear-gradient(180deg, var(--accent), var(--blue-primary));
  border-radius: 3px 3px 0 0;
  transition: transform 0.2s var(--ease-out), filter 0.2s;
  transform-origin: bottom;
  animation: bar-grow 0.5s var(--ease-out) backwards;
}
.growth-bar-col:hover .growth-bar {
  filter: brightness(1.15);
  transform: scaleY(1.03);
}
@keyframes bar-grow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@media (prefers-reduced-motion: reduce) {
  .growth-bar { animation: none; }
}

/* Table */
.data-table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background 0.25s;
}

.table-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-header h2 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover   { background: var(--surface-muted); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }

.badge-admin {
  background: #EFF6FF;
  color: var(--blue-primary);
}

.badge-user {
  background: #F0FDF4;
  color: #16A34A;
}

[data-theme="dark"] .badge-admin {
  background: rgba(21,101,192,0.2);
  color: #60a5fa;
}

[data-theme="dark"] .badge-user {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.badge-gold {
  background: var(--gold-pale);
  color: var(--gold-dark);
}

/* Pouls pour les statuts "en ligne / actif" */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}
.status-dot.running {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.6);
  animation: pulse-dot 1.8s infinite;
}
.status-dot.stopped { background: var(--text-muted); }
.status-dot.error   { background: var(--danger); }

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ===== FOOTER ===== */
.footer {
  background: #0f172a;
  color: rgba(255,255,255,0.7);
  padding: 3rem 2rem;
  margin-top: auto;
}

[data-theme="dark"] .footer {
  background: #060d1a;
  border-top: 1px solid var(--border);
}

.footer-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem; }
.footer-logo  { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.footer-brand-name { font-size: 1.1rem; font-weight: 700; color: #fff; }
.footer-desc  { font-size: 0.85rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: 0.875rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: #fff; }
.footer-bottom { max-width: 1100px; margin: 2rem auto 0; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.4); }

/* ===== SPINNER ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== INPUTS EN DARK — OVERRIDES SPÉCIFIQUES ===== */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--border);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .bot-stats { padding: 3rem 1rem; }
  .bot-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bot-stat-card { min-height: 135px; padding: 1rem .7rem; }
  .bot-stat-number { font-size: 1.65rem; }
  .navbar { height: auto; min-height: 64px; padding: .7rem 1rem; gap: .75rem; }
  .navbar-brand { min-width: 0; }
  .navbar-title { font-size: 1.05rem; white-space: nowrap; }
  .navbar-nav { gap: .4rem .65rem; flex-wrap: wrap; justify-content: flex-end; }
  .navbar-nav a { font-size: .78rem; }
  .navbar-nav .nav-btn { padding: 7px 11px; }
    .site-mobile-menu-button { display: inline-flex; }
    .site-mobile-menu-overlay { display: block; }
  .panel-sidebar { display: none; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .navbar-nav a.nav-current::after { bottom: -.25rem; }
}

  /* ===== MENU MOBILE GLOBAL ===== */
  .site-mobile-menu-button { display: inline-flex; }
  .site-mobile-menu,
  .site-mobile-menu-overlay { display: block; }

  .site-mobile-menu-button {
    width: 42px;
    height: 42px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    cursor: pointer;
    flex-shrink: 0;
  }
  .site-mobile-menu-button span { width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; }
  body.site-mobile-menu-open .site-mobile-menu-button span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.site-mobile-menu-open .site-mobile-menu-button span:nth-child(2) { opacity: 0; }
  body.site-mobile-menu-open .site-mobile-menu-button span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-mobile-menu-button span { transition: transform .22s var(--ease-out), opacity .18s ease; }
  .site-mobile-menu-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.48); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .site-mobile-menu { position: fixed; inset: 0 auto 0 0; z-index: 301; width: min(300px, 84vw); overflow-y: auto; padding: 1.1rem 0 1.5rem; background: var(--surface); box-shadow: 12px 0 30px rgba(15,23,42,.2); transform: translateX(-105%); transition: transform .24s ease; }
  .site-mobile-menu-header { display: flex; align-items: center; justify-content: space-between; padding: 0 1.25rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-primary); font-size: 1.05rem; }
  .site-mobile-menu-close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.7rem; line-height: 1; }
  .site-mobile-menu-links { padding-top: .6rem; }
  .site-mobile-menu-links p { margin: 1rem 1.25rem .35rem; color: var(--text-muted); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
  .site-mobile-menu-links a { display: block; padding: .7rem 1.25rem; color: var(--text-secondary); font-size: .92rem; font-weight: 600; text-decoration: none; }
  .site-mobile-menu-links a:hover { background: var(--surface-muted); color: var(--blue-primary); }
  body.site-mobile-menu-open { overflow: hidden; }
  body.site-mobile-menu-open .site-mobile-menu { transform: translateX(0); }
  body.site-mobile-menu-open .site-mobile-menu-overlay { opacity: 1; pointer-events: auto; }

  .navbar.has-mobile-menu .navbar-nav { display: none; }
  .navbar.has-mobile-menu .site-mobile-menu-button { display: inline-flex; }

/* ======================================================================
   RAFFINEMENTS VISUELS
   — Aucun nouvel asset (pas d'image, pas de police, pas de JS).
   — Uniquement des couleurs dérivées des tokens existants (color-mix),
     des bordures statiques et des transitions sur transform/couleur :
     rien ici n'ajoute de coût de rendu mesurable, y compris sur mobile.
   ====================================================================== */

:root {
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 1px 1px rgba(15,23,42,.04);
  --shadow:    0 4px 20px rgba(21,101,192,.08), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 14px 38px rgba(21,101,192,.14), 0 2px 8px rgba(15,23,42,.08);
  --card-border: color-mix(in srgb, var(--border) 75%, transparent);
}
[data-theme="dark"] {
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow:    0 4px 20px rgba(0,0,0,.32), 0 1px 2px rgba(0,0,0,.22);
  --shadow-lg: 0 16px 42px rgba(0,0,0,.48);
}

/* Sélection de texte à la couleur de la marque plutôt que le bleu système */
::selection { background: color-mix(in srgb, var(--blue-vivid) 35%, transparent); color: var(--text-primary); }

/* Barre de défilement discrète (propriété native, coût nul) */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--blue-primary) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--blue-primary) 40%, transparent);
  border-radius: 99px;
  border: 2px solid var(--surface-subtle);
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--blue-primary) 60%, transparent); }

/* Surfaces "plates" — une bordure fine leur donne un bord net sans alourdir
   le rendu (elles reposaient uniquement sur l'ombre auparavant). */
.card, .stat-card, .auth-card, .data-table-wrap {
  border: 1px solid var(--card-border);
}
.card:hover, .stat-card:hover {
  border-color: color-mix(in srgb, var(--blue-vivid) 40%, var(--border));
}

/* Boutons pleins — un léger reflet statique (dégradé, pas d'image) pour
   plus de relief, identique au poids de rendu d'un aplat de couleur. */
.btn-primary, .nav-btn {
  background-image:
    linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent), transparent 55%),
    linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
  background-color: var(--blue-primary);
}

/* Tableaux — zébrage subtil + ligne active plus lisible */
.data-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-muted) 50%, transparent);
}
.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--blue-pale) 65%, var(--surface));
}

/* Footer — dégradé discret au lieu d'un aplat uni */
.footer { background: linear-gradient(180deg, #0f172a, #0a1424); }
[data-theme="dark"] .footer { background: linear-gradient(180deg, #060d1a, #04070d); }

/* Icônes de stats / badges / alertes — dérivés des tokens sémantiques
   plutôt que de hex figés : plus cohérent avec le reste de la palette,
   même rendu visuel, sans coût de calcul additionnel. */
.stat-icon.blue   { background: color-mix(in srgb, var(--blue-primary) 12%, transparent); color: var(--blue-primary); }
.stat-icon.green  { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.stat-icon.orange { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--warning); }
.badge-admin { background: color-mix(in srgb, var(--blue-primary) 12%, transparent); color: var(--blue-primary); }
.badge-user  { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.alert-error {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.alert-success {
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
}

/* Confort de lecture : un peu plus d'air dans les blocs de texte longs */
.feature-card p, .legal-section p, .legal-section li { line-height: 1.7; }
.features-title, .bot-stats-heading h2, .legal-header h1 { letter-spacing: -0.01em; }

/* Focus clavier : coins arrondis pour matcher les composants, a11y intacte */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  border-radius: 4px;
}