/* Socle commun : polices, couleurs, boutons, champs, notifications, fenêtres modales. */
@font-face {
  font-family: 'Fraunces'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('/fonts/fraunces-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/manrope-normal.woff2') format('woff2');
}

/* Identité Ardé (carte papier et site « L'écrin ») : ivoire, encre et bleu pétrole, rose poudré, terracotta */
:root {
  --paper: #f7f2ea;
  --card: #fffcf7;
  --ink: #0a3c58;
  --ink-2: #33586f;
  --muted: #6f8593;
  --line: #e8e0d3;
  --line-2: #d7cdbf;
  --accent: #0e4f72;
  --accent-ink: #fff;
  --accent-soft: #f6cfc5;
  --terra: #c86f52;
  --ok: #2d6a4a;
  --ok-soft: #e3efe6;
  --warn: #9a5b00;
  --warn-soft: #fbf0d9;
  --danger: #b42318;
  --danger-soft: #fbe7e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(31 27 22 / 6%), 0 8px 24px -12px rgb(31 27 22 / 18%);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 500 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; margin: 0; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

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

/* ---- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 999px;
  background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none;
  cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { border-color: var(--ink); background: #000; }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: rgb(31 27 22 / 6%); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); }
.btn--icon { width: 44px; padding: 0; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn--sm.btn--icon { width: 36px; }
.btn--block { width: 100%; }

/* ---- champs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.input {
  width: 100%; min-height: 44px; padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; font-size: 16px;
}
textarea.input { min-height: 84px; resize: vertical; line-height: 1.4; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

/* ---- notifications */
.toasts {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px;
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow);
  animation: toast-in .25s ease-out;
}
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---- fenêtre modale */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: rgb(31 27 22 / 45%); animation: fade .2s; }
.modal__box {
  position: relative; width: min(100%, 520px); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow); animation: pop .2s ease-out;
}
.modal__box--wide { width: min(100%, 760px); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 4px 24px; }
.modal__head h2 { font-size: 22px; }
.modal__head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal__body { padding: 12px 24px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

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