/* ============================================================
   Partenar IA — partenaria.net
   Design system dérivé du brand book interne.
   Aucune requête externe : pas de police distante, pas de CDN.
   ============================================================ */

:root {
  /* Palette brand book */
  --bg:        #0B1020;   /* Bleu nuit */
  --surface:   #121A33;   /* Fond de carte, dérivé */
  --surface-2: #0E1528;
  --text:      #F5F7FA;   /* Blanc cassé */
  --muted:     #9AA5B8;   /* Texte secondaire — éclairci pour le contraste */
  --slate:     #5B6475;   /* Gris ardoise : filets et bordures uniquement */
  --border:    #253052;
  --cyan:      #35D0FF;   /* Accent primaire : CTA, liens, éléments actifs */
  --mint:      #7AF0C0;   /* Gains chiffrés, validations */
  /* --violet: #8A6CFF  réservé à la console agence, non utilisé ici */
  --todo:      #FFB86B;   /* Marqueur d'élément à compléter — hors charte */

  --font: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system,
          "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --measure: 68ch;
  --radius: 14px;
  --section-y: clamp(3.5rem, 9vw, 6.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.05rem, 1.2rem + 3.6vw, 3.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 1.15rem + 1.9vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1.02rem + 0.5vw, 1.4rem); }
p  { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

strong { font-weight: 700; color: var(--text); }
em { font-style: italic; color: var(--muted); }

/* ---------- Utilitaires ---------- */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { max-width: 780px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--cyan); color: var(--bg);
  padding: .8rem 1.2rem; font-weight: 700; z-index: 200;
}
.skip:focus { left: 1rem; top: 1rem; }

.rule {
  width: 62px; height: 4px; background: var(--cyan);
  border-radius: 2px; margin-bottom: 1.6rem;
}

.eyebrow {
  font-size: .82rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: .9rem;
}

.muted { color: var(--muted); }
.lead { font-size: clamp(1.06rem, 1rem + 0.4vw, 1.25rem); color: var(--muted); }

/* Marqueur d'élément à compléter avant mise en ligne */
.todo {
  color: var(--todo);
  border: 1px dashed var(--todo);
  border-radius: 5px;
  padding: 0 .38em;
  font-size: .93em;
  white-space: nowrap;
}

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 16, 32, .88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand .baseline {
  display: none; color: var(--muted); font-size: .84rem;
  padding-left: .8rem; border-left: 1px solid var(--border);
}
@media (min-width: 1000px) { .brand .baseline { display: block; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  background: var(--cyan);
  color: #0B1020;              /* jamais de blanc sur cyan */
  font-weight: 700;
  font-size: 1rem;
  padding: .95rem 1.5rem;
  border-radius: 10px;
  text-decoration: none;
  border: 2px solid var(--cyan);
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: #7BE0FF; border-color: #7BE0FF; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .6rem 1.05rem; font-size: .92rem; }
.btn-note { display: block; margin-top: .85rem; color: var(--muted); font-size: .93rem; max-width: 48ch; }

/* ---------- Sections ---------- */
section { padding-block: var(--section-y); }
section + section { border-top: 1px solid var(--border); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem); }
.hero h1 { max-width: 19ch; }
.hero .lead { max-width: 58ch; margin-bottom: 2.1rem; }

/* Deux colonnes : le discours à gauche, le pré-audit à droite.
   Une seule colonne par défaut — l'empilement mobile est l'état de base,
   les deux colonnes n'apparaissent qu'à partir de 900px. */
.hero-grille { display: grid; gap: clamp(2.5rem, 5vw, 3.5rem); align-items: start; }

/* Le cadre du pré-audit. L'app est servie depuis app.partenaria.net, notre
   propre infrastructure : c'est la seule origine externe autorisée par le CSP. */
.hero-app-cadre {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color-scheme: dark;
}
.hero-app-note {
  display: block; margin-top: .85rem;
  color: var(--muted); font-size: .93rem; max-width: 48ch;
}

@media (min-width: 900px) {
  .hero-grille { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
  /* En demi-largeur, les plafonds de lecture d'origine étrangleraient la colonne. */
  .hero-grille h1 { max-width: 15ch; }
  .hero-grille .lead { max-width: none; }
}

/* ---------- Bandeau de réassurance ---------- */
.trust {
  background: var(--surface-2);
  border-block: 1px solid var(--border);
  padding-block: 1.15rem;
}
.trust ul {
  list-style: none; margin: 0; padding: 0; max-width: none;
  display: flex; flex-wrap: wrap; gap: .6rem 2.2rem;
  justify-content: center; text-align: center;
}
.trust li {
  display: flex; align-items: center; gap: .5rem;
  font-size: .93rem; font-weight: 600; color: var(--text);
}
.trust svg { flex: none; width: 17px; height: 17px; color: var(--mint); }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 1.15rem; }
/* 3 colonnes seulement quand chaque carte garde une mesure lisible */
@media (min-width: 980px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 680px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}
.card h3 { margin-bottom: .55rem; }
.card p, .card ul { max-width: none; }
.card :last-child { margin-bottom: 0; }
.card .tag {
  display: inline-block; margin-top: 1rem; font-size: .84rem;
  color: var(--muted); border-top: 1px solid var(--border);
  padding-top: .8rem; width: 100%;
}
.card .num {
  display: block; font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: .55rem;
}

/* Liste à puces sobres */
.ticks { list-style: none; padding: 0; }
.ticks li { position: relative; padding-left: 1.5rem; margin-bottom: .55rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
}
.ticks.mint li::before { background: var(--mint); }

/* Liste "ce que nous ne faisons pas" */
.nots { list-style: none; padding: 0; max-width: var(--measure); }
.nots li {
  border-left: 3px solid var(--slate);
  padding: .15rem 0 .15rem 1.15rem;
  margin-bottom: 1.35rem;
}
.nots li:last-child { border-left-color: var(--cyan); }

/* ---------- Pré-audit express ---------- */
.pa { margin-top: 2.2rem; }

.pa-champ {
  display: grid; gap: .5rem;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem; max-width: var(--measure);
}
.pa-champ label { font-weight: 600; font-size: .98rem; }
.pa-champ input {
  font: inherit; font-size: 1.1rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: .75rem .9rem; width: 8.5rem;
  font-variant-numeric: tabular-nums;
}
.pa-champ input::placeholder { color: var(--slate); }
.pa-champ input:focus-visible { border-color: var(--cyan); }
@media (min-width: 620px) {
  .pa-champ { grid-template-columns: 1fr auto auto; align-items: center; gap: .5rem .9rem; }
  .pa-champ label { grid-column: 1 / -1; }
}
.pa-unite { color: var(--muted); font-size: .95rem; }

.pa-erreur {
  color: var(--todo); border-left: 3px solid var(--todo);
  padding-left: .9rem; max-width: var(--measure);
}

.pa-resultat {
  margin-top: 2.6rem; padding-top: 2.2rem;
  border-top: 1px solid var(--border);
}
.pa-resultat:focus { outline: none; }

.pa-nombre {
  font-size: clamp(2rem, 1.4rem + 2.8vw, 3.2rem);
  line-height: 1.1; font-weight: 700; letter-spacing: -0.03em;
  color: var(--mint); margin: 0 0 .5rem;
}
.pa-equivalent { font-size: 1.1rem; color: var(--text); max-width: 44ch; }

.pa-details { margin: 1.6rem 0; border-top: 1px solid var(--border); }
.pa-details summary {
  cursor: pointer; padding: .9rem 0; font-weight: 600;
  font-size: .95rem; color: var(--cyan);
}
.pa-details p { font-size: .95rem; color: var(--muted); margin-bottom: .6rem; }
.pa-details .pa-prudence {
  font-style: italic; border-left: 2px solid var(--border);
  padding-left: .9rem; margin-top: 1rem;
}

.pa-avertissement {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.3rem;
  margin-bottom: 1.8rem; max-width: var(--measure); font-size: .97rem;
}

/* ---------- Tableaux ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table {
  width: 100%; border-collapse: collapse; margin: 0 0 .5rem;
  font-size: .96rem; min-width: 540px;
}
caption { text-align: left; color: var(--muted); font-size: .92rem; padding-bottom: .9rem; }
th, td { text-align: left; padding: .95rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); border-bottom-color: var(--slate);
}
tbody tr:last-child td { border-bottom: none; }
td strong { color: var(--text); }
.num-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Étapes ---------- */
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 1.6rem; }
@media (min-width: 700px)  { .steps { grid-template-columns: repeat(2, 1fr); gap: 1.8rem 1.6rem; } }
@media (min-width: 1020px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 1.3rem; } }
.steps li { counter-increment: s; padding-top: 1.1rem; border-top: 2px solid var(--border); }
.steps li::before {
  content: counter(s); display: block; font-size: .82rem; font-weight: 700;
  color: var(--cyan); margin-bottom: .5rem; letter-spacing: .08em;
}
.steps h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.steps p { font-size: .95rem; color: var(--muted); margin: 0; max-width: none; }

/* ---------- Observations (preuve) ---------- */
.obs { display: grid; gap: 1rem; }
@media (min-width: 760px) { .obs { grid-template-columns: repeat(2, 1fr); } }
.obs li {
  list-style: none; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--cyan); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.35rem;
}
.obs li p { margin: 0; font-size: .97rem; max-width: none; }
.obs li p:first-child { font-weight: 700; margin-bottom: .3rem; }
.obs li p:last-child { color: var(--muted); }

/* ---------- Qui livre ---------- */
.author { display: grid; gap: 1.8rem; align-items: start; }
@media (min-width: 760px) { .author { grid-template-columns: 190px 1fr; } }
.avatar {
  aspect-ratio: 1; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--slate);
  display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: .86rem; padding: 1rem;
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--border); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.15rem 2.5rem 1.15rem 0;
  font-weight: 700; font-size: 1.03rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: .5rem; top: 1.55rem;
  width: 10px; height: 10px; border-right: 2px solid var(--cyan);
  border-bottom: 2px solid var(--cyan); transform: rotate(45deg);
  transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.75rem; }
.faq details p { margin: 0 0 1.15rem; color: var(--muted); }

/* ---------- CTA final ---------- */
.final { background: var(--surface-2); }
.final h2 { max-width: 22ch; }
.final .ticks { margin-bottom: 1.9rem; }

/* ---------- Pied de page ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.6rem 2rem;
  font-size: .92rem; color: var(--muted);
}
.site-footer .cols { display: grid; gap: 1.8rem; margin-bottom: 2rem; }
@media (min-width: 720px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text); margin-bottom: .9rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--cyan); }
.site-footer img { height: 26px; width: auto; margin-bottom: .9rem; }
.site-footer .legal {
  border-top: 1px solid var(--border); padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* ---------- Contenu de page interne (légal) ---------- */
.doc { padding-block: clamp(2.5rem, 6vw, 4rem) var(--section-y); }
.doc h2 { margin-top: 2.6rem; }
.doc h3 { margin-top: 1.9rem; }
.doc ul { margin-bottom: 1.2rem; }
.doc li { margin-bottom: .45rem; }
.notice {
  background: var(--surface); border: 1px solid var(--todo);
  border-left-width: 4px; border-radius: var(--radius);
  padding: 1.2rem 1.35rem; margin-bottom: 2rem;
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--todo); }

/* ---------- Impression ---------- */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .final, .btn { display: none; }
  a { color: #000; }
}
