/* Arké : socle commun des pages du site.
   Couleurs, typographie et composants relevés sur les maquettes des figures 15 à 22. */

/* Manrope (SIL OFL 1.1, voir fonts/OFL.txt), servie par le site : aucun appel à un tiers. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin-wght-normal.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;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("fonts/manrope-latin-ext-wght-normal.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;
}

:root {
  color-scheme: light;

  --ink: #1d2130;
  --ink-2: #3d4454;
  --muted: #5a6173;
  --subtle: #8a91a2;
  --faint: #a3aab8;

  --surface: #fff;
  --canvas: #f5f6f8;
  --line: #dce0e7;
  --line-soft: #eef0f4;

  --teal: #0e7c7b;
  --teal-strong: #0b6968;
  --teal-ink: #0a5e5d;
  --teal-soft: #e1f1f0;
  --purple: #5b4b8a;

  --red: #b42318;
  --red-strong: #9a1e14;
  --red-ink: #8f1b12;
  --red-soft: #fdecea;
  --red-line: #f0c6c2;
  --amber-ink: #6b4700;
  --amber-soft: #fff4db;

  --night: #000;
  --night-2: #1e222c;
  --night-3: #2b303d;
  --scrim: rgb(29 33 48 / 0.55);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --focus-ring: 0 0 0 3px rgb(14 124 123 / 0.28);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ Base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

/* Un <dialog> modal ne bloque pas le défilement de la page qu'il recouvre. */
html:has(dialog[open]) {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  /* biome-ignore lint/suspicious/noDuplicateProperties: repli 100vh pour les navigateurs sans unité dvh */
  min-height: 100dvh;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: l'attribut hidden doit masquer même un composant qui fixe display */
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.visually-hidden {
  /* biome-ignore lint/complexity/noImportantStyles: masquage visuel qui ne doit être annulé par aucun composant */
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- Marque */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 24px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: 20px;
  height: auto;
}

.brand-mark .leaf-1 {
  fill: var(--teal);
}

.brand-mark .leaf-2 {
  fill: var(--purple);
}

/* ---------------------------------------------------------------- Boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    box-shadow 0.15s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Action en cours : le libellé (« Préparation… 3 sur 12 ») doit rester lisible. */
.btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.8;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:not(:disabled):hover {
  background: var(--teal-strong);
}

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:not(:disabled):hover {
  border-color: #c9ced8;
  background: #f9fafb;
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:not(:disabled):hover {
  background: var(--red-strong);
}

.btn-danger:focus-visible {
  box-shadow: 0 0 0 3px rgb(180 35 24 / 0.25);
}

.btn-danger-outline {
  border-color: var(--red-line);
  background: var(--surface);
  color: var(--red);
}

.btn-danger-outline:not(:disabled):hover {
  border-color: #e5a7a1;
  background: var(--red-soft);
}

.btn-lg {
  min-height: 50px;
  padding: 0 20px;
  border-radius: 12px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn .icon {
  width: 20px;
  height: 20px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-ink);
  font-weight: 700;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-danger {
  color: var(--red);
}

/* ---------------------------------------------------------------- Pastilles */

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.badge-open,
.badge-active {
  background: var(--teal-soft);
  color: var(--teal-ink);
}

.badge-closed,
.badge-inactive {
  background: var(--line-soft);
  color: var(--ink-2);
}

.badge-expired {
  background: var(--line-soft);
  color: var(--muted);
}

.badge-deletion {
  background: var(--red-soft);
  color: var(--red-ink);
}

.badge-expiring {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

/* ---------------------------------------------------------------- Messages éphémères */

.toasts {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  gap: 8px;
  justify-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgb(29 33 48 / 0.18);
  animation: toast-in 0.25s var(--ease-out);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease-in forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------------------------------------------------------------- Fenêtres */

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  color: inherit;
}

dialog::backdrop {
  background: var(--scrim);
}

dialog[open]::backdrop {
  animation: fade-in 0.2s ease-out;
}

dialog.is-closing::backdrop {
  animation: fade-out 0.18s ease-in forwards;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  ::backdrop {
    /* biome-ignore lint/complexity/noImportantStyles: le réglage « réduire les animations » du visiteur l'emporte */
    animation-duration: 1ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: le réglage « réduire les animations » du visiteur l'emporte */
    transition-duration: 1ms !important;
  }
}
