/* ── NegoToken — Design Polish ─────────────────────────────────────────────
   Animations, micro-interactions, effets visuels
   Inclure dans toutes les pages via <link rel="stylesheet" href="/design.css">
   ────────────────────────────────────────────────────────────────────────── */

/* ── Fond subtil avec grain ──────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #0c2a4520 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* ── Apparition au chargement ────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page > * {
  animation: fadeUp 0.5s ease both;
}
.page > *:nth-child(1) { animation-delay: 0.05s; }
.page > *:nth-child(2) { animation-delay: 0.1s; }
.page > *:nth-child(3) { animation-delay: 0.15s; }
.page > *:nth-child(4) { animation-delay: 0.2s; }
.page > *:nth-child(5) { animation-delay: 0.25s; }
.page > *:nth-child(6) { animation-delay: 0.3s; }
.page > *:nth-child(7) { animation-delay: 0.35s; }
.page > *:nth-child(8) { animation-delay: 0.4s; }
.page > *:nth-child(9) { animation-delay: 0.45s; }

/* ── Cards : hover lift ──────────────────────────────────────────────────── */
.card,
.concept,
.feature,
.cert-card,
.result-card,
.login-card,
.fin-card,
.stat-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card:hover,
.concept:hover,
.feature:hover,
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(56, 189, 248, 0.08);
}
.cert-card {
  animation: scaleIn 0.6s ease both;
}

/* ── Boutons : effets avancés ────────────────────────────────────────────── */
.btn,
.btn-creer,
.btn-sec,
.btn-accept,
.btn-decline,
.btn-primary,
.btn-danger,
.btn-cert-copy,
.btn-cert-dl,
.btn-envoyer,
.login-btn,
.btn-retour,
.refresh-btn,
.kill-btn {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
/* .btn-go reste en position absolute dans son wrapper — pas d'overflow hidden */
.btn-go {
  transition: all 0.2s ease;
}

/* Ripple effect on click */
.btn::after,
.btn-creer::after,
.btn-accept::after,
.btn-primary::after,
.login-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.btn:active::after,
.btn-creer:active::after,
.btn-accept:active::after,
.btn-primary:active::after,
.login-btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}

/* Scale down on press */
.btn:active,
.btn-creer:active,
.btn-sec:active,
.btn-accept:active,
.btn-primary:active,
.btn-cert-dl:active,
.login-btn:active {
  transform: scale(0.97);
}

/* Glow on primary buttons */
.btn-creer:hover,
.btn:hover:not(:disabled),
.btn-primary:hover:not(:disabled),
.login-btn:hover {
  box-shadow: 0 4px 16px -4px rgba(56, 189, 248, 0.35);
}
.btn-accept:hover {
  box-shadow: 0 4px 16px -4px rgba(34, 197, 94, 0.35);
}
.btn-cert-dl:hover {
  box-shadow: 0 4px 16px -4px rgba(245, 158, 11, 0.35);
}

/* ── Inputs : glow on focus ──────────────────────────────────────────────── */
input:focus,
select:focus,
.token-input:focus,
.offre-input:focus,
.co-input:focus,
.pin-input:focus,
.login-input:focus {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

/* ── Badge statut : pulse sur actif ──────────────────────────────────────── */
.badge-actif {
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(56, 189, 248, 0); }
}

/* ── Dot en ligne : meilleur pulse ───────────────────────────────────────── */
.dot.online {
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  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); }
}

/* ── Historique : apparition fluide ──────────────────────────────────────── */
.histo-item {
  animation: histoSlide 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes histoSlide {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.histo-item:hover {
  background: #111827;
}

/* ── Progress bar : shimmer ──────────────────────────────────────────────── */
.progress-fill {
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  animation: shimmer 2s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Timer urgent : glow rouge ───────────────────────────────────────────── */
.timer-val.urgent {
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

/* ── Certificat : confetti-like shimmer border ───────────────────────────── */
.cert-card {
  position: relative;
}
.cert-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #f59e0b, #d97706);
  background-size: 300% 300%;
  animation: certShimmer 4s ease infinite;
  z-index: -1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 2px;
  border-radius: 1rem;
}
@keyframes certShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ── Logo hover ──────────────────────────────────────────────────────────── */
.logo, .admin-logo, .header-logo .logo {
  transition: text-shadow 0.3s ease;
}
.logo:hover, .admin-logo:hover, .header-logo:hover .logo {
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

/* ── Sablier : meilleure animation ───────────────────────────────────────── */
.sablier-anim {
  animation: sablierSpin 2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}
@keyframes sablierSpin {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* ── Feature cards : icon bounce on hover ────────────────────────────────── */
.feature:hover .feature-icon {
  animation: iconBounce 0.5s ease;
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-6px); }
  60%      { transform: translateY(-2px); }
}

/* ── Étapes : animation stagger ──────────────────────────────────────────── */
.etape {
  animation: fadeUp 0.5s ease both;
}
.etape:nth-child(1) { animation-delay: 0.15s; }
.etape:nth-child(2) { animation-delay: 0.25s; }
.etape:nth-child(3) { animation-delay: 0.35s; }
.etape:nth-child(4) { animation-delay: 0.45s; }

/* ── Numéros étape : glow ────────────────────────────────────────────────── */
.etape-num {
  transition: all 0.3s ease;
}
.etape:hover .etape-num {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

/* ── Typing dots : meilleur bounce ───────────────────────────────────────── */
.typing span {
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing span:nth-child(1) { animation-delay: 0s; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* ── Stats publiques : count-up feel ─────────────────────────────────────── */
.stat-pub-val, .stat-val {
  transition: all 0.4s ease;
}

/* ── Lien URL : subtle highlight on hover ────────────────────────────────── */
.lien-url, .lien-acheteur {
  transition: background 0.2s, border-color 0.2s;
}
.lien-url:hover, .lien-acheteur:hover {
  background: #131c31;
  border-color: #38bdf8;
  cursor: pointer;
}

/* ── Token badge : hover glow ────────────────────────────────────────────── */
.token-badge {
  transition: all 0.25s ease;
}
.token-badge:hover {
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.15);
}

/* ── Scrollbar custom (webkit) ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ── Selection color ─────────────────────────────────────────────────────── */
::selection { background: #38bdf833; color: #e2e8f0; }

/* ── Smooth scroll global ────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Reduced motion : respecter les préférences utilisateur ──────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
