:root {
--wine: #52031A;
--wine-2: #8A032D;
--gold: #c8932f;
--gold-soft: #fbf1dc;
--bg: #f6f2f3;
--surface: #ffffff;
--ink: #1c1417;
--muted: #7a6d72;
--line: #ece4e6;
--radius: 24px;
--shadow: 0 1px 2px rgba(40,10,20,.04), 0 8px 24px rgba(40,10,20,.07);
}

{ box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background:
radial-gradient(600px 300px at 50% -80px, rgba(138,3,45,.14), transparent 70%),
var(--bg);
color: var(--ink);
min-height: 100vh;
padding: max(20px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
-webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: 560px; margin: 0 auto; }

/* En-tête */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; padding: 0 4px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
width: 38px; height: 38px; border-radius: 12px;
background: linear-gradient(135deg, var(--wine), var(--wine-2));
color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem;
box-shadow: 0 6px 14px rgba(82,3,26,.3);
}
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; line-height: 1.1; }
.brand-sub { font-size: .72rem; color: var(--muted); font-weight: 500; }
.rule-chip { font-size: .7rem; font-weight: 700; color: var(--wine-2); background: #fff; border: 1px solid var(--line); padding: 6px 10px; border-radius: 999px; }

.grid { display: grid; gap: 14px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(236,228,230,.6); }
.card-title { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

/* Carte de fidélité */
.loyalty-card {
position: relative; overflow: hidden; cursor: pointer;
border-radius: 28px; padding: 24px; color: #fff;
background:
radial-gradient(420px 220px at 100% 0%, rgba(255,255,255,.18), transparent 60%),
radial-gradient(300px 200px at 0% 110%, rgba(200,147,47,.35), transparent 60%),
linear-gradient(135deg, var(--wine) 0%, var(--wine-2) 100%);
box-shadow: 0 20px 40px rgba(82,3,26,.35), inset 0 1px 0 rgba(255,255,255,.15);
transition: transform .25s ease;
}
.loyalty-card:active { transform: scale(.985); }
.loyalty-card::after {
content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
}
.lc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; position: relative; z-index: 1; }
.lc-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.lc-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.tag-status {
font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
backdrop-filter: blur(6px); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.barcode-wrapper { background: #fff; border-radius: 16px; padding: 14px 12px 8px; position: relative; z-index: 1; }
.barcode-wrapper svg { width: 100%; height: auto; max-height: 84px; display: block; }
.copy-note { text-align: center; font-size: .74rem; opacity: .75; margin-top: 12px; position: relative; z-index: 1; }
.gwallet-btn {
position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
margin-top: 16px; padding: 13px; border-radius: 14px; background: #fff; color: var(--wine);
font-weight: 800; font-size: .88rem; text-decoration: none;
box-shadow: 0 6px 16px rgba(0,0,0,.2); transition: transform .2s;
}
.gwallet-btn:hover { transform: translateY(-1px); }

/* Bon d'achat */
.reward {
display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius);
background: linear-gradient(135deg, #fff7e3, var(--gold-soft)); border: 1px solid #f0d9a4;
box-shadow: var(--shadow);
}
.reward-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--gold); color: #fff; display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; box-shadow: 0 6px 14px rgba(200,147,47,.4); }
.reward-title { font-weight: 800; font-size: .98rem; color: #5b3b05; }
.reward-sub { font-size: .8rem; color: #8a6a2a; margin-top: 2px; }

/* Stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-points { display: flex; flex-direction: column; justify-content: center; }
.stat-number { font-size: 3rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; background: linear-gradient(135deg, var(--wine), var(--wine-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-top: 6px; }
.stat-pill { display: inline-block; margin-top: 12px; background: var(--gold-soft); color: #8a5d0a; font-size: .72rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; align-self: flex-start; }
.ring-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 1.25rem; letter-spacing: -.02em; }
.ring-center small { display: block; font-size: .62rem; font-weight: 700; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.ring-caption { font-size: .76rem; color: var(--muted); margin-top: 10px; font-weight: 600; line-height: 1.3; }
.ring-caption b { color: var(--wine-2); }

/* Parrainage */
.referral {
display: flex; gap: 18px; align-items: center;
position: relative; overflow: hidden;
color: #fff;
background:
radial-gradient(420px 220px at 100% 0%, rgba(255,255,255,.18), transparent 60%),
radial-gradient(300px 200px at 0% 110%, rgba(200,147,47,.35), transparent 60%),
linear-gradient(135deg, var(--wine) 0%, var(--wine-2) 100%);
box-shadow: 0 20px 40px rgba(82,3,26,.35), inset 0 1px 0 rgba(255,255,255,.15);
border: 1px solid rgba(255, 255, 255, 0.15);
}
.referral h3 { font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.referral p { font-size: .82rem; color: rgba(255, 255, 255, 0.85); margin: 6px 0 14px; line-height: 1.45; }
.referral p b { color: #fff; }

.qr-frame { padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.qr-frame img, .qr-frame canvas { display: block; }
.btn-dark { border: none; cursor: pointer; background: var(--ink); color: #fff; font-weight: 700; font-size: .82rem; padding: 11px 16px; border-radius: 12px; transition: transform .2s; }
.btn-dark:hover { transform: translateY(-1px); }

/* Magasin */
.store-address { font-size: .9rem; line-height: 1.5; color: var(--ink); margin-bottom: 14px; }
.store-address span { color: var(--muted); }
.links-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-pill { text-align: center; text-decoration: none; font-weight: 700; font-size: .8rem; padding: 12px; border-radius: 14px; color: var(--wine); background: #fbeff2; border: 1px solid #f3d6de; transition: all .2s; }
.link-pill:hover { background: var(--wine); color: #fff; border-color: var(--wine); }

/* Historique */
.ticket-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.ticket-row:last-child { border-bottom: none; padding-bottom: 0; }
.ticket-icon { width: 40px; height: 40px; border-radius: 12px; background: #fbeff2; color: var(--wine-2); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-num { font-weight: 700; font-size: .9rem; }
.ticket-date { font-size: .76rem; color: var(--muted); margin-top: 1px; }
.ticket-right { text-align: right; }
.ticket-amount { font-weight: 800; font-size: .95rem; }
.ticket-points { font-size: .72rem; font-weight: 800; color: #1f8a4c; background: #e8f7ee; padding: 2px 8px; border-radius: 999px; display: inline-block; margin-top: 3px; }
.empty { font-size: .88rem; color: var(--muted); text-align: center; padding: 10px 0; }

.logout { display: block; text-align: center; margin: 22px auto 0; font-size: .82rem; font-weight: 600; color: var(--muted); text-decoration: none; padding: 10px; }
.logout:hover { color: var(--wine); }

/* Authentification */
.tabs-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: #ebe3e5; border-radius: 16px; margin-bottom: 16px; }
.tab-trigger { border: none; background: transparent; padding: 12px; border-radius: 12px; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer; transition: all .2s; }
.tab-trigger.active { background: #fff; color: var(--wine); box-shadow: 0 2px 8px rgba(40,10,20,.1); }
.auth-intro { text-align: center; margin: 8px 0 22px; }
.auth-intro h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.auth-intro p { color: var(--muted); font-size: .86rem; margin-top: 6px; }
.form-group { margin-bottom: 14px; }
label { display: block; font-size: .74rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; letter-spacing: .02em; }
input { width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; font-size: 1rem; font-family: inherit; color: var(--ink); background: #fcfafa; outline: none; transition: all .2s; }
input:focus { border-color: var(--wine-2); background: #fff; box-shadow: 0 0 0 4px rgba(138,3,45,.1); }
.btn-primary { width: 100%; padding: 15px; border: none; border-radius: 14px; font-size: .98rem; font-weight: 800; cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--wine), var(--wine-2)); box-shadow: 0 10px 22px rgba(82,3,26,.3); transition: transform .2s; margin-top: 6px; }
.btn-primary:hover { transform: translateY(-1px); }
.alert-box { background: #fef0f0; color: #a11a1a; padding: 13px 16px; border-radius: 14px; font-size: .86rem; margin-bottom: 16px; border: 1px solid #f7c9c9; font-weight: 600; }

.toast-msg { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; font-size: .86rem; font-weight: 600; box-shadow: 0 12px 28px rgba(0,0,0,.3); display: none; z-index: 1000; }

@media (max-width: 420px) {
.rule-chip { display: none; }
.referral { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ═════════════ Ajouts : nouvelles fonctionnalités ═════════════ */
[hidden] { display: none !important; }
a.brand { text-decoration: none; color: inherit; }
select { width: 100%; padding: 14px 12px; border: 1.5px solid var(--line); border-radius: 14px; font-size: 1rem; font-family: inherit; color: var(--ink); background: #fcfafa; outline: none; }
select:focus { border-color: var(--wine-2); box-shadow: 0 0 0 4px rgba(138,3,45,.1); }
.row-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.btn-link { display: block; text-align: center; text-decoration: none; }
.back-link { display: inline-block; margin: 0 4px 14px; font-size: .84rem; font-weight: 700; color: var(--wine-2); text-decoration: none; }

/* Pied de page */
.legal-links { text-align: center; margin: 18px 0 6px; font-size: .76rem; color: var(--muted); }
.legal-links a { color: var(--muted); text-decoration: none; padding: 6px 4px; }
.legal-links a:hover { color: var(--wine); text-decoration: underline; }

/* Scan en caisse : code-barres cliquable */
button.barcode-wrapper { display: block; width: 100%; border: none; font: inherit; color: inherit; text-align: center; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.scan-hint { display: block; margin-top: 8px; font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: #7a6d72; }
.barcode-fallback { font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; color: #2a0a14; padding: 12px 0; word-break: break-all; }
.scan-overlay {
position: fixed; inset: 0; z-index: 2000; background: #ffffff; color: #111;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom)); cursor: pointer;
}
.scan-overlay svg { width: 100%; max-width: 920px; height: auto; max-height: 68vh; display: block; }
.scan-note { font-size: .86rem; font-weight: 600; color: #555; text-align: center; }
.scan-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #ddd; background: #f4f4f4; color: #111; font-size: 1.1rem; cursor: pointer; }
body.scan-lock { overflow: hidden; }

/* Installation / hors-ligne */
.install-card { display: flex; align-items: center; gap: 14px; position: relative; padding-right: 44px; }
.install-card strong { font-size: .95rem; }
.install-card p { font-size: .8rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.install-card .btn-dark { flex-shrink: 0; }
.install-close { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border: none; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; border-radius: 50%; }
.offline-chip { background: #fff7e3; color: #7a5410; border: 1px solid #f0d9a4; border-radius: 14px; padding: 10px 14px; font-size: .8rem; font-weight: 600; margin-bottom: 14px; text-align: center; }

/* Bienvenue, offres, aide */
.welcome h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; }
.welcome ol { padding-left: 20px; font-size: .9rem; line-height: 1.6; color: var(--ink); margin-bottom: 12px; }
.welcome-bonus { background: var(--gold-soft); color: #7a5410; border-radius: 12px; padding: 10px 12px; font-size: .86rem; font-weight: 700; margin-bottom: 12px; }
.offer { padding: 12px 0; border-bottom: 1px solid var(--line); }
.offer:last-child { border-bottom: none; padding-bottom: 0; }
.offer-title { font-weight: 800; font-size: .95rem; }
.offer-desc { font-size: .84rem; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.offer-end { display: inline-block; margin-top: 6px; font-size: .7rem; font-weight: 800; color: #8a5d0a; background: var(--gold-soft); padding: 3px 8px; border-radius: 999px; }
.validity-note { font-size: .76rem; color: var(--muted); text-align: center; margin: -4px 8px 0; line-height: 1.4; }
.hint-card { display: block; text-decoration: none; color: var(--ink); font-size: .88rem; line-height: 1.45; }

/* Statut */
.status-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--wine); }
.perks { list-style: none; margin: 10px 0 14px; }
.perks li { font-size: .86rem; line-height: 1.45; padding-left: 20px; position: relative; margin-bottom: 4px; }
.perks li::before { content: "✓"; position: absolute; left: 0; color: #1f8a4c; font-weight: 800; }
.status-next { font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.status-next b { color: var(--wine-2); }
.bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--wine-2), var(--gold)); transition: width 1s ease; }
.status-foot { font-size: .72rem; color: var(--muted); margin-top: 8px; }
details.tiers { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.tiers summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--wine-2); list-style: none; }
details.tiers summary::-webkit-details-marker { display: none; }
details.tiers summary::after { content: " ▾"; }
details.tiers[open] summary::after { content: " ▴"; }
.tier { margin-top: 12px; }
.tier-name { font-weight: 800; font-size: .88rem; }
.tier-name span { font-weight: 600; color: var(--muted); }
.tier .perks { margin: 6px 0 0; }

/* Magasin */
.card-title .open-badge { margin-left: 8px; text-transform: none; letter-spacing: 0; font-size: .72rem; padding: 3px 9px; border-radius: 999px; font-weight: 800; vertical-align: 1px; }
.open-badge.open { color: #1f8a4c; background: #e8f7ee; }
.open-badge.closed { color: #a11a1a; background: #fef0f0; }
.hours-row { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; padding: 6px 0; color: var(--muted); }
.hours-row.today { color: var(--ink); font-weight: 800; }
.links-row-sep { margin-top: 14px; }
.review-pill { display: block; margin-top: 12px; }

/* Historique */
.chips { display: flex; gap: 8px; margin-bottom: 8px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: .76rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.chip.active { background: var(--wine); border-color: var(--wine); color: #fff; }
.ticket-points.neg { color: #a11a1a; background: #fef0f0; }

/* Compte, formulaires, messages */
.account-links { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.account-links > a { font-size: .86rem; font-weight: 700; color: var(--wine-2); text-decoration: none; padding: 8px; }
.account-links form { width: 100%; }
button.logout { background: none; border: none; width: 100%; cursor: pointer; font-family: inherit; }
.alert-box.success-box { background: #e8f7ee; color: #17663a; border-color: #bfe6cf; }
.alert-box.info-box { background: var(--gold-soft); color: #7a5410; border-color: #f0d9a4; }
.otp-input { text-align: center; font-size: 1.8rem; letter-spacing: .5em; font-weight: 800; padding-left: 1.2em; }
.auth-secondary { margin-top: 16px; text-align: center; font-size: .8rem; color: var(--muted); }
.auth-secondary a { display: inline-block; margin-top: 8px; color: var(--wine-2); font-weight: 700; padding: 6px; }
.form-note { font-size: .76rem; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.form-note-lead { font-size: .86rem; margin: 0 0 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .82rem; font-weight: 500; color: var(--ink); letter-spacing: 0; margin-top: 12px; line-height: 1.45; }
.check input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--wine-2); padding: 0; }
.check a { color: var(--wine-2); font-weight: 700; }
.prefs-title { margin-top: 22px; }
.btn-danger { width: 100%; padding: 14px; border: none; border-radius: 14px; font-size: .94rem; font-weight: 800; cursor: pointer; color: #fff; background: #b3261e; }
.danger-card { border-color: #f1c4c0; }
.error-card { text-align: center; }
.error-code { font-size: 3.2rem; font-weight: 900; color: var(--wine-2); line-height: 1; margin-bottom: 10px; }
.error-card h2 { margin-bottom: 8px; }
.legal h2 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 4px; }
.legal h3 { font-size: .95rem; margin: 18px 0 6px; }
.legal p, .legal li { font-size: .86rem; line-height: 1.6; color: var(--ink); }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 6px; }
.legal a { color: var(--wine-2); }
.legal-date { font-size: .74rem; color: var(--muted); }

/* ═════════════ Mode sombre automatique ═════════════ */
@media (prefers-color-scheme: dark) {
:root {
--bg: #14090c; --surface: #1f1216; --ink: #f4eaed; --muted: #a8979d; --line: #3a2830;
--gold-soft: #3a2b10; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}
body { background: radial-gradient(600px 300px at 50% -80px, rgba(138,3,45,.35), transparent 70%), var(--bg); }
.card { border-color: rgba(58,40,48,.7); }
.rule-chip { background: var(--surface); color: #e8a9bb; }
.brand-sub { color: var(--muted); }
input, select { background: #261a1f; color: var(--ink); border-color: var(--line); }
input:focus, select:focus { background: #2d1f25; border-color: #d4506f; box-shadow: 0 0 0 4px rgba(212,80,111,.2); }
input:disabled { opacity: .6; }
.tabs-nav { background: #261a1f; }
.tab-trigger.active { background: var(--surface); color: #f0a8bb; box-shadow: none; }
.alert-box { background: #3a1517; color: #ffb4b0; border-color: #5c2427; }
.alert-box.success-box { background: #12301f; color: #8fe0ae; border-color: #1f5133; }
.alert-box.info-box { background: var(--gold-soft); color: #f0d08a; border-color: #5c4416; }
.reward { background: linear-gradient(135deg, #3a2b10, #2e220d); border-color: #5c4416; }
.reward-title { color: #f6dca0; }
.reward-sub { color: #cdaa60; }
.stat-pill, .offer-end { background: var(--gold-soft); color: #f0c872; }
.stat-number { background: linear-gradient(135deg, #f08aa5, #e0a24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ring-caption b, .status-next b { color: #f08aa5; }
.status-name, .back-link, .legal a, .check a, .auth-secondary a, .account-links > a, details.tiers summary { color: #f08aa5; }
.qr-frame { background: #fff; border-color: transparent; }
.link-pill { background: #2d1a21; border-color: #4a2a35; color: #f0a8bb; }
.link-pill:hover { background: var(--wine-2); color: #fff; border-color: var(--wine-2); }
.ticket-icon { background: #2d1a21; color: #f08aa5; }
.ticket-points { background: #12301f; color: #8fe0ae; }
.ticket-points.neg { background: #3a1517; color: #ffb4b0; }
.open-badge.open { background: #12301f; color: #8fe0ae; }
.open-badge.closed { background: #3a1517; color: #ffb4b0; }
.offline-chip { background: var(--gold-soft); color: #f0d08a; border-color: #5c4416; }
.chip.active { background: var(--wine-2); border-color: var(--wine-2); }
.danger-card { border-color: #5c2427; }
.btn-dark { background: #f4eaed; color: #1c1417; }
.toast-msg { background: #f4eaed; color: #1c1417; }
.logout:hover { color: #f08aa5; }
}