/* ==========================================================================
   LAUSANNE MASSAGES — carte de fidélité (carte.html)
   S'ajoute à style.css : mêmes couleurs, caractères, boutons et champs.
   ========================================================================== */

.loyalty {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(30px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
}
.loyalty > :not(.blob) { position: relative; z-index: 1; }
.loyalty [hidden] { display: none !important; }

.loyalty__blob-a { top: 150px; right: -210px; width: 290px; height: 220px; }
.loyalty__blob-b { top: 240px; right: -120px; width: 190px; height: 150px; }

/* En-tête */
.loyalty__brand { margin-bottom: 44px; text-align: center; }
.loyalty__wordmark {
  display: block;
  font: 400 21px/1.2 var(--font-display);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
}
.loyalty__brand .eyebrow { display: block; margin-top: 6px; font-size: 9px; color: var(--color-stone-grey); }

.loyalty__loading { margin-top: 30px; text-align: center; color: var(--color-stone-grey); }
.loyalty__section .heading { margin: 12px 0 22px; }
.loyalty__intro { font-size: 14px; max-width: 34em; }
.loyalty__note { margin-top: 12px; font-size: 12px; color: var(--color-stone-grey); }
.loyalty__section[data-view="admin"] { margin-bottom: 44px; }

/* Les dix cases */
.stamps-card { padding: 26px 20px 22px; }
.stamps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px 10px;
}
.stamp {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--color-pebble-line);
  border-radius: 50%;
  font: 400 11px/1 var(--font-body);
  color: var(--color-stone-grey);
  transition: background-color .6s var(--ease-soft), border-color .6s var(--ease-soft);
}
.stamp svg { width: 48%; height: 48%; }
.stamp.is-done {
  border-color: var(--color-soft-cocoa);
  background: var(--color-soft-cocoa);
  color: var(--color-sea-salt);
}
.stamp--gift {
  align-content: center;
  gap: 3px;
  border-style: dashed;
  border-color: var(--color-soft-cocoa);
  color: var(--color-soft-cocoa);
  text-align: center;
}
.stamp--gift span { font: 400 17px/1 var(--font-display); }
.stamp--gift small { font: 400 7px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.stamp--gift.is-ready {
  border-style: solid;
  background: var(--color-sea-salt);
  animation: gift-glow 2.6s ease-in-out infinite;
}
.stamp.is-new { animation: stamp-in .9s var(--ease-out) both; }

@keyframes stamp-in {
  from { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
}
@keyframes gift-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 53, 46, .22); }
  50%      { box-shadow: 0 0 0 7px rgba(59, 53, 46, 0); }
}

.stamps__status {
  margin-top: 22px;
  font: 300 20px/1.3 var(--font-display);
  text-align: center;
  text-wrap: balance;
}

/* Espace praticien */
.practitioner {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 22px 20px 16px;
  border: 1px solid var(--color-soft-cocoa);
  text-align: center;
}
.btn--solid {
  --btn-fill: rgba(236, 230, 222, .16);
  width: 100%;
  min-height: 56px;
  background: var(--color-soft-cocoa);
  color: var(--color-sea-salt);
  white-space: normal;
}
.is-busy .btn--solid { opacity: .55; pointer-events: none; }
.practitioner__msg { min-height: 1.75em; font-size: 13px; }
.practitioner__msg:empty { min-height: 0; }
.practitioner__undo {
  padding: 6px 4px;
  border: 0;
  background: none;
  font: 400 10px/1.5 var(--font-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-stone-grey);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* QR code */
.loyalty__qr { display: grid; justify-items: center; gap: 12px; margin-top: 34px; text-align: center; }
.qr { width: min(62vw, 230px); }
.qr svg { display: block; width: 100%; height: auto; border-radius: 4px; }
.loyalty__qr-text { max-width: 26em; font-size: 12px; color: var(--color-stone-grey); }
.loyalty__code { font: 400 10px/1.5 var(--font-body); letter-spacing: .2em; color: var(--color-stone-grey); }

/* Astuce : écran d'accueil */
.loyalty__help {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.loyalty__help summary {
  position: relative;
  padding: 16px 28px 16px 0;
  font: 400 10px/1.5 var(--font-body);
  letter-spacing: .22em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
}
.loyalty__help summary::-webkit-details-marker { display: none; }
.loyalty__help summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  width: 6px; height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform .4s var(--ease-out);
}
.loyalty__help[open] summary::after { transform: translateY(-20%) rotate(-135deg); }
.loyalty__help ul { display: grid; gap: 8px; padding: 0 0 18px; }
.loyalty__help strong { font-weight: 400; }

/* Historique */
.loyalty__history { margin-top: 30px; }
.loyalty__history ul { margin-top: 10px; }
.loyalty__history li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.loyalty__history li span:first-child { color: var(--color-stone-grey); }

/* Formulaire de création (sur fond clair) */
.loyalty__form { margin-top: 30px; }
.loyalty .field input:-webkit-autofill {
  -webkit-text-fill-color: var(--color-soft-cocoa);
  box-shadow: 0 0 0 100px #f3eee8 inset;
  caret-color: var(--color-soft-cocoa);
}

/* Pied de page */
.loyalty__foot {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 48px;
  font-size: 11px;
  color: var(--color-stone-grey);
  text-align: center;
}
.loyalty__foot .link { color: var(--color-soft-cocoa); }

/* Mouvement réduit */
.reduced-motion .stamp.is-new { animation: fade-in .6s ease both; }
.reduced-motion .stamp--gift.is-ready { animation: none; box-shadow: 0 0 0 4px rgba(59, 53, 46, .12); }
