/* ============================================================
   Site de Vente GMI DZ — Système de style
   DA « L'Atelier du Marchand » — cf. Cahier des charges §4.
   Neutres chauds papier-encre · accent indigo unique · plat au repos.
   CSS écrit en propriétés logiques → prêt pour le RTL arabe.
   ============================================================ */

:root {
  /* Accent — un seul, ≤ 10 % de la surface */
  --accent:        #1E6FCC;
  --accent-hover:  #2480DF;
  --accent-bg:     #EBF3FD;
  --accent-light:  #D0E5F8;
  /* Neutres chauds « papier-encre » */
  --bg:            #F9F9F7;
  --surface:       #FFFFFF;
  --sidebar-bg:    #FBFBF9;
  --hover:         #F1F1EF;
  --active-bg:     #EAEAE6;
  --border:        #E8E8E4;
  --border-strong: #D4D4CE;
  --text:          #191919;
  --text2:         #5C5B56;
  --text3:         #9B9993;
  /* Sémantiques */
  --green: #0A6E0A;  --green-bg: #EBF9EB;
  --amber: #8C5E00;  --amber-bg: #FEF3DC;
  --red:   #B02B30;  --red-bg:   #FDECEA;

  /* Typographie */
  --font-sans: "Inter", "Noto Sans Arabic", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Échelle d'espacement */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px; --sp-9: 96px;

  /* Rayons */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;

  /* Ombre — uniquement sur état (hover/focus/modale) */
  --shadow-hover: 0 2px 8px rgba(25, 25, 25, .08);
  --shadow-focus: 0 0 0 3px var(--accent-light);

  --maxw: 1080px;
}

/* L'arabe : Noto Sans Arabic en priorité (Inter n'a pas les glyphes arabes). */
html[lang="ar"] { --font-sans: "Noto Sans Arabic", "Inter", system-ui, sans-serif; }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, iframe { max-width: 100%; display: block; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Chiffres financiers — toujours en mono, chiffres tabulaires, latins */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* --- Typographie --- */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
p  { color: var(--text2); }
a  { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--r-sm); }

/* Lien d'évitement (accessibilité clavier) */
.skip-link {
  position: absolute; inset-inline-start: var(--sp-3); inset-block-start: var(--sp-3);
  z-index: 100; background: var(--surface); color: var(--text);
  padding: var(--sp-2) var(--sp-4); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); font-size: .9rem; font-weight: 600;
  transform: translateY(-150%); transition: transform .15s;
}
.skip-link:focus-visible { transform: translateY(0); }

/* --- Mise en page --- */
.container { max-inline-size: var(--maxw); margin-inline: auto; padding-inline: var(--sp-5); }
section { padding-block: var(--sp-8); }
.section-eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text3); margin-block-end: var(--sp-3);
}
.section-text { margin-block: var(--sp-3) var(--sp-5); max-inline-size: 50ch; }

/* --- En-tête --- */
.site-header {
  position: sticky; inset-block-start: 0; z-index: 50;
  background: rgba(249, 249, 247, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-block-end: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: var(--sp-3);
  /* En-tête en LTR dans toutes les langues : la barre de langue reste
     fixée à droite et ne saute pas de côté en passant à l'arabe. */
  direction: ltr;
}
.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700;
  color: var(--text); letter-spacing: -0.02em; }
.brand-logo { inline-size: 30px; block-size: 30px; border-radius: 7px; flex: none; }
.brand-name { font-size: .95rem; line-height: 1.15; }
.brand-name-full { display: none; }
@media (min-width: 600px) {
  .brand-name-full { display: inline; }
  .brand-name-short { display: none; }
}

/* Sélecteur de langue */
.lang-switch { display: flex; gap: 2px; background: var(--hover);
  border-radius: var(--r-sm); padding: 3px; }
.lang-switch a {
  font-size: .82rem; font-weight: 600; color: var(--text2);
  padding: var(--sp-1) var(--sp-3); border-radius: 4px; line-height: 1.6;
}
.lang-switch a[aria-current="page"] { background: var(--surface); color: var(--text);
  box-shadow: 0 1px 2px rgba(25,25,25,.06); }
.lang-switch a:hover { color: var(--text); }

/* --- Boutons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: inherit; font-size: .98rem; font-weight: 600; cursor: pointer;
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-md);
  border: 1px solid transparent; transition: background .15s, box-shadow .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; box-shadow: var(--shadow-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--hover); color: var(--text); }
.btn-lg { padding: var(--sp-4) var(--sp-7); font-size: 1.05rem; }

/* --- Accroche / Hero --- */
.hero { padding-block: var(--sp-9) var(--sp-8); }
.hero .eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-bg);
  padding: var(--sp-1) var(--sp-3); border-radius: 999px; margin-block-end: var(--sp-5);
}
.hero h1 { max-inline-size: 16ch; }
.hero .lead {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem); color: var(--text2);
  max-inline-size: 52ch; margin-block: var(--sp-5);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block-start: var(--sp-6); }
.hero-note { font-size: .88rem; color: var(--text3); margin-block-start: var(--sp-4); }

/* --- Démonstration --- */
.demo .video-frame {
  position: relative; aspect-ratio: 16 / 9; background: var(--active-bg);
  border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.demo .video-frame iframe { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border: 0; }

/* --- Prix --- */
.pricing { background: var(--sidebar-bg); border-block: 1px solid var(--border); }
.price-grid {
  display: grid; gap: var(--sp-4); grid-template-columns: 1fr;
  margin-block-start: var(--sp-6);
}
/* Carte prix : le logo du moyen de paiement masque le montant ;
   survol (desktop), focus (clavier) ou appui (mobile) le révèle. */
.price-card {
  position: relative; font-family: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-7); min-block-size: 252px;
  display: grid; place-items: center; overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.price-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.price-front, .price-back {
  grid-area: 1 / 1; display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); transition: opacity .2s;
}
.price-logo {
  block-size: 84px; max-inline-size: 210px; object-fit: contain;
  border-radius: var(--r-md); margin-block-end: var(--sp-2);
}
.price-method { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.price-hint {
  font-size: .8rem; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.price-hint::before { content: "↑"; font-size: 1rem; }
.price-back { opacity: 0; }
.price-back .amount { font-size: 3.5rem; font-weight: 700; color: var(--text); }
.price-back .currency { font-size: .9rem; font-weight: 600; color: var(--text3);
  letter-spacing: .04em; }
.price-card:hover .price-back,
.price-card:focus-visible .price-back,
.price-card.revealed .price-back { opacity: 1; }
.price-card:hover .price-front,
.price-card:focus-visible .price-front,
.price-card.revealed .price-front { opacity: 0; }
.price-meta { text-align: center; margin-block-start: var(--sp-5);
  font-size: .92rem; color: var(--text2); }
.price-meta .badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: var(--green-bg); color: var(--green); font-weight: 600;
  font-size: .85rem; padding: var(--sp-1) var(--sp-3); border-radius: 999px;
  margin-block-end: var(--sp-3);
}

/* --- Installation --- */
.install-grid { display: grid; gap: var(--sp-4); grid-template-columns: 1fr;
  margin-block-start: var(--sp-6); }
.install-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-6);
}
.install-card h3 { margin-block-end: var(--sp-3); }
.install-card p { font-size: .94rem; margin-block-end: var(--sp-5); }
.steps { list-style: none; counter-reset: s; display: grid; gap: var(--sp-3); }
.steps li { counter-increment: s; display: flex; gap: var(--sp-3);
  font-size: .92rem; color: var(--text2); }
.steps li::before {
  content: counter(s); flex: none; inline-size: 22px; block-size: 22px;
  background: var(--accent-bg); color: var(--accent); font-family: var(--font-mono);
  font-size: .8rem; font-weight: 600; border-radius: 50%;
  display: grid; place-items: center;
}
.store-badge { display: inline-block; transition: transform .15s, box-shadow .15s; }
.store-badge:hover { transform: translateY(-1px); }
.store-badge img { block-size: 46px; inline-size: auto; border-radius: var(--r-sm); }
.ios-safari {
  inline-size: 52px; block-size: 52px; border-radius: var(--r-md);
  margin-block-end: var(--sp-4);
  transition: transform .15s, box-shadow .15s;
}
.ios-safari:hover { transform: translateY(-1px); }

/* --- Commande (emplacement brique 2) --- */
.order { background: var(--sidebar-bg); border-block: 1px solid var(--border); }
.order-placeholder {
  margin-block-start: var(--sp-6); padding: var(--sp-8) var(--sp-5);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  text-align: center; color: var(--text3); font-size: .92rem;
}

/* --- Pied de page --- */
.site-footer {
  border-block-start: 1px solid var(--border); background: var(--sidebar-bg);
  padding-block: var(--sp-7); font-size: .88rem; color: var(--text3);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--sp-4);
  justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; gap: var(--sp-5); }
.site-footer a { color: var(--text2); }

/* --- Formulaire de commande --- */
.order-form { margin-block-start: var(--sp-6); max-inline-size: 460px;
  display: grid; gap: var(--sp-5); }
.order-form .field { display: grid; gap: var(--sp-2); border: 0; }
.order-form label, .order-form legend {
  font-size: .9rem; font-weight: 600; color: var(--text); padding: 0; }
/* Champ téléphone en cases (style code de licence). L'input réel recouvre
   les cases, transparent ; les cases affichent les chiffres saisis. */
.phone-code { position: relative; }
.phone-boxes { display: flex; flex-wrap: wrap; gap: clamp(4px, 1.5vw, 8px); }
.phone-box {
  inline-size: clamp(26px, 7.4vw, 34px); block-size: 42px;
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600;
  color: var(--text); background: var(--surface);
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.phone-box.active { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.phone-box.overflow {
  border-color: var(--red); color: var(--red); background: var(--red-bg);
}
.phone-code.invalid .phone-box:not(.overflow) { border-color: var(--red); }
.phone-code input {
  position: absolute; inset: 0; inline-size: 100%; block-size: 100%;
  margin: 0; padding: 0; border: 0; background: transparent;
  color: transparent; caret-color: transparent; font-size: 16px; cursor: pointer;
}
.phone-code input:focus-visible { box-shadow: none; }
.field-hint { font-size: .82rem; color: var(--text3); }
.field-error, .form-error { font-size: .85rem; color: var(--red); font-weight: 500; }
.radio-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-block-start: var(--sp-1); }
.radio {
  display: flex; align-items: center; gap: var(--sp-4);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6); cursor: pointer; flex: 1 1 240px;
  font-weight: 600; font-size: 1.2rem; transition: border-color .15s, background .15s;
}
.radio:hover { background: var(--hover); }
.radio:has(input:checked) {
  border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.radio input { accent-color: var(--accent); flex: none;
  inline-size: 20px; block-size: 20px; }
.radio-logo { block-size: 50px; inline-size: auto; max-inline-size: 124px;
  object-fit: contain; border-radius: 8px; flex: none; }
.order-form button:disabled { opacity: .65; cursor: progress; }
.cf-turnstile { min-block-size: 0; } /* invisible : aucun espace réservé */

/* --- Confirmation de commande --- */
.order-confirmation {
  margin-block-start: var(--sp-6); max-inline-size: 460px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-7) var(--sp-6); text-align: center;
}
.confirm-mark {
  inline-size: 48px; block-size: 48px; margin-inline: auto;
  background: var(--green-bg); color: var(--green); border-radius: 50%;
  display: grid; place-items: center; font-size: 1.5rem; font-weight: 700;
  margin-block-end: var(--sp-4);
}
.order-confirmation h3 { font-size: 1.3rem; }
.confirm-code-label { font-size: .85rem; color: var(--text3); margin-block-start: var(--sp-5); }
.confirm-code { margin-block: var(--sp-1) var(--sp-4); }
.confirm-code .num { font-size: 1.8rem; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.confirm-next { font-size: .92rem; }
.confirm-install {
  margin-block-start: var(--sp-5); padding-block-start: var(--sp-5);
  border-block-start: 1px solid var(--border);
}
.confirm-install strong { color: var(--text); font-size: .92rem; }
.confirm-install p { margin-block: var(--sp-2); font-size: .88rem; }

/* --- Responsive (mobile-first → ≥ 720px) --- */
@media (min-width: 720px) {
  .price-grid { grid-template-columns: 1fr 1fr; max-inline-size: 600px; margin-inline: auto; }
  .install-grid { grid-template-columns: 1fr 1fr; }
}

/* --- Préférence de mouvement réduit --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
