/* ==========================================================================
   Sans Perdre le Fil — Design System Tokens
   Direction A : « Studio Maille » — Bento Scandinave moderne, zéro serif
   Harmonisé avec le logo Point Chaînette (#BE185D sur #FDF2F8)
   100 % autonome hors-ligne — polices locales vendored (/static/fonts/)
   ========================================================================== */

@import url("/static/fonts/fonts.css");

:root {
  color-scheme: light;

  /* --- Surfaces & Fonds (Atelier Jour — Bento glacé) --- */
  --bg-canvas: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-sunken: #EEF1F6;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F3F4F8;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-dock: rgba(255, 255, 255, 0.94);

  /* --- Encres & Textes (WCAG AA/AAA vérifiés) --- */
  --ink-primary: #111827;          /* 16.69:1 sur surface */
  --ink-secondary: #4B5563;        /* 7.56:1 sur surface */
  --ink-muted: #5B6472;            /* >= 5.5:1 sur surface */

  /* --- Accents métier (Rose Foncé du logo + Menthe Sauge + Corail) --- */
  --accent-primary: #BE185D;       /* Rose Foncé — 6.04:1 avec blanc */
  --accent-primary-hover: #9D174D; /* 7.88:1 avec blanc */
  --accent-primary-soft: #FDF2F8;  /* Rose très pâle — texte #BE185D dessus = 5.53:1 */
  --accent-primary-ring: #FBCFE8;
  --accent-on-primary: #FFFFFF;

  --accent-craft: #0F766E;         /* Menthe Sauge — 5.47:1 avec blanc */
  --accent-craft-hover: #0D5D56;
  --accent-craft-soft: #ECFDF5;
  --accent-on-craft: #FFFFFF;

  --accent-warm: #C2410C;          /* Corail / Ambre — 5.18:1 avec blanc */
  --accent-warm-hover: #9A3412;
  --accent-warm-soft: #FFF7ED;
  --accent-on-warm: #FFFFFF;

  --accent-danger: #DC2626;
  --accent-danger-hover: #B91C1C;
  --accent-danger-soft: #FEF2F2;
  --accent-on-danger: #FFFFFF;

  /* --- Bordures & Séparateurs --- */
  --border-subtle: #E6E8EE;
  --border-strong: #D0D5DF;
  --border-control: #8B93A1;       /* >= 3.1:1 sur blanc (WCAG 1.4.11) */

  /* --- Overlays, Focus & Outils Atelier --- */
  --focus-ring: rgba(190, 24, 93, 0.28);
  --backdrop-scrim: rgba(15, 18, 24, 0.44);
  --ruler-fill: rgba(190, 24, 93, 0.16);
  --ruler-accent: var(--accent-primary);
  --ruler-on-accent: var(--accent-on-primary);
  --counter-pulse: rgba(190, 24, 93, 0.22);
  --counter-alert-bg: #FFF7ED;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%234B5563' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  /* --- Typographie 100 % moderne & locale (zéro serif) --- */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.375rem;     /* 22px */
  --text-2xl: 1.75rem;     /* 28px */
  --text-3xl: 2.125rem;    /* 34px */

  --leading-tight: 1.18;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* --- Rayons modernes style Bento --- */
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-btn: 12px;
  --radius-md: 16px;
  --radius-card: 18px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* --- 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;

  /* --- Ombres ultra-douces style Bento Apple / iOS --- */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 2px 10px rgba(17, 24, 39, 0.045), 0 1px 2px rgba(17, 24, 39, 0.03);
  --shadow-md: 0 10px 28px rgba(17, 24, 39, 0.08), 0 2px 6px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 22px 50px rgba(17, 24, 39, 0.14), 0 6px 16px rgba(17, 24, 39, 0.06);
  --shadow-accent: 0 4px 14px rgba(190, 24, 93, 0.22);

  /* --- Dimensions & Safe-Area iOS / Android --- */
  --sidebar-w: 236px;
  --topbar-h: 60px;
  --bottom-nav-h: 64px;
  --content-max: 1280px;
  --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);

  /* --- Transitions --- */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 150ms;
  --dur-base: 230ms;

  /* --- Z-index --- */
  --z-topbar: 20;
  --z-sidebar: 25;
  --z-sticky-bar: 30;
  --z-bottom-nav: 40;
  --z-banner: 50;
  --z-toast: 80;
}

/* ==========================================================================
   Mode Soirée (Ardoise carbone + Rose lumineux & règle ambre douce)
   ========================================================================== */

[data-theme="night"] {
  color-scheme: dark;

  --bg-canvas: #0F1218;
  --bg-surface: #171C26;
  --bg-sunken: #1F2634;
  --bg-elevated: #1D2432;
  --bg-hover: #242C3D;
  --bg-glass: rgba(23, 28, 38, 0.88);
  --bg-dock: rgba(29, 36, 50, 0.94);

  --ink-primary: #F3F5F8;
  --ink-secondary: #B0B8C8;
  --ink-muted: #9CA6B8;

  --accent-primary: #F472B6;       /* Rose lumineux — 7.08:1 avec on-primary */
  --accent-primary-hover: #F9A8D4;
  --accent-primary-soft: #2A1925;  /* Texte #F472B6 dessus = 6.27:1 */
  --accent-primary-ring: rgba(244, 114, 182, 0.32);
  --accent-on-primary: #0F1218;

  --accent-craft: #34D399;         /* 9.75:1 avec on-craft */
  --accent-craft-hover: #6EE7B7;
  --accent-craft-soft: #132C26;
  --accent-on-craft: #0F1218;

  --accent-warm: #F59E0B;          /* 8.73:1 avec on-warm */
  --accent-warm-hover: #FBBF24;
  --accent-warm-soft: #33240F;
  --accent-on-warm: #0F1218;

  --accent-danger: #F87171;
  --accent-danger-hover: #FCA5A5;
  --accent-danger-soft: #35181C;
  --accent-on-danger: #1F0909;

  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --border-control: #6B778D;

  --focus-ring: rgba(244, 114, 182, 0.34);
  --backdrop-scrim: rgba(5, 7, 11, 0.76);
  --ruler-fill: rgba(245, 158, 11, 0.22); /* Règle ambre douce le soir */
  --ruler-accent: var(--accent-warm);
  --ruler-on-accent: var(--accent-on-warm);
  --counter-pulse: rgba(244, 114, 182, 0.26);
  --counter-alert-bg: #33240F;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23B0B8C8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.46);
  --shadow-lg: 0 24px 54px rgba(0, 0, 0, 0.60);
  --shadow-accent: 0 4px 16px rgba(244, 114, 182, 0.22);
}
