/* ==========================================================================
   Richi Coiffure — carte de fidélité (pages /fidelite et /fidelite-salon)
   Chargé après theme-blackbox.css : même noir, même verre, même Bebas.
   ========================================================================== */

.fid { max-width: 460px; margin: 0 auto; }
.fid-intro { text-align: center; margin-bottom: 1.75rem; }
.fid-intro .section-title { font-size: clamp(3rem, 14vw, 4.75rem); }
.fid-intro p:last-child { color: var(--on-dark-muted); margin: .75rem auto 0; max-width: 30rem; }
.fid-msg { text-align: center; color: var(--on-dark-muted); padding: 2rem 0; }

/* ---------- La carte ---------- */
.pass {
  position: relative; overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(130% 90% at 100% 0, rgba(255, 255, 255, .13), transparent 55%),
    radial-gradient(90% 70% at 0 100%, rgba(255, 255, 255, .05), transparent 60%),
    linear-gradient(160deg, #17181d, #0b0c0f 70%);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #f2f2f4;
}
.pass.is-bump { animation: pass-bump .5s ease-out; }
@keyframes pass-bump { 40% { transform: scale(1.02); box-shadow: 0 0 40px rgba(255, 255, 255, .18); } }

.pass__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.25rem 1.25rem 0; }
.pass__brand { font-family: var(--f-display); font-size: 2.1rem; line-height: .9; letter-spacing: .02em; text-shadow: var(--glow); }
.pass__brand span { display: block; font-family: var(--f-sans); font-size: .62rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--on-dark-muted); text-shadow: none; margin-top: .35rem; }
.pass__count { text-align: right; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--on-dark-muted); }
.pass__count b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 2.3rem; line-height: 1; letter-spacing: .02em; color: #f2f2f4; }

.pass__body { padding: 1.25rem; }
.pass__label { font-size: .66rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--on-dark-muted); }
.pass__name { font-family: var(--f-display); font-size: 2rem; line-height: 1; letter-spacing: .02em; margin-top: .2rem; overflow-wrap: anywhere; }

.stamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.45rem, 2.5vw, .75rem); margin: 1.25rem 0 1rem; }
.stamp {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px dashed rgba(255, 255, 255, .22); color: rgba(255, 255, 255, .22);
  transition: background-color .35s, border-color .35s, color .35s, box-shadow .35s;
}
.stamp svg { width: 52%; height: 52%; }
.stamp.is-on { background: #f2f2f4; border: 1.5px solid #f2f2f4; color: #07080a; box-shadow: 0 0 16px rgba(255, 255, 255, .35); }
.stamp--gift { border-style: solid; border-color: rgba(255, 255, 255, .5); color: rgba(255, 255, 255, .7); }
.stamp--gift.is-ready { background: transparent; border-color: #f2f2f4; color: #f2f2f4; animation: gift-glow 2s ease-in-out infinite; }
@keyframes gift-glow { 50% { box-shadow: 0 0 22px rgba(255, 255, 255, .55); } }
.stamp.is-new { animation: stamp-in .55s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes stamp-in { from { transform: scale(.4); } }

.pass__msg { font-weight: 600; font-size: 1rem; line-height: 1.4; min-height: 2.8em; margin: 0; }
.pass__msg.is-ready { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; letter-spacing: .02em; text-shadow: var(--glow); }

.pass__qr { display: grid; justify-items: center; gap: .5rem; margin-top: 1.1rem; padding: 1rem; border-radius: 16px; background: #fff; color: #07080a; }
.pass__qr [data-qr] { width: 168px; height: 168px; }
.pass__qr [data-qr] img, .pass__qr [data-qr] canvas { width: 168px !important; height: 168px !important; }
.pass__qr p { margin: 0; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-align: center; }
.pass__qr code { font: 700 .8rem/1 var(--f-sans); letter-spacing: .18em; }

.pass__foot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .7rem; color: var(--on-dark-muted); }
.pass__foot b { display: block; color: #f2f2f4; font-weight: 600; font-size: .78rem; margin-top: .15rem; white-space: nowrap; }
.pass__foot a { color: inherit; text-decoration: none; }
.pass__foot > :last-child { text-align: right; }

.fid-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.25rem; margin-top: 1.25rem; font-size: .82rem; color: var(--on-dark-muted); text-align: center; }
.fid-sub button { background: none; border: 0; padding: .5rem 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.fid-offline { text-align: center; font-size: .8rem; color: var(--on-dark-muted); margin-top: .75rem; }

/* ---------- Formulaires (inscription, salon) ---------- */
.fid-box {
  padding: clamp(1.25rem, 4vw, 1.75rem); border-radius: 22px;
  background: var(--surface); border: 1px solid rgba(255, 255, 255, .12);
}
.fid-box h2 { font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1; letter-spacing: .02em; margin: 0 0 .5rem; }
.fid-box > p { color: var(--on-dark-muted); margin: 0 0 1.25rem; }
.fid-form { display: grid; gap: 1rem; }
.fid-field { display: grid; gap: .4rem; }
.fid-field label { font-size: .7rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--on-dark-muted); }
.fid-field input {
  width: 100%; min-height: 52px; padding: 0 1rem; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .14);
  color: #f2f2f4; font: 500 16px var(--f-sans);
}
.fid-field input:focus { outline: none; border-color: #f2f2f4; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.fid-check { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; font-size: .85rem; color: var(--on-dark-muted); }
.fid-check input { width: 22px; height: 22px; margin: 0; accent-color: #f2f2f4; }
.fid-check a { color: #f2f2f4; }
.fid-status { min-height: 1.4em; margin: 0; font-size: .9rem; color: var(--on-dark-muted); }
.fid-status.is-error { color: #f87171; }
.fid-status.is-ok { color: #4ade80; }
.fid-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.fid-form .btn { width: 100%; }
.fid-form.is-sending { opacity: .6; pointer-events: none; }

/* ---------- Espace salon ---------- */
.fsalon { max-width: 980px; margin: 0 auto; }
.salon-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.salon-top .section-title { font-size: clamp(2.75rem, 10vw, 4.5rem); }
.salon-top__tools { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip-btn {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line); color: #f2f2f4;
  font: 600 .8rem var(--f-sans); letter-spacing: .04em;
}
.chip-btn:hover { border-color: #f2f2f4; }
.salon-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.5rem; align-items: start; }
.salon-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.salon-stats div { padding: .85rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid rgba(255, 255, 255, .08); font-size: .72rem; color: var(--on-dark-muted); }
.salon-stats b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1; color: #f2f2f4; }

.salon-search { margin-bottom: .75rem; }
.salon-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; max-height: 62vh; overflow-y: auto; }
.salon-list button {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem;
  min-height: 60px; padding: .6rem 1rem; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08); color: #f2f2f4; font: 600 1rem var(--f-sans);
}
.salon-list button:hover, .salon-list button[aria-current="true"] { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .06); }
.salon-list small { display: block; font-weight: 500; font-size: .78rem; color: var(--on-dark-muted); }
.pill { white-space: nowrap; padding: .3rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: rgba(255, 255, 255, .08); }
.pill.is-ready { background: #f2f2f4; color: #07080a; }
.salon-empty { color: var(--on-dark-muted); padding: 1rem 0; }

.client { position: sticky; top: 1rem; }
.client__actions { display: grid; gap: .6rem; margin-top: 1rem; }
.client__actions .btn { width: 100%; }
.client__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.client__meta { font-size: .8rem; color: var(--on-dark-muted); margin: .75rem 0 0; text-align: center; }
.client__tel { color: var(--on-dark-muted); text-decoration: none; font-size: .9rem; }
.btn-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .25); color: #f2f2f4; }
.btn-ghost:disabled, .btn:disabled { opacity: .4; pointer-events: none; }
.btn-danger { color: #f87171; }

.salon-new { margin-top: 1.5rem; }
.salon-new .fid-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.salon-new .fid-check, .salon-new .btn, .salon-new .fid-status { grid-column: 1 / -1; }

/* Fenêtre (QR à montrer, affiche du comptoir) */
.fid-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .8); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.fid-modal[hidden] { display: none; }
.fid-modal__box { width: min(100%, 380px); padding: 1.5rem; border-radius: 22px; background: #111216; border: 1px solid rgba(255, 255, 255, .14); text-align: center; }
.fid-modal__box h2 { font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1; margin: 0 0 .5rem; }
.fid-modal__box p { color: var(--on-dark-muted); margin: 0 0 1rem; font-size: .9rem; }
.fid-modal__qr { display: grid; place-items: center; padding: 1rem; border-radius: 16px; background: #fff; margin-bottom: 1rem; }
.fid-modal__qr img, .fid-modal__qr canvas { width: 220px !important; height: 220px !important; }
.fid-modal__actions { display: grid; gap: .5rem; }

@media (max-width: 760px) {
  .salon-grid { grid-template-columns: minmax(0, 1fr); }
  .client { position: static; order: -1; }
  .salon-new .fid-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .pass__foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pass__foot > :last-child { grid-column: 1 / -1; text-align: left; }
}

/* Affiche du comptoir : seule la fenêtre s'imprime */
@media print {
  body.is-printing > *:not(.fid-modal) { display: none !important; }
  body.is-printing .fid-modal { position: static; background: #fff; }
  body.is-printing .fid-modal__box { background: #fff; color: #000; border: 0; width: 100%; }
  body.is-printing .fid-modal__box p { color: #333; }
  body.is-printing .fid-modal__actions { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pass.is-bump, .stamp.is-new, .stamp--gift.is-ready { animation: none !important; }
}

/* Les boutons masqués restent masqués (.btn impose display:inline-flex) */
.fid [hidden], .fsalon [hidden], .fid-modal [hidden] { display: none !important; }
