/* Onboarding Modem — noir & blanc, jetons façon shadcn. */

@font-face {
  font-family: "Sora";
  font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/assets/fonts/sora-latin.woff2") format("woff2");
}

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --fg: #0a0a0a;
  --fg-soft: #737373;
  --fg-faint: #a3a3a3;
  --field: #f1f0ef;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --ring: rgba(10, 10, 10, .12);
  --radius: 8px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --display: "Sora", var(--sans);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0a0a0a; --card: #0f0f0f; --fg: #fafafa; --fg-soft: #a3a3a3; --fg-faint: #6f6f6f;
  --field: #171717; --border: #262626; --border-strong: #333333; --ring: rgba(250, 250, 250, .18);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* l'attribut gagne toujours sur .cmd{display:flex} etc. */
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: calc(100dvh - 32px); }
.left { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24px 40px; }

/* bandeau prototype */
.demo-bar {
  width: 100%; padding: 7px 16px; text-align: center; font-size: 12px;
  color: var(--fg-soft); background: var(--card); border-bottom: 1px solid var(--border);
}
.demo-bar b { color: var(--fg); font-weight: 600; }
.demo-bar button {
  margin-left: 10px; font: inherit; font-size: 11.5px; padding: 1px 8px; cursor: pointer;
  background: transparent; color: var(--fg-soft); border: 1px solid var(--border-strong);
  border-radius: 999px;
}
.demo-bar button:hover { color: var(--fg); }

/* progression */
.rail { display: flex; align-items: center; gap: 6px; margin: 0 0 34px; }
.rail i {
  display: block; width: 26px; height: 3px; border-radius: 999px;
  background: var(--border-strong); transition: background .35s ease, width .35s ease;
}
.rail i.on { background: var(--fg); }
.rail i.now { width: 40px; }

/* écran */
main { width: 100%; max-width: 380px; }
.step { display: none; }
.step.live { display: block; animation: in .38s cubic-bezier(.22,.61,.36,1) both; }
.step.out { animation: out .22s ease both; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes out { to { opacity: 0; transform: translateY(-6px); } }

h1 { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 4px; }
.sub { color: var(--fg-soft); margin: 0 0 28px; }

label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.field { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; height: 38px; padding: 0 12px; font: inherit;
  background: var(--field); color: var(--fg);
  border: 1px solid transparent; border-radius: var(--radius); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: var(--fg-faint); }
input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px var(--ring); }
.hint { font-size: 12px; color: var(--fg-faint); margin-top: 6px; }
.err { font-size: 12.5px; color: var(--fg); margin: -10px 0 14px; display: none; }
.err.show { display: block; }
.err::before { content: "— "; color: var(--fg-faint); }

button.primary {
  width: 100%; height: 40px; margin-top: 8px; font: inherit; font-weight: 500;
  background: var(--fg); color: var(--bg); border: 0; border-radius: var(--radius); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s ease, transform .06s ease;
}
button.primary:hover { opacity: .88; }
button.primary:active { transform: scale(.995); }
button.primary[disabled] { opacity: .45; cursor: default; }
button.ghost {
  width: 100%; height: 36px; margin-top: 8px; font: inherit; font-size: 13px;
  background: transparent; color: var(--fg-soft); border: 0; cursor: pointer;
}
button.ghost:hover { color: var(--fg); }
.foot { text-align: center; color: var(--fg-soft); font-size: 13px; margin-top: 22px; }
.foot a { color: var(--fg); text-underline-offset: 2px; }
.foot code { font-family: var(--mono); font-size: 12px; }

/* liste de connexions */
.tool {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
}
.tool .ic { width: 20px; height: 20px; display: grid; place-items: center; color: var(--fg); }
.tool .txt { flex: 1; min-width: 0; }
.tool .n { display: block; font-weight: 500; }
.tool .d { display: block; font-size: 12.5px; color: var(--fg-soft); }
.tool button {
  font: inherit; font-size: 12.5px; height: 28px; padding: 0 12px; cursor: pointer;
  background: var(--fg); color: var(--bg); border: 0; border-radius: 999px;
}
.tool button:hover { opacity: .88; }
.tool[data-state="linked"] button { background: transparent; color: var(--fg-soft); cursor: default; }
.tool[data-state="linked"] { border-color: var(--border-strong); }
.tool .tick { display: none; }
.tool[data-state="linked"] .tick { display: block; }

/* propositions de nom */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 18px; }
.chips button {
  font: inherit; font-size: 12.5px; padding: 3px 10px; cursor: pointer;
  background: var(--card); color: var(--fg-soft);
  border: 1px solid var(--border); border-radius: 999px;
}
.chips button:hover { color: var(--fg); border-color: var(--border-strong); }

/* plans */
.plan {
  display: block; padding: 14px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.plan-head { display: flex; align-items: flex-start; gap: 12px; }
.plan:hover { border-color: var(--border-strong); }
.plan.sel { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.plan-head .dot {
  width: 15px; height: 15px; margin-top: 3px; border-radius: 999px;
  border: 1px solid var(--border-strong); position: relative; flex: none;
}
.plan.sel .plan-head .dot { border-color: var(--fg); }
.plan.sel .plan-head .dot::after {
  content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--fg);
  animation: pop .2s ease both;
}
@keyframes pop { from { transform: scale(.4); } to { transform: none; } }
.plan .n { display: block; font-weight: 500; }
.plan .d { display: block; font-size: 12.5px; color: var(--fg-soft); }
.plan .price { margin-left: auto; align-self: center; font-size: 13px; font-weight: 500; white-space: nowrap; }
/* Solo n'est pas encore vendable en réel : visible, mais en retrait. */
.plan.soon { opacity: .55; cursor: default; }
.plan.soon:hover { border-color: var(--border); }

.row { display: flex; gap: 10px; }
.row .field { flex: 1; }

/* attente */
.waiting { text-align: center; padding: 10px 0 4px; }
.spin {
  width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 999px;
  border: 2px solid var(--border-strong); border-top-color: var(--fg);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting .what { font-weight: 500; }
.waiting .log { font-size: 12.5px; color: var(--fg-soft); margin-top: 6px; min-height: 1.5em; }

/* succès */
.done { text-align: center; }
.seal {
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 999px;
  border: 1px solid var(--fg); display: grid; place-items: center;
  animation: seal .45s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes seal { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.seal svg path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: draw .5s ease .2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.cmd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 20px 0 4px; padding: 11px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--mono); font-size: 12.5px; text-align: left;
}
.cmd button { font: inherit; font-size: 11px; background: none; border: 0; color: var(--fg-soft); cursor: pointer; }
.cmd button:hover { color: var(--fg); }
/* mention sous le code de connexion : discrète, alignée sur la boîte */
.claim-note { font-size: 11.5px; color: var(--fg-faint); text-align: left; margin: 4px 2px 0; }
.claim-note button {
  font: inherit; padding: 0; background: none; border: 0; cursor: pointer;
  color: var(--fg-soft); text-decoration: underline; text-underline-offset: 2px;
}
.claim-note button:hover { color: var(--fg); }

/* illustration de pied de page */
.art { width: 100%; max-width: 620px; margin: 12px auto 0; padding: 0 20px 40px; opacity: .92; }
.art img, .art svg { width: 100%; height: auto; display: block; }
[data-theme="dark"] .art { filter: invert(1) brightness(.92); opacity: .7; }

/* ── connexion d'un outil : bouton → cercle → coche ──────────── */
.tool button.link { position: relative; overflow: hidden; width: 88px; transition: width .34s cubic-bezier(.22,1,.36,1), background .2s ease; }
.tool button.link .lbl { transition: opacity .16s ease; }
.tool button.link .ring, .tool button.link .tick { position: absolute; inset: 0; margin: auto; opacity: 0; }
.tool button.link .ring {
  width: 14px; height: 14px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
}
[data-theme="dark"] .tool button.link .ring { border-color: rgba(0,0,0,.3); border-top-color: #000; }
.tool[data-state="busy"] button.link { width: 28px; }
.tool[data-state="busy"] button.link .lbl { opacity: 0; }
.tool[data-state="busy"] button.link .ring { opacity: 1; animation: spin .7s linear infinite; }
.tool[data-state="linked"] button.link { width: 28px; background: transparent; color: var(--fg); border: 1px solid var(--border-strong); }
.tool[data-state="linked"] button.link .lbl { opacity: 0; }
.tool[data-state="linked"] button.link .tick { opacity: 1; }
.tool[data-state="linked"] button.link .tick path {
  stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .34s cubic-bezier(.22,1,.36,1) .06s forwards;
}
.tool[data-state="linked"] { animation: settle .34s cubic-bezier(.22,1,.36,1); }
@keyframes settle { 0% { transform: none; } 45% { transform: translateY(-2px); } 100% { transform: none; } }

/* ── paiement : conteneur qui morphe ─────────────────────────── */
.morph { overflow: hidden; transition: height .38s cubic-bezier(.22,1,.36,1); }
.cardbox { padding: 14px 0 2px; }
.cardbox .f { opacity: 0; transform: translateY(6px); filter: blur(2px); }
.cardbox:not([hidden]) .f { animation: rise .34s cubic-bezier(.22,1,.36,1) forwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }

.creditcard {
  position: relative; aspect-ratio: 1.586; width: 100%; margin: 4px 0 18px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--field);
  display: grid; grid-template-areas: "brand brand" "num num" "who til";
  align-content: space-between; padding: 16px 18px;
  opacity: 0; transform: translateY(8px) scale(.99); animation: rise .4s cubic-bezier(.22,1,.36,1) forwards;
}
.creditcard .brand { grid-area: brand; font-size: 11px; letter-spacing: .14em; color: var(--fg-soft); }
.creditcard .num { grid-area: num; font-family: var(--mono); font-size: 16px; letter-spacing: .06em; }
.creditcard .who { grid-area: who; font-size: 10.5px; letter-spacing: .1em; color: var(--fg-soft); align-self: end; }
.creditcard .til { grid-area: til; font-family: var(--mono); font-size: 11.5px; color: var(--fg-soft); text-align: right; align-self: end; }

/* ── bouton payer : idle → cercle → coche ────────────────────── */
button.pay { position: relative; overflow: hidden; display: flex; margin-left: auto; margin-right: auto; transition: width .42s cubic-bezier(.22,1,.36,1), border-radius .42s cubic-bezier(.22,1,.36,1); }
button.pay .lbl { transition: opacity .18s ease; }
button.pay .ring, button.pay .tick { position: absolute; inset: 0; margin: auto; opacity: 0; }
button.pay .ring { width: 16px; height: 16px; border-radius: 999px; border: 2px solid rgba(255,255,255,.32); border-top-color: #fff; }
[data-theme="dark"] button.pay .ring { border-color: rgba(0,0,0,.28); border-top-color: #000; }
button.pay.busy { width: 44px; border-radius: 999px; }
button.pay.busy .lbl { opacity: 0; }
button.pay.busy .ring { opacity: 1; animation: spin .7s linear infinite; }
button.pay.ok { width: 44px; border-radius: 999px; }
button.pay.ok .lbl, button.pay.ok .ring { opacity: 0; }
button.pay.ok .tick { opacity: 1; }
button.pay.ok .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .32s cubic-bezier(.22,1,.36,1) .08s forwards; }
.paywrap { display: flex; justify-content: center; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* second computer offert par le plan payant */
.extra { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); text-align: left; }
.extra .t { font-weight: 500; }
.extra .d { font-size: 12.5px; color: var(--fg-soft); margin: 2px 0 12px; }
.extra .line { display: flex; gap: 8px; }
.extra input { flex: 1; }
.extra button {
  height: 38px; padding: 0 14px; font: inherit; font-size: 13px; cursor: pointer;
  background: var(--fg); color: var(--bg); border: 0; border-radius: var(--radius);
}
.extra .later { background: transparent; color: var(--fg-soft); }
.extra .later:hover { color: var(--fg); }
.extra.done-extra { animation: rise .34s cubic-bezier(.22,1,.36,1) both; }

/* ── le terminal, et son écran qui s'allume ──────────────────── */
/* ── panneau de droite ───────────────────────────────────────── */
.right {
  position: relative; overflow: hidden; margin: 16px 16px 16px 0; border-radius: 20px;
  background: #0d0d0d; color: #f2f2f2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 40px 40px;
  background-image:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.06), transparent 60%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
}
.right .pitch {
  text-align: center; max-width: 30ch;
  min-height: 150px;                 /* 3 lignes de titre + 2 de sous-titre */
  display: flex; flex-direction: column; justify-content: flex-end;
}
.right h2 {
  font-family: var(--display); font-size: clamp(20px, 2.1vw, 27px); font-weight: 600;
  letter-spacing: -.025em; line-height: 1.2; margin: 0 0 10px;
}
.right .pitch p { margin: 0; color: rgba(242,242,242,.62); font-size: 14px; }
.right .pitch.swap { animation: pitch .42s cubic-bezier(.22,1,.36,1); }
@keyframes pitch { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } }

.stage { position: relative; width: 100%; max-width: 430px; margin-top: 46px; }

/* ── le terminal, héros du panneau ───────────────────────────── */
.term {
  position: relative; z-index: 2; display: flex; flex-direction: column;
  height: 348px; border-radius: 12px; overflow: hidden;
  background: #131313; border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 24px 48px -20px rgba(0,0,0,.8);
}
.term .bar {
  display: flex; align-items: center; gap: 5px; padding: 9px 12px; flex: none;
  border-bottom: 1px solid rgba(255,255,255,.08); font-size: 11px; color: rgba(242,242,242,.5);
}
.term .bar i { width: 7px; height: 7px; border-radius: 999px; background: rgba(255,255,255,.18); }
.term .bar span { margin-left: 6px; font-family: var(--mono); }
.term pre {
  margin: 0; padding: 14px 16px; flex: 1; overflow: hidden;
  font-family: var(--mono); font-size: 12px; line-height: 1.85;
  color: #e8e8e8; white-space: pre-wrap; word-break: break-all;
}
.term .p { color: rgba(242,242,242,.45); }
.term .c { color: rgba(242,242,242,.38); }
.term .g { color: #4ade80; }
.term .cur {
  display: inline-block; width: 7px; height: 13px; margin-left: 1px;
  background: #e8e8e8; vertical-align: -2px; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* cartes flottantes */
.chip, .badge, .meter {
  position: absolute; z-index: 3; pointer-events: none;
  opacity: 0; transform: translateY(8px) scale(.985); filter: blur(3px);
  /* sortie : nette et sans délai, pour laisser la place à la scène suivante */
  transition: opacity .2s ease, transform .2s ease, filter .2s ease;
  
}
.chip.show, .badge.show, .meter.show {
  opacity: 1; transform: none; filter: none;
  transition: opacity .5s cubic-bezier(.22,1,.36,1),
              transform .5s cubic-bezier(.22,1,.36,1),
              filter .5s cubic-bezier(.22,1,.36,1);
}
.chip {
  display: flex; align-items: center; gap: 9px; padding: 8px 13px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #f2f2f2; font-size: 12.5px; font-weight: 500;
  box-shadow: 0 12px 30px -18px rgba(0,0,0,.9);
}
.chip img { width: 15px; height: 15px; flex: none; object-fit: contain; border-radius: 3px; }
.chip img[src$="github.svg"], .chip img[src$="openai.svg"] { filter: invert(1) brightness(1.4); }
.chip em { font-style: normal; font-size: 11px; color: rgba(242,242,242,.45);
  min-width: 60px; text-align: right; transition: color .3s ease; }
.chip.ok em { color: #4ade80; }
.chip.ok { border-color: rgba(74, 222, 128, .45); background: rgba(74, 222, 128, .09); }
.chip { transition: background .35s ease, border-color .35s ease; }
.c1 { left: -5%; top: 56%;  }
.c2 { right: -6%; top: 70%;  }
.c3 { left: -3%; bottom: 5%;  }

.badge {
  padding: 5px 10px; border-radius: 999px; font-size: 11px; letter-spacing: .02em;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); color: rgba(242,242,242,.8);
}
.b1 { left: 2%; top: -38px; z-index: 1;  }
.b2 { right: 2%; top: -38px; z-index: 1;  }

.dots { display: flex; gap: 6px; margin-top: 44px; }
.dots i { width: 5px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.25); transition: background .3s ease; }
.dots i.on { background: #fff; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .right { margin: 0 12px 16px; padding: 30px 20px 26px; }
  .stage { max-width: 340px; }
  .chip, .badge, .meter { display: none; }
  .term { height: 300px; }
}

/* ── scène 4 : les heures actives ────────────────────────────── */
.meter {
  position: absolute; z-index: 3; right: -4%; top: -26px; width: 56%; padding: 13px 15px; border-radius: 14px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #f2f2f2; box-shadow: 0 18px 40px -22px rgba(0,0,0,.9);
}
.meter .row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.meter .row b { font-weight: 600; }
.meter .track { height: 5px; border-radius: 999px; background: rgba(255,255,255,.14); overflow: hidden; }
.meter .track i { display: block; height: 100%; width: 0; background: #f2f2f2; transition: width .8s cubic-bezier(.22,1,.36,1); }
.meter.show .track i { width: var(--w, 34%); }
.meter p { margin: 9px 0 0; font-size: 10.5px; color: rgba(242,242,242,.42); }

.c1.show { transition-delay: .10s !important; }
.c2.show { transition-delay: .18s !important; }
.c3.show { transition-delay: .26s !important; }
.b1.show { transition-delay: .30s !important; }
.b2.show { transition-delay: .38s !important; }
.meter.show { transition-delay: .12s !important; }

/* ── l'écran réagit quand on surligne du texte ────────────────
   L'héritage du tube : une couche de balayage qui scintille le
   temps d'une secousse, par-dessus le terminal. */
.term .flick {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 240, 205, .10) 0%, transparent 70%),
    repeating-linear-gradient(180deg, rgba(255, 236, 200, .07) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
.stage.flicker .term .flick { animation: flick .62s steps(1, end) both; }
@keyframes flick {
  0%   { opacity: 0; }
  8%   { opacity: .55; }
  16%  { opacity: .05; }
  26%  { opacity: .75; }
  38%  { opacity: .12; }
  52%  { opacity: .45; }
  68%  { opacity: .08; }
  84%  { opacity: .28; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .stage.flicker .term .flick { animation: none; } }

/* le surlignage garde la teinte du tube */
::selection { background: rgba(243, 201, 141, .32); }
.right ::selection { background: rgba(255, 226, 170, .28); color: #fff; }
