/* =====================================================================
   Carte Electoral Prototype — Premium Dark UI
   Mobile-first, glassmorphism, animations légères, design unique
   PROTOTYPE NON OFFICIEL
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@500;600;700&display=swap");

:root {
  --bg-1: #0b1020;
  --bg-2: #0f172a;
  --bg-3: #1a2238;
  --surface: #131a2d;
  --surface-2: #1a2238;
  --ink:  #e9f1ff;
  --ink-2: #a8b6d6;
  --ink-3: #6b78a0;
  --line:   #232b44;
  --line-2: #2c3656;

  --accent:    #38bdf8;   /* cyan */
  --accent-2:  #2563eb;   /* blue */
  --accent-3:  #f5c46b;   /* gold */
  --accent-4:  #c084fc;   /* violet */
  --ok:        #34d399;
  --warn:      #fbbf24;
  --err:       #f87171;
  --doub:      #fb7185;

  --r-1: 8px;
  --r-2: 14px;
  --r-3: 22px;
  --r-pill: 999px;

  --shadow-1: 0 10px 30px rgba(2,8,32,.45);
  --shadow-2: 0 18px 60px rgba(2,8,32,.6);
  --shadow-glow: 0 0 0 1px rgba(56,189,248,.25), 0 18px 60px rgba(56,189,248,.18);

  --grad-1: linear-gradient(135deg,#38bdf8 0%, #2563eb 50%, #1e1b4b 100%);
  --grad-2: linear-gradient(135deg,#f5c46b 0%, #ea580c 50%, #7c1d6f 100%);
  --grad-3: linear-gradient(135deg,#0ea5e9 0%, #6366f1 100%);

  --safe-top: env(safe-area-inset-top);
  --safe-bot: env(safe-area-inset-bottom);
}

*,*::before,*::after { box-sizing: border-box; }
html,body { margin:0; padding:0; }
html { -webkit-text-size-adjust:100%; }
body {
  font-family: 'Inter','Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: calc(var(--safe-top) + 0px) 0 var(--safe-bot);
}

/* Fond sobre — désactivé (gardé pour compat) */
.bg-aurora { display: none; }
.orb { display: none; }

/* Watermark prototype */
.proto-watermark {
  position: fixed; bottom: 8px; left: 0; right: 0; text-align: center; z-index: 99;
  font-size: 10px; letter-spacing: 1.5px; color: #f5c46b;
  text-shadow: 0 0 12px rgba(245,196,107,.35);
  pointer-events: none; font-weight: 600;
}

/* ============ Topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin: 12px; border-radius: var(--r-3);
}
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px; position: relative;
  background: var(--grad-1);
  box-shadow: 0 8px 24px rgba(56,189,248,.4);
}
.brand-mark::after {
  content:""; position: absolute; inset: 6px; border-radius: 8px;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.55), transparent 50%);
}
.brand-text strong { display: block; font-size: 14px; letter-spacing: .2px; }
.brand-text small { color: var(--accent-3); font-size: 9.5px; letter-spacing: 1.5px; font-weight: 700; }
.topnav { display: flex; align-items: center; gap: 8px; }
.topnav a { color: var(--ink-2); text-decoration: none; padding: 8px 12px; border-radius: var(--r-pill); font-size: 13px; transition: .2s; }
.topnav a:hover { color: var(--ink); background: var(--bg-3); }
.btn-ghost { border: 1px solid var(--line-2); }

@media (max-width: 540px) {
  .topnav a:not(.btn-ghost) { display: none; }
}

/* ============ Page wrappers ============ */
.page { max-width: 1200px; margin: 0 auto; padding: 8px 16px 80px; }
.container { max-width: 540px; margin: 0 auto; }
.container-lg { max-width: 1100px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 22px;
  box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 14px; }

.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.card-sub { color: var(--ink-2); font-size: 13.5px; margin: 0 0 16px; }

/* ============ Hero ============ */
.hero { padding: 28px 0; text-align: center; }
.hero h1 {
  font-size: clamp(28px, 6vw, 44px);
  margin: 8px 0 12px;
  letter-spacing: -.5px;
  line-height: 1.1;
  background: linear-gradient(135deg,#fff,#cfe5ff 35%,#f5c46b 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--ink-2); font-size: 16px; max-width: 580px; margin: 0 auto 16px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: rgba(245,196,107,.1); border: 1px solid rgba(245,196,107,.3);
  color: var(--accent-3); font-size: 11px; font-weight: 700; letter-spacing: 2px;
}
.eyebrow::before {
  content:""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-3);
  box-shadow: 0 0 12px var(--accent-3);
}
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ============ Buttons ============ */
.btn {
  --bg: var(--grad-1);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border: none; cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: white; text-decoration: none;
  border-radius: var(--r-pill);
  background: var(--bg);
  box-shadow: 0 12px 30px rgba(37,99,235,.35);
  position: relative; overflow: hidden;
  transition: transform .15s ease, box-shadow .25s ease, filter .25s ease;
  letter-spacing: .2px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 16px 40px rgba(37,99,235,.45); }
.btn:active { transform: translateY(0); }
.btn::after {
  content:""; position: absolute; top:0; left:-150%; width: 70%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.25), transparent);
  transition: left .8s;
}
.btn:hover::after { left: 150%; }
.btn-block { width: 100%; }
.btn-gold { --bg: var(--grad-2); box-shadow: 0 12px 30px rgba(234,88,12,.35); }
.btn-line {
  background: transparent; border: 1px solid var(--line-2); color: var(--ink);
  box-shadow: none;
}
.btn-line:hover { background: var(--bg-3); box-shadow: none; }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.btn[disabled] { opacity:.5; cursor:not-allowed; transform: none !important; }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--ink-2); letter-spacing: .3px; text-transform: uppercase; font-weight: 600; }
.input, select, textarea {
  width: 100%; padding: 13px 14px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  border-radius: var(--r-2); color: var(--ink); font-size: 15px;
  font-family: inherit; transition: border-color .2s, background .2s, box-shadow .2s;
  outline: none;
}
.input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  background: var(--bg-3);
  box-shadow: 0 0 0 3px rgba(56,189,248,.15);
}
.input::placeholder { color: var(--ink-3); }
.input-group { position: relative; }
.input-group .input { padding-left: 56px; }
.input-group .prefix {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 8px; font-size: 12px; color: var(--ink-2); font-weight: 600;
}
.help { font-size: 12px; color: var(--ink-3); }
.help-error { color: var(--err); font-size: 12.5px; }

.otp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-grid input {
  font-size: 22px; font-weight: 700; text-align: center; letter-spacing: 0;
  padding: 14px 0; background: var(--bg-2);
}

/* ============ Step dots / progress ============ */
.step-dots { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 8px 0 16px; }
.step-dots .dot {
  width: 22px; height: 6px; border-radius: var(--r-pill);
  background: var(--line-2); transition: .3s ease;
}
.step-dots .dot.done { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.step-dots .dot.active { background: var(--accent-3); width: 38px; box-shadow: 0 0 12px var(--accent-3); }

.progress { height: 6px; background: var(--line); border-radius: var(--r-pill); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--grad-1); transition: width .4s ease; box-shadow: 0 0 12px var(--accent); }

/* Bannière code OTP mode démo (reste visible sur la page) */
.demo-otp-banner {
  background: var(--surface-2);
  border: 2px solid var(--accent-3);
  border-radius: var(--r-2);
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.demo-otp-banner strong { color: var(--accent-3); display: block; margin-bottom: 6px; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; }
.demo-otp-code {
  display: inline-block;
  margin-top: 4px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  padding: 8px 12px;
  background: var(--bg-2);
  border-radius: var(--r-2);
  border: 1px solid var(--line-2);
}

/* ============ Home (page d'accueil simple) ============ */
.home-hero { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 24px 0; }
.home-card { width: 100%; max-width: 460px; text-align: center; padding: 32px 24px; }
.home-title {
  font-size: clamp(28px, 7vw, 38px); margin: 14px 0 8px;
  line-height: 1.1; letter-spacing: -.5px; color: var(--ink);
}
.home-sub { color: var(--ink-2); margin: 0 0 24px; font-size: 15px; }
.home-actions { display: flex; flex-direction: column; gap: 10px; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700;
  background: var(--bg-3); color: var(--ink-2);
  letter-spacing: .3px;
}
.badge-ok { background: rgba(52,211,153,.14); color: var(--ok); }
.badge-warn { background: rgba(251,191,36,.14); color: var(--warn); }
.badge-err { background: rgba(248,113,113,.14); color: var(--err); }
.badge-doub { background: rgba(251,113,133,.14); color: var(--doub); }
.badge-susp { background: rgba(192,132,252,.14); color: var(--accent-4); }

/* ============ Camera scanner ============ */
.scan-stage {
  position: relative; aspect-ratio: 9/16; max-height: 70vh;
  border-radius: var(--r-3); overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--line-2);
}
.scan-stage video, .scan-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.scan-stage video { transform: scaleX(1); }
.scan-stage.mirror video { transform: scaleX(-1); }

.scan-overlay {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 14px;
}
.scan-frame {
  width: 86%; aspect-ratio: 1.6/1; align-self: center;
  border: 2px dashed rgba(245,196,107,.7); border-radius: 18px;
  position: relative; transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 0 0 999px rgba(0,0,0,.45);
}
.scan-frame.ok { border-color: var(--ok); border-style: solid; box-shadow: 0 0 0 999px rgba(0,0,0,.55), 0 0 25px rgba(52,211,153,.5); }
.scan-frame.warn { border-color: var(--warn); }
.scan-frame.err { border-color: var(--err); }
.scan-frame::before, .scan-frame::after,
.scan-frame > .corner-tl, .scan-frame > .corner-br {
  content:""; position:absolute; width: 28px; height: 28px;
  border-color: var(--accent); border-style: solid; border-width: 0;
}
.scan-frame::before { top: -3px; left: -3px; border-top-width: 4px; border-left-width: 4px; border-radius: 12px 0 0 0; }
.scan-frame::after { bottom: -3px; right: -3px; border-bottom-width: 4px; border-right-width: 4px; border-radius: 0 0 12px 0; }
.scan-frame .corner-tl { top:-3px; right:-3px; border-top-width: 4px; border-right-width: 4px; border-radius: 0 12px 0 0; }
.scan-frame .corner-br { bottom:-3px; left:-3px; border-bottom-width: 4px; border-left-width: 4px; border-radius: 0 0 0 12px; }

.scan-frame .laser {
  position: absolute; left: 6%; right: 6%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  top: 0; animation: laser 2.4s linear infinite;
  filter: blur(.4px);
}
@keyframes laser {
  0%   { top: 6%;  opacity: .3; }
  50%  { top: 90%; opacity: 1;  }
  100% { top: 6%;  opacity: .3; }
}

.scan-frame.circle {
  width: min(70vw, 320px); aspect-ratio: 1/1; border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(0,0,0,.55);
}
.scan-frame.circle::before, .scan-frame.circle::after,
.scan-frame.circle > .corner-tl, .scan-frame.circle > .corner-br { display: none; }
.scan-frame.circle .laser { display: none; }

.scan-hint {
  background: rgba(0,0,0,.5); border: 1px solid var(--line-2);
  padding: 10px 14px; border-radius: var(--r-pill);
  color: var(--ink); font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.scan-hint .dot-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(56,189,248,.7); }
  70%  { box-shadow: 0 0 0 12px rgba(56,189,248,0); }
  100% { box-shadow: 0 0 0 0 rgba(56,189,248,0); }
}
.scan-hint.ok { color: var(--ok); }
.scan-hint.warn { color: var(--warn); }
.scan-hint.err { color: var(--err); }

.scan-actions {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  width: 100%; pointer-events: auto;
}

/* ============ Liveness ============ */
.live-step {
  background: rgba(0,0,0,.5); padding: 12px 18px; border-radius: var(--r-3);
  font-size: 16px; font-weight: 600; text-align: center;
  border: 1px solid var(--line-2);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}
.live-checks { display: flex; gap: 8px; justify-content: center; padding: 10px 0; }
.live-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-pill);
  font-size: 12px; background: var(--bg-3); color: var(--ink-2);
  border: 1px solid var(--line);
  transition: .25s;
}
.live-check.done { background: rgba(52,211,153,.16); color: var(--ok); border-color: rgba(52,211,153,.4); }
.live-check.active { background: rgba(56,189,248,.16); color: var(--accent); border-color: rgba(56,189,248,.4); }
.live-check::before {
  content:"○"; font-size: 12px;
}
.live-check.done::before { content:"✓"; }

/* ============ Carte ISO ID-1 (CR80) : 85,6 × 53,98 mm — rendu à l’écran + disclaimer ============ */
.voter-card-land-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.voter-card--land {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  color-scheme: light;
  font-family: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  /* Annule .center (text-align:center) sur le bloc parent : champs à gauche */
  text-align: left;
}
/* Ratio ISO — largeur 100% du parent (évite le scroll horizontal : 100vw ignorait le padding .page/.container). */
.voter-card-land__cr80 {
  container-type: inline-size;
  container-name: cr80;
  width: 100%;
  max-width: min(520px, 100%);
  aspect-ratio: 85.6 / 53.98;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: clamp(10px, 2.2cqw, 14px);
  overflow: hidden;
  background: #fff;
  border: 2px solid #0f172a;
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.1),
    0 8px 24px rgba(30, 58, 138, 0.15);
  box-sizing: border-box;
}
.voter-card-land__header {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 45%, #1d4ed8 100%);
  padding: 1.4mm 2.2mm 1.4mm clamp(26mm, 30%, 34mm);
  display: flex;
  align-items: center;
  min-height: 0;
}
.voter-card-land__header-cut {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  max-width: 32mm;
  background: #0f172a;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 0 100%);
  box-shadow: 1mm 0 3mm rgba(0, 0, 0, 0.12);
}
.voter-card-land__header-text {
  position: relative;
  z-index: 1;
  text-align: right;
  width: 100%;
}
.voter-card-land__title {
  margin: 0;
  font-size: clamp(10px, 3.1cqw, 18px);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.voter-card-land__subtitle {
  margin: 0.35em 0 0;
  font-size: clamp(8px, 2.2cqw, 13px);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.voter-card-land__body {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  background: #fff;
  padding: clamp(8px, 2cqw, 14px) clamp(10px, 2.4cqw, 16px);
  display: flex;
  flex-direction: column;
}
.voter-card-land__watermark {
  position: absolute;
  inset: 6% 10%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(37, 99, 235, 0.06) 0%, transparent 58%),
    radial-gradient(circle, rgba(37, 99, 235, 0.1) 0.25mm, transparent 0.4mm);
  background-size: auto, 1.4mm 1.4mm;
  pointer-events: none;
  z-index: 0;
}
.voter-card-land__cols {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(10px, 3cqw, 22px);
  flex: 1;
  min-height: 0;
}
.voter-card-land__fields {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(4px, 1.1cqw, 9px);
  align-items: flex-start;
  padding-inline-end: 0;
}
/* Deux colonnes au contenu seulement : plus de colonne 1fr qui étire le vide avant la photo */
.voter-card-land__field {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: clamp(6px, 1.6cqw, 14px);
  align-items: baseline;
  margin: 0;
  width: max-content;
  max-width: 100%;
}
.voter-card-land__k {
  font-size: clamp(9px, 2.6cqw, 14px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #475569;
  line-height: 1.2;
  white-space: normal;
  min-width: 0;
}
.voter-card-land__v {
  font-size: clamp(11px, 3.5cqw, 17px);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
  min-width: 0;
  max-width: 38cqw;
}
.voter-card-land__photo {
  flex-shrink: 0;
  width: clamp(88px, 22cqw, 158px);
  height: clamp(88px, 22cqw, 158px);
  min-width: clamp(88px, 22cqw, 158px);
  min-height: clamp(88px, 22cqw, 158px);
  aspect-ratio: 1 / 1;
  align-self: center;
  border-radius: clamp(8px, 1.6cqw, 12px);
  overflow: hidden;
  background: #e2e8f0;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
}
.voter-card-land__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  forced-color-adjust: none;
}
.voter-card-land__photo-fallback {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(145deg, #cbd5e1, #94a3b8);
}
.voter-card-land__footer {
  position: relative;
  flex: 0 0 auto;
  background: linear-gradient(90deg, #1d4ed8 0%, #2563eb 55%, #1e40af 100%);
  padding: 1.4mm 1.8mm 1.5mm;
}
.voter-card-land__footer-cut {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 34%;
  max-width: 28mm;
  background: #0f172a;
  clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%);
  opacity: 0.95;
}
.voter-card-land__footer-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.2mm;
  flex-wrap: nowrap;
}
.voter-card-land__sig-block {
  flex: 1;
  min-width: 0;
}
.voter-card-land__sig {
  display: block;
  font-family: 'Brush Script MT', 'Segoe Script', 'Apple Chancery', cursive;
  font-size: clamp(10px, 3cqw, 17px);
  font-weight: 400;
  color: #fff;
  line-height: 1.05;
  margin-bottom: 0.15em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voter-card-land__sig-label {
  font-size: clamp(6px, 1.7cqw, 11px);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}
.voter-card-land__valid-block {
  text-align: center;
  padding: 0 1mm;
  flex-shrink: 0;
}
.voter-card-land__valid-label {
  display: block;
  font-size: clamp(6px, 1.7cqw, 11px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.15em;
}
.voter-card-land__valid-date {
  font-size: clamp(9px, 2.6cqw, 15px);
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.voter-card-land__qr-block {
  flex-shrink: 0;
  text-align: center;
  width: clamp(72px, 16cqw, 100px);
}
.voter-card-land__qr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4px, 1cqw, 7px);
  background: #fff;
  border-radius: clamp(6px, 1.2cqw, 10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  margin-bottom: 0.25em;
  width: clamp(64px, 14cqw, 92px);
  height: clamp(64px, 14cqw, 92px);
  min-width: clamp(64px, 14cqw, 92px);
  min-height: clamp(64px, 14cqw, 92px);
  box-sizing: border-box;
}
.voter-card-land__qr canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
}
.voter-card-land__oni-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12em;
  max-width: 20cqw;
  margin: 0 auto;
}
.voter-card-land__oni-label {
  font-size: clamp(5px, 1.5cqw, 9px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  line-height: 1;
}
.voter-card-land__id-line {
  font-size: clamp(7px, 2cqw, 12px);
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  word-break: break-all;
  margin: 0 auto;
  max-width: 18cqw;
}
.voter-card-land__disclaimer {
  margin: 0.5em 0 0;
  padding: 0.5em 1rem 0;
  font-size: clamp(9px, 2.2vw, 12px);
  line-height: 1.35;
  color: #64748b;
  text-align: center;
  max-width: min(520px, 100%);
  background: transparent;
  border: none;
}

/* Téléphone : texte plus compact, libellé au-dessus de la valeur (évite chevauchement / débordement) */
@media (max-width: 480px) {
  .voter-card-land__body {
    padding: clamp(6px, 1.4cqw, 10px) clamp(8px, 1.8cqw, 12px);
  }
  .voter-card-land__title {
    font-size: clamp(9px, 2.7cqw, 15px);
  }
  .voter-card-land__subtitle {
    font-size: clamp(7px, 1.9cqw, 11px);
  }
  .voter-card-land__cols {
    gap: clamp(6px, 2cqw, 12px);
  }
  .voter-card-land__field {
    grid-template-columns: 1fr;
    row-gap: 1px;
    column-gap: 0;
    width: 100%;
  }
  .voter-card-land__k {
    font-size: clamp(8px, 2.2cqw, 11px);
  }
  .voter-card-land__v {
    font-size: clamp(10px, 3cqw, 14px);
    max-width: 100%;
  }
  .voter-card-land__photo {
    width: clamp(72px, 20cqw, 120px);
    height: clamp(72px, 20cqw, 120px);
    min-width: clamp(72px, 20cqw, 120px);
    min-height: clamp(72px, 20cqw, 120px);
  }
  .voter-card-land__footer-inner {
    flex-wrap: wrap;
    gap: 6px;
  }
  .voter-card-land__qr-block {
    width: clamp(56px, 14cqw, 80px);
  }
  .voter-card-land__qr {
    width: clamp(52px, 12cqw, 72px);
    height: clamp(52px, 12cqw, 72px);
    min-width: clamp(52px, 12cqw, 72px);
    min-height: clamp(52px, 12cqw, 72px);
  }
}

/* Résultat page vérification (lignes clé / valeur) */
.card .vc-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.card .vc-line span:first-child { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.card .vc-line span:last-child { color: var(--ink); font-weight: 600; text-align: right; word-break: break-word; }

/* ============ Lists / tables (admin) ============ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.kpi {
  padding: 16px 18px; border-radius: var(--r-2);
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.kpi small { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.kpi h2 { font-size: 28px; margin: 4px 0 0; letter-spacing: -.5px; }
.kpi .hint { font-size: 11.5px; color: var(--ink-2); }
.kpi::before {
  content:""; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px;
  border-radius: 50%; opacity: .25;
  background: var(--grad-1);
}
.kpi.k2::before { background: var(--grad-2); }
.kpi.k3::before { background: linear-gradient(135deg,#34d399,#0ea5e9); }
.kpi.k4::before { background: linear-gradient(135deg,#f87171,#7c1d6f); }

table.tbl {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
table.tbl th, table.tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.tbl th { color: var(--ink-3); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 700; background: var(--bg-2); }
table.tbl tr:hover td { background: var(--bg-3); }
table.tbl td.actions { white-space: nowrap; text-align: right; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* ============ Auth ============ */
.auth-wrap { min-height: 80vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }

/* ============ Loader ============ */
.loader {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loader-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center;
  background: rgba(3,6,21,.7); backdrop-filter: blur(8px);
}
.loader-overlay .ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, var(--accent));
  animation: spin 1.2s linear infinite; padding: 4px;
  -webkit-mask: radial-gradient(circle 28px at center, transparent 99%, black 100%);
          mask: radial-gradient(circle 28px at center, transparent 99%, black 100%);
}

/* ============ Footer ============ */
.footer { text-align: center; padding: 24px 16px; color: var(--ink-3); font-size: 11.5px; }
.footer .proto-banner {
  background: rgba(245,196,107,.08); border: 1px solid rgba(245,196,107,.25);
  color: var(--accent-3); padding: 10px 14px; border-radius: var(--r-2);
  display: inline-block; margin-bottom: 8px; max-width: 700px;
}

/* ============ Animations utilitaires ============ */
.fade-in { animation: fadeIn .45s ease both; }
.slide-up { animation: slideUp .55s cubic-bezier(.2,.7,.2,1) both; }
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { opacity:0; transform: translateY(14px); } to { opacity:1; transform: translateY(0); } }

/* Two-column responsive */
.split { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 880px) {
  .split { grid-template-columns: 1.1fr 1fr; }
  .split.flip { grid-template-columns: 1fr 1.1fr; }
}

.center { text-align: center; }
.muted { color: var(--ink-2); }
.tiny { font-size: 11.5px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gap-12 { gap: 12px; } .gap-8 { gap: 8px; }
.flex { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.hidden { display: none !important; }

/* Scrollbar dark */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.16); }

/* Selection */
::selection { background: rgba(56,189,248,.4); color: white; }

/* Sweet alert override hint (used by SweetAlert2) */
.swal2-popup.proto {
  background: linear-gradient(180deg, #0d1b3e, #050b22) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 22px !important;
}

/* Print: pour cartes */
@media print {
  body { background: white; color: black; }
  .topbar, .footer, .proto-watermark, .topnav, .btn { display: none !important; }
  .voter-card--land { box-shadow: none; border: none; }
  .voter-card-land__cr80 {
    box-shadow: none;
    border: 0.2mm solid #000;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
