/* ============================================================================
   ZYNGO TYPOGRAPHY HARMONIZATION LAYER
   --------------------------------------------------------------------------
   Feuille de style chargée en DERNIER dans <head> sur toutes les pages
   hors admin/. Elle unifie la typographie de l'application :
     • Police moderne et bien lisible : Plus Jakarta Sans (Latin) +
       Noto Sans Arabic (RTL/ar) + JetBrains Mono (mono).
     • Taille de police de base plus grande : 17 px (au lieu de 15–16 px).
     • Échelle typographique harmonisée pour titres, paragraphes,
       labels, champs de formulaire et boutons.
     • Désactive les polices système génériques qui variaient selon
       les pages (system-ui / 'DM Sans' / 'Segoe UI' / etc.).

   Cette feuille utilise `!important` pour surcharger les styles inline
   propres à chaque page. Les polices "display" (Bebas Neue, Syne,
   Playfair) sont conservées pour les éléments de marque / hero afin
   de ne pas casser l'identité visuelle.

   v1 — 2026-10
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+Arabic:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ---- Font stacks --------------------------------------------------- */
  --zg-font-body: 'Plus Jakarta Sans', 'DM Sans', system-ui, -apple-system,
                  'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --zg-font-display: 'Plus Jakarta Sans', 'Syne', 'DM Sans', sans-serif;
  --zg-font-mono: 'JetBrains Mono', 'DM Mono', ui-monospace, 'SFMono-Regular',
                  Menlo, Consolas, monospace;
  --zg-font-ar: 'Noto Sans Arabic', 'Plus Jakarta Sans', system-ui, sans-serif;

  /* ---- Type scale (1 rem = 17 px on browsers default) ----------------- */
  --zg-fs-xs:   0.8125rem;  /* 13 px */
  --zg-fs-sm:   0.875rem;  /* 14 px */
  --zg-fs-base: 1.0625rem; /* 17 px */
  --zg-fs-md:   1.125rem;  /* 18 px */
  --zg-fs-lg:   1.25rem;   /* 20 px */
  --zg-fs-xl:   1.5rem;    /* 24 px */
  --zg-fs-2xl:  1.875rem;  /* 30 px */
  --zg-fs-3xl:  2.25rem;   /* 36 px */

  --zg-lh-tight: 1.2;
  --zg-lh-base:  1.6;
  --zg-lh-loose: 1.7;
}

/* ============================================================================
   1. BASE TYPOGRAPHY
   ============================================================================ */

html { font-size: 100%; }

body,
.auth-screen {
  font-family: var(--zg-font-body) !important;
  font-size: var(--zg-fs-base) !important;          /* 17 px */
  line-height: var(--zg-lh-base) !important;         /* 1.6   */
  letter-spacing: -0.005em !important;
  font-weight: 400 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

/* Arabic / RTL : bascule vers Noto Sans Arabic */
[lang="ar"] body,
[lang="ar"] button,
[lang="ar"] input,
[lang="ar"] select,
[lang="ar"] textarea,
[dir="rtl"] body,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] select,
[dir="rtl"] textarea {
  font-family: var(--zg-font-ar) !important;
}

/* ============================================================================
   2. HEADINGS — unified, modern scale
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--zg-font-body) !important;
  font-weight: 700 !important;
  line-height: var(--zg-lh-tight) !important;
  letter-spacing: -0.02em !important;
  text-wrap: balance;
}
h1 { font-size: var(--zg-fs-2xl) !important; }   /* 30 */
h2 { font-size: var(--zg-fs-xl)  !important; }   /* 24 */
h3 { font-size: var(--zg-fs-lg)  !important; }   /* 20 */
h4 { font-size: var(--zg-fs-md)  !important; }   /* 18 */
h5 { font-size: var(--zg-fs-base)!important; }   /* 17 */
h6 { font-size: var(--zg-fs-sm)  !important; }   /* 14 */

/* Auth screen card title — keep display weight */
.auth-screen .card-title {
  font-family: var(--zg-font-body) !important;
  font-size: var(--zg-fs-2xl) !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  line-height: 1.15 !important;
}

/* Page title bars used across client/driver pages */
.page-title,
.hdr-title,
.tb-title,
.tb-logo {
  font-family: var(--zg-font-body) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em !important;
}

/* ============================================================================
   3. PARAGRAPHS, LABELS, TEXT
   ============================================================================ */

p, li, dt, dd, figcaption {
  line-height: var(--zg-lh-base) !important;
}

p { font-size: inherit; }   /* let body size cascade */

label,
.flabel,
.field-label {
  font-family: var(--zg-font-body) !important;
  font-size: var(--zg-fs-sm) !important;        /* 14 px → 15 px */
  font-weight: 600 !important;
  letter-spacing: -0.005em !important;
}
.flabel { font-size: 0.9375rem !important; }   /* 15 px */

/* Small helper texts — bumped up slightly but kept compact */
.field-hint,
.card-sub,
.footer-txt,
.card-tag,
.sb-sec,
.sb-foot-lbl,
.field-error {
  font-family: var(--zg-font-body) !important;
}
.card-sub      { font-size: 1rem       !important; line-height: 1.55 !important; }
.footer-txt    { font-size: 0.9375rem  !important; line-height: 1.5  !important; }
.field-hint    { font-size: 0.875rem   !important; line-height: 1.45 !important; }
.card-tag      { font-size: 0.75rem    !important; letter-spacing: 0.08em !important; }
.sb-sec,
.sb-foot-lbl   { font-size: 0.6875rem  !important; letter-spacing: 0.18em !important; }

/* Body links — slightly heavier for readability */
a { font-weight: 500; }

/* Mono text — uniform JetBrains Mono */
code, pre, kbd, samp, .mono, .dm-mono, .sb-time,
.mono-num, [data-mono] {
  font-family: var(--zg-font-mono) !important;
  font-variant-ligatures: none;
}

/* ============================================================================
   4. FORM CONTROLS — modern readable size + uniform font
   ============================================================================ */

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="search"],
input[type="url"], input[type="date"], input[type="time"],
input[type="datetime-local"], input[type="month"], input[type="week"],
input:not([type]), select, textarea {
  font-family: var(--zg-font-body) !important;
  font-size: 1rem !important;                       /* 17 px context */
  line-height: 1.5 !important;
  font-weight: 400 !important;
}

/* Auth screens specifically — slightly larger inputs */
.auth-screen .finput,
.auth-screen .captcha-input {
  font-family: var(--zg-font-body) !important;
  font-size: var(--zg-fs-base) !important;          /* 17 px */
  line-height: 1.5 !important;
}

/* ============================================================================
   5. BUTTONS — uniform font + minimum readable size
   ============================================================================ */

button,
.btn, .btn-primary, .btn-gold, .btn-in, .abtn-gold,
.cta, .auth-screen .cta,
.hbtn, .tb-btn, .lang-pill, .vt-btn,
.sb-item, .sb-close, .sb-chip, .sb-badge, .sb-sec, .sb-foot-lbl,
.captcha-refresh, .eye {
  font-family: var(--zg-font-body) !important;
}

button,
.btn,
.btn-primary,
.btn-gold,
.btn-in,
.abtn-gold,
.cta,
.auth-screen .cta {
  font-size: 1rem !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

/* Keep micro chips compact but never < 13 px */
.captcha-refresh, .eye {
  font-size: var(--zg-fs-xs) !important;            /* 13 px floor */
}

/* ============================================================================
   5b. MENU & SIDEBAR — mobile-friendly typography
   --------------------------------------------------------------------------
   The dashboard sidebars (client + driver) use .sb-* classes. The original
   inline styles shrink .sb-item to 0.82rem (~13px) on mobile via a media
   query — far too small for touch UI. The rules below override that and
   enforce iOS HIG / Material touch targets (≥ 44 px) with readable text.
   ============================================================================ */

/* Section labels ("NAVIGATION", "PRÉFÉRENCES", …) */
.sb-sec,
.sb-foot-lbl {
  font-size: 0.75rem !important;             /* 12 px (was 0.65–0.7) */
  letter-spacing: 0.14em !important;
  font-weight: 800 !important;
}

/* Main menu items */
.sb-item {
  font-size: 1rem !important;                /* 16 px (was 0.95 / 0.82 on mobile) */
  font-weight: 600 !important;
  line-height: 1.3 !important;
  min-height: 44px !important;                /* iOS HIG touch target */
  padding: 12px 14px !important;
  gap: 12px !important;
}
.sb-item i,
.sb-item span { font-size: 1rem !important; line-height: 1.3 !important; }

/* User identity block in sidebar header */
.sb-name  { font-size: 1.15rem !important; font-weight: 800 !important; line-height: 1.25 !important; }
.sb-role  { font-size: 0.8125rem !important; font-weight: 700 !important; letter-spacing: 0.06em !important; }
.sb-chip  { font-size: 0.8125rem !important; padding: 5px 12px !important; font-weight: 700 !important; }
.sb-chip i { font-size: 0.75rem !important; }
.sb-badge { font-size: 0.75rem !important; padding: 4px 10px !important; font-weight: 800 !important; }

/* Sidebar close button — bigger, easier to tap */
.sb-close {
  width: 38px !important;
  height: 38px !important;
  font-size: 1rem !important;
}

/* Language pills in sidebar footer */
.lang-pill {
  font-size: 0.9375rem !important;            /* 15 px (was 0.85) */
  font-weight: 700 !important;
  min-height: 44px !important;
  padding: 10px !important;
}

/* Header buttons (hamburger, notifications, etc.) */
.hbtn, .tb-btn {
  width: 46px !important;
  height: 46px !important;
  font-size: 1.125rem !important;            /* 18 px icon */
  min-height: 44px !important;
}

/* Sidebar width on mobile — slightly wider so menu items have breathing room */
@media (max-width: 768px) {
  .sidebar { width: min(320px, 86vw) !important; }
  .sb-head { padding: 20px 18px 16px !important; }
  .sb-sec  { padding: 12px 12px 4px !important; }
  .sb-foot { padding: 14px !important; }
  .sb-av   { width: 52px !important; height: 52px !important; font-size: 1.65rem !important; }
}

@media (max-width: 480px) {
  .sb-item   { font-size: 1.0625rem !important; padding: 13px 16px !important; min-height: 48px !important; }
  .sb-item i,
  .sb-item span { font-size: 1.0625rem !important; }
  .lang-pill { font-size: 1rem !important; min-height: 48px !important; }
  .hbtn, .tb-btn { width: 48px !important; height: 48px !important; }
}

/* ============================================================================
   6. TABLES & DATA — readable numeric presentation
   ============================================================================ */

table { font-variant-numeric: tabular-nums; }
th, td { font-size: var(--zg-fs-sm) !important; line-height: 1.5 !important; }
th { font-weight: 700 !important; }

/* ============================================================================
   7. PRESERVE INTENTIONAL DISPLAY FONTS
   --------------------------------------------------------------------------
   Some elements use display fonts (Bebas Neue, Syne, Playfair) for branding,
   hero numbers, or logos. We do NOT override their font-family, but we bump
   their font-size proportionally where it makes sense.
   ============================================================================ */

.auth-brand,
.topbar-logo,
.logo-name,
.logo,
.brand-mark {
  /* These keep their existing display font but inherit body weight scale. */
}

/* Big hero numbers / scores — bump slightly for impact */
.score-num,
.hero-num,
.mc-val,
.sb-av,
.vt-btn-num {
  font-family: var(--zg-font-display) !important;
}

/* ============================================================================
   8. FOCUS & ACCESSIBILITY — keep visible outlines
   ============================================================================ */

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--zg-gold, #FFC107);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================================
   9. RESPONSIVE — prevent iOS zoom, scale down on mobile
   ============================================================================ */

@media (max-width: 768px) {
  body, .auth-screen {
    font-size: 1rem !important;                    /* 16 px on mobile */
    line-height: 1.55 !important;
  }
  h1 { font-size: var(--zg-fs-xl)  !important; }   /* 24 */
  h2 { font-size: var(--zg-fs-lg)  !important; }   /* 20 */
  h3 { font-size: var(--zg-fs-md)  !important; }   /* 18 */
  .auth-screen .card-title { font-size: var(--zg-fs-xl) !important; }

  /* iOS Safari requires ≥ 16 px on inputs to avoid auto-zoom */
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="password"], input[type="number"], input[type="search"],
  input[type="url"], input[type="date"], input[type="time"],
  input[type="datetime-local"], input:not([type]),
  select, textarea {
    font-size: 16px !important;
  }
  button { font-size: 16px !important; }
}

@media (max-width: 480px) {
  h1 { font-size: 1.375rem !important; }            /* 22 */
  h2 { font-size: 1.1875rem !important; }          /* 19 */
  .auth-screen .card-title { font-size: 1.375rem !important; }
}

/* ============================================================================
   10. REDUCED MOTION — no font-size transitions
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
