/* ═══════════════════════════════════════════════════════════════
   Jus d'orange SaaS — Design Tokens & Base
   Mobile-first, premium dark theme
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* ─── Surfaces (layered depth, warm-neutral dark) ─── */
  --bg-base:       #0a0a0c;
  --bg-surface:    #141417;
  --bg-surface2:   #1c1c20;
  --bg-surface3:   #26262b;
  --bg-hover:      #2f2f35;
  --bg-elevated:   #17171b;

  /* ─── Borders ─── */
  --border:        #2c2c33;
  --border-subtle: #212127;
  --border-strong: #3a3a42;

  /* ─── Brand (orange) ─── */
  --orange:        #ff6d1a;
  --orange-light:  #ff9351;
  --orange-dark:   #d9540a;
  --orange-glow:   rgba(255,109,26,0.16);
  --orange-glow2:  rgba(255,109,26,0.07);
  --gradient-brand: linear-gradient(135deg, #ff8534 0%, #ff6d1a 50%, #e5560c 100%);

  /* ─── Text ─── */
  --text-primary:   #f4f4f6;
  --text-secondary: #a1a1ab;
  --text-muted:     #6b6b76;
  --text-faint:     #4a4a52;
  --text-link:      #ff9351;

  /* ─── Status ─── */
  --green:    #2ecc71;
  --green-bg: rgba(46,204,113,0.13);
  --yellow:   #f5a623;
  --yellow-bg:rgba(245,166,35,0.13);
  --red:      #f04747;
  --red-bg:   rgba(240,71,71,0.13);
  --blue:     #4a9eff;
  --blue-bg:  rgba(74,158,255,0.13);
  --purple:   #b06cff;
  --purple-bg:rgba(176,108,255,0.13);

  /* ─── Spacing scale ─── */
  --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;

  /* ─── Radii ─── */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   22px;
  --radius-full: 9999px;

  /* ─── Typography ─── */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* ─── Shadows (soft, layered) ─── */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.3), 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.45), 0 4px 8px rgba(0,0,0,0.3);
  --shadow-xl:  0 24px 56px rgba(0,0,0,0.55);
  --shadow-orange: 0 6px 24px rgba(255,109,26,0.28);

  /* ─── Transitions ─── */
  --transition-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 240ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ─── Layout metrics ─── */
  --sidebar-width: 244px;
  --topbar-height: 62px;
  --bottomnav-height: 62px;

  /* ─── Safe areas (notched phones) ─── */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Subtle ambient brand glow at the top.
     NOTE: deliberately NOT using `background-attachment: fixed` — on iOS
     Safari that repaints the whole gradient on every scroll frame, which
     makes scrolling stutter or lock up completely. */
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(255,109,26,0.05) 0%, transparent 60%);
  background-repeat: no-repeat;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--orange-light); }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

/* Remove tap highlight, keep taps snappy */
a, button, .nav-item, .btn, .page-btn, [onclick] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-surface3); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
* { scrollbar-width: thin; scrollbar-color: var(--bg-surface3) transparent; }

::selection { background: var(--orange-glow); color: var(--orange-light); }

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ─── Typography ────────────────────────────────────────────── */
h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.6px; line-height: 1.2; }
h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
h4 { font-size: 14px; font-weight: 600; }
h5 { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px; }

p { color: var(--text-secondary); line-height: 1.65; }

code, pre {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-surface2);
  border-radius: var(--radius-sm);
}
code { padding: 2px 7px; color: var(--orange-light); border: 1px solid var(--border-subtle); }
pre { padding: var(--space-4); overflow-x: auto; border: 1px solid var(--border); }

/* ─── Utilities ─────────────────────────────────────────────── */
.text-primary   { color: var(--text-primary)   !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted)     !important; }
.text-orange    { color: var(--orange)          !important; }
.text-green     { color: var(--green)           !important; }
.text-yellow    { color: var(--yellow)          !important; }
.text-red       { color: var(--red)             !important; }
.text-sm        { font-size: 12px; }
.text-xs        { font-size: 11px; }
.text-mono      { font-family: var(--font-mono); }
.font-bold      { font-weight: 700; }
.font-medium    { font-weight: 500; }

.flex           { display: flex; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1          { gap: var(--space-1); }
.gap-2          { gap: var(--space-2); }
.gap-3          { gap: var(--space-3); }
.gap-4          { gap: var(--space-4); }
.flex-wrap      { flex-wrap: wrap; }
.flex-col       { flex-direction: column; }
.w-full         { width: 100%; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Fade-in helper for content loads */
.fade-in { animation: fadeInUp var(--transition-base) both; }
