:root {
  --mist: #eef2f6;
  --paper: #ffffff;
  --ink: #12233b;
  --slate: #4d6078;
  --line: #cfd8e3;
  --cobalt: #2747f0;
  --cobalt-ink: #ffffff;
  --amber: #e9a23b;
  --amber-soft: #fdf1dc;
  --ok: #1e8a5a;
  --danger: #b3312b;
  --radius: 10px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--mist); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.6;
}
a { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* En-tête */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; gap: 16px; }
.mark { font-weight: 800; font-size: 1.7rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: baseline; gap: 2px; }
.mark::after { content: ""; width: 0.28em; height: 0.78em; background: var(--cobalt); display: inline-block; margin-left: 3px; transform: translateY(0.08em); }
.mark small { font-size: 0.78rem; font-weight: 500; letter-spacing: 0; color: var(--slate); margin-left: 10px; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a.plain { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a.plain:hover { text-decoration: underline; }

/* Boutons */
.btn { display: inline-block; font: inherit; font-weight: 700; padding: 12px 22px; border-radius: var(--radius); border: 2px solid var(--cobalt); background: var(--cobalt); color: var(--cobalt-ink); text-decoration: none; cursor: pointer; }
.btn:hover { background: #1c37c4; border-color: #1c37c4; }
.btn.ghost { background: transparent; color: var(--cobalt); }
.btn.ghost:hover { background: rgba(39, 71, 240, 0.08); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* Accueil : héros */
.hero { display: grid; gap: 40px; padding: 28px 0 56px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 56px; padding-top: 48px; } }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.8rem); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 20px; }
.lead { font-size: 1.15rem; color: var(--slate); max-width: 34em; margin: 0 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* La démonstration : une tâche qui s'arrête pour demander l'accord */
.task { margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 1px 0 var(--line); }
.task-ask { margin: 0 0 16px; font-weight: 600; }
.task-steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.task-steps li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.task-steps .state { color: var(--ok); font-weight: 700; white-space: nowrap; }
.task-steps .wait .state { color: #8a5a0a; }
.approve { margin-top: 16px; background: var(--amber-soft); border: 2px solid var(--amber); border-radius: var(--radius); padding: 14px 16px; }
.approve p { margin: 0 0 10px; font-weight: 600; }
.approve .row { display: flex; gap: 10px; }
.fake { display: inline-block; padding: 8px 16px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; border: 2px solid var(--ink); }
.fake.yes { background: var(--ink); color: #fff; }
.done-line { margin: 14px 0 0; font-weight: 700; color: var(--ok); }
.task figcaption { margin-top: 14px; font-size: 0.85rem; color: var(--slate); }

@media (prefers-reduced-motion: no-preference) {
  .task .seq { opacity: 0; animation: show 0.5s ease forwards; }
  .task .s1 { animation-delay: 0.5s; }
  .task .s2 { animation-delay: 1.3s; }
  .task .s3 { animation-delay: 2.1s; }
  .task .s4 { animation-delay: 2.9s; }
  .task .s5 { animation-delay: 5.2s; }
  .task .fake.yes { animation: press 0.6s ease 4.6s both; }
  @keyframes show { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @keyframes press { 0% { transform: none; } 50% { transform: scale(0.94); } 100% { transform: none; } }
}

/* Sections de texte */
.block { padding: 56px 0; border-top: 1px solid var(--line); }
.block h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -0.025em; line-height: 1.12; margin: 0 0 26px; max-width: 18em; }
.pairs { margin: 0; padding: 0; }
.pairs > div { display: grid; gap: 4px 32px; padding: 16px 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .pairs > div { grid-template-columns: 1fr 1.2fr; } }
.pairs dt { font-weight: 700; }
.pairs dd { margin: 0; color: var(--slate); }
.prose p { max-width: 38em; margin: 0 0 16px; color: var(--slate); font-size: 1.05rem; }
.prose p strong { color: var(--ink); }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 22px; margin-bottom: 22px; }
.price .amount { font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; }
.price .per { color: var(--slate); font-size: 1.05rem; }
.fine { font-size: 0.9rem; color: var(--slate); max-width: 40em; margin-top: 14px; }
.foot { padding: 34px 0 48px; border-top: 1px solid var(--line); color: var(--slate); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { color: var(--slate); }

/* Connexion */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 28px; max-width: 480px; margin: 40px auto; }
.card h1 { font-size: 1.8rem; margin-bottom: 8px; }
label { display: block; font-weight: 700; margin: 18px 0 6px; }
input[type="password"], input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 11px 13px;
}
input:focus, textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(39, 71, 240, 0.2); }
.msg { margin: 14px 0 0; padding: 10px 13px; border-radius: var(--radius); font-size: 0.95rem; }
.msg.err { background: #fbe9e7; color: var(--danger); border: 1px solid #efc2bd; }
.msg.ok { background: #e4f4ec; color: #14573a; border: 1px solid #b6e0cb; }
.msg.info { background: var(--amber-soft); color: #6b4608; border: 1px solid var(--amber); }
.muted { color: var(--slate); }

/* Espace Neo */
.app { display: grid; gap: 20px; padding-bottom: 40px; }
@media (min-width: 900px) { .app { grid-template-columns: 1fr 320px; align-items: start; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel h2 { font-size: 1.05rem; margin: 0 0 10px; letter-spacing: -0.01em; }
.chat { display: flex; flex-direction: column; min-height: 62vh; max-height: 78vh; }
.thread { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 12px; }
.turn { max-width: 86%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 3px; }
.turn.neo { align-self: flex-start; background: var(--mist); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.empty { margin: auto; text-align: center; color: var(--slate); max-width: 28em; padding: 20px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.chip { font: inherit; font-weight: 700; font-size: 0.9rem; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
.chip:hover { background: var(--ink); color: #fff; }
.composer { display: flex; gap: 10px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; }
.composer textarea { resize: none; min-height: 46px; max-height: 160px; }
.status { min-height: 1.4em; font-size: 0.9rem; color: var(--slate); margin-top: 8px; }
.meter { height: 8px; background: var(--mist); border-radius: 99px; overflow: hidden; margin: 8px 0; border: 1px solid var(--line); }
.meter > i { display: block; height: 100%; background: var(--cobalt); width: 0; }
.apps { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.apps li { padding: 4px 10px; border-radius: 99px; background: #e4f4ec; color: #14573a; font-size: 0.85rem; font-weight: 600; }
.side { display: grid; gap: 20px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--cobalt); text-decoration: underline; cursor: pointer; }
.hidden { display: none !important; }
