:root {
  /* Charte CFEN Presta16 : encre noire, jaune de marque, papier chaud.
     --brand porte les aplats (texte --on-brand dessus) ; --teal reste le
     nom historique de l'accent lisible sur fond clair (or foncé). */
  --navy:     #16181c;
  --brand:    #ffd520;
  --on-brand: #16181c;
  --teal:     #8a6f00;
  --teal-bg:  #fff7d6;
  --on-ink:   #ffd520;   /* accent lisible sur les fonds encre */
  --bg:       #f6f6f3;
  --white:    #ffffff;
  --border:   #e4e3dd;
  --text:     #16181c;
  --muted:    #6f6f68;
  --light:    #a9a9a0;
  --r:       12px;
  --r-sm:    8px;
  --r-xs:    6px;
  --sh:      0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --sh-md:   0 8px 32px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font-family: 'Plus Jakarta Sans', sans-serif; cursor: pointer; border: none; background: none; }

/* ── Header ──────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--white); height: 58px;
  border-bottom: 3px solid var(--brand);
}
.header-inner {
  height: 100%; max-width: 920px; margin: 0 auto;
  padding: 0 20px; display: flex; align-items: center; gap: 8px;
}
.header-logo { height: 26px; flex-shrink: 0; }
.header-nav { display: flex; align-items: center; gap: 2px; margin-left: 20px; flex: 1; }
@media (max-width: 640px) { .header-nav { display: none; } }
.hn-btn {
  padding: 7px 14px; border-radius: var(--r-xs);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: color .15s, background .15s;
}
.hn-btn:hover  { color: var(--text); background: rgba(22,24,28,.05); }
.hn-btn.active { color: var(--text); background: var(--brand); }
.header-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.hu-name {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
@media (max-width: 480px) { .hu-name { display: none; } }
.btn-logout {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 5px 12px; border-radius: var(--r-xs);
  border: 1px solid var(--border);
  transition: background .15s, color .15s; white-space: nowrap;
}
.btn-logout:hover { background: rgba(22,24,28,.05); color: var(--text); }

/* ── Layout ──────────────────────────────────────────────── */
.main-wrap { padding-top: 58px; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); min-height: 100dvh; }
@media (min-width: 641px) { .main-wrap { padding-bottom: 32px; } }
.page-inner { max-width: 700px; margin: 0 auto; padding: 28px 16px; }

/* ── Bottom nav ──────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--white); border-top: 1px solid var(--border);
  display: flex;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 641px) { .bottom-nav { display: none; } }
.bn-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--light); transition: color .15s; padding: 8px 4px;
}
.bn-btn.active { color: var(--teal); }
.bn-icon  { display: flex; align-items: center; }
.bn-label { font-size: 10.5px; font-weight: 600; }

/* ── Dashboard greeting ──────────────────────────────────── */
.dash-greeting {
  font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 20px;
}

/* ── NFC Card 3D ─────────────────────────────────────────── */
.card-scene {
  perspective: 1200px;
  width: min(100%, 380px);
  margin: 0 auto 24px;
  aspect-ratio: 1.586;
  -webkit-tap-highlight-color: transparent;
  container-type: inline-size;
  cursor: pointer;
}
.card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}
.card-face {
  position: absolute; inset: 0; border-radius: 16px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* ── Card front (PNG background) ────────────────────────── */
.card-front {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  box-shadow: 0 24px 60px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.16);
}
.card-shine {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
}

/* Bandeau solde — en haut, la seule zone libre des cartes CFEN */
.card-info {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 6.5% 5.5% 0;
}
.card-info-left  { /* solde */ }
.card-info-right { text-align: right; }

/* Prefixe cov- (card overlay) pour éviter collision avec credit-item ci-* */
.cov-label {
  font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.8px;
  line-height: 1; margin-bottom: 3px; display: block;
}
.cov-amount {
  font-size: 22px; font-weight: 800; line-height: 1;
  letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
  display: block;
}
@media (max-width: 360px) { .cov-amount { font-size: 18px; } }

.cov-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px; font-weight: 700; letter-spacing: 2px;
  display: block; line-height: 1; margin-bottom: 4px;
}
@media (max-width: 360px) { .cov-code { font-size: 11px; letter-spacing: 1px; } }

.cov-flip {
  font-size: 10px; font-weight: 600; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 3px;
  opacity: .7; transition: opacity .15s; padding: 0;
}
.cov-flip:hover { opacity: 1; }

/* ── Card back (PNG verso) ───────────────────────────────── */
.card-back {
  transform: rotateY(180deg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 24px 60px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.14);
  border-radius: 16px;
}

/* Zone code — bas droite (zone grise du verso) */
.cbcz {
  position: absolute;
  bottom: 11.5%;
  right: 7.5%;
  width: 34%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 15%;
}
.cbcz-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: clamp(10px, 4.5cqi, 22px);
  font-weight: 700;
  color: #555;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}
/* Bouton copier sous la zone grise, centré */
.cbcz-copy {
  position: absolute;
  bottom: 2.5%;
  right: 7.5%; width: 34%;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(7px, 1.8cqi, 10px); font-weight: 600;
  color: #888; opacity: .75; transition: opacity .15s;
}
.cbcz-copy:hover { opacity: 1; }

/* ── Dash stats ──────────────────────────────────────────── */
.dash-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.dash-stat {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh);
  padding: 16px; text-align: center;
}
.dash-stat.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.dash-stat.clickable:hover { border-color: var(--teal); box-shadow: 0 4px 20px rgba(22,24,28,.08); }
.ds-value { font-size: 24px; font-weight: 700; color: var(--teal); display: flex; align-items: center; justify-content: center; line-height: 1; }
.ds-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-top: 5px; }

/* ── Section title ───────────────────────────────────────── */
.section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; margin-top: 24px;
}

/* ── CTA link ────────────────────────────────────────────── */
.cta-link {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; text-align: left; width: 100%;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--sh);
  transition: border-color .15s, box-shadow .15s;
}
.cta-link:hover { border-color: var(--teal); box-shadow: 0 4px 20px rgba(22,24,28,.08); }
.cta-body  { flex: 1; }
.cta-title { font-size: 15px; font-weight: 600; color: var(--text); }
.cta-sub   { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cta-arrow { color: var(--light); flex-shrink: 0; transition: color .15s; }
.cta-link:hover .cta-arrow { color: var(--teal); }

/* ── Card generic ────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }

/* ── Code card (parrainage page) ─────────────────────────── */
.code-card { padding: 22px 24px; margin-bottom: 14px; }
.cc-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 10px; }
.cc-value { font-family: 'Courier New', Courier, monospace; font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: 4px; margin-bottom: 16px; }
@media (max-width: 400px) { .cc-value { font-size: 20px; letter-spacing: 2px; } }
.cc-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-hint    { font-size: 12.5px; color: var(--muted); }

/* ── Page header ─────────────────────────────────────────── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-header p  { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-copy {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--r-sm);
  background: var(--teal-bg); color: var(--teal);
  border: 1px solid rgba(138,111,0,.28);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.btn-copy:hover { background: rgba(138,111,0,.14); }

.btn-submit {
  width: 100%; padding: 13px; background: var(--brand); color: var(--on-brand);
  border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; font-weight: 700;
  transition: opacity .15s;
}
.btn-submit:hover   { opacity: .88; }
.btn-submit:active  { opacity: .8; }
.btn-submit:disabled { opacity: .4; cursor: not-allowed; }

.btn-link {
  background: none; color: var(--muted); font-size: 13px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.btn-link:hover { color: var(--text); }

/* ── Member list ─────────────────────────────────────────── */
.member-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.member-item:last-child { border-bottom: none; }
.mi-avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.mi-info { flex: 1; min-width: 0; }
.mi-name { font-size: 14px; font-weight: 600; color: var(--text); }
.mi-date { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.badge--green  { background: #e9efeb; color: #2e4a3c; }
.badge--yellow { background: #fff7d6; color: #8a6f00; }
.badge--gray   { background: #f1f5f9; color: #64748b; }
.badge--blue   { background: #eff8ff; color: #2563eb; }

/* ── Credit list ─────────────────────────────────────────── */
.credit-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.credit-item:last-child { border-bottom: none; }
.ci-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 50%; background: var(--teal-bg); color: var(--teal); display: flex; align-items: center; justify-content: center; }
.ci-amount { font-size: 16px; font-weight: 700; color: var(--teal); }
.ci-date   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Boutique categories ─────────────────────────────────── */
.cat-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; margin-top: 4px;
}
.cat-tab {
  padding: 7px 14px; border-radius: 100px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--white); color: var(--muted);
  transition: all .15s; white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.cat-tab:hover  { border-color: var(--teal); color: var(--teal); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ── Solde bar (boutique) ────────────────────────────────── */
.solde-bar { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; margin-bottom: 20px; }
.sb-label  { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.sb-amount { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1; font-variant-numeric: tabular-nums; }
.sb-icon   { color: var(--teal); opacity: .35; }

/* ── Products grid ───────────────────────────────────────── */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
@media (min-width: 480px) { .products-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }
.product-card { overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.product-card:hover { border-color: #c5d2e0; box-shadow: var(--sh-md); }
.pc-image { position: relative; width: 100%; aspect-ratio: 4/3; background: #f0f3f7; color: var(--light); }
.pc-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px; box-sizing: border-box; }
.pc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; background: rgba(255,255,255,.82); color: #444; border: none; border-radius: 50%; cursor: pointer; z-index: 3; padding: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: background .15s; }
.pc-arrow svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pc-arrow:hover { background: #fff; color: #111; }
.pc-prev { left: 6px; }
.pc-next { right: 6px; }
.pc-dots { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.pc-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.25); cursor: pointer; pointer-events: auto; transition: background .15s; border: 1.5px solid rgba(255,255,255,.6); }
.pc-dots .dot.active { background: var(--brand); border-color: var(--brand); }
.pc-body  { padding: 14px; }
.pc-name  { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 4px; }
.pc-desc  { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 8px; }
.pc-price { font-size: 20px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.pc-price span { font-size: 11px; color: var(--muted); font-weight: 500; }
.pc-stock { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.pc-btn {
  width: 100%; margin-top: 12px; padding: 9px; border-radius: var(--r-xs);
  background: var(--brand); color: var(--on-brand);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 600; transition: opacity .15s;
}
.pc-btn:not(:disabled):hover { opacity: .85; }
.pc-btn:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

/* ── Order item ──────────────────────────────────────────── */
.order-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.order-item:last-child { border-bottom: none; }
.oi-icon  { width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r-xs); background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.oi-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.oi-date  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.oi-price { font-size: 16px; font-weight: 700; color: var(--text); text-align: right; flex-shrink: 0; }

/* ── Inner card ──────────────────────────────────────────── */
.inner-card { padding: 20px 22px; margin-bottom: 14px; }

/* ── Auth ────────────────────────────────────────────────── */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-box  { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-md); padding: 40px 36px; }
@media (max-width: 460px) { .auth-box { padding: 32px 22px; } }
.auth-logo  { text-align: center; margin-bottom: 28px; }
.auth-logo img { height: 46px; margin: auto; }  /* lockup Presta16 | cfen : tres large (ratio ~4:1) */
.auth-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
.form-label  { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input  {
  width: 100%; padding: 11px 14px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: 'Plus Jakarta Sans', sans-serif; font-size: 15px; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(255,213,32,.35); }
.form-input::placeholder { color: var(--light); }
.form-input:disabled { background: var(--bg); color: var(--muted); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 14px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5; margin-bottom: 16px; }
.alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert--ok    { background: #f0fdf8; color: #059669; border: 1px solid #a7f3d0; }
.alert--info  { background: #eff8ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Loading / empty ─────────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 200px; color: var(--muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; flex-shrink: 0; border: 2px solid var(--border); border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.es-icon { margin-bottom: 12px; opacity: .3; }
.es-text { font-size: 14px; line-height: 1.7; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-wrap { position: fixed; bottom: 78px; right: 16px; z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
@media (min-width: 641px) { #toast-wrap { bottom: 24px; } }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; max-width: 280px; box-shadow: 0 4px 20px rgba(0,0,0,.2); pointer-events: auto; animation: tin .25s ease-out, tout .25s ease-in 2.75s forwards; }
.toast--err { background: #b91c1c; }
@keyframes tin  { from { opacity: 0; transform: translateX(12px); } }
@keyframes tout { to   { opacity: 0; transform: translateX(12px); } }

/* ── Page transition ─────────────────────────────────────── */
.page-enter { animation: pen .22s ease-out; }
@keyframes pen { from { opacity: 0; transform: translateY(8px); } }

/* ── Thème complet par carte (surcharge des variables CSS) ── */
/* Chaque carte reprend l'accent de son exemplaire physique :
   Privilège = jaune CFEN, Ambassadeur = vert profond. */
body[data-carte="1"],
body[data-carte="3"] { --brand: #ffd520; --on-brand: #16181c; --teal: #8a6f00; --teal-bg: #fff7d6; } /* CF_Pri / PR_Pri */
body[data-carte="2"],
body[data-carte="4"] { --brand: #2e4a3c; --on-brand: #ffffff; --teal: #2e4a3c; --teal-bg: #e9efeb; } /* CF_Amb / PR_Amb */

/* ── Leaderboard ─────────────────────────────────────────── */
.lb-card { padding: 0 !important; overflow: hidden; }
.lb-header {
  display: flex; align-items: center;
  padding: 10px 18px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted);
}
.lb-header span:last-child { margin-left: auto; }
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: var(--bg); }
.lb-row--me { background: var(--teal-bg); }
.lb-row--me:hover { background: var(--teal-bg); }
.lb-rank { font-size: 13px; width: 24px; flex-shrink: 0; }
.lb-code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px; font-weight: 700; color: var(--text); flex: 1;
  letter-spacing: 1px;
}
.lb-row--me .lb-code { color: var(--teal); }
.lb-count {
  font-size: 15px; font-weight: 700; color: var(--teal);
  margin-left: auto; flex-shrink: 0;
}

/* ── Legal footer ────────────────────────────────────────── */
.legal-footer {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 4px; padding: 20px 16px 12px; border-top: 1px solid var(--border);
  margin-top: 8px;
}
.lf-link {
  font-size: 12px; color: var(--muted); padding: 4px 6px; border-radius: var(--r-xs);
  font-family: 'Plus Jakarta Sans', sans-serif; transition: color .15s, background .15s;
}
.lf-link:hover { color: var(--text); background: var(--border); }
.lf-sep  { font-size: 12px; color: var(--border); }
.lf-copy { font-size: 12px; color: var(--light); padding: 4px 6px; }

/* ── Auth legal links ────────────────────────────────────── */
.auth-legal {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 4px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border);
}
.auth-legal .btn-link { font-size: 12px; }

/* ── Legal page body ─────────────────────────────────────── */
.legal-body { padding: 24px; }
.legal-body h3 { font-size: 14px; font-weight: 700; color: var(--navy); margin: 20px 0 8px; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p  { font-size: 13.5px; color: var(--text); line-height: 1.75; margin-bottom: 10px; }
.legal-body ul { font-size: 13.5px; color: var(--text); line-height: 1.75; padding-left: 20px; margin-bottom: 10px; }
.legal-body li { margin-bottom: 4px; }
.legal-body a  { color: var(--teal); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.legal-body code { font-size: 12px; background: var(--bg); padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; }
.legal-body em { color: var(--muted); }
.legal-body strong { color: var(--text); }

/* ── Legal modal ─────────────────────────────────────────── */
.legal-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(22,24,28,.45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.legal-modal-box {
  background: var(--white); border-radius: var(--r); width: 100%; max-width: 620px;
  max-height: 88dvh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.lmb-close {
  display: flex; align-items: center; gap: 6px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); width: 100%; text-align: left;
  font-size: 13px; font-weight: 600; color: var(--muted);
  font-family: 'Plus Jakarta Sans', sans-serif; transition: color .15s;
  flex-shrink: 0;
}
.lmb-close:hover { color: var(--text); }
.lmb-content { overflow-y: auto; padding: 24px; flex: 1; }
.lmb-content .page-header { margin-bottom: 16px; }

/* ── Cookie banner ───────────────────────────────────────── */
.cookie-banner {
  position: fixed; left: 0; right: 0; z-index: 300;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: rgba(255,255,255,.88);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
}
@media (min-width: 641px) { .cookie-banner { bottom: 0; } }
.cb-text { font-size: 13px; flex: 1; min-width: 200px; line-height: 1.55; }
.cb-link {
  color: var(--on-ink); background: none; border: none; font-size: 13px;
  cursor: pointer; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 600;
}
.cb-link:hover { text-decoration: underline; }
.cb-btn {
  background: var(--brand); color: var(--on-brand); border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: var(--r-xs);
  white-space: nowrap; font-family: 'Plus Jakarta Sans', sans-serif; transition: opacity .15s;
}
.cb-btn:hover { opacity: .88; }

/* ── Utils ───────────────────────────────────────────────── */
.mt-4       { margin-top: 16px; }
.mb-4       { margin-bottom: 16px; }
.text-sm    { font-size: 13px; }
.text-muted { color: var(--muted); }
.flex       { display: flex; }
.items-center { align-items: center; }
.gap-2      { gap: 8px; }
.flex-1     { flex: 1; }
.min-w-0    { min-width: 0; }

/* ── CTA Parrainer ───────────────────────────────────────── */
.btn-parrainer {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; margin-bottom: 20px;
  background: var(--navy); border: none; border-radius: var(--r);
  box-shadow: 0 6px 24px rgba(22,24,28,.18);
  cursor: pointer; text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: box-shadow .18s ease, transform .18s ease;
}
.btn-parrainer:hover  { box-shadow: 0 10px 32px rgba(22,24,28,.26); }
.btn-parrainer:active { transform: scale(.985); }
.btn-parrainer:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.bp-icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  background: rgba(255,213,32,.18); color: var(--on-ink);
  display: flex; align-items: center; justify-content: center;
}
.bp-text  { flex: 1; min-width: 0; }
.bp-title { display: block; font-size: 16px; font-weight: 700; color: #fff; }
.bp-sub   { display: block; font-size: 12.5px; color: rgba(255,255,255,.6); margin-top: 2px; }
.bp-arrow { color: rgba(255,255,255,.45); flex-shrink: 0; display: flex; }
.btn-parrainer:hover .bp-arrow { color: var(--on-ink); }

.dash-stat.clickable:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ── Bottom sheet ────────────────────────────────────────── */
body.no-scroll { overflow: hidden; }

.sheet-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(22,24,28,.5); backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: shOv .2s ease-out;
}
.sheet {
  position: relative;
  width: 100%; max-height: 92dvh;
  background: var(--white);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 48px rgba(22,24,28,.3);
  display: flex; flex-direction: column;
  animation: shUp .28s cubic-bezier(.32,.72,0,1);
}
.sheet-overlay.is-closing            { animation: shOv .18s ease-in reverse; }
.sheet-overlay.is-closing .sheet     { animation: shUp .18s ease-in reverse; }
@keyframes shOv { from { opacity: 0; } }
@keyframes shUp { from { transform: translateY(100%); } }

.sheet-grab {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 10px auto 0; flex-shrink: 0;
}
.sheet-close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); border: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, color .15s;
}
.sheet-close:hover { background: #e6ecf3; color: var(--text); }
.sheet-close:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.sheet-head { padding: 14px 20px 18px; flex-shrink: 0; }
.sheet-eyebrow {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--on-ink); margin-bottom: 6px;
}
.sheet-title {
  font-size: 20px; font-weight: 700; color: var(--text);
  line-height: 1.25; margin: 0 44px 16px 0;
}
.sheet-reward {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-sm);
  background: var(--navy);
}
.sr-amount {
  font-size: 22px; font-weight: 700; color: var(--on-ink);
  line-height: 1; flex-shrink: 0; font-variant-numeric: tabular-nums;
}
.sr-text { font-size: 12.5px; line-height: 1.4; color: rgba(255,255,255,.72); }

.sheet-body {
  flex: 1 1 auto; min-height: 0;
  padding: 4px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.sheet-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; line-height: 1.5; }

/* ── Champs de la feuille ────────────────────────────────── */
.field     { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 359px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.sheet .form-input { font-size: 16px; min-height: 46px; }   /* 16px : pas de zoom iOS */
.form-input.is-invalid { border-color: #e9a3a3; }
.form-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(185,28,28,.1); }

.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.field-err  { display: block; font-size: 12px; font-weight: 600; color: #b91c1c; margin-top: 5px; line-height: 1.4; }
.field-err:empty { display: none; }

.select-wrap { position: relative; }
.select-wrap select.form-input {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px; cursor: pointer; background: var(--white);
}
.select-wrap::after {
  content: ''; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}
.select-wrap select.form-input:invalid { color: var(--light); }

/* ── Confirmation ────────────────────────────────────────── */
.parr-done { text-align: center; padding: 12px 0 4px; }
.pd-check {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--teal-bg); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  animation: pdPop .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pdPop { from { transform: scale(.6); opacity: 0; } }
.pd-title { font-size: 19px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.pd-text  { font-size: 14px; line-height: 1.65; color: var(--muted); margin-bottom: 22px; }
.pd-again { margin-top: 12px; }

/* ── Feuille → boîte de dialogue sur grand écran ─────────── */
@media (min-width: 600px) {
  .sheet-overlay { align-items: center; padding: 20px; }
  .sheet {
    max-width: 520px; border-radius: var(--r);
    max-height: 88dvh; box-shadow: 0 24px 64px rgba(22,24,28,.32);
    animation: shPop .24s cubic-bezier(.32,.72,0,1);
  }
  .sheet-overlay.is-closing .sheet { animation: shPop .18s ease-in reverse; }
  @keyframes shPop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-overlay, .sheet, .pd-check { animation: none !important; }
  .btn-parrainer { transition: none; }
}
