/* Klyvio — Design tokens (Dark theme)
   Direction : dark SaaS premium, cohérent avec klyvio.fr
   Palette : bleu nuit profond + accent cyan signature + Outfit
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* ─── Fonds ─── */
  --bg:           #080F1A;   /* fond principal — bleu nuit profond */
  --bg2:          #0C1A2A;   /* cards, panels, formulaires */
  --bg3:          #0F2035;   /* éléments légèrement surélevés */

  /* ─── Accent cyan signature ─── */
  --accent:       #00AEEF;
  --accent-dark:  #0088CC;
  --accent-dim:   rgba(0, 174, 239, 0.08);
  --accent-glow:  rgba(0, 174, 239, 0.18);
  --border:       rgba(0, 174, 239, 0.15);
  --border-hover: rgba(0, 174, 239, 0.45);

  /* ─── Neutres ─── */
  --white:        #FFFFFF;
  --gray:         #93B5CE;   /* texte secondaire — bleu-gris */
  --gray-dim:     #2A3F55;   /* bordures inputs, séparateurs */
  --gray-deep:    #162330;   /* surfaces très sombres */

  /* ─── Sémantiques ─── */
  --success:      #22c55e;
  --success-dim:  rgba(34, 197, 94, 0.12);
  --warn:         #f59e0b;
  --warn-dim:     rgba(245, 158, 11, 0.12);
  --danger:       #ef4444;
  --danger-dim:   rgba(239, 68, 68, 0.12);

  /* ─── Aliases de compatibilité (remplacent l'ancien système) ─── */
  --ink-950:      #080F1A;
  --ink-900:      #0C1A2A;
  --ink-800:      #0F2035;
  --ink-700:      #162330;
  --ink-600:      #1E3347;
  --ink-500:      #2A3F55;
  --ink-400:      #3D5A75;
  --ink-300:      #7A9BB8;
  --ink-200:      #9BB8D0;
  --ink-150:      rgba(0, 174, 239, 0.12);
  --ink-100:      rgba(0, 174, 239, 0.08);
  --ink-75:       rgba(0, 174, 239, 0.05);
  --ink-50:       rgba(255, 255, 255, 0.03);
  --ink-0:        #FFFFFF;

  --accent-50:    rgba(0, 174, 239, 0.08);
  --accent-100:   rgba(0, 174, 239, 0.15);
  --accent-200:   rgba(0, 174, 239, 0.25);
  --accent-300:   #5DD4F8;
  --accent-400:   #29C0F5;
  --accent-500:   #00AEEF;
  --accent-600:   #0088CC;
  --accent-700:   #006699;
  --accent-800:   #004466;

  --success-50:   rgba(34, 197, 94, 0.12);
  --success-500:  #22c55e;
  --success-600:  #16a34a;
  --warn-50:      rgba(245, 158, 11, 0.12);
  --warn-500:     #f59e0b;
  --warn-600:     #d97706;
  --danger-50:    rgba(239, 68, 68, 0.12);
  --danger-500:   #ef4444;
  --danger-600:   #dc2626;

  --viz-indigo:   #818cf8;
  --viz-teal:     #2ee0b0;
  --viz-amber:    #f5b547;
  --viz-rose:     #f472b6;
  --viz-violet:   #a78bfa;
  --viz-lime:     #a3e635;
  --viz-sky:      #38bdf8;
  --viz-slate:    #94a3b8;

  /* ─── Typographie ─── */
  --font-sans:    'Outfit', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* ─── Radii ─── */
  --r-xs:   6px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-2xl:  24px;
  --r-pill: 999px;

  /* ─── Ombres & glow ─── */
  --sh-xs:   0 1px 3px rgba(0, 0, 0, 0.4);
  --sh-sm:   0 2px 8px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.3);
  --sh-md:   0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --sh-lg:   0 24px 64px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.35);
  --sh-glow: 0 0 0 3px rgba(0, 174, 239, 0.25);
  --sh-card: 0 0 0 1px rgba(0, 174, 239, 0.05) inset,
             0 30px 80px rgba(0, 174, 239, 0.06);

  /* ─── Espacement (base 4px) ─── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;

  /* ─── Page ─── */
  --page-bg:     var(--bg);
  --surface:     var(--bg2);
  --surface-2:   var(--bg3);
  --text:        #FFFFFF;
  --text-soft:   var(--gray);
  --text-mute:   #6A8BA8;
  --border-col:  var(--border);   /* alias pour border */
}

/* ═══ Base reset ═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Dot grid fond signature */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(
    circle,
    rgba(0, 174, 239, 0.18) 1px,
    transparent 1px
  );
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 80%);
}

#root { position: relative; z-index: 1; }

button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--gray-dim);
}

/* ═══ Typographie ══════════════════════════════════════════════════ */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Eyebrow avec trait — signature Klyvio */
.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow-line::before {
  content: "";
  display: block;
  width: 22px;
  height: 1px;
  background: var(--accent);
  flex-shrink: 0;
}

.mono { font-family: var(--font-mono); }

/* ═══ Boutons ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--sh-glow); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 174, 239, 0.35);
}

.btn-accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 174, 239, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: var(--gray-dim);
}
.btn-ghost:hover {
  background: var(--ink-75);
  border-color: var(--gray);
}

.btn-subtle {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border);
}
.btn-subtle:hover {
  background: var(--accent-100);
  border-color: var(--accent);
}

.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--r-sm); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r-xs); }

/* ═══ Cards ════════════════════════════════════════════════════════ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover {
  border-color: var(--border-hover);
}

.card-flat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* Glow card — panels importants */
.card-glow {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow:
    0 30px 80px rgba(0, 174, 239, 0.08),
    0 0 0 1px rgba(0, 174, 239, 0.05) inset;
}

/* ═══ Chips / Badges ═══════════════════════════════════════════════ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border);
}
.chip-accent {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border);
}
.chip-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.25);
}
.chip-warn {
  background: var(--warn-dim);
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.25);
}
.chip-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

/* ═══ Formulaires ══════════════════════════════════════════════════ */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
}

.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--gray-dim);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--white);
  transition: all .15s;
}
.input::placeholder, .textarea::placeholder {
  color: var(--text-mute);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--sh-glow);
}

/* ═══ Progress bar ═════════════════════════════════════════════════ */
.progress {
  height: 4px;
  background: var(--gray-dim);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.2,.8,.2,1);
}

/* ═══ Divers ════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); width: 100%; }
.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

/* ═══ Scrollbar ════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: var(--gray-dim);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gray); }
::-webkit-scrollbar-track { background: transparent; }

/* ═══ Animations ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.fade-in { animation: fadeIn .4s cubic-bezier(.2,.8,.2,1) both; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}

/* ═══ Navigation ═══════════════════════════════════════════════════ */
header.app-header {
  background: rgba(8, 15, 26, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* ═══ Responsive ═══════════════════════════════════════════════════ */
html, body { overflow-x: hidden; max-width: 100vw; }
svg { max-width: 100%; }

@media (max-width: 1180px) {
  div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 960px) {
  main > div[style*="grid-template-columns: 1.2fr 1fr"],
  main > div[style*="grid-template-columns: 1.1fr 1fr"],
  div[style*="grid-template-columns: 1.3fr 1fr"],
  div[style*="grid-template-columns: 1.1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  section[style*="grid-template-columns: 1.1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
    padding: 40px 20px !important;
  }
  .app-nav { display: none !important; }
  [style*="padding: 56px 80px"] { padding: 32px 24px !important; }
  [style*="padding: 72px 28px 48px"] { padding: 40px 20px 28px !important; }
  [style*="padding: 64px 28px"]  { padding: 40px 20px !important; }
  [style*="padding: 80px 28px"]  { padding: 48px 20px !important; }
  [style*="padding: 40px 28px 80px"] { padding: 28px 16px 60px !important; }
  h1.display[style*="font-size: 72px"] { font-size: 44px !important; }
  h2.display[style*="font-size: 44px"] { font-size: 30px !important; }
  div.display[style*="font-size: 48px"] { font-size: 34px !important; }
  [style*="position: sticky"][style*="top: 120px"] { position: static !important; }
}

@media (max-width: 720px) {
  div[style*="grid-template-columns: repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  div[style*="grid-template-columns: repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  section[style*="grid-template-columns: 1.1fr 1fr"] > div:last-child:not(:first-child) {
    display: none;
  }
  div[style*="max-width: 1280px"][style*="display: flex"][style*="gap: 2px"] {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
  }
  h1.display[style*="font-size: 72px"] { font-size: 36px !important; line-height: 1.05 !important; }
  .btn-lg { padding: 12px 18px; font-size: 14px; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 520px) {
  .app-nav .nav-secondary { display: none !important; }
  header .chip { display: none; }
  header .btn-ghost { display: none; }
  header[style*="padding: 14px 28px"] { padding: 12px 14px !important; }
  .only-mobile { display: block !important; }
}

@media (min-width: 721px) {
  .only-mobile { display: none !important; }
}
