/* ============================================================
   FraisMobile Gabon — Design System
   style.css — Variables globales, reset, typographie, layout
   ============================================================ */

/* ── IMPORTS GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* ── CLASSE UTILITAIRE MATERIAL SYMBOLS ── */
.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.ms-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.ms-sm  { font-size: 18px; }
.ms-md  { font-size: 24px; }
.ms-lg  { font-size: 32px; }
.ms-xl  { font-size: 40px; }
.ms-2xl { font-size: 48px; }

/* ── 1. VARIABLES LIGHT MODE ── */
:root {
  /* Marque */
  --color-brand-green:       #1A7F4F;
  --color-brand-green-dark:  #145f3b;
  --color-brand-green-light: #e8f5ee;
  --color-brand-yellow:      #F5C518;

  /* Moov Africa Gabon */
  --color-moov-blue:         #1565C0;
  --color-moov-blue-light:   #e3edf9;
  --color-moov-orange:       #E8520A;
  --color-moov-orange-light: #fdf0ea;

  /* Airtel Gabon */
  --color-airtel-red:        #E8001C;
  --color-airtel-red-light:  #fde8eb;

  /* Fonds & surfaces */
  --color-bg-primary:       #FFFFFF;
  --color-bg-secondary:     #F5F5F5;
  --color-bg-tertiary:      #EBEBEB;
  --color-surface-card:     #FFFFFF;
  --color-surface-overlay:  rgba(0,0,0,0.04);

  /* Texte */
  --color-text-primary:     #111111;
  --color-text-secondary:   #4A4A4A;
  --color-text-muted:       #888888;
  --color-text-inverse:     #FFFFFF;

  /* Bordures */
  --color-border-light:     #E0E0E0;
  --color-border-medium:    #C4C4C4;
  --color-border-brand:     #1A7F4F;

  /* États sémantiques */
  --color-success:          #1A7F4F;
  --color-success-bg:       #e8f5ee;
  --color-error:            #D32F2F;
  --color-error-bg:         #fdecea;
  --color-warning:          #F57C00;
  --color-warning-bg:       #fff3e0;
  --color-info:             #1565C0;
  --color-info-bg:          #e3edf9;

  /* Typographie */
  --font-primary: 'Nunito', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'Courier New', Courier, monospace;

  --font-size-xs:   12px;
  --font-size-sm:   13px;
  --font-size-base: 15px;
  --font-size-md:   17px;
  --font-size-lg:   20px;
  --font-size-xl:   24px;
  --font-size-2xl:  30px;
  --font-size-3xl:  38px;

  --font-weight-regular: 400;
  --font-weight-medium:  600;
  --font-weight-bold:    700;
  --font-weight-black:   800;

  --line-height-tight: 1.3;
  --line-height-base:  1.6;
  --line-height-loose: 1.8;

  /* Espacements */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Rayons */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 3px 10px rgba(0,0,0,0.10);
  --shadow-lg: 0 6px 24px rgba(0,0,0,0.12);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* Layout */
  --max-width-app: 480px;
  --nav-height:    60px;
  --bottom-nav-h:  64px;

  /* Z-index */
  --z-base:  1;
  --z-nav:   100;
  --z-modal: 1000;
  --z-toast: 2000;
}

/* ── 2. DARK MODE ── */
@media (prefers-color-scheme: dark) {
  :root {
    --color-brand-green:       #22A865;
    --color-brand-green-dark:  #1A7F4F;
    --color-brand-green-light: #0d2e1d;

    --color-bg-primary:        #0F0F0F;
    --color-bg-secondary:      #1A1A1A;
    --color-bg-tertiary:       #242424;
    --color-surface-card:      #1E1E1E;
    --color-surface-overlay:   rgba(255,255,255,0.05);

    --color-text-primary:      #F0F0F0;
    --color-text-secondary:    #ABABAB;
    --color-text-muted:        #666666;
    --color-text-inverse:      #0F0F0F;

    --color-border-light:      #2C2C2C;
    --color-border-medium:     #404040;
    --color-border-brand:      #22A865;

    --color-moov-blue-light:   #0d1e3a;
    --color-moov-orange-light: #2e1400;
    --color-airtel-red-light:  #2e0008;

    --color-success:           #22A865;
    --color-success-bg:        #0d2e1d;
    --color-error:             #EF5350;
    --color-error-bg:          #2e0a0a;
    --color-warning:           #FFA726;
    --color-warning-bg:        #2e1a00;
    --color-info:              #42A5F5;
    --color-info-bg:           #0d1e3a;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
    --shadow-md: 0 3px 10px rgba(0,0,0,0.40);
    --shadow-lg: 0 6px 24px rgba(0,0,0,0.50);
  }
}

/* ── 3. RESET & BASE ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg-secondary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-brand-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-brand-green-dark); }

ul, ol  { list-style: none; }
button  { font-family: var(--font-primary); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font-primary); font-size: var(--font-size-base); }

/* ── 4. TYPOGRAPHIE ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
}

h1 { font-size: var(--font-size-2xl); font-weight: var(--font-weight-black); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-md); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }
small  { font-size: var(--font-size-xs); }
strong { font-weight: var(--font-weight-bold); }

/* ── 5. LAYOUT PRINCIPAL ── */
.app-wrapper {
  max-width: var(--max-width-app);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-bg-primary);
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-content {
  flex: 1;
  padding: var(--space-4);
  padding-bottom: calc(var(--bottom-nav-h) + var(--space-4));
}

/* ── 6. NAVIGATION SUPÉRIEURE ── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  background: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  gap: var(--space-3);
}

.top-nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.top-nav__logo-img { height: 36px; width: auto; }

/* Fallback texte logo */
.top-nav__logo-text {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-black);
  color: var(--color-brand-green);
  letter-spacing: -0.3px;
}
.top-nav__logo-text span { color: var(--color-moov-blue); }

/* ── 7. NAVIGATION BAS (Mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width-app);
  height: var(--bottom-nav-h);
  background: var(--color-bg-primary);
  border-top: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: var(--z-nav);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  transition: color var(--transition-fast);
  min-width: 64px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item .material-symbols-rounded {
  font-size: 26px;
  transition: font-variation-settings var(--transition-base);
}

.bottom-nav__item:hover,
.bottom-nav__item--active {
  color: var(--color-brand-green);
}

.bottom-nav__item--active .material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

/* ── 8. UTILITAIRES ── */
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

.text-center      { text-align: center; }
.text-right       { text-align: right; }
.text-muted       { color: var(--color-text-muted); }
.text-success     { color: var(--color-success); }
.text-error       { color: var(--color-error); }
.text-brand       { color: var(--color-brand-green); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1          { flex: 1; }
.w-full          { width: 100%; }
.hidden          { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--color-border-light);
  margin: var(--space-4) 0;
}

.section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-3);
}