/* ============================================================
   AI CRM — site promo
   Charte issue de apple/AICRM/Core/DesignSystem/DesignTokens.swift
   Palette sombre de l'app ; les captures (claires) portent la couleur.
   ============================================================ */

:root {
  /* Surfaces (tokens dark de l'app) */
  --page: #0E0D16;
  --surface: #191826;
  --surface-2: #1F1E30;
  --line: #353248;

  /* Texte */
  --ink: #F8F7FF;
  --muted: #B4B0CC;
  --faint: #8A86A8;

  /* Accent principal — lavande */
  --lav: #8578FF;
  --lav-deep: #5B51E8;
  --lav-soft: #2A2545;

  /* Accents */
  --mint: #4BDCAF;
  --peach: #FFA45C;
  --rose: #F793AA;
  --violet: #AD85FF;
  --sky: #64B2F0;

  /* Rayons : deux rôles, deux rayons (règle de l'app) */
  --r-control: 14px;
  --r-card: 18px;

  --nav-h: 56px;
  --w: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--lav); color: #0E0D16; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav pilule flottante ---------- */
.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--nav-h);
  padding: 0 8px 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(25, 24, 38, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: box-shadow 0.3s, border-color 0.3s;
  white-space: nowrap;
}
.nav.scrolled {
  border-color: rgba(133, 120, 255, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.nav .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
  margin-right: 10px;
}
.brand-dot {
  width: 22px; height: 22px;
  border-radius: 7px; /* bubble(22) ≈ 7 */
  background: linear-gradient(135deg, var(--lav) 0%, var(--lav-deep) 100%);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #fff;
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.nav-links a.active { color: var(--ink); background: rgba(133, 120, 255, 0.16); }
.nav .cta {
  margin-left: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--page);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.2s, background 0.2s;
}
.nav .cta:hover { background: var(--lav); color: #fff; transform: scale(1.04); }

@media (max-width: 640px) {
  .nav { left: 12px; right: 12px; transform: none; justify-content: space-between; padding: 0 6px 0 14px; }
  .nav-links a { padding: 8px 9px; font-size: 13px; }
  .nav .brand span:last-child { display: none; }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--r-control);
  font-size: 15px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--lav);
  color: #fff;
  box-shadow: 0 6px 24px rgba(133, 120, 255, 0.35);
}
.btn-primary:hover { background: var(--lav-deep); transform: translateY(-2px); box-shadow: 0 10px 32px rgba(133, 120, 255, 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--lav); background: rgba(133, 120, 255, 0.08); transform: translateY(-2px); }
.btn-light { background: var(--ink); color: var(--page); }
.btn-light:hover { background: #fff; transform: translateY(-2px); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 90px) 0 60px;
  text-align: center;
}
.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 20% 10%, #1A1430 0%, transparent 70%),
    radial-gradient(700px 500px at 80% 20%, #14102A 0%, transparent 70%),
    radial-gradient(900px 600px at 50% 90%, rgba(133, 120, 255, 0.10) 0%, transparent 60%);
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 28px;
}
.badge .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--mint);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(75, 220, 175, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(75, 220, 175, 0); }
}
h1 {
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 820px;
  margin: 0 auto 24px;
  text-wrap: balance;
}
h2 { text-wrap: balance; }
h1 .grad {
  background: linear-gradient(100deg, var(--lav) 10%, var(--violet) 50%, var(--rose) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.sub {
  font-size: clamp(17px, 2.2vw, 20px);
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 70px; }

/* ---------- Cadres téléphone / emplacements images ---------- */
.img-slot {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(400px 300px at 30% 20%, rgba(133, 120, 255, 0.09), transparent),
    var(--surface);
  border: 1px dashed var(--line);
  display: grid;
  place-items: center;
}
.img-slot::before {
  content: attr(data-label);
  position: absolute;
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 0 20px;
}
.img-slot img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.phone {
  width: 100%;
  aspect-ratio: 402 / 820;
  border-radius: 44px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.phone .img-slot {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  border-style: solid;
}

.hero-phones {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 28px;
  max-width: 860px;
  margin: 0 auto;
  perspective: 1200px;
}
.hero-phones .phone { max-width: 260px; }
.hero-phones .phone:nth-child(1) { transform: rotateY(14deg) translateY(24px); }
.hero-phones .phone:nth-child(2) { max-width: 300px; z-index: 2; }
.hero-phones .phone:nth-child(3) { transform: rotateY(-14deg) translateY(24px); }
@media (max-width: 720px) {
  .hero-phones .phone:nth-child(1), .hero-phones .phone:nth-child(3) { display: none; }
}

/* ---------- Bandeau défilant ---------- */
.ticker {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  overflow: hidden;
  margin: 70px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ticker-track {
  display: flex;
  gap: 48px;
  width: max-content;
  animation: ticker 32s linear infinite;
}
.ticker span {
  font-size: 15px;
  font-weight: 700;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 48px;
  white-space: nowrap;
}
.ticker span::after { content: "✦"; color: var(--lav); font-size: 12px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
section { padding: 70px 0; }
.section-head { max-width: 620px; margin-bottom: 52px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lav);
  margin-bottom: 14px;
}
h2 {
  font-size: clamp(30px, 4.5vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.section-head p { color: var(--muted); font-size: 17px; }

/* ---------- Grille features ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--card-accent, var(--lav));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4);
}
.card .icon {
  width: 44px; height: 44px;
  border-radius: 14px; /* bubble(44) ≈ 14 */
  display: grid; place-items: center;
  font-size: 20px;
  margin-bottom: 18px;
  background: color-mix(in srgb, var(--card-accent, var(--lav)) 16%, transparent);
}
.card h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--muted); }
.card .img-slot { aspect-ratio: 16 / 10; border-radius: 12px; margin-top: 20px; }

.c-lav   { --card-accent: var(--lav); }
.c-mint  { --card-accent: var(--mint); }
.c-peach { --card-accent: var(--peach); }
.c-rose  { --card-accent: var(--rose); }
.c-violet{ --card-accent: var(--violet); }
.c-sky   { --card-accent: var(--sky); }

/* ---------- Grande capture ---------- */
.showcase .img-slot {
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

/* ---------- Galerie horizontale ---------- */
.gallery {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 10px 4px 30px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery .phone {
  flex: 0 0 240px;
  scroll-snap-align: center;
}
.gallery figcaption {
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--faint);
  margin-top: 14px;
}

/* ---------- Bloc CTA final ---------- */
.cta-block {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(500px 300px at 80% 0%, rgba(133, 120, 255, 0.22), transparent 70%),
    radial-gradient(400px 300px at 10% 100%, rgba(75, 220, 175, 0.10), transparent 70%),
    var(--surface);
  padding: clamp(40px, 7vw, 80px);
  text-align: center;
}
.cta-block h2 { max-width: 560px; margin: 0 auto 14px; }
.cta-block p { color: var(--muted); max-width: 460px; margin: 0 auto 32px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 60px;
  margin-top: 40px;
}
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.foot .links { display: flex; gap: 24px; }
.foot a { font-size: 14px; color: var(--muted); font-weight: 600; }
.foot a:hover { color: var(--ink); }
.foot .copy { font-size: 13px; color: var(--faint); }

/* ---------- Révélation au scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }
.reveal-d2 { transition-delay: 0.16s; }
.reveal-d3 { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ticker-track { animation: none; }
}

/* ============================================================
   DOCS
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  padding-top: calc(var(--nav-h) + 70px);
  min-height: 100vh;
}
@media (max-width: 800px) { .docs-layout { grid-template-columns: 1fr; gap: 20px; } }

.docs-side {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  align-self: start;
  padding-bottom: 40px;
}
@media (max-width: 800px) { .docs-side { position: static; } }

.docs-search {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 20px;
  outline: none;
  transition: border-color 0.2s;
}
.docs-search:focus { border-color: var(--lav); }
.docs-search::placeholder { color: var(--faint); }

.docs-side nav { display: flex; flex-direction: column; gap: 2px; }
.docs-side .side-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 18px 0 8px 12px;
}
.docs-side nav a {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.docs-side nav a:hover { color: var(--ink); background: var(--surface); }
.docs-side nav a.current { color: var(--lav); background: var(--lav-soft); }

.docs-main { max-width: 720px; padding-bottom: 100px; }
.doc-section { padding: 28px 0 20px; scroll-margin-top: calc(var(--nav-h) + 40px); }
.doc-section + .doc-section { border-top: 1px solid var(--line); }
.doc-section h2 { font-size: 28px; margin-bottom: 14px; }
.doc-section h3 { font-size: 17px; font-weight: 700; margin: 26px 0 10px; }
.doc-section p, .doc-section li { color: var(--muted); font-size: 15.5px; }
.doc-section ul, .doc-section ol { padding-left: 22px; margin: 10px 0; }
.doc-section li { margin: 6px 0; }
.doc-section strong { color: var(--ink); }
.doc-section code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 13.5px;
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  color: var(--rose);
}
.doc-note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--card-accent, var(--lav));
  border-radius: 12px;
  background: var(--surface);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 14.5px;
  color: var(--muted);
}
.doc-section .img-slot { aspect-ratio: 16 / 9; border-radius: 12px; margin: 18px 0; }
.doc-section.hidden { display: none; }

.docs-empty {
  display: none;
  color: var(--faint);
  padding: 40px 0;
  text-align: center;
}

/* ============================================================
   SHOP
   ============================================================ */
.shop-hero { padding: calc(var(--nav-h) + 80px) 0 20px; text-align: center; }

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-top: 50px;
}
@media (max-width: 860px) { .plans { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; } }

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 30px;
  text-align: left;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.plan:hover { transform: translateY(-5px); box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4); }
.plan.featured {
  border-color: var(--lav);
  background:
    radial-gradient(300px 200px at 50% 0%, rgba(133, 120, 255, 0.14), transparent 70%),
    var(--surface);
  box-shadow: 0 20px 60px rgba(91, 81, 232, 0.25);
}
.plan .tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--lav);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 5px 14px;
  border-radius: 999px;
}
.plan h3 { font-size: 19px; font-weight: 800; }
.plan .plan-desc { font-size: 14px; color: var(--muted); margin: 6px 0 22px; }
.plan .price { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.plan .price small { font-size: 15px; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.plan ul { list-style: none; margin: 24px 0 28px; flex: 1; }
.plan li {
  font-size: 14.5px;
  color: var(--muted);
  padding: 7px 0 7px 26px;
  position: relative;
}
.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--mint);
  font-weight: 800;
}
.plan li.off { color: var(--faint); text-decoration: line-through; }
.plan li.off::before { content: "—"; color: var(--faint); }
.plan .btn { width: 100%; justify-content: center; }

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq details[open] { border-color: var(--lav); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 700;
  font-size: 15.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--lav);
  transition: transform 0.25s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 22px 18px; color: var(--muted); font-size: 14.5px; }
