/*
 * StockSys — page de téléchargement publique.
 * Charte « Comptoir clair » : IBM Plex Sans, clair par défaut, sombre via prefers-color-scheme.
 * Fluide (clamp) du téléphone (360px) au grand écran (1920px), sans jamais dépasser un
 * gabarit de lecture confortable. Voir docs/spec.md et la direction visuelle (memory).
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

:root {
  --bg: #eef0f3;
  --ground: #f4f6f9;
  --surface: #fff;
  --border: #d9dde3;
  --border-soft: #e6e9ed;
  --text: #1a1d21;
  --text-2: #3b424c;
  --muted: #5c6470;
  --accent: #2f6fd6;
  --accent-strong: #1f54ad;
  --accent-text: #1f54ad;
  --accent-bg: #e4ebf7;
  --button-primary: #2f6fd6;
  --button-primary-text: #fff;
  --logo-in: #2f6fd6;
  --logo-out: #1a1d21;
  --dark-band-bg: #1a1d21;
  --dark-band-text: #fff;
  --dark-band-muted: #aeb5c1;
  --dark-band-border: #3b424c;

  --container-max: 1280px;
  --side-pad: clamp(20px, 5vw, 80px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --ground: #181c22;
    --surface: #1c2027;
    --border: #2a2f38;
    --border-soft: #262b34;
    --text: #e8eaee;
    --text-2: #aeb5c1;
    --muted: #8b93a1;
    --accent: #6b8dff;
    --accent-strong: #1a41b8;
    --accent-text: #a9bcff;
    --accent-bg: #1f2a44;
    --button-primary: #2657e6;
    --button-primary-text: #fff;
    --logo-in: #6b8dff;
    --logo-out: #e8eaee;
    --dark-band-bg: #0e1013;
    --dark-band-text: #e8eaee;
    --dark-band-muted: #8b93a1;
    --dark-band-border: #2a2f38;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent-text);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--text);
  padding: 0.75em 1em;
  z-index: 20;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--side-pad);
}

.eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.section-title {
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 8px;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 62ch;
}

/* En-tête */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand svg {
  flex: none;
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 9px;
}

/* Menu : bouton accessible (aria-expanded), replié en téléphone/tablette, à plat en bureau (min-width: 900px). */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-toggle {
  list-style: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--accent-bg);
}

.main-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  font-size: 1rem;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 8px var(--side-pad) 16px;
  box-shadow: 0 12px 24px rgba(26, 29, 33, 0.12);
}

.main-nav.is-open {
  display: flex;
}

.main-nav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 12px 4px;
  min-height: 44px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.main-nav a:last-child {
  border-bottom: 0;
}

.main-nav a:hover {
  color: var(--accent-text);
}

.main-nav .nav-cta {
  margin-top: 8px;
  justify-content: center;
}

/* le bouton garde ses couleurs et son padding face à la règle générique des liens du menu */
.main-nav a.nav-cta,
.main-nav a.nav-cta:hover {
  color: var(--button-primary-text);
  text-decoration: none;
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .main-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: static;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 8px 28px;
  }

  .main-nav a {
    border-bottom: 0;
    padding: 4px 2px;
    min-height: auto;
  }

  .main-nav a:hover {
    text-decoration: underline;
  }

  .main-nav .nav-cta {
    margin-top: 0;
    margin-left: 8px;
  }

  .main-nav a.nav-cta {
    padding: 10px 18px;
    min-height: 40px;
  }
}

/* Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  line-height: 1.2;
}

.btn-primary {
  background: var(--button-primary);
  color: var(--button-primary-text);
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-secondary-dark {
  background: transparent;
  color: var(--dark-band-text);
  border-color: var(--dark-band-border);
}

.btn-secondary-dark:hover {
  border-color: var(--dark-band-muted);
}

/* Hero */

.hero {
  padding: 40px 0 0;
  background: var(--ground);
  border-bottom: 1px solid var(--border-soft);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.1rem, 1.55rem + 2.6vw, 4.25rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 18ch;
}

.hero .lead {
  font-size: clamp(1.05rem, 0.98rem + 0.3vw, 1.3rem);
  color: var(--text-2);
  max-width: 62ch;
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  width: 100%;
  max-width: 420px;
}

.hero-actions .btn {
  flex: 1 1 auto;
}

/* bureau : les deux boutons côte à côte, comme la maquette A */
@media (min-width: 768px) {
  .hero-actions {
    max-width: none;
    width: auto;
    flex-wrap: nowrap;
  }

  .hero-actions .btn {
    flex: 0 0 auto;
    padding: 15px 28px;
    font-size: 1.05rem;
  }
}

/* Téléphone : encart « installer sur mon PC » (le logiciel ne s'installe que sur Windows) */
.send-panel {
  width: 100%;
  max-width: 520px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.send-panel-title {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.send-panel-text,
.send-panel-status {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
}

.send-panel-status:empty {
  display: none;
}

.send-panel-url {
  margin: 0;
  overflow-wrap: anywhere;
}

.send-panel-url code {
  font-size: 0.9rem;
}

.send-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-reassurance {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.app-window {
  margin-top: 16px;
  width: 100%;
  max-width: 1120px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(26, 29, 33, 0.14);
}

.app-window-bar {
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.app-window-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-window img {
  display: block;
  width: 100%;
  height: auto;
}

/* Bandeau de faits */

.facts {
  padding: 32px 0;
  border-bottom: 1px solid var(--border-soft);
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.fact-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

.fact p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (min-width: 640px) {
  .facts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .facts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Sections génériques */

section {
  padding: clamp(40px, 6vw, 96px) 0;
  border-top: 1px solid var(--border-soft);
}

.hero + .facts {
  border-top: 0;
}

/* Fonctions (rangées alternées) */

.feature-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 8vw, 100px);
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}

.feature-row-text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-row-text h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.2rem + 1.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.feature-row-text > p {
  margin: 0;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 56ch;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.98rem;
  color: var(--text-2);
}

.check-list li {
  padding-left: 1.6em;
  position: relative;
}

.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-text);
  font-weight: 700;
}

.feature-row-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

@media (min-width: 768px) {
  .feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 64px;
  }

  .feature-row--reverse .feature-row-text {
    order: 2;
  }

  .feature-row--reverse .feature-row-media {
    order: 1;
  }
}

/* Éditions */

.editions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.edition {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(20px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edition--highlight {
  border: 2px solid var(--accent);
}

.edition-badge {
  align-self: flex-start;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: 99px;
}

.edition h3 {
  margin: 0;
  font-size: 1.3rem;
}

.edition .edition-for {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.edition ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--text-2);
  font-size: 0.95rem;
  flex: 1;
}

.edition ul li {
  margin-bottom: 4px;
}

.edition-price {
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

@media (min-width: 640px) {
  .editions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .editions {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Comment ça marche */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-number {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-text);
}

.steps h3 {
  margin: 0;
  font-size: 1.1rem;
}

.steps p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

/* Configuration requise */

.req-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-2);
}

.req-list li {
  margin-bottom: 4px;
}

/* FAQ */

.faq-list {
  border-top: 1px solid var(--border-soft);
}

.faq-list details {
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 0;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--accent-text);
  font-weight: 700;
}

.faq-list details[open] summary::before {
  content: "\2212";
}

.faq-list p {
  margin: 10px 0 0 1.2em;
  color: var(--text-2);
  max-width: 62ch;
}

/* Bandeau sombre d'appel à l'action */

.cta-band {
  background: var(--dark-band-bg);
  color: var(--dark-band-text);
  border-top: 0;
}

.cta-band-inner {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.cta-band-text h2 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);
  letter-spacing: -0.01em;
}

.cta-band-text p {
  margin: 0;
  color: var(--dark-band-muted);
}

.cta-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (min-width: 768px) {
  .cta-band-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Pied de page */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

.site-footer a {
  color: var(--text-2);
}

/* ── Achat en ligne et page de retour (étape 6) ─────────────────────────── */
/* `hidden` doit l'emporter sur les `display` des classes (.btn, .order-key) que merci.js masque et révèle. */
[hidden] {
  display: none !important;
}

.buy-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.buy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: 600;
  color: var(--text-2);
}

.buy-field input,
.buy-field select {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-height: 44px;
}

.buy-choice {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-right: 18px;
  font-weight: 400;
  color: var(--text);
  min-height: 44px;
}

.buy-error {
  margin: 0;
  color: #b3261e;
}

.order-status {
  max-width: 560px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.order-key {
  display: block;
  margin: 12px 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--accent-text);
  word-break: break-all;
}
