/* Page publique d'Eddwa (eddwa.veridisgo.com) et politique de confidentialité.
   Couleurs : les jetons de docs/04-DESIGN-SYSTEM.md, recopiés de app/lib/ui/theme/couleurs.dart
   (tools/tests/test_publier.py vérifie la recopie). Polices du système, aucune ressource externe. */

:root {
  color-scheme: light dark;
  --fond: #F5F7F4;
  --surface: #FFFFFF;
  --surface-alt: #EDF1EC;
  --contour: #D5DCD6;
  --contour-fort: #76847C;
  --texte: #111B16;
  --texte-doux: #4E5B54;
  --primaire: #0B6B45;
  --primaire-doux: #D7F0E2;
  --sur-primaire-doux: #073B27;
  --curseur-veridis: #1E5945;
  --garde-fond: #0B6B45;
  --garde-texte: #FFFFFF;
  --garde-texte-doux: #CBEBDB;
  --garde-appel: #FFFFFF;
  --garde-sur-appel: #0B6B45;

  --police: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-arabe: "Noto Sans Arabic", "Noto Naskh Arabic", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --police-chiffres: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0D1210;
    --surface: #161D19;
    --surface-alt: #1E2722;
    --contour: #2C3731;
    --contour-fort: #718078;
    --texte: #E7EDE9;
    --texte-doux: #B7C4BC;
    --primaire: #6DC196;
    --primaire-doux: #043D26;
    --sur-primaire-doux: #BDF0D5;
    --curseur-veridis: #3FA37C;
    --garde-fond: #0B3A27;
    --garde-texte: #E7EDE9;
    --garde-texte-doux: #A8D9BF;
    --garde-appel: #6DC196;
    --garde-sur-appel: #00210F;
  }
}

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

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

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  /* À 200 % ou sur un écran étroit, un mot trop long se coupe plutôt que de déborder. */
  overflow-wrap: break-word;
}

:lang(ar) {
  font-family: var(--police-arabe);
}

body:lang(ar) {
  /* L'arabe paraît plus petit au même corps : +2 px et un interligne plus ample (04, « Typographie »). */
  font-size: 1.125rem;
  line-height: 1.67;
}

::selection {
  background: var(--primaire-doux);
  color: var(--sur-primaire-doux);
}

a {
  color: var(--primaire);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--texte);
  outline-offset: 2px;
}

.page {
  max-width: 40rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* --- En-tête ------------------------------------------------------------------------------ */

.entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 4.5rem;
}

.logotype {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3rem;
  color: var(--texte);
  text-decoration: none;
  /* « Eddwa » reste en latin et de gauche à droite, même dans la page arabe (04, « Logotype »). */
  direction: ltr;
  font-family: var(--police);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.5rem;
}

.logotype img {
  width: 2rem;
  height: 2rem;
}

.pastille {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding-inline: 1rem;
  border: 1px solid var(--contour-fort);
  border-radius: 999px;
  color: var(--primaire);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.pastille:lang(ar) { font-size: 1rem; }

/* --- Le panneau : la réponse, comme sur l'accueil de l'app (04, « Panneau ») ------------------- */

.panneau {
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: var(--garde-fond);
  color: var(--garde-texte);
}

.panneau :focus-visible { outline-color: var(--garde-texte); }

.statut {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--garde-texte-doux);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.statut:lang(ar) { font-size: 1rem; line-height: 1.625rem; }

.statut svg {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
}

h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1:lang(ar) {
  letter-spacing: 0;
  line-height: 1.4;
}

.chapo {
  margin: 0.75rem 0 0;
  max-width: 34em;
  color: var(--garde-texte-doux);
}

.telecharger {
  /* L'icône est dans la ligne : quand le libellé passe sur deux lignes, elle reste collée au premier mot. */
  display: block;
  min-height: 3.75rem;
  margin-top: 1.5rem;
  padding: 1.125rem 1rem;
  border-radius: 1rem;
  background: var(--garde-appel);
  color: var(--garde-sur-appel);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.5rem;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  transition: background-color 120ms ease-out, transform 80ms ease-out;
}

.telecharger:lang(ar) { font-size: 1.1875rem; line-height: 1.75rem; }

.telecharger svg {
  width: 1.375rem;
  height: 1.375rem;
  margin-inline-end: 0.5rem;
  vertical-align: -0.3125rem;
  fill: currentColor;
}

.telecharger:hover {
  background: color-mix(in srgb, var(--garde-appel) 92%, var(--garde-sur-appel));
}

.telecharger:active { transform: scale(0.98); }

.fiche-apk {
  margin: 0.75rem 0 0;
  color: var(--garde-texte-doux);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.fiche-apk:lang(ar) { font-size: 1rem; line-height: 1.625rem; }

.fiche-apk span, .insecable { white-space: nowrap; }

.iphone {
  margin: 0.25rem 0 0;
  color: var(--garde-texte-doux);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.iphone:lang(ar) { font-size: 1rem; line-height: 1.625rem; }

.ordinateur { display: none; }

@media (min-width: 64rem) and (hover: hover) and (pointer: fine) {
  .ordinateur {
    display: block;
    margin: 0.25rem 0 0;
    color: var(--garde-texte-doux);
    font-size: 0.875rem;
  }
}

/* --- Ligne d'information (04, « LigneInfo ») ------------------------------------------------- */

.info {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding-inline: 1rem;
  color: var(--texte-doux);
}

.info svg {
  width: 1.25rem;
  height: 1.5rem;
  fill: currentColor;
}

.info p { margin: 0; }

/* --- Sections -------------------------------------------------------------------------------- */

section { margin-top: 2.5rem; }

h2 {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.75rem;
}

h2:lang(ar) { font-size: 1.5rem; line-height: 2.125rem; }

/* Groupe de lignes (04, « GroupeLignes ») : filets en retrait de 16 au début seulement. */
.groupe {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--contour);
  border-radius: 1.25rem;
  background: var(--surface);
  overflow: hidden;
}

.groupe > li {
  position: relative;
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 1rem;
}

.groupe > li + li::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 1rem 0;
  height: 1px;
  background: var(--contour);
}

.groupe svg {
  width: 1.25rem;
  height: 1.5rem;
  fill: var(--primaire);
}

.groupe p { margin: 0; color: var(--texte-doux); }

.groupe strong {
  display: block;
  color: var(--texte);
  font-weight: 600;
}

/* Étapes d'installation : le numéro dit l'ordre. */
.etapes { counter-reset: etape; }

.etapes > li {
  counter-increment: etape;
  grid-template-columns: 2rem minmax(0, 1fr);
}

.etapes > li::after {
  content: counter(etape);
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primaire-doux);
  color: var(--sur-primaire-doux);
  font-weight: 600;
  line-height: 1;
}

.etapes > li > p {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  color: var(--texte);
}

.note {
  margin: 0.75rem 0 0;
  padding-inline: 1rem;
  color: var(--texte-doux);
}

.empreinte {
  display: block;
  margin: 0.75rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: var(--surface-alt);
  color: var(--texte);
  font-family: var(--police-chiffres);
  font-size: 0.875rem;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}

section > p { margin: 0; }
section > p + p { margin-top: 0.75rem; }

/* --- Pied de page et signature (04, « Signature Veridis Go ») -------------------------------- */

.pied {
  margin-top: 3rem;
  padding-block: 1.5rem 2.5rem;
  border-top: 1px solid var(--contour);
}

.liens {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* En bloc en ligne, pas en flex : le libellé et l'adresse (isolée dans un <bdi> en arabe) coulent comme un
   seul texte ; le remplissage donne la cible de 48. */
.liens a {
  display: inline-block;
  padding-block: 0.75rem;
}

.signature {
  display: flex;
  justify-content: center;
  margin: 2rem 0 0;
}

.signature a {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.25em 0.3em;
  padding: 0.75rem 1rem;
  color: var(--texte-doux);
  font-size: 0.8125rem;
  line-height: 1.5rem;
  text-decoration: none;
}

.signature a:lang(ar) { font-size: 0.9375rem; }

/* Le logo a la hauteur des capitales du texte voisin, jamais moins de 12 ; il s'assoit sur la ligne
   de base comme un mot (ses lettres finissent à 100/107 de sa hauteur). */
.veridis {
  --hauteur: max(12px, 0.714em);
  height: var(--hauteur);
  width: auto;
  vertical-align: calc(var(--hauteur) * -7 / 107);
  overflow: visible;
}

.veridis .lettres { fill: currentColor; }
.veridis .curseur { fill: var(--curseur-veridis); }

/* --- Politique de confidentialité ------------------------------------------------------------ */

.politique h1 {
  font-size: clamp(1.625rem, 1.4rem + 1vw, 2rem);
}

.politique .date {
  margin: 0.5rem 0 0;
  color: var(--texte-doux);
}

.politique section { margin-top: 2rem; }

.politique h2 { font-size: 1.25rem; line-height: 1.75rem; }

.politique h2:lang(ar) { font-size: 1.375rem; line-height: 2rem; }

.politique p, .politique li { max-width: 65ch; }

.politique ul { margin: 0.5rem 0 0; padding-inline-start: 1.25rem; }

.politique li + li { margin-top: 0.375rem; }

.langue-ar {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--contour);
}

/* Écran étroit ou zoom à 200 % sur un téléphone (moins de 320 px CSS) : les marges rendent la place
   au texte. */
@media (max-width: 20rem) {
  h1, h2, p, li, .telecharger { hyphens: auto; }
  /* Une adresse ou un nom de fichier ne prend jamais de trait d'union qui n'existe pas. */
  a[href^="mailto:"], [translate="no"] { hyphens: manual; }
  .page { padding-inline: 0.75rem; }
  .panneau { padding: 1rem; }
  .info, .note { padding-inline: 0; }
  .groupe > li { padding: 0.75rem; gap: 0.5rem; }
  .groupe > li + li::before { inset-inline-start: 0.75rem; }
  .empreinte { padding-inline: 0.75rem; }
  h1 { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .telecharger { transition: none; }
  .telecharger:active { transform: none; }
}
