/* pages.css — les pages hors accueil : documentation, pages juridiques, 404,
   bienvenue après l'achat, gestion de l'abonnement.
   Même charte que l'accueil (tokens.css) ; pas de scène 3D derrière. */

.page { position: relative; z-index: 1; min-height: 72vh; padding-top: clamp(112px, 12vw, 148px); }

/* ---------------------------------------------------------------- Texte long
   Le corps des articles et des pages juridiques. */
.prose { color: var(--fg-3); font-size: 16.5px; line-height: 1.7; }
/* Le texte arrive par fetch (legal.js) : tant que l'article est vide, il garde
   une hauteur d'écran, et le pied de page ne saute pas quand il se remplit. */
.prose[data-legal]:empty { min-height: 100vh; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.2em 0 .6em; font: 600 clamp(22px, 1.2vw + 16px, 27px)/1.2 var(--display); letter-spacing: -.01em; color: var(--fg); scroll-margin-top: 100px; }
.prose h3 { margin: 1.8em 0 .4em; font: 600 17px/1.35 var(--sans); color: var(--fg); scroll-margin-top: 100px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--fg-5); }
.prose strong, .prose b { color: var(--fg-2); font-weight: 600; }
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--fg); }
.prose kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; background: #1C1C1E; box-shadow: inset 0 -1px 0 rgba(0,0,0,.5), 0 0 0 1px var(--line-2); font: 600 12.5px/1.6 var(--mono); color: var(--fg-2); text-align: center; }
.prose code { padding: 1px 5px; border-radius: 5px; background: #16161A; font: 500 .9em/1 var(--mono); color: var(--fg-2); }
.prose .table-scroll { overflow-x: auto; margin: 0 0 1.2em; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; box-shadow: inset 0 -1px 0 var(--line); vertical-align: top; }
.prose th { color: var(--fg-2); font-weight: 600; background: #0E0E11; }
.prose tr:last-child td { box-shadow: none; }
/* `.prose .note` : l'encadré d'un article, pas la mention en mono de l'accueil. */
.prose .note { margin: 1.2em 0; padding: 14px 16px; border-radius: 12px; background: #101014; box-shadow: inset 0 0 0 1px var(--line-2); font: 400 15.5px/1.6 var(--sans); letter-spacing: 0; color: var(--fg-3); }
.prose .note > strong { display: block; margin-bottom: 4px; color: var(--fg); }
.prose .note p { margin: 0; }
.prose .note.caution { box-shadow: inset 3px 0 0 var(--red), inset 0 0 0 1px var(--line-2); }
.prose .step-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.2em 0; }
.prose .step-overview a { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: #101014; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--fg); font-weight: 600; }
.prose .step-overview span { font: 500 12px/1 var(--mono); color: var(--fg-5); }
.prose .quick-links { display: grid; gap: 8px; margin: 1.2em 0; }
.prose .quick-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #101014; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; }
/* Ce qui reste à compléter ou à valider avant la mise en ligne. */
.prose mark.todo { padding: 1px 5px; border-radius: 5px; background: rgba(241,106,93,.14); box-shadow: inset 0 0 0 1px rgba(241,106,93,.45); color: #FFB4AB; font-weight: 500; }

/* ---------------------------------------------------------------- Pages juridiques */
.legal-head { max-width: 760px; margin: 0 0 clamp(36px, 5vw, 56px); }
.legal-layout { display: grid; grid-template-columns: 230px minmax(0, 720px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.legal-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 120px); overflow-y: auto; }
.legal-toc a { padding: 6px 10px; border-radius: 8px; font-size: 13.5px; line-height: 1.35; color: var(--fg-4); text-decoration: none; transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.legal-toc a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { display: none; }
}

/* ---------------------------------------------------------------- Documentation
   Les rubriques à gauche, l'article au centre, son sommaire à droite. */
.docs-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.docs-bar .eyebrow { margin: 0 auto 0 0; }
.docs-search {
  display: inline-flex; align-items: center; gap: 10px; min-width: 260px; height: 40px; padding: 0 8px 0 12px;
  border: 0; border-radius: 11px; cursor: pointer; background: #111114; box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 14px/1 var(--sans); color: var(--fg-4); transition: box-shadow 200ms var(--ease);
}
.docs-search:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.docs-search svg { width: 16px; height: 16px; }
.docs-search kbd { margin-left: auto; padding: 4px 6px; border-radius: 6px; background: #1C1C1E; font: 600 11px/1 var(--mono); color: var(--fg-4); }
.docs-topics { display: none; height: 40px; padding: 0 14px; border: 0; border-radius: 11px; cursor: pointer; background: none; box-shadow: inset 0 0 0 1px var(--line-2); font: 500 14px/1 var(--sans); color: var(--fg); }

.docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.docs-side { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-bottom: 24px; }
.docs-side .docs-home { display: block; margin-bottom: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--fg-2); text-decoration: none; }
.docs-side .docs-home.on, .docs-side .docs-home:hover { background: rgba(255,255,255,.06); color: var(--fg); }
.docs-side details { margin-bottom: 4px; }
.docs-side summary { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; cursor: pointer; list-style: none; font: 500 11.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); }
.docs-side summary::-webkit-details-marker { display: none; }
.docs-side summary::after { content: "›"; font-size: 14px; transform: rotate(90deg); transition: transform 200ms var(--ease); }
.docs-side details:not([open]) summary::after { transform: none; }
.docs-side summary:hover { color: var(--fg-2); }
.docs-side details a { display: block; padding: 6px 10px 6px 18px; border-radius: 8px; font-size: 14px; line-height: 1.35; color: var(--fg-3); text-decoration: none; }
.docs-side details a:hover { color: var(--fg); background: rgba(255,255,255,.04); }
.docs-side details a[aria-current] { color: var(--fg); background: rgba(255,255,255,.08); }

.docs-main { min-width: 0; outline: none; }
/* Rempli par docs.js après le pied de page : vide, il garde une hauteur d'écran. */
.docs-main:empty { min-height: 100vh; }
.docs-title { margin: 0; font: 600 clamp(32px, 2.6vw + 18px, 48px)/1.08 var(--display); letter-spacing: -.02em; color: var(--fg); text-wrap: balance; }
.docs-lead { margin: 14px 0 0; max-width: 36em; font-size: clamp(17px, .4vw + 15px, 19px); line-height: 1.55; color: var(--fg-3); }
.docs-crumb { display: flex; gap: 8px; margin: 0 0 14px; font: 500 12px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-5); }
.docs-crumb a { color: var(--fg-4); text-decoration: none; }
.docs-crumb a:hover { color: var(--fg); }
.docs-meta { margin: 12px 0 0; font: 500 12.5px/1 var(--mono); color: var(--fg-5); }
.docs-article .docs-lead { margin-bottom: 1em; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 3em; }
.docs-pager a { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: 14px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); text-decoration: none; font-weight: 600; transition: box-shadow 200ms var(--ease); }
.docs-pager a:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.docs-pager a.next { text-align: right; }
.docs-pager small { font: 500 12px/1 var(--mono); color: var(--fg-5); }

.docs-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.docs-toc-label { margin: 0 0 8px; padding: 0 10px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-5); }
.docs-toc a { padding: 5px 10px; border-radius: 7px; font-size: 13px; line-height: 1.35; color: var(--fg-4); text-decoration: none; box-shadow: inset 2px 0 0 transparent; transition: color 200ms var(--ease), box-shadow 200ms var(--ease); }
.docs-toc a:hover { color: var(--fg-2); }
.docs-toc a.on { color: var(--fg); box-shadow: inset 2px 0 0 var(--fg); }

/* L'accueil de la documentation. */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 36px; }
.docs-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; text-decoration: none; color: var(--fg-3); font-size: 14.5px; line-height: 1.5; }
.docs-card .n { font: 500 12px/1 var(--mono); color: var(--fg-5); }
.docs-card b { font: 600 20px/1.2 var(--display); color: var(--fg); }
.docs-card em { margin-top: auto; padding-top: 6px; font-style: normal; font-weight: 600; color: var(--fg-2); }
.docs-h2 { margin: 48px 0 14px; font: 600 24px/1.2 var(--display); color: var(--fg); }
.docs-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.docs-links a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: box-shadow 200ms var(--ease); }
.docs-links a:hover { box-shadow: inset 0 0 0 1px var(--line-3); }
.docs-links b { color: var(--fg); }
.docs-links span { font-size: 14px; color: var(--fg-4); }

/* La recherche (⌘K). */
.docs-find { width: min(620px, calc(100vw - 32px)); margin-top: 12vh; }
.docs-find-in { padding: 14px; }
.docs-find input {
  width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 12px; background: #0B0B0D;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--fg); font: 400 16px/1 var(--sans); outline: none;
}
.docs-find input:focus { box-shadow: inset 0 0 0 1px var(--fg-3); }
.docs-find-status { margin: 12px 4px 6px; font: 500 12px/1 var(--mono); color: var(--fg-5); }
.docs-find-results { display: grid; gap: 2px; max-height: 52vh; overflow-y: auto; }
.docs-find-results a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; text-decoration: none; outline: none; }
.docs-find-results a:hover, .docs-find-results a:focus { background: rgba(255,255,255,.06); }
.docs-find-results small { font: 500 11px/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-5); }
.docs-find-results b { color: var(--fg); font-weight: 600; }
.docs-find-results span { font-size: 13.5px; color: var(--fg-4); }
.docs-empty { padding: 12px; color: var(--fg-4); }

@media (max-width: 1100px) {
  .docs-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-topics { display: inline-block; }
  .docs-search { min-width: 0; }
  .docs-search span, .docs-search kbd { display: none; }
  .docs-side { display: none; position: static; max-height: none; padding: 12px; border-radius: 14px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); }
  .docs-layout.menu-open .docs-side { display: block; }
  .docs-links, .docs-pager { grid-template-columns: 1fr; }
  .prose .step-overview { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- 404 */
.missing { display: grid; place-items: center; text-align: center; min-height: 80vh; padding-bottom: 60px; }
.missing .wrap { position: relative; }
.missing-art { width: 120px; height: 120px; margin: 0 auto 28px; opacity: .9; }
.missing .lead { margin-left: auto; margin-right: auto; }
.missing .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }

/* ---------------------------------------------------------------- Bienvenue
   Le retour de Stripe (js/welcome.js) : l'attente, puis l'app à télécharger. */
.welcome { display: grid; place-items: center; text-align: center; min-height: 80vh; padding-bottom: 60px; }
.welcome .wrap { max-width: 680px; }
.welcome-art { width: 96px; height: 96px; margin: 0 auto 28px; opacity: .9; }
.welcome .lead { margin-left: auto; margin-right: auto; }
.welcome .lead b { color: var(--fg); font-weight: 600; }
.welcome .cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.welcome .note { margin-top: 18px; }
/* L'attente : un anneau qui tourne — seulement une transformation. */
.welcome .wait { display: block; width: 28px; height: 28px; margin: 30px auto 0; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-2); border-top: 2px solid var(--fg-2); animation: wait 900ms linear infinite; }
@keyframes wait { to { transform: rotate(360deg); } }
/* Se connecter dans l'app : un filet, pas de fond. */
.welcome-signin { max-width: 520px; margin: 36px auto 0; padding: 20px 22px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; }
.welcome-signin h2 { margin: 0 0 12px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-4); }
.welcome-signin ol { display: grid; gap: 8px; margin: 0; padding-left: 1.3em; font-size: 15.5px; line-height: 1.5; color: var(--fg-3); }
.welcome-signin li::marker { color: var(--fg-5); }
.welcome-signin b { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.welcome-signin .warn { margin: 14px 0 0; padding-top: 12px; box-shadow: inset 0 1px 0 var(--line); font-size: 14px; line-height: 1.5; color: var(--fg-4); }
.welcome-signin .warn b { color: var(--fg-2); }

/* ---------------------------------------------------------------- Abonnement
   Gérer son abonnement sans l'app (js/account.js) : l'adresse, le code qui
   la prouve, puis le portail de Stripe. */
.account { display: grid; place-items: center; text-align: center; min-height: 80vh; padding-bottom: 60px; }
.account .wrap { max-width: 580px; }
.account .lead { margin-left: auto; margin-right: auto; }
.account-panel { margin: 36px auto 0; padding: 26px 26px 22px; border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; }
.account-panel .form { margin-top: 0; }
.account-panel .btn { width: 100%; }
.account-panel .btn:disabled { opacity: .55; cursor: default; transform: none; }
.account-panel .fine { margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg-4); text-align: center; }
.account-panel .who { margin: 0; font-size: 15px; line-height: 1.5; color: var(--fg-3); }
.account-panel .who b { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.account-panel input.code { font: 600 26px/1 var(--mono); letter-spacing: .4em; text-align: center; padding-left: .4em; }
.account .note { margin-top: 20px; }
@media (max-width: 480px) { .account-panel { padding: 20px 18px 18px; } }
