/* ============================================================
   5-5.pro — Design System v4
   Dark/Light theme · Performance-first · Zero backdrop-filter
   ============================================================ */

/* ── Tokens — Dark (default) ──────────────────────────────── */
:root {
  --c-bg:            #0a0a14;
  --c-bg-rgb:        10, 10, 20;
  --c-surface:       rgba(255,255,255,0.04);
  --c-surface-hover: rgba(255,255,255,0.07);
  --c-glass-border:  rgba(255,255,255,0.08);
  --c-text:          #e2e8f0;
  --c-text-muted:    #94a3b8;
  --c-text-faint:    #64748b;
  --c-text-heading:  #f1f5f9;

  --c-primary:       #3b82f6;
  --c-primary-light: #60a5fa;
  --c-primary-glow:  rgba(59,130,246,0.2);

  --c-accent:        #06b6d4;
  --c-accent-light:  #22d3ee;
  --c-success:       #10b981;
  --c-success-light: #34d399;
  --c-warning:       #f59e0b;
  --c-warning-light: #fbbf24;
  --c-danger:        #ef4444;
  --c-danger-light:  #f87171;

  --c-input-bg:      rgba(0,0,0,0.25);
  --c-input-bg-focus:rgba(0,0,0,0.35);
  --c-input-border:  rgba(255,255,255,0.06);
  --c-input-border-hover: rgba(255,255,255,0.12);
  --c-row-hover:     rgba(255,255,255,0.02);
  --c-row-border:    rgba(255,255,255,0.03);
  --c-icon:          rgba(148,163,184,0.4);
  --c-placeholder:   rgba(148,163,184,0.3);
  --c-auth-card-bg:  rgba(12,12,24,0.85);
  --c-blob-opacity:  1;
  --c-shadow:        0,0,0;

  --s-xs: .25rem; --s-sm: .5rem; --s-md: .75rem; --s-lg: 1rem;
  --s-xl: 1.5rem; --s-2xl: 2rem; --s-3xl: 3rem;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;
  --t-fast: .15s ease; --t-base: .25s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Tokens — Light ───────────────────────────────────────── */
[data-theme="light"] {
  --c-bg:            #f0f2f5;
  --c-bg-rgb:        240,242,245;
  --c-surface:       rgba(255,255,255,0.7);
  --c-surface-hover: rgba(255,255,255,0.85);
  --c-glass-border:  rgba(0,0,0,0.08);
  --c-text:          #1e293b;
  --c-text-muted:    #475569;
  --c-text-faint:    #94a3b8;
  --c-text-heading:  #0f172a;

  --c-primary:       #2563eb;
  --c-primary-light: #3b82f6;
  --c-primary-glow:  rgba(37,99,235,0.12);

  --c-accent:        #0891b2;
  --c-accent-light:  #06b6d4;
  --c-success:       #059669;
  --c-success-light: #10b981;
  --c-warning:       #d97706;
  --c-warning-light: #f59e0b;
  --c-danger:        #dc2626;
  --c-danger-light:  #ef4444;

  --c-input-bg:      rgba(255,255,255,0.6);
  --c-input-bg-focus:rgba(255,255,255,0.9);
  --c-input-border:  rgba(0,0,0,0.1);
  --c-input-border-hover: rgba(0,0,0,0.18);
  --c-row-hover:     rgba(0,0,0,0.02);
  --c-row-border:    rgba(0,0,0,0.04);
  --c-icon:          rgba(71,85,105,0.5);
  --c-placeholder:   rgba(148,163,184,0.6);
  --c-auth-card-bg:  rgba(255,255,255,0.8);
  --c-blob-opacity:  0.5;
  --c-shadow:        100,116,139;
}

/* ── Reset ────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; color-scheme: dark; }
[data-theme="light"] { color-scheme: light; }

body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .35s ease, color .25s ease;
}

a { color: var(--c-primary-light); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-accent-light); }
img { max-width: 100%; height: auto; }

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: var(--s-sm); color: var(--c-text-heading); }
h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: var(--s-lg); color: var(--c-text-heading); }
h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: var(--s-md); color: var(--c-text-heading); }
p  { margin-bottom: var(--s-lg); color: var(--c-text-muted); }
.text-sm { font-size: .875rem; } .text-muted { color: var(--c-text-muted); }
.text-center { text-align: center; } .mt-1 { margin-top: var(--s-lg); }

/* ── Layout ───────────────────────────────────────────────── */
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: var(--s-xl) var(--s-lg); }

/* ── Navbar — solid bg, zero blur ─────────────────────────── */
.navbar {
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-glass-border);
  position: sticky; top: 0; z-index: 100;
  transition: background .3s ease;
}
.navbar-container { display: flex; align-items: center; justify-content: space-between; padding: var(--s-md) 0; }
.logo { font-size: 1.2rem; font-weight: 800; color: var(--c-text-heading) !important; letter-spacing: -.03em; }
.nav-links ul { display: flex; list-style: none; gap: var(--s-xs); align-items: center; }
.nav-links a { font-size: .85rem; font-weight: 500; color: var(--c-text-muted); padding: var(--s-sm) var(--s-md); border-radius: var(--r-md); transition: color var(--t-fast), background var(--t-fast); white-space: nowrap; }
.nav-links a:hover { color: var(--c-text-heading); background: var(--c-surface-hover); }

/* ── Theme Toggle ─────────────────────────────────────────── */
.theme-toggle { position: relative; width: 44px; height: 24px; background: var(--c-surface); border: 1px solid var(--c-glass-border); border-radius: var(--r-full); cursor: pointer; transition: background .3s ease, color .3s ease, transform .3s ease; flex-shrink: 0; }
.theme-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-toggle-slider { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-primary-light); box-shadow: 0 1px 3px rgba(var(--c-shadow),.3); transition: transform .3s cubic-bezier(.4,0,.2,1); display: flex; align-items: center; justify-content: center; }
.theme-toggle-slider::before { content: '🌙'; font-size: 10px; line-height: 1; }
.theme-toggle-input:checked + .theme-toggle-slider { transform: translateX(20px); }
.theme-toggle-input:checked + .theme-toggle-slider::before { content: '☀️'; }

/* ── Hamburger / Mobile Nav ───────────────────────────────── */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: var(--s-sm); flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; }

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--c-bg); border-bottom: 1px solid var(--c-glass-border); padding: var(--s-lg); z-index: 99; }
  .nav-links.active { display: block; }
  .nav-links ul { flex-direction: column; gap: var(--s-xs); }
  .nav-links a { display: block; padding: var(--s-md) var(--s-lg); }
}

/* ── KPI Cards ────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-lg); margin-bottom: var(--s-2xl); }
.kpi-card { background: var(--c-surface); border: 1px solid var(--c-glass-border); border-radius: var(--r-lg); padding: var(--s-xl); transition: background .2s ease, border-color .2s ease; }
.kpi-card:hover { background: var(--c-surface-hover); }
.kpi-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-muted); margin-bottom: var(--s-sm); }
.kpi-value { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-bottom: var(--s-xs); }
.kpi-sub { font-size: .8rem; color: var(--c-text-faint); }
.kpi-card--primary .kpi-value { color: var(--c-primary-light); }
.kpi-card--success .kpi-value { color: var(--c-success-light); }
.kpi-card--warning .kpi-value { color: var(--c-warning-light); }
.kpi-card--accent  .kpi-value { color: var(--c-accent-light); }

/* ── Articles / Cards ─────────────────────────────────────── */
article { background: var(--c-surface); border: 1px solid var(--c-glass-border); border-radius: var(--r-lg); padding: var(--s-xl); margin-bottom: var(--s-xl); transition: background .3s ease; }

/* ── Tables ───────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
thead th { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-faint); padding: var(--s-md) var(--s-lg); border-bottom: 1px solid var(--c-glass-border); text-align: left; }
tbody td { padding: var(--s-md) var(--s-lg); border-bottom: 1px solid var(--c-row-border); font-size: .9rem; vertical-align: middle; }
tbody tr:hover { background: var(--c-row-hover); }

/* ── Forms ─────────────────────────────────────────────────── */
label { display: block; font-size: .85rem; font-weight: 500; color: var(--c-text-muted); margin-bottom: var(--s-xs); }

input[type="text"],input[type="email"],input[type="password"],
input[type="url"],input[type="number"],input[type="date"],
select,textarea {
  width: 100%; background: var(--c-input-bg); border: 1px solid var(--c-input-border);
  border-radius: var(--r-md); color: var(--c-text); padding: var(--s-md) var(--s-lg);
  font-family: var(--font); font-size: .9rem; transition: border-color .15s ease, box-shadow .15s ease;
  margin-bottom: var(--s-lg); outline: none;
}
input:focus,select:focus,textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-glow); }
input::placeholder,textarea::placeholder { color: var(--c-placeholder); }
textarea { min-height: 100px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-lg); }

/* Select — readable option backgrounds */
select { background-color: var(--c-bg); color: var(--c-text); }
select option { background: var(--c-bg); color: var(--c-text); padding: .5rem; }
[data-theme="light"] select { background-color: #fff; }
[data-theme="light"] select option { background: #fff; color: #1e293b; }

/* ── Buttons ──────────────────────────────────────────────── */
button,.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm); background: var(--c-primary); color: #fff; border: none; border-radius: var(--r-md); padding: var(--s-md) var(--s-xl); font-family: var(--font); font-size: .9rem; font-weight: 600; cursor: pointer; position: relative; transition: background .2s ease, transform .2s ease; }
button::after,.btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 4px 12px var(--c-primary-glow); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
button:hover,.btn:hover { background: var(--c-primary-light); transform: translateY(-1px); }
button:hover::after,.btn:hover::after { opacity: 1; }
button.secondary,.btn-secondary { background: var(--c-surface); border: 1px solid var(--c-glass-border); color: var(--c-text); }
button.secondary:hover { background: var(--c-surface-hover); transform: translateY(-1px); }
button.secondary::after { display: none; }
.btn-sm { font-size: .8rem; padding: .35rem .85rem; border-radius: var(--r-sm); }
.btn-sm.danger { background: rgba(239,68,68,.15); color: var(--c-danger-light); border: 1px solid rgba(239,68,68,.2); }
.btn-sm.danger:hover { background: rgba(239,68,68,.25); }
.btn-sm.danger::after { display: none; }

/* ── Badges ───────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: var(--s-xs); font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: var(--r-full); white-space: nowrap; }
.badge--free       { background: rgba(59,130,246,.15); color: var(--c-primary-light); }
.badge--subscribed { background: rgba(16,185,129,.15); color: var(--c-success-light); }
.badge--expired    { background: rgba(239,68,68,.15); color: var(--c-danger-light); }
.badge--active     { background: rgba(16,185,129,.15); color: var(--c-success-light); }
.badge--pending    { background: rgba(245,158,11,.15); color: var(--c-warning-light); }
.badge--disabled   { background: rgba(100,116,139,.15); color: var(--c-text-faint); }
.badge--proprietaire { background: rgba(168,85,247,.15); color: #c084fc; }
.badge--manager      { background: rgba(59,130,246,.15); color: var(--c-primary-light); }
.badge--collaborateur{ background: rgba(6,182,212,.15); color: var(--c-accent-light); }
[data-theme="light"] .badge--proprietaire { color: #7c3aed; }

/* ── Ranking ──────────────────────────────────────────────── */
.rank-number { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-full); font-weight: 700; font-size: .8rem; }
.rank-1 { background: rgba(245,158,11,.2); color: var(--c-warning-light); }
.rank-2 { background: rgba(148,163,184,.2); color: #cbd5e1; }
.rank-3 { background: rgba(180,83,9,.2); color: #d97706; }
.rank-other { background: var(--c-surface); color: var(--c-text-faint); }
[data-theme="light"] .rank-1 { color: #b45309; }
[data-theme="light"] .rank-2 { color: #64748b; }

/* ── Details ──────────────────────────────────────────────── */
details { background: var(--c-surface); border: 1px solid var(--c-glass-border); border-radius: var(--r-lg); padding: var(--s-xl); margin-bottom: var(--s-xl); }
details>summary { cursor: pointer; font-weight: 600; color: var(--c-primary-light); list-style: none; }
details>summary::-webkit-details-marker { display: none; }
details[open]>summary { margin-bottom: var(--s-lg); padding-bottom: var(--s-lg); border-bottom: 1px solid var(--c-glass-border); }

/* ── Empty / Flash ────────────────────────────────────────── */
.empty-state { text-align: center; padding: var(--s-3xl) var(--s-xl); color: var(--c-text-faint); }
.empty-state-icon { font-size: 3rem; margin-bottom: var(--s-lg); opacity: .5; }
.flash { padding: var(--s-lg) var(--s-xl); border-radius: var(--r-lg); margin-bottom: var(--s-xl); font-size: .9rem; font-weight: 500; text-align: center; border: 1px solid; animation: fadeSlideUp .4s cubic-bezier(.16,1,.3,1) both; position: relative; }
.flash--error   { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: var(--c-danger-light); box-shadow: 0 2px 12px rgba(239,68,68,.1); }
.flash--success { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.3); color: var(--c-success-light); box-shadow: 0 2px 12px rgba(16,185,129,.1); }
[data-theme="light"] .flash--error   { background: rgba(239,68,68,.07); border-color: rgba(239,68,68,.2); color: #dc2626; box-shadow: 0 2px 12px rgba(239,68,68,.06); }
[data-theme="light"] .flash--success { background: rgba(16,185,129,.07); border-color: rgba(16,185,129,.2); color: #059669; box-shadow: 0 2px 12px rgba(16,185,129,.06); }

/* ── Misc ─────────────────────────────────────────────────── */
.action-row  { display: flex; align-items: center; gap: var(--s-sm); flex-wrap: wrap; }
.inline-form { display: inline-flex; align-items: center; margin: 0; }
.qr-container { text-align: center; padding: var(--s-xl); }
.qr-code { background: #fff; border-radius: var(--r-md); padding: var(--s-lg); display: inline-block; }
.share-btn { position: relative; display: inline-flex; align-items: center; gap: var(--s-sm); margin-top: var(--s-lg); background: var(--c-primary); color: #fff !important; padding: var(--s-md) var(--s-xl); border-radius: var(--r-full); font-weight: 600; font-size: .9rem; transition: background var(--t-base), border-color var(--t-base); }
.share-btn:hover { background: var(--c-primary-light); transform: translateY(-2px); }
.share-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 8px 20px var(--c-primary-glow); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.share-btn:hover::after { opacity: 1; }

.challenge-progress-text { text-align: center; font-size: 2.5rem; font-weight: 800; color: var(--c-primary-light); margin-bottom: var(--s-lg); }
.challenge-progress-text span { color: var(--c-success-light); }
progress { width: 100%; height: 12px; border-radius: var(--r-full); border: none; background: rgba(var(--c-bg-rgb),.15); margin-bottom: var(--s-md); }
progress::-webkit-progress-bar { background: rgba(var(--c-bg-rgb),.15); border-radius: var(--r-full); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); border-radius: var(--r-full); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--c-primary), var(--c-accent)); border-radius: var(--r-full); }

.stat-row  { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s-lg); margin-bottom: var(--s-2xl); }
.stat-item { text-align: center; background: var(--c-surface); border: 1px solid var(--c-glass-border); border-radius: var(--r-lg); padding: var(--s-xl); }
.stat-number { font-size: 1.75rem; font-weight: 800; color: var(--c-primary-light); }
.stat-label  { font-size: .8rem; color: var(--c-text-faint); margin-top: var(--s-xs); }
.page-footer { display: flex; gap: var(--s-lg); flex-wrap: wrap; margin-top: var(--s-2xl); padding-top: var(--s-xl); border-top: 1px solid var(--c-glass-border); }
.page-footer a { font-weight: 500; font-size: .9rem; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .stat-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  .container { padding: var(--s-lg) var(--s-md); }
}

/* ============================================================
   WOW — Lightweight (no mask-composite, no blur)
   ============================================================ */

.glow-card {
  position: relative;
  transition: transform .25s ease, border-color .25s ease;
  contain: layout style paint;
}
.glow-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 8px 24px -6px rgba(var(--c-shadow),.15), 0 0 10px var(--c-primary-glow);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.glow-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59,130,246,.25);
}
.glow-card:hover::after {
  opacity: 1;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeSlideUp .4s cubic-bezier(.16,1,.3,1) both; }
.delay-1 { animation-delay: .04s; } .delay-2 { animation-delay: .08s; }
.delay-3 { animation-delay: .12s; } .delay-4 { animation-delay: .16s; }
.delay-5 { animation-delay: .20s; } .delay-6 { animation-delay: .24s; }
.delay-7 { animation-delay: .28s; } .delay-8 { animation-delay: .32s; }

/* ============================================================
   BACKGROUND — Static layered gradients (no animation)
   ============================================================ */

.floating-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--c-blob-opacity);
  background:
    radial-gradient(circle at 10% 0%,   rgba(59,130,246,.18),  transparent 55%),
    radial-gradient(circle at 90% 100%, rgba(6,182,212,.14),   transparent 55%),
    radial-gradient(circle at 60% 40%,  rgba(168,85,247,.11),  transparent 50%);
}

/* Light theme slightly softer tints */
[data-theme="light"] .floating-blobs {
  background:
    radial-gradient(circle at 10% 0%,   rgba(59,130,246,.10),  transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(6,182,212,.08),   transparent 50%),
    radial-gradient(circle at 60% 40%,  rgba(168,85,247,.06),  transparent 45%);
}

/* ============================================================
   AUTH PAGES — No backdrop-filter, no mask-composite
   ============================================================ */

.auth-container { 
  min-height: 100dvh; 
  display: flex; 
  align-items: safe center; 
  justify-content: center; 
  padding: 2rem 1rem; 
}

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card { width: 100%; max-width: 460px; position: relative; z-index: 1; animation: cardReveal .6s cubic-bezier(.16,1,.3,1) forwards; contain: layout style paint; }

/* Simplified visuals */
.auth-card { background: var(--c-auth-card-bg); border-radius: 24px; border: 1px solid rgba(59,130,246,.35); box-shadow: 0 8px 24px rgba(15,23,42,.45); }

.auth-card.auth-card--wide { max-width: 720px; border-radius: 28px; border-color: rgba(59,130,246,.5); }

.auth-card:hover { border-color: rgba(59,130,246,.7); }

/* Soft ambient glow (no blur, just shadow) */
.auth-card::after {
  content: ''; position: absolute; inset: -30px; border-radius: 50px;
  background: radial-gradient(ellipse, rgba(59,130,246,.05), transparent 70%);
  z-index: -2; pointer-events: none;
}

.auth-card-inner {
  background: var(--c-auth-card-bg);
  border-radius: 24px; padding: 2.5rem 2.25rem;
  position: relative; overflow: hidden;
}

/* Top accent line */
.auth-card-inner::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(59,130,246,.5) 25%, rgba(6,182,212,.7) 50%, rgba(168,85,247,.5) 75%, transparent 95%);
}

.auth-header { text-align: center; margin-bottom: 2rem; position: relative; z-index: 1; }
.auth-logo { font-size: 2.2rem; font-weight: 800; letter-spacing: -.05em; display: inline-block; margin-bottom: .5rem; text-decoration: none !important; color: var(--c-text-heading) !important; }
.auth-logo span { background: linear-gradient(135deg, #60a5fa, #22d3ee, #a78bfa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-subtitle { color: var(--c-text-muted); font-size: .95rem; }

.auth-form { position: relative; z-index: 1; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .auth-row { grid-template-columns: 1fr; } }

.auth-field { margin-bottom: 1.25rem; }
.auth-field label { font-size: .78rem; font-weight: 600; color: var(--c-text-faint); margin-bottom: .5rem; letter-spacing: .04em; text-transform: uppercase; }

.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > svg { position: absolute; left: 1rem; width: 18px; height: 18px; color: var(--c-icon); transition: color .2s ease; pointer-events: none; z-index: 2; }
.auth-input-wrap input {
  width: 100%; height: 3.25rem; padding: 0 1rem 0 2.85rem;
  background: var(--c-input-bg); border: 1px solid var(--c-input-border);
  border-radius: 12px; color: var(--c-text); font-family: var(--font); font-size: .92rem;
  outline: none; transition: border-color .2s ease, box-shadow .2s ease; margin-bottom: 0;
}
.auth-input-wrap input::placeholder { color: var(--c-placeholder); }
.auth-input-wrap input:hover { border-color: var(--c-input-border-hover); }
.auth-input-wrap input:focus { border-color: rgba(59,130,246,.5); box-shadow: 0 0 0 3px var(--c-primary-glow); }
.auth-input-wrap:focus-within > svg { color: var(--c-primary-light); }

/* ── Password visibility toggle ───────────────────────── */
.pw-toggle {
  /* Reset global button defaults */
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  font-weight: inherit;
  /* Positioning inside .auth-input-wrap */
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  /* Appearance */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--c-icon);
  cursor: pointer;
  transition: color .15s ease;
}
/* Override button:hover (specificity wins: class+pseudo > element+pseudo) */
.pw-toggle:hover {
  background: none;
  color: var(--c-text-heading);
  transform: translateY(-50%);  /* Keep vertical centering, cancel button translateY(-1px) */
}
/* Suppress the global button glow ::after */
.pw-toggle::after { display: none !important; }
/* Inner SVG icons — override the descendant .auth-input-wrap > svg rule above */
.pw-toggle svg {
  position: static;
  width: 18px;
  height: 18px;
  pointer-events: none;
  color: inherit;
}
/* When a toggle is present: no left icon → reset left padding; add right padding */
.auth-input-wrap:has(.pw-toggle) input {
  padding-left: 1rem;
  padding-right: 2.85rem;
}

.auth-field-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.auth-field-header label { margin-bottom: 0; }
.auth-field-header a { font-size: .78rem; color: var(--c-primary-light); opacity: .8; text-transform: none; font-weight: 500; letter-spacing: 0; }
.auth-field-header a:hover { opacity: 1; }

.auth-btn {
  width: 100%; height: 3.25rem; border: none; border-radius: 12px;
  font-family: var(--font); font-size: .95rem; font-weight: 700;
  color: #fff; cursor: pointer; margin-top: .5rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 14px rgba(59,130,246,.25);
  transition: transform .2s ease;
}
.auth-btn { position: relative; }
.auth-btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 8px 24px rgba(59,130,246,.3); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.auth-btn:hover { transform: translateY(-2px); }
.auth-btn:hover::after { opacity: 1; }
.auth-btn:active { transform: translateY(0); }

.auth-footer { margin-top: 1.75rem; text-align: center; font-size: .9rem; color: var(--c-text-faint); padding-top: 1.5rem; border-top: 1px solid var(--c-glass-border); position: relative; z-index: 1; }
.auth-footer a { color: var(--c-primary-light); font-weight: 600; }
.auth-footer a:hover { color: var(--c-accent-light); }

/* Auth sections separation */
.auth-section { margin-bottom: 2rem; }
.auth-section-title { font-size: .9rem; font-weight: 600; color: var(--c-text-heading); margin-bottom: 1rem; }
.auth-section-desc { font-size: .8rem; color: var(--c-text-faint); margin-bottom: 1.25rem; }

.auth-divider { 
  display: flex; align-items: center; text-align: center; 
  margin: 2rem 0; color: var(--c-text-faint); font-size: .8rem; letter-spacing: .05em; 
  text-transform: uppercase; }
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; border-bottom: 1px solid var(--c-glass-border); }
.auth-divider::before { margin-right: 1rem; }
.auth-divider::after { margin-left: 1rem; }

/* ── Desktop : prévenir le débordement des emails longs ──── */
@media (min-width: 769px) {
  .responsive-table td[data-label="Email"] {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ============================================================
   PERFORMANCE — Reduced Motion + Mobile Savings
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 768px) {
  .glow-card:hover { transform: none; border-color: var(--c-glass-border); }
  .glow-card::after { display: none; }
}

/* Mobile auth page padding overrides */
@media (max-width: 768px) {
  .auth-container {
    padding: 1rem 1rem;
  }
  .auth-card-inner {
    padding: 1.5rem 1.25rem;
  }
  .auth-header {
    margin-bottom: 1.5rem;
  }
}

/* ── Mode Switch Button ────────────────────────────────── */
.mode-switch-btn {
    background: linear-gradient(135deg, var(--c-primary), var(--c-accent)) !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: .8rem !important;
    padding: 0.4rem 0.85rem !important;
    border-radius: var(--r-full) !important;
    transition: transform var(--t-fast), box-shadow var(--t-fast) !important;
    white-space: nowrap;
}
.mode-switch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--c-primary-glow);
}

/* ============================================================
   COLLECTE LAYOUT — staff/dashboard
   QR visible immédiatement sur mobile, compact sur desktop
   ============================================================ */

.collecte-layout {
  display: grid;
  gap: var(--s-xl);
  margin-bottom: var(--s-xl);
}
.collecte-qr-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.collecte-actions {
  display: flex;
  gap: var(--s-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--s-lg);
}
.collecte-stats {
  display: grid;
  gap: var(--s-lg);
}

/* Desktop : QR à gauche (compact), stats à droite */
@media (min-width: 769px) {
  .collecte-layout {
    grid-template-columns: auto 1fr;
    align-items: start;
  }
  .collecte-qr-card .qr-code {
    width: 200px;
    height: 200px;
    padding: var(--s-md);
  }
  .collecte-stats {
    grid-template-columns: 1fr;
  }
  .collecte-actions .share-btn {
    font-size: .82rem;
    padding: var(--s-sm) var(--s-lg);
    margin-top: 0;
  }
}

/* Mobile : QR en haut, stats en ligne compacte dessous */
@media (max-width: 768px) {
  .collecte-layout {
    grid-template-columns: 1fr;
    gap: var(--s-lg);
  }
  .collecte-qr-card {
    padding: var(--s-lg) var(--s-md);
  }
  .collecte-qr-card .qr-code {
    width: 220px;
    height: 220px;
    padding: var(--s-sm);
  }
  .collecte-actions {
    margin-top: var(--s-md);
  }
  .collecte-actions .share-btn {
    font-size: .8rem;
    padding: var(--s-sm) var(--s-lg);
    margin-top: 0;
  }
  .collecte-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-sm);
  }
  .collecte-stats .stat-item {
    padding: var(--s-md);
  }
  .collecte-stats .stat-number {
    font-size: 1.25rem;
  }
  .collecte-stats .stat-label {
    font-size: .7rem;
  }
}

/* ============================================================
   RESPONSIVE TABLES → Mobile cards
   Utilisé dans users.php (Mon équipe)
   Desktop inchangé.
   ============================================================ */

@media (max-width: 768px) {
  .responsive-table,
  .responsive-table thead,
  .responsive-table tbody {
    display: block;
    width: 100%;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tbody tr {
    display: block;
    border: 1px solid var(--c-glass-border);
    border-radius: var(--r-lg);
    padding: var(--s-lg);
    margin-bottom: var(--s-md);
    background: var(--c-surface);
  }
  .responsive-table tbody tr:hover {
    background: var(--c-surface);
  }
  .responsive-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s-sm) 0;
    border-bottom: 1px solid var(--c-row-border);
    text-align: right;
  }
  .responsive-table tbody td:first-child {
    padding-top: 0;
  }
  .responsive-table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .responsive-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: .72rem;
    color: var(--c-text-faint);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    flex-shrink: 0;
    margin-right: var(--s-md);
    white-space: nowrap;
  }
  /* Colonne Actions : pas de label, boutons à droite */
  .responsive-table .td-actions {
    flex-wrap: wrap;
    gap: var(--s-sm);
    padding-top: var(--s-md);
    justify-content: flex-end;
  }
  .responsive-table .td-actions::before {
    display: none;
  }
  .responsive-table .td-actions .action-row {
    width: 100%;
    justify-content: flex-end;
  }
  /* Select dans les cellules */
  .responsive-table td .inline-form select {
    min-width: 0;
  }
}
