/* =====================================================================
   style.css — Formulaire public (arabe, RTL, mobile-first)

   Palette :
     jaune vif  #FFD60A  (fond)
     noir       #000000  (texte, ultra gras)
     rouge      #E63946  (accents, actions)
     blanc      #FFFFFF  (cartes)

   90% du trafic est mobile : tout est dimensionne pour le pouce.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. RESET
   --------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --jaune:       #FFD60A;
  --jaune-fonce: #E6BF00;
  --noir:        #000000;
  --rouge:       #E63946;
  --rouge-fonce: #C42B37;
  --blanc:       #FFFFFF;
  --gris:        #6B6B6B;
  --gris-clair:  #EFEFEF;
  --vert:        #25D366;
  --bleu-fb:     #1877F2;

  --rayon:       18px;
  --rayon-petit: 12px;
  --ombre:       0 4px 0 var(--noir);
  --ombre-forte: 0 6px 0 var(--noir);
}

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

body.page-public {
  background: var(--jaune);
  color: var(--noir);
  font-family: 'Cairo', 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.6;
  min-height: 100vh;
  padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
  /* Motif discret : evite l'aplat de jaune pur, fatigant a l'ecran. */
  background-image: radial-gradient(rgba(0, 0, 0, .06) 1px, transparent 1px);
  background-size: 22px 22px;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
}

/* ---------------------------------------------------------------------
   2. EN-TETE
   --------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 8px 0 22px;
}

.badge-live {
  display: inline-block;
  background: var(--rouge);
  color: var(--blanc);
  font-size: 14px;
  font-weight: 900;
  padding: 7px 16px;
  border-radius: 999px;
  border: 3px solid var(--noir);
  box-shadow: 0 3px 0 var(--noir);
  margin-bottom: 16px;
  animation: pulsation 2.4s ease-in-out infinite;
}

@keyframes pulsation {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.05); }
}

.titre-geant {
  font-size: clamp(30px, 9vw, 46px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.surligne {
  display: inline-block;
  background: var(--noir);
  color: var(--jaune);
  padding: 0 10px;
  border-radius: 8px;
  transform: rotate(-1.2deg);
}

.sous-titre {
  font-size: clamp(16px, 4.5vw, 20px);
  font-weight: 700;
  color: var(--noir);
  opacity: .85;
}

.compteur {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 18px;
  background: var(--blanc);
  border: 3px solid var(--noir);
  border-radius: 999px;
  padding: 8px 20px;
  box-shadow: var(--ombre);
}

.compteur strong {
  font-size: 24px;
  font-weight: 900;
  color: var(--rouge);
}

.compteur span {
  font-size: 14px;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   3. BANDEAU PARRAIN
   --------------------------------------------------------------------- */
.bandeau-parrain {
  background: var(--noir);
  color: var(--jaune);
  border-radius: var(--rayon-petit);
  padding: 12px 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
}

.bandeau-parrain strong {
  color: var(--blanc);
  font-weight: 900;
}

/* ---------------------------------------------------------------------
   4. ETAPES
   --------------------------------------------------------------------- */
.etapes {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.etape {
  flex: 1;
  background: var(--blanc);
  border: 3px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 10px 6px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 900;
  box-shadow: 0 3px 0 var(--noir);
}

.etape .num {
  display: block;
  width: 26px;
  height: 26px;
  line-height: 22px;
  margin: 0 auto 5px;
  background: var(--rouge);
  color: var(--blanc);
  border: 2px solid var(--noir);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 900;
}

/* ---------------------------------------------------------------------
   5. CARTES
   --------------------------------------------------------------------- */
.carte {
  background: var(--blanc);
  border: 4px solid var(--noir);
  border-radius: var(--rayon);
  padding: 22px 18px;
  margin-bottom: 20px;
  box-shadow: var(--ombre-forte);
}

.carte h2 {
  font-size: 21px;
  font-weight: 900;
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------------
   6. ALERTES
   --------------------------------------------------------------------- */
.alerte {
  border: 4px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--noir);
}

.alerte-erreur {
  background: var(--rouge);
  color: var(--blanc);
}

.alerte ul {
  list-style: none;
}

.alerte li {
  padding-right: 20px;
  position: relative;
  margin-bottom: 4px;
}

.alerte li::before {
  content: '⚠';
  position: absolute;
  right: 0;
}

.alerte li:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   7. FORMULAIRE
   --------------------------------------------------------------------- */
.champ {
  margin-bottom: 18px;
}

.champ label {
  display: block;
  font-size: 15.5px;
  font-weight: 900;
  margin-bottom: 7px;
}

.requis     { color: var(--rouge); }
.facultatif { color: var(--gris); font-weight: 700; font-size: 13px; }

.champ input,
.champ select {
  width: 100%;
  /* 16px minimum : en dessous, iOS zoome automatiquement au focus. */
  font-size: 16px;
  font-family: inherit;
  font-weight: 700;
  color: var(--noir);
  background: var(--gris-clair);
  border: 3px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 14px;
  min-height: 52px;              /* cible tactile confortable */
  transition: background .15s, box-shadow .15s;
}

.champ select {
  /* Fleche personnalisee : la fleche native se place mal en RTL. */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  background-size: 22px;
  padding-left: 42px;
}

.champ input:focus,
.champ select:focus {
  outline: none;
  background: var(--blanc);
  box-shadow: 0 0 0 4px var(--jaune), 0 0 0 7px var(--noir);
}

.champ input.invalide {
  background: #FFE8EA;
  border-color: var(--rouge);
}

.champ input::placeholder {
  color: #9A9A9A;
  font-weight: 700;
}

.aide {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gris);
  margin-top: 5px;
}

.erreur-js {
  display: block;
  font-size: 13px;
  font-weight: 900;
  color: var(--rouge);
  margin-top: 5px;
  min-height: 1px;
}

/* Pot de miel : invisible, mais toujours dans le DOM pour piéger les bots. */
.pot-de-miel {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

/* ---------------------------------------------------------------------
   8. BOUTONS
   --------------------------------------------------------------------- */
.bouton-principal {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 20px;
  font-weight: 900;
  color: var(--blanc);
  background: var(--rouge);
  border: 4px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 17px 18px;
  min-height: 60px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--noir);
  transition: transform .08s, box-shadow .08s, background .15s;
  -webkit-tap-highlight-color: transparent;
}

.bouton-principal:hover { background: var(--rouge-fonce); }

/* Effet "bouton enfonce" : retour tactile clair sans JavaScript. */
.bouton-principal:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--noir);
}

.bouton-principal:disabled {
  background: var(--gris);
  cursor: not-allowed;
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--noir);
}

.mention {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gris);
  margin-top: 14px;
}

/* ---------------------------------------------------------------------
   9. CARTE PRIX
   --------------------------------------------------------------------- */
.carte-prix {
  background: var(--noir);
  color: var(--blanc);
}

.carte-prix h2 { color: var(--jaune); }

.liste-prix {
  list-style: none;
  margin-bottom: 16px;
}

.liste-prix li {
  position: relative;
  padding-right: 28px;
  margin-bottom: 9px;
  font-size: 15.5px;
  font-weight: 700;
}

.liste-prix li::before {
  content: '✓';
  position: absolute;
  right: 0;
  color: var(--jaune);
  font-weight: 900;
}

.valeur {
  background: var(--jaune);
  color: var(--noir);
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  padding: 12px;
  border-radius: var(--rayon-petit);
}

/* ---------------------------------------------------------------------
   10. CONCOURS FERME
   --------------------------------------------------------------------- */
.carte-ferme {
  text-align: center;
}

.carte-ferme h2 { font-size: 25px; margin-bottom: 10px; }
.carte-ferme p  { font-size: 16px; font-weight: 700; color: var(--gris); }

.emoji-geant {
  font-size: 58px;
  line-height: 1;
  margin-bottom: 14px;
}

/* ---------------------------------------------------------------------
   11. PAGE DE SUCCES
   --------------------------------------------------------------------- */
.carte-succes {
  text-align: center;
  background: var(--noir);
  color: var(--blanc);
}

.titre-succes {
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 900;
  color: var(--jaune);
  margin-bottom: 10px;
}

.texte-succes {
  font-size: 16px;
  font-weight: 700;
}

.texte-succes strong { color: var(--jaune); }

.stats-perso {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 20px;
}

.stat {
  background: var(--blanc);
  border: 3px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 14px 6px;
  text-align: center;
  box-shadow: 0 4px 0 var(--noir);
}

.stat strong {
  display: block;
  font-size: 25px;
  font-weight: 900;
  color: var(--rouge);
  line-height: 1.1;
}

.stat span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gris);
  margin-top: 3px;
}

.explication {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.explication strong {
  background: var(--jaune);
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 900;
}

.boite-lien {
  margin-bottom: 12px;
}

.boite-lien input {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  /* Le lien est en caracteres latins : on force la direction LTR. */
  direction: ltr;
  text-align: center;
  color: var(--noir);
  background: var(--jaune);
  border: 3px dashed var(--noir);
  border-radius: var(--rayon-petit);
  padding: 14px 10px;
  min-height: 52px;
}

.boutons-partage {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.bouton-partage {
  display: block;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  font-size: 16.5px;
  font-weight: 900;
  color: var(--blanc);
  border: 3px solid var(--noir);
  border-radius: var(--rayon-petit);
  padding: 14px;
  min-height: 54px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--noir);
  transition: transform .08s, box-shadow .08s;
}

.bouton-partage:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--noir);
}

.bouton-partage.whatsapp { background: var(--vert); }
.bouton-partage.facebook { background: var(--bleu-fb); }
.bouton-partage.natif    { background: var(--noir); }

.code-perso {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gris);
  margin-top: 16px;
}

.code-perso strong {
  direction: ltr;
  display: inline-block;
  font-size: 18px;
  font-weight: 900;
  color: var(--noir);
  letter-spacing: 2px;
}

.liste-regles {
  padding-right: 20px;
}

.liste-regles li {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 9px;
}

.liste-regles strong {
  background: var(--jaune);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 900;
}

/* ---------------------------------------------------------------------
   12. TOAST
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--noir);
  color: var(--blanc);
  font-size: 15px;
  font-weight: 900;
  padding: 13px 24px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------------
   13. PIED DE PAGE
   --------------------------------------------------------------------- */
.pied {
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(0, 0, 0, .55);
  padding: 10px 0 20px;
}

.lien-retour {
  display: inline-block;
  color: var(--noir);
  font-weight: 900;
  text-decoration: underline;
  margin-bottom: 10px;
}

/* ---------------------------------------------------------------------
   14. ECRANS LARGES
   --------------------------------------------------------------------- */
@media (min-width: 600px) {
  body.page-public { padding: 30px 20px; }
  .carte           { padding: 28px 26px; }
  .etape           { font-size: 14px; padding: 12px 8px; }
  .boutons-partage { grid-template-columns: 1fr 1fr; }
  .bouton-partage.natif { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------
   15. ACCESSIBILITE — mouvement reduit
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
