/* ============================================================
   ID4Africa Demo — Design System
   Brand: Idakto
   ============================================================ */

/* ── Poppins — police locale (offline-safe) ─────────────── */
/*
   Télécharger les fichiers .woff2 depuis :
   https://fonts.google.com/specimen/Poppins
   Poids nécessaires : 400 (Regular), 600 (SemiBold), 700 (Bold), 800 (ExtraBold)
   Les placer dans : assets/fonts/
*/
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/Poppins-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Brand primaires */
  --brand-blue:        #272e66;
  --brand-blue-mid:    #384C9B;
  --brand-orange:      #f08329;
  --brand-grey:        #f5f4f5;

  /* Gradient de fond principal */
  --bg-gradient: linear-gradient(160deg, #1a2060 0%, #272e66 40%, #1c2350 100%);

  /* Surfaces */
  --surface-0:   rgba(255, 255, 255, 0.04);
  --surface-1:   rgba(255, 255, 255, 0.07);
  --surface-2:   rgba(255, 255, 255, 0.11);

  /* Bordures */
  --line:        rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.22);

  /* Texte */
  --text:        #f0f4ff;
  --text-muted:  rgba(240, 244, 255, 0.55);
  --text-faint:  rgba(240, 244, 255, 0.35);

  /* États */
  --ok:    #4ecca3;
  --warn:  #f08329;
  --error: #ff6b7a;
  --info:  #6ea8fe;

  /* Ombre */
  --shadow-sm:  0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-md:  0 12px 36px rgba(0, 0, 0, 0.35);
  --shadow-lg:  0 24px 60px rgba(0, 0, 0, 0.45);

  /* Rayon */
  --radius-sm:  12px;
  --radius-md:  20px;
  --radius-lg:  28px;
  --radius-xl:  36px;

  /* Typographie */
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;

  /* Espacement touch-friendly (min 64px pour écran tactile 24-27") */
  --touch-target: 64px;
}

/* ── Reset & base ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Typographie ────────────────────────────────────────── */
h1 { font-size: clamp(36px, 4vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(26px, 3vw, 44px); font-weight: 700; line-height: 1.1;  letter-spacing: -0.01em; }
h3 { font-size: clamp(20px, 2vw, 28px); font-weight: 700; line-height: 1.2; }
p  { font-size: clamp(16px, 1.4vw, 20px); color: var(--text-muted); line-height: 1.65; }

/* ── Layout ─────────────────────────────────────────────── */
.container {
  width: min(1440px, calc(100% - 48px));
  margin-inline: auto;
}

/* ── Card / Surface ─────────────────────────────────────── */
.card {
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.card--raised {
  background: var(--surface-1);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}

/* ── Boutons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--touch-target);
  padding: 0 32px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--brand-orange);
  color: #fff;
  box-shadow: 0 6px 24px rgba(240, 131, 41, 0.38);
}
.btn-primary:hover { box-shadow: 0 10px 32px rgba(240, 131, 41, 0.5); transform: translateY(-2px); }

.btn-secondary {
  background: var(--surface-1);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--surface-2); transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--line);
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); }

.btn-icon {
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 20px;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.header-logo {
  height: 36px;
  width: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Language switcher ──────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.lang-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.lang-btn.active {
  background: var(--surface-2);
  color: var(--text);
}

.lang-btn:hover:not(.active) {
  color: var(--text);
}

/* ── Back button ────────────────────────────────────────── */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  background: var(--surface-0);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-back:hover { background: var(--surface-1); color: var(--text); }

.btn-back svg { width: 16px; height: 16px; }

/* ── Badge / Pill ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-0);
  font-size: 13px;
  color: var(--text-muted);
}

.badge--orange {
  background: rgba(240, 131, 41, 0.12);
  border-color: rgba(240, 131, 41, 0.3);
  color: var(--brand-orange);
}

/* ── Progress bar ───────────────────────────────────────── */
.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-orange), #ffaa5e);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ── Status dot ─────────────────────────────────────────── */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}
.dot--ok    { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.dot--warn  { background: var(--warn); }
.dot--error { background: var(--error); }

/* ── Separator ──────────────────────────────────────────── */
.sep {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}

/* ── Utilitaires ────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-muted   { color: var(--text-muted); }
.text-orange  { color: var(--brand-orange); }
.text-ok      { color: var(--ok); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .container { width: calc(100% - 32px); }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
}
