/* ==============================================================================
   niowi santé — Design System v1
   Foundations: colors, typography, spacing, radii.
   Single source of truth — all values mirror NIOWI_DESIGN_SYSTEM.md.
   ============================================================================== */

/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ceadd64d.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/e0c5d252.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/221d34ef.woff2") format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ea430f35.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/12ebdcff.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/706b683e.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/9e9d77c5.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ceadd64d.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/e0c5d252.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/221d34ef.woff2") format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/ea430f35.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/12ebdcff.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/706b683e.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/9e9d77c5.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ceadd64d.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/e0c5d252.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/221d34ef.woff2") format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ea430f35.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/12ebdcff.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/706b683e.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/9e9d77c5.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* cyrillic-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ceadd64d.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/e0c5d252.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* greek-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/221d34ef.woff2") format('woff2');
  unicode-range: U+1F00-1FFF;
}
/* greek */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/ea430f35.woff2") format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* vietnamese */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/12ebdcff.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/706b683e.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/9e9d77c5.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


:root {
  /* ──────────────────────────────────────────────────────────
     COLOR — primary ramp (bleu niowi)
     ────────────────────────────────────────────────────────── */
  --p-50:  #F0F4FD;
  --p-100: #D6E1F8;
  --p-200: #BDCEF4;
  --p-400: #7598E0;  /* PRIMARY — boutons, rail actif, focus */
  --p-600: #5578C4;  /* hover bouton primaire */
  --p-800: #3558A8;  /* texte sur p-50/p-100 */
  --p-900: #1A3580;  /* texte sur p-200 */

  /* ──────────────────────────────────────────────────────────
     COLOR — accent ramp (rose niowi)
     ────────────────────────────────────────────────────────── */
  --a-50:  #FDF0F7;
  --a-100: #F8D0E7;
  --a-200: #F4B0D7;
  --a-400: #E06B9F;  /* ACCENT — notifications, badges org, aide */
  --a-600: #C4517F;
  --a-800: #9A3460;
  --a-900: #701A42;

  /* ──────────────────────────────────────────────────────────
     COLOR — neutrals
     ────────────────────────────────────────────────────────── */
  --n-50:  #F7F8FA;   /* fond de page (alias --bg) */
  --n-100: #EEF0F4;   /* séparateur tableau */
  --n-200: #E2E6EF;   /* bordure défaut */
  --n-300: #C8CDD8;   /* bordure hover */
  --n-400: #9AA3B5;   /* icônes, placeholder, hint (alias --fg-3) */
  --n-500: #6B7589;
  --n-600: #4A5568;   /* corps de texte (alias --fg-2) */
  --n-700: #2D3748;
  --n-800: #1A2340;   /* texte principal — headlines (alias --fg-1) */
  --n-900: #0D1424;

  /* ──────────────────────────────────────────────────────────
     COLOR — semantic
     ────────────────────────────────────────────────────────── */
  --success:        #34A853;
  --success-light:  #E8F5EC;
  --success-dark:   #1A7F3C;
  --success-border: #A7F3D0;

  --warning:        #F59E0B;
  --warning-light:  #FFFBEB;
  --warning-dark:   #92400E;
  --warning-border: #FDE68A;

  --danger:         #E53935;
  --danger-light:   #FEF0F0;
  --danger-dark:    #991B1B;
  --danger-border:  #FECACA;

  /* ──────────────────────────────────────────────────────────
     COLOR — convenience aliases used across the app
     ────────────────────────────────────────────────────────── */
  --bg:        #F8F9FB;        /* fond app — légèrement teinté, jamais blanc pur */
  --surface:   #FFFFFF;        /* cards, panels, surfaces élevées */
  --border:    var(--n-200);
  --fg-1:      var(--n-800);   /* texte principal */
  --fg-2:      var(--n-600);   /* corps */
  --fg-3:      var(--n-400);   /* tertiaire — hint, placeholder, meta */

  --primary:   var(--p-400);
  --primary-l: #EEF3FD;
  --primary-d: var(--p-600);
  --accent:    var(--a-400);
  --accent-l:  var(--a-50);
  --accent-d:  var(--a-600);

  /* Champs de saisie — fond gris pour visibilité sur card blanche */
  --input-bg:        #F4F6FA;
  --input-bg-focus:  #FFFFFF;

  /* ──────────────────────────────────────────────────────────
     TYPOGRAPHY
     ────────────────────────────────────────────────────────── */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type scale (rem on 16px base — html font-size is fluid clamp) */
  --fs-h1:       2rem;        /* 32px — titre auth, page cover */
  --fs-h2:       1.5rem;      /* 24px — titre section */
  --fs-h3:       1.25rem;     /* 20px — titre card, panneau */
  --fs-h4:       1.0625rem;   /* 17px — titre topbar */
  --fs-h5:       0.9375rem;   /* 15px — titre tableau, liste */
  --fs-h6:       0.875rem;    /* 14px — en-tête de card */
  --fs-body-lg:  0.9375rem;   /* 15px — corps principal */
  --fs-body:     0.875rem;    /* 14px — tableau, formulaire */
  --fs-body-sm:  0.8125rem;   /* 13px — métadonnées */
  --fs-label:    0.8125rem;   /* 13px — label form, colonne */
  --fs-caption:  0.75rem;     /* 12px — hint, erreur, horodatage */
  --fs-overline: 0.6875rem;   /* 11px — section label MAJUSCULES */

  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semi:    600;
  --fw-bold:    700;

  /* ──────────────────────────────────────────────────────────
     SPACING — multiple of 4px
     ────────────────────────────────────────────────────────── */
  --sp-4:  0.25rem;   /*  4px — gap interne badge */
  --sp-8:  0.5rem;    /*  8px — gap éléments proches */
  --sp-12: 0.75rem;   /* 12px — gap composants */
  --sp-16: 1rem;      /* 16px — padding card, gap colonne */
  --sp-20: 1.25rem;   /* 20px — padding page standard */
  --sp-24: 1.5rem;    /* 24px — padding section */
  --sp-32: 2rem;      /* 32px — gap blocs */
  --sp-40: 2.5rem;    /* 40px — gap sections */
  --sp-48: 3rem;
  --sp-64: 4rem;

  /* Tap target tokens — tablette tactile */
  --tap-min:    2.75rem;  /* 44px — Apple HIG minimum */
  --tap-ideal:  3rem;     /* 48px — recommandé niowi */
  --tap-cta:    3.5rem;   /* 56px — CTA principal */
  --tap-gap-min:    0.75rem;
  --tap-gap-safe:   1rem;
  --tap-gap-danger: 2rem;

  /* ──────────────────────────────────────────────────────────
     RADII
     ────────────────────────────────────────────────────────── */
  --r-4:    0.25rem;     /*  4px — micro */
  --r-6:    0.375rem;    /*  6px — btn-sm */
  --r-8:    0.5rem;      /*  8px — STANDARD : input, bouton, alerte */
  --r-10:   0.625rem;    /* 10px — card, panel */
  --r-12:   0.75rem;     /* 12px — modal */
  --r-16:   1rem;        /* 16px — auth card */
  --r-full: 9999px;      /* pill — badge, tag, chip */

  /* ──────────────────────────────────────────────────────────
     STRUCTURE
     ────────────────────────────────────────────────────────── */
  --rail-w:    5.143rem;  /* 72px — largeur rail navigation */
  --topbar-h:  4rem;      /* 64px — hauteur topbar */

  /* ──────────────────────────────────────────────────────────
     SHADOWS — système d'élévation niowi
     ────────────────────────────────────────────────────────── */
  --shadow-sm:    0 1px 2px rgba(26, 35, 64, 0.04);
  --shadow:       0 1px 4px rgba(26, 35, 64, 0.06);
  --shadow-md:    0 4px 12px rgba(26, 35, 64, 0.08);
  --shadow-lg:    0 4px 32px rgba(117, 152, 224, 0.08), 0 1px 4px rgba(26, 35, 64, 0.06);
  --shadow-modal: 0 8px 32px rgba(26, 35, 64, 0.10), 0 2px 8px rgba(26, 35, 64, 0.06);
  --shadow-rail:        0 2px 8px  rgba(117, 152, 224, 0.25);
  --shadow-rail-hover:  0 4px 12px rgba(117, 152, 224, 0.35);
  --shadow-rail-active: 0 4px 12px rgba(85, 120, 196, 0.45);

  /* Focus ring — anneaux par couleur */
  --ring-primary: 0 0 0 3px rgba(117, 152, 224, 0.12);
  --ring-danger:  0 0 0 3px rgba(229, 57, 53, 0.10);
  --ring-success: 0 0 0 3px rgba(52, 168, 83, 0.10);

  /* ──────────────────────────────────────────────────────────
     MOTION
     ────────────────────────────────────────────────────────── */
  --t-fast: 80ms;        /* :active feedback tactile */
  --t-base: 120ms;       /* hover, color transitions */
  --t-slow: 180ms;       /* panels, modals */
  --easing: cubic-bezier(0.4, 0, 0.2, 1); /* ease — niowi standard */
}

/* ==============================================================================
   BASE — html + body
   App is calibrated for tablet 13" (1024px-1920px).
   ============================================================================== */

html {
  /* Fluid base : 13px @ 1024px → 16px @ 1920px */
  font-size: clamp(13px, 0.5vw + 8.8px, 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg-1);
  font-family: var(--font-sans);
  font-size: var(--fs-body-lg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==============================================================================
   SEMANTIC TYPE — apply directly to elements
   ============================================================================== */
h1, .h1 {
  font-family: var(--font-sans);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  letter-spacing: -0.5px;
  color: var(--fg-1);
  line-height: 1.2;
  margin: 0 0 var(--sp-16);
}
h2, .h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.3px;
  color: var(--fg-1);
  line-height: 1.25;
  margin: 0 0 var(--sp-12);
}
h3, .h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semi);
  letter-spacing: -0.2px;
  color: var(--fg-1);
  line-height: 1.3;
  margin: 0 0 var(--sp-8);
}
h4, .h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semi);
  color: var(--fg-1);
  line-height: 1.35;
  margin: 0 0 var(--sp-8);
}
h5, .h5 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-semi);
  color: var(--fg-1);
  margin: 0 0 var(--sp-4);
}
h6, .h6 {
  font-size: var(--fs-h6);
  font-weight: var(--fw-semi);
  color: var(--fg-1);
  margin: 0 0 var(--sp-4);
}
p {
  font-size: var(--fs-body-lg);
  color: var(--fg-2);
  line-height: 1.6;
  margin: 0 0 var(--sp-12);
}

.label {
  display: block;
  font-size: var(--fs-label);
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  margin-bottom: 5px;
}
.caption {
  font-size: var(--fs-caption);
  color: var(--fg-3);
}
.overline {
  font-size: var(--fs-overline);
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--fg-3);
}
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
