/* NOVORIVA Loyalty — couche UI V4.6 : jetons et composants communs (affine style.css / v2.css sans les réécrire).
   Pages client : les couleurs du RESTAURANT priment (brand.css) ; NOVORIVA reste discret. */
:root{
  --bg:#f4f6fa; --surface:#fff; --surface-2:#f8f9fc; --text:#121a2f; --muted:#5d6880; --line:#e2e7f0; --line-strong:#cfd7e4;
  --accent:#2f5fe0; --accent-ink:#fff; --accent-soft:#edf2ff; --navy:#111a33;
  --ok:#11845f; --ok-soft:#e7f6ef; --danger:#c0293f; --danger-soft:#fdecef; --warn:#9a5b00; --warn-soft:#fff5e3;
  --r-sm:10px; --r:14px; --r-lg:20px;
  --shadow:0 1px 2px rgba(18,26,47,.05),0 8px 24px rgba(18,26,47,.06);
  --shadow-lift:0 2px 4px rgba(18,26,47,.06),0 16px 36px rgba(18,26,47,.10);
  --focus:0 0 0 3px rgba(47,95,224,.35);
  --ease:cubic-bezier(.2,.8,.2,1);
}
html{font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;-webkit-text-size-adjust:100%;text-rendering:optimizeLegibility}
body{background:var(--bg);color:var(--text)}
::selection{background:rgba(47,95,224,.18)}
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:6px}
a{text-underline-offset:3px}
h1{font-size:clamp(26px,5.2vw,36px);letter-spacing:-.02em;line-height:1.15;text-wrap:balance}
h2{font-size:19px;letter-spacing:-.01em;margin-bottom:12px}
.muted{color:var(--muted)}
.num,.stat strong,.points strong,.badge,.kpi-value,td{font-variant-numeric:tabular-nums}
.ic{width:20px;height:20px;flex:none;vertical-align:-4px}
.ic-sm{width:16px;height:16px;vertical-align:-3px}
.skip{position:absolute;left:-9999px}.skip:focus{left:12px;top:12px;z-index:9;background:#fff;padding:8px 12px;border-radius:8px}

/* En-tête compact (une ligne, même sur iPhone) */
.topbar{position:sticky;top:0;z-index:5;background:rgba(255,255,255,.92);backdrop-filter:saturate(1.4) blur(10px);-webkit-backdrop-filter:saturate(1.4) blur(10px)}
.topbar-inner{min-height:58px;gap:12px}
.brand{display:inline-flex;align-items:center;gap:8px;font-size:17px;font-weight:800;letter-spacing:-.02em;white-space:nowrap}
.brand-icon{width:28px;height:28px;border-radius:8px;margin:0;background:var(--navy)}
.brand-icon .ic{width:16px;height:16px;color:#9fb8ff;vertical-align:0}
.brand-dot{display:none}
nav[aria-label="Navigation principale"]{gap:4px;font-size:14px;font-weight:600;overflow-x:auto;scrollbar-width:none}
nav[aria-label="Navigation principale"] a,nav[aria-label="Navigation principale"] .link-button{padding:8px 10px;border-radius:9px;white-space:nowrap;font-size:14px}
nav[aria-label="Navigation principale"] a:hover,nav[aria-label="Navigation principale"] .link-button:hover{background:var(--surface-2);text-decoration:none}
.nav-action{background:var(--accent);color:var(--accent-ink)!important}
.nav-action:hover{background:var(--accent)!important;filter:brightness(1.06)}
.topbar.slim nav .hide-slim{display:none}
@media(max-width:640px){.brand{font-size:15px;gap:7px}.brand-icon{width:26px;height:26px}.main{padding-top:22px}nav .hide-mobile{display:none}nav[aria-label="Navigation principale"] a,nav[aria-label="Navigation principale"] .link-button{padding:8px 7px;font-size:13.5px}}

/* Boutons : mêmes formes partout, états complets */
.button{border-radius:12px;min-height:48px;padding:12px 18px;font-size:15px;font-weight:700;letter-spacing:-.005em;
  transition:transform .15s var(--ease),box-shadow .2s var(--ease),filter .2s,background-color .2s;box-shadow:0 1px 2px rgba(18,26,47,.12)}
.button:hover{filter:brightness(1.06)}
.button:active{transform:translateY(1px)}
.button:focus-visible{box-shadow:var(--focus)}
.button-outline{background:var(--surface);border:1px solid var(--line-strong);color:var(--text);box-shadow:none}
.button-outline:hover{background:var(--surface-2);filter:none}
.button.small{min-height:36px;padding:7px 12px;font-size:13px;border-radius:10px}
.button[aria-busy=true]{position:relative;color:transparent!important;pointer-events:none}
.button[aria-busy=true]::after{content:"";position:absolute;inset:0;margin:auto;width:18px;height:18px;border-radius:50%;
  border:2px solid rgba(255,255,255,.55);border-top-color:#fff;animation:spin .7s linear infinite}
.button-outline[aria-busy=true]::after{border-color:var(--line-strong);border-top-color:var(--accent)}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Formulaires */
.stack label{font-size:14px;font-weight:650;color:var(--text)}
.stack input,select,textarea{border:1px solid var(--line-strong);border-radius:var(--r-sm);min-height:46px;background:var(--surface);transition:border-color .15s,box-shadow .15s}
.stack input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:var(--focus)}
[aria-invalid=true]{border-color:var(--danger)!important}
.field-error,.form-errors{color:var(--danger);font-size:13px}
.form-errors{background:var(--danger-soft);border-radius:var(--r);padding:12px 14px}

/* Messages (retour d'action) */
.message{display:flex;gap:10px;align-items:flex-start;border-radius:var(--r);padding:12px 14px;font-size:14px;font-weight:550;box-shadow:var(--shadow);
  background:var(--ok-soft);border:1px solid #bfe6d4;color:#0b5c42;animation:rise .25s var(--ease)}
.message.error{background:var(--danger-soft);border-color:#f3c2ca;color:#8e1d2e}
@keyframes rise{from{transform:translateY(-4px);opacity:.4}to{transform:none;opacity:1}}

/* Surfaces */
.card-panel,.stat,.list-panel,.restaurant-tile{border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow)}
.card-panel{padding:22px}
@media(min-width:720px){.card-panel{padding:28px}}
.list-row{transition:background-color .15s}
a.list-row:hover{background:var(--surface-2);text-decoration:none}
.badge{border-radius:999px;padding:3px 9px;font-size:12px;font-weight:700;letter-spacing:0}
.empty{border-radius:var(--r);border-color:var(--line-strong);text-align:left}

/* Espace commerçant : en-tête et navigation sur une seule ligne défilante */
.merchant-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.merchant-head h1{font-size:24px;margin:0}
.merchant-head .role{font-size:12px;font-weight:700;color:var(--muted);background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:4px 10px;white-space:nowrap}
.sub-nav{flex-wrap:nowrap;overflow-x:auto;gap:2px;margin:0 0 24px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:14px;
  scrollbar-width:none;scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,#000 92%,transparent)}
.sub-nav::-webkit-scrollbar{display:none}
.sub-nav a{flex:none;border:0;background:none;border-radius:10px;padding:9px 13px;font-size:14px;font-weight:650;color:var(--muted);scroll-snap-align:start}
.sub-nav a:hover{color:var(--text);background:var(--surface-2)}
.sub-nav a[aria-current=page]{background:var(--navy);color:#fff}
@media(min-width:900px){.sub-nav{-webkit-mask-image:none}}

/* Indicateurs du tableau de bord */
.kpi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
@media(min-width:900px){.kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.stat{padding:16px 18px}.stat span{font-size:13px}.stat strong{font-size:30px;letter-spacing:-.02em;margin-top:2px}

/* Page restaurant : identité du restaurant, valeur, création en un geste */
.r-hero{display:grid;gap:14px;margin-bottom:18px}
.r-hero .r-id{display:flex;align-items:center;gap:14px}
.r-hero .r-id img{width:60px;height:60px;border-radius:16px;object-fit:contain;background:#fff;box-shadow:var(--shadow)}
.r-hero h1{margin:0}
.r-tagline{margin:4px 0 0;color:var(--muted);font-size:16px}
.r-value{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.r-value li{display:inline-flex;align-items:center;gap:6px;color:inherit;background:color-mix(in srgb,currentColor 9%,transparent);
  border:1px solid color-mix(in srgb,currentColor 22%,transparent);border-radius:999px;padding:7px 12px;font-size:14px;font-weight:600}
.r-join{display:grid;gap:12px}
.r-join .offers-choice{margin:4px 0 0}
.r-join .choice-cta{min-height:56px;font-size:16px}
.r-join .fine{font-size:13px;color:var(--muted);margin:0}
.r-rewards{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.r-rewards li{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r)}
.r-rewards .ic{color:var(--accent)}
.r-rewards .pts{margin-left:auto;font-weight:750;white-space:nowrap}
.r-facts{display:flex;flex-direction:column;gap:6px;font-size:14px;color:var(--muted)}
.r-layout{display:grid;gap:18px}
@media(min-width:900px){.r-layout{grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);align-items:start}.r-side{position:sticky;top:76px}}
.scan-meta{margin:6px 0 0;font-size:14px;color:var(--muted)}
.section-head.merchant-head{align-items:center;margin-bottom:12px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.list-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}.list-head h2{margin:0}
.search{display:flex;gap:8px;flex:1;max-width:420px}.search input{flex:1;min-height:40px;padding:8px 12px;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface)}
.table{width:100%;border-collapse:collapse;font-size:14px}.table th{font-size:12px;font-weight:700;color:var(--muted);text-align:left;padding:10px 14px;border-bottom:1px solid var(--line);background:var(--surface-2)}
.table td{padding:11px 14px;border-bottom:1px solid var(--line)}.table tr:last-child td{border-bottom:0}.table .num{text-align:right}
.table a{display:inline-flex;gap:4px;align-items:baseline}.table-wrap{overflow-x:auto}
@media(max-width:640px){.clients th:nth-child(3),.clients td:nth-child(3){display:none}}
.r-tagline{color:inherit;opacity:.82}
.legal summary{cursor:pointer;font-weight:650;color:var(--text)}.legal summary::marker{color:var(--muted)}.legal p{margin:8px 0 0}
.section-head.merchant-head{flex-direction:row;align-items:center;justify-content:space-between;text-align:left;flex-wrap:wrap}
.merchant-head h1{text-align:left}
.period{display:inline-flex;gap:2px;padding:3px;background:var(--surface);border:1px solid var(--line);border-radius:12px}
.period .button{min-height:32px;padding:5px 12px;font-size:13px;border-radius:9px;box-shadow:none}
.period .button-outline{border:0;background:none;color:var(--muted)}
@media(max-width:640px){.clients th,.clients td{padding:10px 8px}.clients .badge{font-size:11px;padding:2px 7px}.clients td:first-child{max-width:130px}}
@media(max-width:720px){.topbar{position:static}.topbar-inner{padding:10px 0;gap:6px}}
/* Élévation neutre : pas de halo ni de lueur colorée (accueil NOVORIVA, modèle « Chaleureux ») */
.hero{background:var(--navy);box-shadow:var(--shadow-lift)}
.branded.brand-warm .restaurant-hero,.branded.brand-warm .digital-card,.branded .digital-card{box-shadow:0 2px 4px rgba(18,26,47,.08),0 14px 32px rgba(18,26,47,.14)}
.demo-ribbon{font-size:12px;letter-spacing:0;font-weight:700;text-transform:none}
.pill{font-size:12px;letter-spacing:.03em}

/* V4.9.0 — carte Web universelle : un élément masqué l'est vraiment (le style .button imposait display) */
.a2hs [hidden]{display:none!important}
.a2hs .button{margin:.25rem 0 .5rem}
/* V4.9.0-dev2 — carte Web : QR visible dès l'ouverture sur téléphone (mesuré : il était sous la ligne de flottaison) */
@media (max-width:760px){.card-col.qr-first{display:flex;flex-direction:column}.card-col.qr-first>.qr-panel{order:-1;margin-top:0;margin-bottom:1rem}
.card-col.qr-first>.qr-panel h2{margin-top:0}.card-col.qr-first>.qr-panel>p.muted:first-of-type{display:none}}
/* ===== V4.9.0-dev4 — LOYALTY-UX-MOBILE-01 : mobile d'abord, gros boutons, libellés simples ===== */
.m-cta{display:flex;align-items:center;justify-content:center;width:100%;min-height:58px;font-size:1.2rem;font-weight:800;border-radius:16px;text-align:center}
.m-check{display:flex;gap:12px;align-items:flex-start;padding:14px;border:2px solid var(--line,#e3e7ef);border-radius:14px;margin:0 0 14px;cursor:pointer;background:#fff;color:#111a33}
.m-check input{width:26px;height:26px;flex:0 0 26px;margin:2px 0 0;accent-color:var(--b-primary,#2f5fe0)}
.m-check strong{display:block;font-size:1.05rem;line-height:1.3}
.m-check small{display:block;color:#5b6478;margin-top:4px;line-height:1.35;font-size:.82rem}
.m-check:has(input:checked){border-color:var(--b-primary,#2f5fe0);box-shadow:0 0 0 3px rgba(47,95,224,.12)}
.m-reassure{text-align:center;margin-top:10px}
.m-links{display:flex;flex-wrap:wrap;gap:4px 18px}
.m-links a{display:inline-flex;align-items:center;min-height:44px}
.m-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:6px}
.m-top a{display:inline-flex;align-items:center;min-height:44px}
.topbar nav a,.topbar nav .link-button{min-height:44px;display:inline-flex;align-items:center}
.m-sum{display:none}
@media (max-width:760px){
  .card-col{display:flex;flex-direction:column}
  .card-col>.m-sum{order:-2;display:block;background:var(--b-card,#111a33);color:var(--b-on-card,#fff);border-radius:20px;padding:14px 18px;margin:0 0 12px}
  .m-sum-id{display:flex;align-items:center;gap:10px;font-size:1.05rem;line-height:1.25}
  .m-sum-id img{width:40px;height:40px;border-radius:10px;background:#fff;object-fit:contain;flex:0 0 40px}
  .m-points{display:flex;align-items:baseline;gap:8px;margin:10px 0 2px}
  .m-points .m-label{font-weight:700;opacity:.92}
  .m-points b{font-size:2.6rem;line-height:1;color:var(--b-points,inherit)}
  .m-points small{font-size:1.1rem;opacity:.85}
  .m-reward{background:#e7f8ee;color:#0b5d2a;border-radius:14px;padding:10px 12px;margin:8px 0 0;font-size:1.05rem;line-height:1.35}
  .m-next{margin:6px 0 0;opacity:.95}
  .card-col>.digital-card{order:6;margin-top:12px}
  .card-col>.qr-panel{padding:14px 16px}
  .card-col>.qr-panel h2{font-size:1.35rem;margin:0 0 6px}
  .qr-panel img.qr{width:min(66vw,260px);height:auto;display:block;margin:0 auto}
  .wallet-note{font-size:.9rem}
  .r-join .m-cta{margin-top:4px}
  .brand-banner{max-height:92px;width:100%;object-fit:cover}
  .r-hero{padding:16px !important}
  .r-hero .brand-logo{width:52px !important;height:52px !important}
  .r-hero h1{font-size:1.45rem !important;line-height:1.2}
  .r-value{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px !important}
  .r-value li{font-size:.85rem !important;padding:5px 10px !important}
}
/* V4.9.0-dev4 (mesures) : en-tête sur UNE ligne au téléphone (≈ 60 px au lieu de ≈ 290 px), résumé compact */
@media (max-width:760px){
  .topbar-inner{flex-direction:row !important;align-items:center !important;justify-content:space-between;padding:8px 0 !important;gap:8px !important}
  .topbar .brand-name{display:none}
  .topbar nav{gap:2px !important;flex-wrap:nowrap !important}
  .topbar nav .hide-mobile{display:none !important}
  .topbar nav a,.topbar nav .link-button{padding:0 8px;font-size:.95rem}
  .main{padding-top:12px !important}
  .m-top{margin:0 0 6px}
  .card-col>.m-sum{padding:12px 16px}
  .m-points{margin:6px 0 0}
  .m-points b{font-size:2.3rem}
  .m-reward{display:block;padding:8px 12px;font-size:1rem}
  .m-reward .ic{width:20px;height:20px;vertical-align:-4px}
  .m-reward small{display:block;font-size:.85rem;margin-top:2px}
  .r-hero{margin-bottom:10px !important}
  .r-join h2{font-size:1.2rem;margin:0 0 10px}
  .r-join{padding:14px !important}
}
@media (max-width:360px){.r-join h2{font-size:1.1rem;margin:0 0 8px}.m-check{padding:12px}.r-hero h1{font-size:1.3rem !important}}
/* V4.9.0-dev4 : zones tactiles ≥ 44 px pour les liens restants (mesurés) */
.topbar .brand{min-height:44px;display:inline-flex;align-items:center}
.back-link{min-height:44px;display:inline-flex;align-items:center}
details.legal summary{min-height:44px;display:flex;align-items:center;cursor:pointer}
.notice a,.r-facts a{display:inline-flex;align-items:center;min-height:44px}
.sub-nav a{min-height:44px;display:inline-flex;align-items:center}
/* V4.9.0-dev4 (mesure en préproduction, bannière du restaurant) : petits téléphones → règle du programme en une ligne dans le bloc de création */
.m-rule{display:none}
@media (max-width:420px){
  .r-value{display:none !important}
  .m-rule{display:block;margin:-4px 0 12px;font-weight:700;font-size:.95rem}
  .branded{padding:10px !important}
  .r-tagline,.brand-tagline{font-size:.95rem}
  .brand-banner{margin-bottom:10px !important}
}
@media (max-width:360px){
  .r-hero .r-tagline{display:none}
  .brand-banner{max-height:64px !important}
  .r-hero .brand-logo,.r-hero .r-id img{width:44px !important;height:44px !important}
  .r-hero{padding:12px 14px !important;gap:8px !important}
}
@media (max-width:420px){ .r-join h2{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap} }   /* masqué visuellement, lu par les lecteurs d'écran */
/* V4.9.0-dev4 (mesure vendeur 360 px) : jamais de lien coupé dans l'en-tête — retour à la ligne plutôt que rognage */
@media (max-width:760px){.topbar nav{flex-wrap:wrap !important;justify-content:flex-end;row-gap:0 !important}.topbar nav a,.topbar nav .link-button{padding:0 6px;font-size:.9rem}.topbar nav form{display:inline-flex}}
.m-reward-label{display:block;font-size:1.15rem;font-weight:800}
