/* ============================================================
   ClipShot — systeme de design
   Direction : editorial contraste.
   Noir chaud, un accent tres sature, typographie forte.
   Aucune ombre portee, aucun glow : le contraste et les
   bordures franches portent la hierarchie.
   ============================================================ */

:root {
  /* Fonds — noir chaud, jamais bleute */
  --bg:        #0a0a09;
  --surface:   #121211;
  --surface-2: #1a1a18;
  --surface-3: #242422;

  /* Bordures franches, pas de degrade */
  --line:      rgba(255, 255, 255, 0.10);
  --line-mid:  rgba(255, 255, 255, 0.18);
  --line-loud: rgba(255, 255, 255, 0.32);

  /* Texte */
  --ink:       #fafaf7;
  --ink-2:     #a3a39c;
  --ink-3:     #6e6e68;
  --ink-4:     #47474300;  /* transparent, garde pour compat */
  --ink-faint: #474743;

  /* Accent : vert acide, legerement adouci pour ne pas vibrer sur le noir.
     Le texte pose dessus est TOUJOURS sombre. */
  --acid:      #c2f53c;
  --acid-soft: #d3ff63;
  --acid-dim:  #9dc72f;
  --acid-wash: rgba(194, 245, 60, 0.11);
  --on-acid:   #0a0a09;

  /* Semantique */
  --danger:    #ff4438;
  --danger-wash: rgba(255, 68, 56, 0.10);
  --warn:      #ffb800;
  --warn-wash: rgba(255, 184, 0, 0.10);
  --ok:        var(--acid);

  /* Rayons : assez genereux pour adoucir, sans tomber dans la « pilule ». */
  --r-sm: 5px;
  --r:    10px;
  --r-lg: 14px;

  /* Profondeur : des ombres tres douces, jamais de halo colore.
     C'est ce qui evite l'effet « decoupe au cutter ». */
  --lift:    0 1px 2px rgba(0,0,0,0.30), 0 4px 12px rgba(0,0,0,0.22);
  --lift-hi: 0 2px 4px rgba(0,0,0,0.32), 0 10px 26px rgba(0,0,0,0.30);

  /* Mouvement : une seule courbe pour tout le site, jamais de lineaire. */
  --ease:  cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast:  150ms var(--ease);
  --base:  240ms var(--ease);
  --slow:  420ms var(--ease);

  /* Compat avec l'ancien nommage, le temps que tout soit migre */
  --bg-0: var(--bg);
  --bg-1: var(--surface);
  --bg-2: var(--surface-2);
  --bg-3: var(--surface-3);
  --border: var(--line);
  --border-strong: var(--line-mid);
  --border-2: var(--line-mid);
  --text-0: var(--ink);
  --text-1: var(--ink-2);
  --text-2: var(--ink-3);
  --text-3: var(--ink-faint);
  --accent: var(--acid);
  --accent-2: var(--acid);
  --accent-soft: var(--acid-wash);
  --success: var(--acid);
  --warning: var(--warn);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--acid); color: var(--on-acid); }

/* ---------- Typographie ---------- */

.display {
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
/* Alias historique */
.font-display { font-family: 'Bricolage Grotesque', 'Inter', sans-serif; letter-spacing: -0.025em; }

/* Chiffres, durees, scores, timecodes : toujours en monospace.
   C'est fonctionnel (colonnes alignees), pas decoratif. */
.mono, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

/* Sur-titre de section : petit, espace, accentue */
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--acid);
}

/* Barre epaisse sous un titre : la signature editoriale du systeme */
.rule::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--acid);
  margin-top: 14px;
}

/* ---------- Surfaces ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--lift);
}
.card-hover {
  transition: border-color var(--base), background-color var(--base),
              transform var(--base), box-shadow var(--base);
}
.card-hover:hover {
  border-color: var(--line-mid);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: var(--lift-hi);
}

/* Encart accentue, sans glow : juste un liseré a gauche */
.note {
  border-left: 3px solid var(--acid);
  background: var(--surface);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 15px 18px;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--base), border-color var(--base),
              color var(--base), transform var(--fast), box-shadow var(--base);
  white-space: nowrap;
}
/* Leger enfoncement au clic : rend l'interface tactile plutot que figee */
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--acid);
  color: var(--on-acid);
  border-color: var(--acid);
}
.btn-primary:hover {
  background: var(--acid-soft);
  border-color: var(--acid-soft);
  box-shadow: var(--lift);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-mid);
}
.btn-ghost:hover { border-color: var(--acid); color: var(--acid); background: var(--surface); }

.btn-quiet {
  background: transparent;
  color: var(--ink-2);
  border-color: transparent;
}
.btn-quiet:hover { color: var(--ink); background: var(--surface-2); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(255, 68, 56, 0.28);
}
.btn-danger:hover { background: var(--danger-wash); border-color: rgba(255, 68, 56, 0.45); }

.btn[disabled], .btn:disabled { opacity: 0.5; pointer-events: none; }

/* ---------- Formulaires ---------- */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 13px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--base), background-color var(--base),
              box-shadow var(--base);
}
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
  border-color: var(--line-mid);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--acid);
  background: var(--surface-2);
  /* Anneau tres discret : guide l'oeil sans crier */
  box-shadow: 0 0 0 3px var(--acid-wash);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); }

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

input[type="range"] {
  accent-color: var(--acid);
  width: 100%;
}

/* Focus visible au clavier, sans halo mou */
:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 2px;
}

/* ---------- Etiquettes ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
}
.tag-acid { color: var(--acid); border-color: rgba(200,255,0,0.35); background: var(--acid-wash); }
.tag-warn { color: var(--warn); border-color: rgba(255,184,0,0.35); background: var(--warn-wash); }
.tag-danger { color: var(--danger); border-color: rgba(255,68,56,0.35); background: var(--danger-wash); }

/* Pastille d'etat */
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}
.dot-live { background: var(--acid); }
.dot-off  { background: var(--ink-faint); }
.dot-rec  { background: var(--danger); }

/* ---------- Messages ---------- */

.msg {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13.5px;
  line-height: 1.5;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border: 1px solid;
}
.msg svg { flex-shrink: 0; margin-top: 2px; }
.msg-ok    { background: var(--acid-wash);   border-color: rgba(200,255,0,0.30); color: var(--acid); }
.msg-error { background: var(--danger-wash); border-color: rgba(255,68,56,0.30); color: #ff8f87; }
.msg-warn  { background: var(--warn-wash);   border-color: rgba(255,184,0,0.30); color: var(--warn); }

/* ---------- Navigation laterale ---------- */

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--base), background-color var(--base);
}
.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav-item.active { color: var(--ink); background: var(--surface-2); }
/* Le repere actif grandit depuis le centre plutot que d'apparaitre d'un coup */
.nav-item::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--acid);
  border-radius: 0 2px 2px 0;
  transform: translateY(-50%);
  transition: height var(--base);
}
.nav-item.active::before { height: 60%; }
.nav-item.active .nav-icon { color: var(--acid); }
.nav-icon {
  width: 16px; height: 16px;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: color var(--base), transform var(--base);
}
.nav-item:hover .nav-icon { color: var(--ink); }
.nav-item:active .nav-icon { transform: scale(0.92); }

/* ---------- Barre de defilement ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--r-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--line-loud); }

/* ---------- Utilitaires ---------- */

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

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: 'JetBrains Mono', monospace;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}

/* Marque, utilisee sur toutes les pages */
.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Bricolage Grotesque', 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.brand .mark { color: var(--acid); }

/* Page autonome centree (auth, erreurs) */
.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.shell-inner { width: 100%; max-width: 380px; }

/* ============================================================
   Mouvement
   Trois usages seulement : l'arrivee d'une page, l'apparition
   d'une section au defilement, et le retour d'une action.
   Rien qui bouge en boucle ou sans raison.
   ============================================================ */

/* Arrivee de page : le contenu monte legerement en s'affichant */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.enter { animation: rise 500ms var(--ease) both; }
/* Decalage en cascade pour une liste d'elements */
.enter-1 { animation: rise 500ms var(--ease) both;  animation-delay:  60ms; }
.enter-2 { animation: rise 500ms var(--ease) both;  animation-delay: 120ms; }
.enter-3 { animation: rise 500ms var(--ease) both;  animation-delay: 180ms; }
.enter-4 { animation: rise 500ms var(--ease) both;  animation-delay: 240ms; }

/* Apparition au defilement : pilotee par IntersectionObserver.
   Sans JS, l'element reste visible : jamais de contenu invisible. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--slow), transform var(--slow);
}
.reveal.seen { opacity: 1; transform: none; }

/* Retour d'action : pulsation unique sur un element qui vient de changer */
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.pop { animation: pop 320ms var(--ease); }

/* Chargement : barre indeterminee, plus discrete qu'un spinner */
@keyframes sweep {
  from { transform: translateX(-100%); }
  to   { transform: translateX(300%); }
}
.loading-bar {
  position: relative; height: 2px; overflow: hidden;
  background: var(--line); border-radius: 2px;
}
.loading-bar::after {
  content: ''; position: absolute; inset: 0;
  width: 33%; background: var(--acid);
  animation: sweep 1.1s var(--ease) infinite;
}

/* Toute animation est desactivable : preference systeme respectee */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
