/* ==========================================================================
   Wilson Dental — Design System (tokens + base)
   Partagé par toutes les pages. Un seul fichier source de vérité.
   ========================================================================== */

/* --- Font --- */

/* --- Design tokens --- */
:root {
  /* Couleur primaire (charte officielle) */
  --ink: #141B4D;               /* Bleu marine - 100% */
  --ink-80: #434974;            /* 80% */
  --ink-60: #72769b;            /* 60% */
  --ink-40: #a1a4bd;            /* 40% */
  --ink-20: #d0d1de;            /* 20% */
  --ink-10: #e7e8ee;            /* 10% (utilitaire : séparateurs) */
  --ink-05: #f3f4f7;            /* 5% (surfaces très claires) */

  /* Neutres */
  --paper: #FFFFFF;
  --paper-warm: #FBFAF7;        /* blanc légèrement chaud (accueil éditorial) */
  --paper-cool: #F5F7FB;        /* blanc légèrement froid (sections alternées) */

  /* Accents — à valider client (cf. tweak) */
  --accent-cobalt: #2F5CFF;     /* Bleu cobalt tiré des photos (lampes/fauteuil) */
  --accent-gold:   #B8915A;     /* Or sable / terre chaude (teint, bois) */
  --accent: var(--ink);         /* Par défaut : pas d'accent, on reste sur l'encre */

  /* Sémantique */
  --success: #2E7D5B;
  --warning: #B8751E;
  --danger:  #B83A3A;

  /* Typographie */
  --font: 'Klarheit Current', 'Klarheit Kurrent', 'Klarheit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-script: 'Caveat', 'Dancing Script', cursive;  /* pour mot du docteur */
  --font-mono: ui-monospace, 'SF Mono', 'Menlo', monospace;

  /* Échelle typo (hiérarchie par taille + letter-spacing + couleur) */
  --fs-display-xl: clamp(64px, 8.5vw, 128px);  /* hero */
  --fs-display-l:  clamp(48px, 6vw, 88px);
  --fs-display-m:  clamp(40px, 4.5vw, 64px);
  --fs-h1:         clamp(36px, 4vw, 52px);
  --fs-h2:         clamp(28px, 3vw, 40px);
  --fs-h3:         24px;
  --fs-h4:         20px;
  --fs-body-l:     18px;
  --fs-body:       16px;
  --fs-body-s:     14px;
  --fs-eyebrow:    12px;

  /* Letter spacing — la graisse unique se compense par le tracking */
  --ls-display: -0.03em;
  --ls-heading: -0.02em;
  --ls-body:    -0.005em;
  --ls-eyebrow: 0.14em;

  /* Line heights */
  --lh-tight: 0.95;
  --lh-heading: 1.1;
  --lh-body: 1.55;
  --lh-loose: 1.7;

  /* Espacements (échelle 4pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --s-11: 192px;

  /* Rayons */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Ombres — médicales, très discrètes */
  --shadow-xs: 0 1px 2px rgba(20, 27, 77, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 27, 77, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 27, 77, 0.08);
  --shadow-lg: 0 24px 48px rgba(20, 27, 77, 0.10);

  /* Layout */
  --container: 1280px;
  --gutter: 24px;
  --header-h: 80px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 560ms;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }

/* --- Typographie utilitaires --- */
.eyebrow {
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--ink-60);
}
.display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
.display-l  { font-size: var(--fs-display-l);  line-height: var(--lh-tight); letter-spacing: var(--ls-display); }
.display-m  { font-size: var(--fs-display-m);  line-height: var(--lh-heading); letter-spacing: var(--ls-display); }
h1, .h1 { font-size: var(--fs-h1); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); margin: 0; }
h2, .h2 { font-size: var(--fs-h2); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); margin: 0; }
h3, .h3 { font-size: var(--fs-h3); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); margin: 0; }
h4, .h4 { font-size: var(--fs-h4); line-height: 1.25; letter-spacing: var(--ls-heading); margin: 0; }
p { margin: 0 0 1em; text-wrap: pretty; }
.lede { font-size: var(--fs-body-l); color: var(--ink-80); line-height: 1.6; }

/* "Italique" simulé (Klarheit n'a pas d'italique) */
.italic-sim { font-style: italic; font-feature-settings: "ss01"; letter-spacing: -0.01em; }
.script { font-family: var(--font-script); font-weight: 500; letter-spacing: 0; }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--s-9); }
.section--sm { padding-block: var(--s-8); }

/* --- Boutons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 28px;
  border-radius: var(--r-full);
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--ink-80); box-shadow: var(--shadow-md); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink-20); }
.btn--secondary:hover { border-color: var(--ink); background: var(--ink-05); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink-05); }
.btn--on-dark { background: var(--paper); color: var(--ink); }
.btn--on-dark:hover { background: var(--ink-05); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--lg { height: 60px; padding: 0 36px; font-size: 16px; }

/* --- Cartes --- */
.card {
  background: var(--paper);
  border: 1px solid var(--ink-10);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: border-color var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}
.card:hover { border-color: var(--ink-40); box-shadow: var(--shadow-sm); }
.card--soft { background: var(--paper-cool); border-color: transparent; }

/* --- Inputs --- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-80);
}
.input, .textarea, .select {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--ink-20);
  border-radius: var(--r-md);
  color: var(--ink);
  outline: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.textarea { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 27, 77, 0.08);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-40); }
.field--error .input, .field--error .textarea { border-color: var(--danger); }
.field .error-msg { color: var(--danger); font-size: 13px; }

/* --- Badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  background: var(--ink-05);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0;
  border: 1px solid var(--ink-10);
}
.badge--dark { background: var(--ink); color: var(--paper); border-color: transparent; }
.badge--ghost { background: transparent; border-color: var(--ink-20); }

/* --- Divider --- */
.divider { height: 1px; background: var(--ink-10); border: 0; margin-block: var(--s-6); }

/* --- Placeholder strié (en attendant visuels réels) --- */
.placeholder-striped {
  background-image: repeating-linear-gradient(
    45deg,
    var(--ink-05) 0 14px,
    var(--paper) 14px 28px
  );
  color: var(--ink-60);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--r-md);
}

/* --- Accordion --- */
.accordion-item {
  border-top: 1px solid var(--ink-10);
  padding-block: var(--s-5);
}
.accordion-item:last-child { border-bottom: 1px solid var(--ink-10); }
.accordion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: var(--fs-h3);
  letter-spacing: var(--ls-heading);
  text-align: left;
}
.accordion-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--ink-20);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: transform var(--dur-med) var(--ease-out), background var(--dur-fast);
}
.accordion-item[open] .accordion-icon { transform: rotate(45deg); background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* --- Helpers --- */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.grid { display: grid; gap: var(--s-5); }
.flex { display: flex; }
.stack > * + * { margin-top: var(--s-4); }

/* --- Micro-animations globales --- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal { animation: fade-up var(--dur-slow) var(--ease-out) both; }

/* --- Prefers reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
