/* =============================================================
   Almawarid — Theme Layer ("Soft Modern SaaS")
   Direction: Linear × Stripe — cool off-white surfaces, muted
   periwinkle primary, teal accent, slightly rounder corners.
   Loaded AFTER style.css.
   ============================================================= */

:root {
  /* ---------- Cool off-white neutrals ---------- */
  --paper-0:   #f9fafc;   /* page background — cool off-white */
  --paper-1:   #ffffff;   /* card surface */
  --paper-2:   #f3f5f9;   /* subtle surface / zebra */
  --paper-3:   #e7eaf1;   /* divider emphasis */

  /* ---------- Text scale (cooler ink) ---------- */
  --ink-900:   #151828;   /* display — deep navy-ink */
  --ink-800:   #232637;   /* strong body */
  --ink-700:   #3a3f52;   /* body */
  --ink-500:   #6b7080;   /* muted body */
  --ink-400:   #9097a6;   /* ghost / placeholder */
  --ink-300:   #c1c6d1;   /* hint */

  /* ---------- Borders & lines ---------- */
  --line-soft: #eceff5;
  --line:      #dde1eb;
  --line-strong: #b4bac8;

  /* ---------------------------------------------------------------
     3-HUE PALETTE (plus neutrals)
     1. Primary  — muted periwinkle. Brand, CTAs, links, "info".
     2. Accent   — teal. Positive states, success, secondary actions.
     3. Alert    — coral. Warnings AND errors collapse into one hue.
     Everything else is neutrals (paper + ink).
     --------------------------------------------------------------- */

  /* 1. Primary — the exact Almawarid logo blue */
  --primary:       #024dec;
  --primary-ink:   #0340c2;
  --primary-hover: #0340c2;
  --primary-tint:  rgba(2,77,236,0.08);
  --primary-ring:  rgba(2,77,236,0.25);

  /* 2. Sky — lighter cousin of the logo blue; replaces amber/orange
     wherever the old UI flagged a warning/alert. Stays in the blue family. */
  --sky:           #09bffe;
  --sky-dark:      #0299d0;
  --sky-tint:      #e1f6ff;
  --sky-ring:      rgba(9,191,254,0.28);

  /* 3. Green — success / positive states */
  --green:         #15803d;
  --green-dark:    #126431;
  --green-tint:    #e1f1e5;
  --green-ring:    rgba(21,128,61,0.25);

  /* 4. Black — ink / errors / strong text. No red. */
  --black:         #0a0a0a;

  /* Aliases — legacy vars expect accent/success/warning/danger/info.
     Collapse every single semantic color into one of the three above. */
  --accent:        var(--green);
  --accent-dark:   var(--green-dark);
  --accent-tint:   var(--green-tint);
  --accent-ring:   var(--green-ring);
  --success:       var(--green);
  --success-tint:  var(--green-tint);
  --warning:       var(--sky-dark);
  --warning-tint:  var(--sky-tint);
  --warning-ring:  var(--sky-ring);
  --danger:        var(--black);
  --danger-tint:   var(--paper-2);
  --danger-ring:   var(--line);
  --info:          var(--primary);
  --info-tint:     var(--primary-tint);
  --alert:         var(--sky-dark);
  --alert-dark:    var(--sky-dark);
  --alert-tint:    var(--sky-tint);
  --alert-ring:    var(--sky-ring);

  /* ---------- Radius (slightly rounder — modern SaaS rhythm) ---------- */
  --radius-xs:  6px;
  --radius-sm:  8px;
  --radius-md:  10px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-pill: 999px;

  /* ---------- Shadows — crisp border-first, not cloudy ---------- */
  --shadow-border: 0 0 0 1px var(--line-soft);
  --shadow-xs:   0 1px 0 rgba(27,25,21,0.03);
  --shadow-sm:   0 1px 2px rgba(27,25,21,0.04), 0 0 0 1px rgba(27,25,21,0.04);
  --shadow-md:   0 2px 6px rgba(27,25,21,0.05), 0 0 0 1px rgba(27,25,21,0.05);
  --shadow-lg:   0 10px 24px rgba(27,25,21,0.08), 0 0 0 1px rgba(27,25,21,0.06);
  --shadow-focus: 0 0 0 3px var(--primary-ring);

  /* ---------- Type ---------- */
  --font-sans:    'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", Menlo, "JetBrains Mono", monospace;

  /* ---------- Spacing scale ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;
  --space-10: 72px;

  /* ---------- Backward-compat aliases ---------- */
  /* The rest of the app references these; map them to the new values
     so legacy selectors inherit the new palette automatically. */
  --bg-deep:       var(--paper-0);
  --bg-mid:        var(--paper-2);
  --bg-card:       var(--paper-1);
  --bg-card-hover: var(--paper-2);
  --border-light:  var(--line-soft);
  --accent-1:      var(--primary);
  --accent-2:      var(--primary);  /* collapse gradient pair to solid */
  --accent-blue:   var(--primary);
  --accent-green:  var(--success);
  --text-main:     var(--ink-800);
  --text-muted:    var(--ink-500);
  --radius-card:   var(--radius-lg);
  --shadow-card:   var(--shadow-lg);
}

/* ---------- Bootstrap token overrides ---------- */
:root {
  --bs-primary:          var(--primary);
  --bs-primary-rgb:      2,77,236;
  --bs-body-color:       var(--ink-800);
  --bs-body-bg:          var(--paper-0);
  --bs-border-color:     var(--line);
  --bs-border-radius:    var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-link-color:       var(--ink-900);
  --bs-link-hover-color: var(--accent);
  --bs-link-color-rgb:   27,25,21;
  --bs-focus-ring-color: var(--primary-ring);
}

/* ---------- Base typography ---------- */
html, body {
  background: var(--paper-0) !important;
  color: var(--ink-800);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv02", "cv11";
  font-optical-sizing: auto;
  letter-spacing: -0.003em;
}
body { font-size: 15px; line-height: 1.55; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  color: var(--ink-900);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1, .h1 { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.03em; }
h2, .h2 { font-size: 1.75rem; font-weight: 750; }
h3, .h3 { font-size: 1.35rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 0.95rem; }
h6, .h6 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-500); font-weight: 700; }

p, li, td, th { color: var(--ink-800); }
small, .small, .text-muted { color: var(--ink-500) !important; }
a { color: var(--ink-900); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-900);
}
.section-sub { color: var(--ink-500); font-size: 1rem; font-weight: 400; }

/* ---------- Layout surfaces ---------- */
.navbar {
  background: color-mix(in srgb, var(--paper-0) 92%, transparent) !important;
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  box-shadow: none !important;
}
.navbar.scrolled { border-bottom-color: var(--line); }
.nav-link { color: var(--ink-700) !important; font-weight: 500; }
.nav-link:hover { color: var(--ink-900) !important; }

.app-sidebar {
  background: var(--paper-0);
  border-right: 1px solid var(--line-soft);
}
.sidebar-link { border-radius: var(--radius-md); color: var(--ink-700); font-weight: 500; }
.sidebar-link:hover { background: var(--paper-2); color: var(--ink-900); }
.sidebar-link.active {
  background: var(--primary);
  color: var(--paper-0);
  font-weight: 600;
}
.sidebar-link.active i { color: var(--paper-0) !important; }
.sidebar-section-label { color: var(--ink-400); font-weight: 700; letter-spacing: 0.1em; }
.sidebar-divider { background: var(--line-soft); }

/* ---------- Cards — lose the cloud shadow, gain crisp borders ---------- */
.card,
.step-card,
.feature-card,
.metric-card,
.timeline-card,
.download-app-card,
.review-card {
  background: var(--paper-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.card:hover,
.step-card:hover,
.feature-card:hover,
.metric-card:hover,
.download-app-card:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  transform: none; /* kill lift-on-hover — feels less template */
}

/* Card "tinted header" pattern — subtle editorial stripe */
.card--tinted > :first-child,
.card-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--ink-900);
}

/* Hero — no dot pattern, flat paper surface */
.hero-section {
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper-0) 100%) !important;
  padding: var(--space-10) 0 var(--space-9) !important;
}
.hero-section::before { display: none !important; }  /* kill the dot-grid fingerprint */
.hero-badge {
  background: var(--paper-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink-700);
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink-900);
}
.text-gradient {
  background: none !important;
  -webkit-text-fill-color: var(--accent) !important;
  color: var(--accent) !important;
}
.hero-subtitle { color: var(--ink-500); font-size: 1.05rem; }

/* Trust bar */
.trust-bar { background: var(--paper-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.trust-icon { color: var(--ink-900); }

/* How-it-works + Features background surfaces */
.how-section, .employee-view-section, .analytics-section {
  background: var(--paper-2) !important;
  border-color: var(--line-soft) !important;
}

/* Step number — flat primary block (ditch the round gradient) */
.step-number {
  background: var(--primary) !important;
  color: var(--paper-0) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: none !important;
  font-family: var(--font-display);
}

/* Feature icon — muted square, primary tint */
.feature-icon, .emp-icon {
  background: var(--primary-tint) !important;
  border: 1px solid var(--line-soft) !important;
  border-radius: var(--radius-md) !important;
  color: var(--primary) !important;
}
.feature-icon--alert, .emp-icon--green {
  background: var(--accent-tint) !important;
  border-color: var(--accent-ring) !important;
  color: var(--accent-dark) !important;
}
.emp-icon--yellow {
  background: var(--alert-tint) !important;
  border-color: var(--alert-ring) !important;
  color: var(--alert-dark) !important;
}
.feature-card--highlight {
  background: var(--paper-2) !important;
  border-color: var(--line) !important;
}

/* ---------- Buttons — solid ink, no gradient, no glow ---------- */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.1rem;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  box-shadow: none;
}
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn-primary,
.btn.btn-primary {
  background: var(--primary) !important;
  border: 1px solid var(--primary) !important;
  color: var(--paper-0) !important;
  box-shadow: var(--shadow-xs) !important;
  background-image: none !important;
}
.btn-primary:hover,
.btn.btn-primary:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}
.btn-primary:active { background: #000 !important; }

.btn-outline-primary {
  background: var(--paper-1);
  border: 1px solid var(--primary) !important;
  color: var(--primary) !important;
}
.btn-outline-primary:hover {
  background: var(--primary) !important;
  color: var(--paper-0) !important;
  border-color: var(--primary) !important;
}

.btn-outline-light,
.btn-outline-secondary {
  background: var(--paper-1);
  border: 1px solid var(--line) !important;
  color: var(--ink-700) !important;
}
.btn-outline-light:hover,
.btn-outline-secondary:hover {
  background: var(--paper-2);
  border-color: var(--line-strong) !important;
  color: var(--ink-900) !important;
}

/* Accent button — for key CTAs ("Commencer gratuitement", "Créer facture") */
.btn-accent {
  background: var(--accent) !important;
  border: 1px solid var(--accent) !important;
  color: var(--paper-0) !important;
}
.btn-accent:hover {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  color: var(--paper-0) !important;
}

/* ---------- Inputs & selects ---------- */
.form-control,
.form-select,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"],
input[type="date"], input[type="datetime-local"], input[type="url"],
textarea, select {
  background: var(--paper-1) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  color: var(--ink-900) !important;
  font-family: var(--font-sans);
  padding: 0.55rem 0.85rem !important;
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: none;
}
.form-control::placeholder,
input::placeholder, textarea::placeholder { color: var(--ink-400) !important; opacity: 1; }
.form-control:focus,
.form-select:focus,
input:focus, textarea:focus, select:focus {
  border-color: var(--ink-700) !important;
  box-shadow: var(--shadow-focus) !important;
  outline: none !important;
}
.form-label, label { color: var(--ink-700); font-weight: 500; font-size: 0.88rem; }

/* ---------- Dropdown ---------- */
.dropdown-menu {
  background: var(--paper-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-lg);
}
.dropdown-item {
  color: var(--ink-800) !important;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  padding: 7px 10px;
}
.dropdown-item:hover, .dropdown-item:focus {
  background: var(--paper-2) !important;
  color: var(--ink-900) !important;
}
.dropdown-item.active {
  background: var(--primary) !important;
  color: var(--paper-0) !important;
}
.dropdown-divider { border-color: var(--line-soft); }

/* ---------- Tables ---------- */
.table {
  color: var(--ink-800);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--paper-2);
}
.table > :not(caption) > * > * { border-color: var(--line-soft); }
.table thead th {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line) !important;
}
.table-hover tbody tr:hover { background: var(--paper-2); }

/* ---------- Alerts (Bootstrap) ---------- */
.alert { border-radius: var(--radius-md); border-width: 1px; border-style: solid; font-size: 0.9rem; }
.alert-success { background: var(--accent-tint); border-color: var(--accent-ring); color: var(--accent-dark); }
.alert-info    { background: var(--primary-tint); border-color: var(--primary-ring); color: var(--primary-ink); }
.alert-warning { background: var(--alert-tint); border-color: var(--alert-ring); color: var(--alert-dark); }
.alert-danger, .alert-error {
  background: var(--alert-tint); border-color: var(--alert-ring); color: var(--alert-dark);
}

/* ---------- Badges / pill chips ---------- */
.badge {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.72rem;
}
.badge.bg-primary { background: var(--primary) !important; color: var(--paper-0); }
.badge.bg-secondary { background: var(--paper-3) !important; color: var(--ink-800); }
.badge.bg-success { background: var(--accent-tint)  !important; color: var(--accent-dark); }
.badge.bg-warning { background: var(--alert-tint)   !important; color: var(--alert-dark); }
.badge.bg-danger  { background: var(--alert-tint)   !important; color: var(--alert-dark); }
.badge.bg-info    { background: var(--primary-tint) !important; color: var(--primary-ink); }

/* ---------- Kbd ---------- */
kbd {
  background: var(--paper-2) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-800) !important;
  font-family: var(--font-mono);
  border-radius: var(--radius-xs) !important;
}

/* ---------- Modal ---------- */
.modal-content {
  background: var(--paper-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header { border-bottom: 1px solid var(--line-soft); padding: var(--space-5); }
.modal-footer { border-top: 1px solid var(--line-soft); padding: var(--space-4) var(--space-5); }
.modal-title { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); }

/* ---------- Shimmer text / gradient accents — neutralized ---------- */
.shimmer-text {
  background: none !important;
  -webkit-text-fill-color: var(--ink-900) !important;
  color: var(--ink-900) !important;
  animation: none !important;
}

/* ---------- Mock boxes (landing page preview cards) ---------- */
.mock-desktop-card {
  background: var(--paper-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.mock-status-row, .mock-info-box {
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
}
.mock-notice { background: var(--accent-tint); border-color: var(--accent-ring); color: var(--accent-dark); }

/* ---------- Metric bar / progress ---------- */
.metric-bar { background: var(--line-soft); border-radius: var(--radius-xs); height: 4px; }
.metric-bar div { background: var(--primary) !important; border-radius: var(--radius-xs); }
/* Timeline productivity: accent (good), neutral grey (idle), alert (bad) */
.timeline-segment.productive   { background: var(--accent) !important; }
.timeline-segment.idle         { background: var(--ink-300) !important; }
.timeline-segment.unproductive { background: var(--alert) !important; }

/* ---------- Section labels (chapter feel) ---------- */
.section-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  margin-bottom: var(--space-3);
}

/* ---------- Utility overrides for common inline-styled patterns ---------- */
/* These catch the most recognizable current signal — indigo #4f46e5
   hex-coded inline — and neutralize it to the new ink primary. */
[style*="#4f46e5"] { /* fine-grained override would need !important on each prop */ }

/* Disable the generic "transform: translateY(-2px)" hover lifts on btn-primary */
.btn-primary:hover { transform: none !important; }

/* Neutralize the indigo box-shadow on .btn-primary that leaks through */
.btn-primary { box-shadow: var(--shadow-xs) !important; }

/* ---------- Print-safe: strip heavy backgrounds ---------- */
@media print {
  body { background: #fff !important; }
  .card, .btn { box-shadow: none !important; border: 1px solid var(--line) !important; }
}

/* ---------- Focus ring across the app ---------- */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible,
a:focus-visible { outline: none; }

/* ---------- Scrollbar polish (WebKit) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-0); }
::-webkit-scrollbar-thumb { background: var(--line); border: 2px solid var(--paper-0); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--line-strong); }

/* ---------- Selection ---------- */
::selection { background: var(--accent-tint); color: var(--ink-900); }
