/* Design system Midnight Dawn, repris de l application pour que le site et
   l app se reconnaissent au premier coup d oeil.

   Aucune police distante : importer Google Fonts enverrait l adresse IP de
   chaque visiteur a Google, ce qui contredirait la page confidentialite. */

:root {
  --nuit: #070b1e;
  --nuit-bas: #101a3a;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-haute: rgba(255, 255, 255, 0.085);
  --bordure: rgba(255, 255, 255, 0.1);
  --or: #ffcd7b;
  --or-fonce: #e8b04b;
  --sarcelle: #55dcbb;
  --corail: #ff6b5a;
  --texte: #dae1ff;
  --texte-doux: #d3c4b0;
  --large: 1080px;
  --lisible: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--nuit);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* height: auto est indispensable des lors que les balises portent width et
   height : sans lui, la largeur est contrainte mais la hauteur reste figee a
   l attribut, et l image est etiree. */
img { max-width: 100%; height: auto; }
a { color: var(--or); }

/* --- Chrome commun ---------------------------------------------------- */

.barre {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 11, 30, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--bordure);
}

.barre .dedans {
  max-width: var(--large);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.marque { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.marque img { width: 34px; height: 34px; }
.marque .nom { font-size: 17px; font-weight: 700; letter-spacing: 3px; color: var(--or); }

.barre nav { margin-inline-start: auto; display: flex; gap: 22px; }
.barre nav a {
  color: var(--texte-doux);
  text-decoration: none;
  font-size: 14.5px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.barre nav a:hover { color: var(--or); border-bottom-color: var(--or); }

/* Lien de soutien : traite comme une action, pas comme une entree de menu. */
.barre nav a.soutien {
  border: 1px solid var(--or);
  border-radius: 999px;
  padding: 6px 16px;
  color: var(--or);
  font-weight: 600;
  transition: background .18s, color .18s;
}
.barre nav a.soutien:hover {
  background: var(--or);
  color: #422c00;
  border-color: var(--or);
}

.section { max-width: var(--large); margin: 0 auto; padding: 88px 24px; }
.section.serre { max-width: var(--lisible); }
.section + .section { padding-top: 0; }

.oeil {
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--or);
  margin: 0 0 14px;
  font-weight: 600;
}

h1 { font-size: clamp(34px, 6vw, 54px); line-height: 1.1; margin: 0 0 20px; letter-spacing: -1px; }
h2 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; margin: 0 0 18px; letter-spacing: -0.5px; }
h3 { font-size: 18px; margin: 0 0 8px; }

.chapo { font-size: clamp(17px, 2.2vw, 20px); color: var(--texte-doux); max-width: 620px; }

/* --- Accueil : hero ---------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--bordure);
}

.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -320px;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(245, 177, 76, 0.20), transparent 68%);
  pointer-events: none;
}

.hero .dedans {
  position: relative;
  max-width: var(--large);
  margin: 0 auto;
  padding: 96px 24px 104px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15.5px;
  transition: transform .16s, opacity .16s;
}
.bouton:hover { transform: translateY(-1px); }
.bouton.plein { background: linear-gradient(135deg, var(--or-fonce), #c68e2d); color: #422c00; }
.bouton.vide { border: 1px solid var(--or); color: var(--or); }

.sous-actions { margin-top: 16px; font-size: 14px; color: var(--texte-doux); opacity: .8; }

/* --- Badges des magasins ------------------------------------------------ */
/* Les deux fichiers viennent d Apple et de Google et ne sont pas retouches :
   les deux marques imposent leur artwork tel quel. On ne peut donc jouer que
   sur la taille d affichage.

   D ou les deux hauteurs differentes. Le PNG de Google porte une marge
   transparente dans l image, celui d Apple non : a hauteur egale, le bouton
   Google paraitrait plus petit. Le rapport de 1,5 fait paraitre les deux
   boutons de meme taille — ce qu Apple demande explicitement quand son badge
   voisine celui d un autre magasin. */

.appel {
  margin-top: 34px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--or);
}

.magasins {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
}

.magasins a { display: inline-flex; transition: transform .18s ease; }
.magasins a:hover { transform: translateY(-2px); }
.magasins img { display: block; width: auto; }

.badge-apple { height: 52px; }
.badge-google { height: 78px; }

/* --- Les deux preuves --------------------------------------------------- */
/* Deux photos nocturnes, cote a cote, sous les trois etapes. Elles disent en
   un regard ce que l application demande — et a quelle heure. */

/* Les deux photos sont au format d un telephone, 9:16. Laissees libres sur
   toute la largeur, elles occuperaient un ecran et demi de hauteur a elles
   seules. Les colonnes sont donc bornees et centrees. */
.preuves {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 300px));
  justify-content: center;
  gap: 26px;
  margin-top: 26px;
}

.preuves figure { margin: 0; }

.preuves img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--bordure);
}

.preuves figcaption {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 13px;
  font-size: 15px;
  color: var(--texte-doux);
}

.preuves .rang {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 205, 123, 0.45);
  color: var(--or);
  font-size: 13px;
  font-weight: 700;
}

/* --- Cadre de telephone ------------------------------------------------ */
/* Les images sont de vraies captures de l application, prises sur Android 16
   en 1080x2400. Le cadre n ajoute que la coque, jamais du contenu. */

.appareil {
  position: relative;
  width: 100%;
  max-width: 272px;
  margin: 0 auto;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(160deg, #333c66, #0b1024 55%, #262e4e);
  box-shadow:
    0 34px 78px rgba(0, 0, 0, .62),
    0 0 0 1px rgba(255, 255, 255, .07),
    inset 0 1px 0 rgba(255, 255, 255, .16);
}

.appareil img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 540 / 1200;
  border-radius: 32px;
  background: var(--nuit);
}

/* Halo chaud derriere l appareil du hero : rappelle le lever du jour.
   Il est porte par un conteneur, et non par .appareil : le pseudo-element
   est ainsi peint avant le cadre, qui garde ses contrastes intacts. */
.vitrine { position: relative; }

/* Le halo ne vaut que pour le hero : ailleurs il deborderait de la colonne
   et provoquerait un defilement horizontal sur la page entiere. */
.hero .vitrine::before {
  content: "";
  position: absolute;
  inset: -10% -20%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 205, 123, .20), transparent 70%);
  pointer-events: none;
}

/* --- Presentation ecran par ecran --------------------------------------- */
/* Un ecran, son explication, cote a cote ; le cote alterne d un bloc a l
   autre pour que le regard reparte de l autre bord en descendant. */

.duo {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 72px;
  align-items: center;
  padding: 72px 0;
}
.duo + .duo { border-top: 1px solid var(--bordure); }

/* Sur un bloc inverse, le texte passe devant l image dans l ordre visuel
   sans changer l ordre du document : la lecture reste correcte au clavier
   et pour un lecteur d ecran. */
.duo.inverse .dire { order: -1; }

.duo .oeil { margin-bottom: 10px; }
.duo h3 { font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25; margin: 0 0 16px; letter-spacing: -0.4px; }
.duo .dire p:not(.oeil) { color: var(--texte-doux); margin: 0 0 14px; max-width: 30em; }
.duo .dire p:last-child { margin-bottom: 0; }

/* Apparition au defilement, sans une ligne de JavaScript.
   L animation n est declaree que la ou le navigateur sait la piloter au
   defilement. Partout ailleurs — Firefox aujourd hui, un navigateur ancien,
   un script bloque — rien n est masque et la section s affiche normalement.
   Une animation qui echoue ne doit jamais rendre du contenu invisible. */
@keyframes apparait {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      animation: apparait linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 24%;
    }

    /* Une suite d elements qui montent l un apres l autre.
       animation-delay ne sert a rien ici : sur une timeline de defilement, le
       temps n avance pas tout seul, c est la page qui avance. Le decalage se
       fait donc sur la plage, pas sur le delai. */
    .reveal-suite > * {
      animation: apparait linear both;
      animation-timeline: view();
      animation-range: entry 4% cover 26%;
    }
    .reveal-suite > :nth-child(2) { animation-range: entry 9% cover 31%; }
    .reveal-suite > :nth-child(3) { animation-range: entry 14% cover 36%; }
    .reveal-suite > :nth-child(4) { animation-range: entry 19% cover 41%; }

    /* Le halo du hero derive lentement pendant toute la descente.
       scroll() et non view() : ce qui compte n est pas l entree d un element
       dans l ecran, mais l avancee de la page entiere. */
    .hero .vitrine::before {
      animation: halo-derive linear both;
      animation-timeline: scroll();
    }
  }
}

@keyframes halo-derive {
  from { transform: translateY(-4%) scale(1); opacity: .95; }
  to   { transform: translateY(10%) scale(1.12); opacity: .55; }
}

/* Fondu entre les pages du site : index, aide, confidentialite, conditions.
   Une seule regle, aucun script. Les navigateurs qui l ignorent naviguent
   comme avant, d un coup — rien ne casse. */
@view-transition { navigation: auto; }

/* Depliage des questions de la FAQ.
   Elles s ouvraient d un coup sec. interpolate-size autorise l animation vers
   une hauteur « auto », que le CSS ne savait pas interpoler jusqu ici. Sous
   @supports : la ou ce n est pas compris, l ouverture reste instantanee, ce
   qui a toujours ete le comportement. */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }

    details::details-content {
      height: 0;
      overflow: clip;
      opacity: 0;
      transition:
        height .3s ease,
        opacity .3s ease,
        content-visibility .3s allow-discrete;
    }

    details[open]::details-content { height: auto; opacity: 1; }
  }
}

/* --- Blocs ------------------------------------------------------------- */

.carte {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: 18px;
  padding: 24px;
}
.carte.accent { border-color: rgba(255, 205, 123, 0.4); }

.grille { display: grid; gap: 18px; }
.grille.trois { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grille.deux { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.etape { display: flex; gap: 18px; align-items: flex-start; }
.numero {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 205, 123, .13);
  border: 1px solid rgba(255, 205, 123, .45);
  color: var(--or);
  font-weight: 700;
}

.fonction h3 { color: var(--texte); }
.fonction p { color: var(--texte-doux); font-size: 15.5px; margin: 0; }

.puces { list-style: none; padding: 0; margin: 0; }
.puces li {
  /* Logique et non physique : la puce est posee du cote du debut de ligne,
     et sa reserve doit suivre. En arabe, un padding a gauche laissait le
     rond passer par-dessus la premiere lettre. */
  padding-block: 11px;
  padding-inline: 30px 0;
  border-bottom: 1px solid var(--bordure);
  position: relative;
  color: var(--texte-doux);
}
.puces li:last-child { border-bottom: none; }
.puces li::before {
  content: "";
  position: absolute; inset-inline-start: 4px; top: 20px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sarcelle);
}

details {
  border-bottom: 1px solid var(--bordure);
  padding: 16px 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--or); font-size: 22px; line-height: 1; }
details[open] summary::after { content: "\2013"; }
details p { color: var(--texte-doux); margin: 12px 0 0; }

/* --- Formulaire de contact ---------------------------------------------- */

#contact { margin-top: 22px; }

#contact label {
  display: block;
  margin: 18px 0 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--texte);
}

#contact select,
#contact textarea,
#contact input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--bordure);
  background: rgba(0, 0, 0, .28);
  color: var(--texte);
  font: inherit;
  font-size: 15.5px;
}

#contact textarea { resize: vertical; min-height: 130px; line-height: 1.6; }

#contact select:focus,
#contact textarea:focus,
#contact input:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(255, 205, 123, .16);
}

#contact button { margin-top: 22px; border: none; cursor: pointer; font: inherit; font-weight: 700; }
#contact button:disabled { opacity: .55; cursor: default; transform: none; }

/* Piege a robots : hors de l ecran plutot que display:none, que certains
   remplisseurs automatiques savent ignorer. Retire du parcours au clavier
   et des lecteurs d ecran par aria-hidden sur le conteneur. */
.pot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.aide { font-size: 14px; color: var(--texte-doux); opacity: .8; margin: 8px 0 0; }

.etat { margin: 14px 0 0; font-size: 15px; min-height: 1.4em; }
.etat.ok { color: var(--sarcelle); }
.etat.ko { color: var(--corail); }

/* --- Pages de texte ---------------------------------------------------- */

.page { max-width: var(--lisible); margin: 0 auto; padding: 48px 24px 90px; }
.page h2 { font-size: 22px; margin: 44px 0 12px; color: var(--or); }
.page h3 { font-size: 17px; margin: 26px 0 8px; }
.page li { margin-bottom: 8px; }
.maj { font-size: 13px; color: var(--texte-doux); opacity: .7; margin-bottom: 36px; }

table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
th, td { text-align: start; padding: 11px 8px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
th { color: var(--or); font-weight: 600; }

footer.site {
  border-top: 1px solid var(--bordure);
  background: rgba(0, 0, 0, .22);
}
footer.site .dedans {
  max-width: var(--large);
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 40px;
  align-items: center;
  font-size: 14.5px;
  color: var(--texte-doux);
}
footer.site nav { margin-inline-start: auto; display: flex; flex-wrap: wrap; gap: 20px; }
footer.site a { text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .hero .dedans { grid-template-columns: 1fr; padding: 64px 24px 72px; }
  .hero .vitrine { order: -1; }
  .hero .appareil { max-width: 250px; }
  .duo { grid-template-columns: 1fr; gap: 36px; padding: 54px 0; }
  .duo.inverse .dire { order: 0; }
  .duo .appareil { max-width: 244px; }
  .section { padding: 64px 24px; }
  /* Sur un telephone, deux portraits cote a cote donnent deux bandes trop
     etroites pour qu on distingue le geste. L une sous l autre, bornees pour
     ne pas depasser la hauteur de l ecran. */
  .preuves { grid-template-columns: minmax(0, 280px); gap: 30px; }
  .barre nav { gap: 15px; }
  .barre nav a { font-size: 13.5px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .barre nav a:not(.court) { display: none; }
  /* Les deux badges cote a cote depassent 360 px de large. Le flex-wrap les
     empilerait, mais deux boutons l un sous l autre occupent la moitie de
     l ecran : mieux vaut les reduire et garder la ligne. Le rapport de 1,5
     entre les deux hauteurs est conserve. */
  .badge-apple { height: 44px; }
  .badge-google { height: 66px; }
}


/* --- Arabe, de droite a gauche --- */

/* Les navigateurs choisissent seuls une police arabe correcte ; les
   imposer depuis un CDN ajouterait une dependance reseau a une page qui
   n en a aucune. On se contente d aerer : la vocalisation arabe demande
   plus de hauteur de ligne que le latin. */
html[lang="ar"] body { line-height: 1.85; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.5; }

/* Le chiffre d etape et le rang des preuves restent lisibles dans les
   deux sens ; seule la ponctuation directionnelle a besoin d aide. */
html[lang="ar"] .oeil { letter-spacing: 0; }

/* Les captures d ecran sont en arabe dans la version arabe : rien a
   retourner. Retourner une image de telephone donnerait un appareil
   miroir, boutons du mauvais cote. */
html[lang="ar"] .appareil img { transform: none; }



/* --- Selecteur de langue --- */

/* Un <details> et non un menu en JavaScript : il s ouvre, se ferme et se
   navigue au clavier sans une ligne de script, et il fonctionne meme si
   le script ne charge pas. */
/* Les <details> de la FAQ portent une bordure, un « + » et une animation
   de hauteur avec overflow: clip. Ce dernier decouperait un menu pose en
   absolu : il doit etre neutralise ici, pas seulement habille. */
.langues { position: relative; border-bottom: none; padding: 0; }
/* details[open] summary::after de la FAQ est plus specifique que la regle
   simple : sans cette seconde ligne, un tiret apparait dans le selecteur
   des qu il est ouvert. */
.langues summary::after,
.langues[open] summary::after { content: none; }

.langues::details-content {
  height: auto; overflow: visible;
  opacity: 0; transition: opacity .18s ease;
}
.langues[open]::details-content { opacity: 1; }

.langues summary {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  font-weight: 400;
  padding: 5px 10px;
  border: 1px solid var(--bordure); border-radius: 999px;
  cursor: pointer; list-style: none;
  font-size: 14px; color: var(--texte-doux);
  transition: border-color .2s, color .2s;
}
.langues summary::-webkit-details-marker { display: none; }
.langues summary:hover { border-color: var(--or); color: var(--texte); }

.drapeau {
  width: 20px; height: 14px; flex: 0 0 auto;
  border-radius: 2px; display: block;
  /* Le drapeau saoudien est un fichier au format 3:2 ; sans cela il s etire
     dans une vignette qui ne l est pas tout a fait. */
  object-fit: cover;
}

.chevron { width: 9px; height: 6px; opacity: .6; transition: transform .2s; }
.langues[open] .chevron { transform: rotate(180deg); }

.langue-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
  min-width: 160px; z-index: 40;
  display: flex; flex-direction: column;
  padding: 6px;
  background: #131b33;
  border: 1px solid var(--bordure); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.langue-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 15px; color: var(--texte-doux); text-decoration: none;
}
.langue-menu a:hover { background: rgba(255, 255, 255, .06); color: var(--texte); }
.langue-menu a.actuelle { color: var(--or); }

/* Chaque nom est ecrit dans sa propre langue, donc dans son propre sens.
   Sans cela, « العربية » s aligne selon la page et non selon lui-meme. */
.langue-menu a[lang="ar"] span { direction: rtl; }
.langue-menu a[lang="fr"] span { direction: ltr; }

/* Sur telephone, la barre porte deja cinq liens : le nom de la langue
   passe a la trappe et le drapeau suffit a se reperer. */
@media (max-width: 720px) {
  .langues summary .nom-langue { display: none; }
  .langues summary { padding: 5px 8px; }
}
