/* Loyall — premium, minimal, commerce physique. Mobile d'abord. */
:root {
  --fond: #f6f5f2;
  --surface: #ffffff;
  --encre: #111111;
  --doux: #6b6b6b;
  --trait: #e4e2dd;
  --erreur: #b3261e;
  --succes: #1e6b45;
  --rayon: 14px;
  --police: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--police);
  background: var(--fond);
  color: var(--encre);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 28px 20px 40px;
  display: flex;
  flex-direction: column;
}

.marque {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.marque button.lien { font-weight: 500; }

h1 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.doux { color: var(--doux); margin: 0 0 32px; font-size: 16px; }

.etape {
  font-size: 13px;
  font-weight: 600;
  color: var(--doux);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.progression {
  display: flex;
  gap: 6px;
  margin-bottom: 40px;
}

.progression span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--trait);
  transition: background 0.3s ease;
}

.progression span.fait { background: var(--encre); }

/* Champs */
label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.champ { margin-bottom: 20px; }

input[type="text"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 15px 16px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--encre);
  appearance: none;
  transition: border-color 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--encre);
}

/* Boutons */
.actions {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  gap: 12px;
}

button {
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bouton {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  padding: 16px 20px;
  border-radius: var(--rayon);
  border: none;
  background: var(--encre);
  color: #fff;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.bouton:active { transform: scale(0.98); }
.bouton:disabled { opacity: 0.4; cursor: default; }

.bouton.secondaire {
  flex: 0 0 auto;
  background: transparent;
  color: var(--encre);
  border: 1px solid var(--trait);
}

.lien {
  background: none;
  border: none;
  padding: 0;
  color: var(--doux);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Choix (types de fidélité, récompenses) */
.choix { display: grid; gap: 10px; margin-bottom: 24px; }

.option {
  text-align: left;
  width: 100%;
  padding: 18px;
  border-radius: var(--rayon);
  border: 1px solid var(--trait);
  background: var(--surface);
  color: var(--encre);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.option strong { display: block; font-size: 17px; margin-bottom: 2px; }
.option span { color: var(--doux); font-size: 14px; }

.option[aria-pressed="true"] {
  border-color: var(--encre);
  box-shadow: 0 0 0 1px var(--encre);
}

.pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.pastille {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--trait);
  background: var(--surface);
  color: var(--encre);
  font-size: 15px;
}

.pastille[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }

.seuil {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.seuil input { width: 96px; text-align: center; }

/* Couleurs */
.couleurs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }

.couleur {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0;
  position: relative;
}

.couleur[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--encre);
}

.couleur-perso {
  overflow: hidden;
  background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935);
}

.couleur-perso input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.logo-zone {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.logo-zone input[type="file"] { display: none; }

/* Aperçu de la carte Wallet */
.carte-wallet {
  border-radius: 18px;
  padding: 20px;
  aspect-ratio: 1.586;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: background 0.3s ease, color 0.3s ease;
  margin-bottom: 8px;
}

.carte-wallet .haut {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.carte-wallet .haut img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.2);
}

.carte-wallet .solde {
  margin-top: auto;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.carte-wallet .barre {
  display: flex;
  gap: 5px;
  margin: 10px 0 12px;
}

.carte-wallet .barre span {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.25;
}

.carte-wallet .barre span.plein { opacity: 1; }

.carte-wallet .bas { font-size: 13px; opacity: 0.85; }

.legende { font-size: 13px; color: var(--doux); text-align: center; margin: 0 0 24px; }

/* Écran final */
.qr {
  background: var(--surface);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--trait);
  margin-bottom: 20px;
}

.qr img { width: 100%; max-width: 220px; display: block; margin: 0 auto 16px; }

.qr .adresse { font-size: 15px; font-weight: 600; word-break: break-all; }

.liste-pret { list-style: none; padding: 0; margin: 0 0 8px; }

.liste-pret li {
  padding: 12px 0;
  border-bottom: 1px solid var(--trait);
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.liste-pret li span:last-child { color: var(--doux); text-align: right; }

/* Messages */
.message {
  padding: 14px 16px;
  border-radius: var(--rayon);
  font-size: 15px;
  margin-bottom: 20px;
}

.message.erreur { background: #fbeceb; color: var(--erreur); }
.message.succes { background: #e8f3ec; color: var(--succes); }

[hidden] { display: none !important; }

.apparition { animation: apparition 0.35s ease both; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .apparition { animation: none; }
}

/* Support à imprimer (QR du comptoir) */
.affiche { display: none; }

@media print {
  body { background: #fff; }
  .page { display: none; }
  .affiche {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    font-family: var(--police);
  }
  .affiche .grand { font-size: 44px; font-weight: 800; letter-spacing: 0.08em; margin: 0; }
  .affiche .nom { font-size: 28px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 8px 0 40px; }
  .affiche img { width: 9cm; height: 9cm; }
  .affiche .petit { margin-top: 32px; font-size: 14px; color: #555; }
}

/* Chaque écran occupe la hauteur restante : les boutons restent en bas */
.page > section { flex: 1; display: flex; flex-direction: column; }
.page > section > form { flex: 1; display: flex; flex-direction: column; }

/* Page Join et carte client */
.regles { list-style: none; padding: 0; margin: 0 0 8px; }

.regles li {
  font-size: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--trait);
}

.actions.colonne { flex-direction: column; align-items: stretch; text-align: center; }

.mention { font-size: 13px; color: var(--doux); text-align: center; margin: 12px 0 0; }

.propulse {
  font-size: 12px;
  color: var(--doux);
  text-align: center;
  letter-spacing: 0.04em;
  margin: 24px 0 0;
  opacity: 0.7;
}

.gain, .recompense-dispo {
  border-radius: var(--rayon);
  padding: 14px 16px;
  font-weight: 600;
  margin: 16px 0 0;
  text-align: center;
}

.gain { background: var(--encre); color: #fff; }
.recompense-dispo { background: #e8f3ec; color: var(--succes); }

.page > section > .qr { margin-top: 20px; }
