/* ============================================================
   UBAAX — Dark super-app design tokens
   ============================================================ */
/* Police Inter — AUTO-HÉBERGÉE sur ubaax.com (aucune dépendance externe ; vie privée : zéro appel tiers) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/inter-800.woff2') format('woff2'); }

:root {
  /* Surfaces */
  --bg:        #0A0A0F;
  --surface:   #15151D;
  --elevated:  #1E1E29;
  --elevated-2:#26263420;
  --border:    #2A2A38;
  --border-soft: #20202C;

  /* Text */
  --text:      #F5F5FA;
  --text-2:    #9A9AB0;
  --text-3:    #6A6A80;

  /* Accent */
  /* Accent — blue → green (dominant duo) */
  --violet:    #2E9BFF;  /* primary accent = blue */
  --blue:      #2BD67B;  /* secondary accent = green */
  --accent-grad: linear-gradient(120deg, #2E9BFF 0%, #2BD67B 100%);
  --accent-grad-soft: linear-gradient(120deg, rgba(46,155,255,0.18) 0%, rgba(43,214,123,0.18) 100%);
  --glow:      0 0 24px rgba(46,155,255,0.45);

  /* Colored-icon palette (cool, blue–green majority + warm pops) */
  --c-blue:    #2E9BFF;
  --c-sky:     #38BDF8;
  --c-cyan:    #1FC8DE;
  --c-teal:    #14C7A8;
  --c-green:   #2BD67B;
  --c-emerald: #34D399;
  --c-indigo:  #5B7CFA;
  --c-amber:   #FBBF24;
  --c-coral:   #FB7185;
  --c-pink:    #F472B6;

  /* Glass surfaces (floating nav, frosted headers) */
  --glass-bg:        rgba(21,21,29,0.72);
  --glass-bg-strong: rgba(18,18,26,0.86);
  --glass-border:    rgba(255,255,255,0.07);
  --glass-shadow:    0 8px 32px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06);
  --nav-active-ink:  #FFFFFF;

  /* Map palette */
  --map-bg: #0C0C14; --map-block: #13131C; --map-road: #1C1C28;
  --map-park: #10241A; --map-river: #13283A;
  --map-roof: #1B1B2A; --map-label: #3C3C4E; --map-tree: #1A3A28;

  /* Semantic */
  --success:   #34D399;
  --warning:   #FBBF24;
  --danger:    #F87171;

  /* Radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 8px 24px rgba(0,0,0,0.45);
  --shadow-3: 0 16px 40px rgba(0,0,0,0.55);
  --shadow-4: 0 24px 60px rgba(0,0,0,0.62);
  --shadow-glass: 0 8px 32px rgba(0,0,0,0.5);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   DAY (LIGHT) THEME — scoped to the app wrapper
   ============================================================ */
.ubaax-app[data-theme="light"] {
  --bg:        #F1F2F8;
  --surface:   #FFFFFF;
  --elevated:  #ECEEF6;
  --border:    #E2E4EF;
  --border-soft: #ECEDF4;

  --text:      #16161F;
  --text-2:    #585870;
  --text-3:    #9494A8;

  --accent-grad-soft: linear-gradient(120deg, rgba(46,155,255,0.13) 0%, rgba(43,214,123,0.13) 100%);
  --glow:      0 0 24px rgba(46,155,255,0.28);

  --shadow-1: 0 1px 2px rgba(20,40,60,0.06);
  --shadow-2: 0 10px 30px rgba(30,90,140,0.13);
  --shadow-3: 0 16px 40px rgba(30,90,140,0.20);
  --shadow-4: 0 24px 60px rgba(30,90,140,0.26);
  --shadow-glass: 0 10px 32px rgba(30,90,140,0.15);

  --glass-bg:        rgba(255,255,255,0.74);
  --glass-bg-strong: rgba(255,255,255,0.88);
  --glass-border:    rgba(20,40,60,0.06);
  --glass-shadow:    0 10px 32px rgba(30,90,140,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
  --nav-active-ink:  #1E8AF0;

  /* foreground accent palette — darkened so icons & text stay legible on
     white surfaces (the bright dark-mode hues wash out at ~1.5:1 otherwise) */
  --violet:    #1A6FD0;
  --blue:      #0B9150;
  --c-blue:    #1A6FD0;
  --c-sky:     #0E7AB8;
  --c-cyan:    #0E8FA3;
  --c-teal:    #0C8A75;
  --c-green:   #0B9150;
  --c-emerald: #0B9150;
  --c-indigo:  #4F46E5;
  --c-amber:   #B9770A;
  --c-coral:   #E23744;
  --c-pink:    #CE3A95;
  --success:   #0B9150;
  --warning:   #B9770A;

  --map-bg: #E6EAF3; --map-block: #DCE1ED; --map-road: #FFFFFF;
  --map-park: #D3E8D4; --map-river: #C6DCEE;
  --map-roof: #EFF2F9; --map-label: #A8AFC2; --map-tree: #B6D9B8;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* buttons must inherit text colour — UA gives them a black `buttontext`
   default that does NOT inherit, breaking any text span that relies on it */
.ubaax-app button { color: inherit; }

.ubaax-app, .ubaax-app * {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.ubaax-app {
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* The scrollable screen viewport — sits under the status bar, above tab bar */
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  isolation: isolate;
}
.screen::-webkit-scrollbar { display: none; }

/* Hide scrollbars on any horizontal rail */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Typography helpers */
.h-display { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.h-1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.h-2 { font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.h-3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.body { font-size: 15px; font-weight: 400; line-height: 1.5; color: var(--text); }
.body-2 { font-size: 14px; font-weight: 400; color: var(--text-2); }
.caption { font-size: 12px; font-weight: 500; color: var(--text-2); }
.overline { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
/* type fluide MOBILE uniquement (≤600px) : tient ≥ taille d'origine sur petit téléphone (lisibilité),
   grandit doucement vers les grands téléphones. Desktop/admin (>600px) gardent les tailles fixes
   d'origine — aucune régression sur le travail desktop/admin déjà livré. */
@media (max-width: 600px) {
  .h-display { font-size: clamp(28px, calc(24px + 1.6vw), 34px); }
  .h-1 { font-size: clamp(23px, calc(20px + 1.2vw), 27px); }
  .h-2 { font-size: clamp(18.5px, calc(16.5px + 0.8vw), 21px); }
  .h-3 { font-size: clamp(16px, calc(14.6px + 0.5vw), 18px); }
  .body { font-size: clamp(15px, calc(14px + 0.35vw), 16.5px); }
  .body-2 { font-size: clamp(14px, calc(13.2px + 0.28vw), 15.5px); }
  .caption { font-size: clamp(12px, calc(11.4px + 0.2vw), 13px); }
}

.grad-text {
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  border-radius: var(--r-md); padding: 0 18px; height: 48px;
  color: var(--text); transition: transform 0.15s var(--ease), filter 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 20px rgba(124,92,255,0.4); }
.btn-primary:active { filter: brightness(0.95); }
.btn-ghost { background: var(--elevated); color: var(--text); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-block { width: 100%; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--elevated); color: var(--text-2);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: all 0.2s var(--ease);
}
.chip.active { background: var(--accent-grad-soft); color: var(--text); border-color: rgba(124,92,255,0.4); }

/* Card */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
}

/* avatar */
.avatar {
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden;
}

/* skeleton shimmer */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
  background: linear-gradient(90deg, #1A1A24 25%, #24243200 37%, #1A1A24 63%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}

/* entrance — opacity stays 1 (transform-only) so content is NEVER invisible,
   even if a sandboxed compositor freezes the animation at time 0 */
@keyframes fadeUp { from { transform: translateY(14px); } to { transform: none; } }
.fade-up { animation: fadeUp 0.45s var(--ease); }
@media (prefers-reduced-motion: reduce) { .fade-up { animation: none; } }

/* profile overlay slide-in (transform-only) */
@keyframes profileIn { from { transform: translateY(30px); } to { transform: none; } }
.profile-in { animation: profileIn 0.4s var(--ease); }
@media (prefers-reduced-motion: reduce) { .profile-in { animation: none; } }


/* ===== M0 mobile-first : safe-areas (double déclaration = fallback vieux navigateurs),
   anti-zoom iOS, anti double-tap. Valeurs identiques à l'existant quand env()=0
   (desktop/admin/Android sans encoche → pixel-perfect inchangé). ===== */
:root {
  /* safe-area centralisée : --safe-t/-b portent env() ; tous les paddings en dérivent
     (production identique, mais surchargeable en test headless pour simuler l'encoche). */
  --safe-t: 0px; --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: 0px; --safe-b: env(safe-area-inset-bottom, 0px);
  --nudge-t: 0px; --nudge-t: max(0px, calc(var(--safe-t) - 47px));
  --pt46: 46px; --pt46: max(46px, calc(var(--safe-t) + 4px));
  --pt52: 52px; --pt52: max(52px, calc(var(--safe-t) + 6px));
  --pt54: 54px; --pt54: max(54px, calc(var(--safe-t) + 8px));
  --pt56: 56px; --pt56: max(56px, calc(var(--safe-t) + 10px));
  --pt60: 60px; --pt60: max(60px, calc(var(--safe-t) + 14px));
  --tabbar-gap: 22px; --tabbar-gap: max(22px, calc(var(--safe-b) + 8px));
  --pb26: 26px; --pb26: max(26px, calc(var(--safe-b) + 12px));
  --pb28: 28px; --pb28: max(28px, calc(var(--safe-b) + 12px));
  --pb30: 30px; --pb30: max(30px, calc(var(--safe-b) + 12px));
  --pb34: 34px; --pb34: max(34px, calc(var(--safe-b) + 14px));
}
/* anti-zoom iOS au focus — mobile uniquement (#root = shell mobile) */
#root input, #root textarea, #root select { font-size: 16px !important; }
/* supprime le délai/zoom double-tap sans bloquer pan ni pinch (carte Leaflet OK) */
body { touch-action: manipulation; }
/* le rubber-band d'une sheet ne se propage plus à l'écran derrière */
#root .screen { overscroll-behavior: contain; }
