/* Thème Digikart — fond gris ardoise, accents bleus. Partagé scan + carte. */
:root {
  --bg: #0f141b;
  --surface: #171f2a;
  --surface-2: #1e2735;
  --border: #2a3645;
  --text: #e7edf5;
  --muted: #93a1b3;
  --blue: #3b82f6;
  --blue-600: #2563eb;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --good: #22c55e;
  --warn: #f59e0b;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  /* surchargée en JS par la couleur du commerçant */
  --brand: #2563eb;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b2533 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brandbar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}
.brandbar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px var(--blue-soft);
}

h1 { font-size: 24px; margin: 6px 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* --- Carte de fidélité (rendu visuel) --- */
.loyalty {
  background: linear-gradient(155deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000));
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  color: #fff;
}
.loyalty::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(400px 200px at 90% -20%, rgba(255,255,255,.25), transparent 60%);
  pointer-events: none;
}
.loyalty .lhead {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 18px;
}
.loyalty .biz { font-size: 19px; font-weight: 800; }
.loyalty .lbl { font-size: 12px; opacity: .85; text-transform: uppercase; letter-spacing: .5px; }
.loyalty .reward { font-size: 14px; opacity: .95; margin-top: 2px; }
.loyalty .badge {
  background: rgba(255,255,255,.18);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700;
  backdrop-filter: blur(4px);
}

/* Pastilles de tampons */
.dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dots .d {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  display: grid; place-items: center;
  font-size: 13px;
  transition: transform .25s, background .25s;
}
.dots .d.on { background: #fff; color: var(--brand); border-color: #fff; }
.dots .d.pop { animation: pop .45s ease; }
@keyframes pop { 0%{transform:scale(.4)} 60%{transform:scale(1.25)} 100%{transform:scale(1)} }

.progress-line { margin-top: 14px; font-size: 13px; opacity: .9; }

/* --- Cartes UI / panneaux --- */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  border: none; border-radius: 14px;
  padding: 15px 18px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, opacity .12s, background .12s;
}
.btn:active { transform: scale(.98); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: var(--blue-600); }
.btn-dark { background: #000; color: #fff; }
.btn-light { background: #fff; color: #111; }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn + .btn { margin-top: 10px; }

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  margin-bottom: 12px;
}
.input:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }

.banner {
  border-radius: 12px; padding: 12px 14px; font-size: 13px;
  margin-bottom: 14px; line-height: 1.4;
}
.banner-demo { background: var(--blue-soft); border: 1px solid var(--blue); color: #cfe0ff; }
.banner-good { background: rgba(34,197,94,.12); border: 1px solid var(--good); color: #c8f5d6; }

.qr {
  background: #fff; padding: 14px; border-radius: 16px;
  width: fit-content; margin: 8px auto;
}
.qr img { display: block; width: 220px; height: 220px; }

.spacer { flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.foot b { color: var(--blue); }

.hidden { display: none !important; }
.fade-in { animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--good); color: #04210f; font-weight: 700;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow);
  animation: fade .3s ease;
}
