/* Socle commun – pointage Intrapresa Cordoliani
   Matières du métier : zinc naturel (fonds), anthracite (texte, en-têtes à joints debout),
   vert-de-gris (action principale). Typo : Atkinson Hyperlegible (lisible en plein soleil),
   Barlow Condensed (signalétique de chantier) pour les titres et les gros boutons. */

@font-face { font-family: 'Atkinson'; src: url('/shared/fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('/shared/fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/shared/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/shared/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --zinc-bg: #eef1f3;
  --surface: #ffffff;
  --ink: #1e2428;
  --anthracite: #2c3439;
  --seam: #3b454b;
  --muted: #56616a;
  --line: #c6ced4;
  --line-soft: #dde3e7;
  --verdigris: #1d6b5a;
  --verdigris-dark: #14503f;
  --verdigris-wash: #dbebe5;
  --amber: #8a5300;
  --amber-wash: #fbefd9;
  --red: #a3322a;
  --red-wash: #f9e3e0;
  --focus: #0b63c5;

  --font-body: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-sign: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --space: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--zinc-bg);
}
h1, h2, h3 { font-family: var(--font-sign); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: 0.01em; }
p { margin: 0; }
a { color: var(--verdigris-dark); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

/* En-tête à joints debout : la signature visuelle (toiture en zinc) */
.seams {
  background-color: var(--anthracite);
  background-image: repeating-linear-gradient(90deg, transparent 0 46px, var(--seam) 46px 48px);
  color: #fff;
}

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border: 2px solid var(--anthracite); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--zinc-bg); }
.btn-primary { background: var(--verdigris); border-color: var(--verdigris); color: #fff; }
.btn-primary:hover { background: var(--verdigris-dark); border-color: var(--verdigris-dark); }
.btn-dark { background: var(--anthracite); border-color: var(--anthracite); color: #fff; }
.btn-dark:hover { background: var(--ink); }
.btn-quiet { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { background: transparent; color: var(--verdigris-dark); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; }

/* Champs */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; }
.field small { color: var(--muted); }
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'],
input[type='date'], input[type='datetime-local'], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 2px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--anthracite); outline: none; box-shadow: 0 0 0 3px rgba(11, 99, 197, 0.35); }
textarea { min-height: 96px; resize: vertical; }

/* Pastilles d'état */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.chip-ok { background: var(--verdigris-wash); color: var(--verdigris-dark); }
.chip-warn { background: var(--amber-wash); color: var(--amber); }
.chip-bad { background: var(--red-wash); color: var(--red); }
.chip-info { background: var(--surface); color: var(--muted); border-color: var(--line); }

.notice { padding: 12px 14px; border-radius: var(--r-sm); border-left: 5px solid var(--anthracite); background: var(--surface); }
.notice-warn { border-left-color: var(--amber); background: var(--amber-wash); }
.notice-bad { border-left-color: var(--red); background: var(--red-wash); }
.notice-ok { border-left-color: var(--verdigris); background: var(--verdigris-wash); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: min(92vw, 480px); padding: 12px 18px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; font-weight: 700; z-index: 100;
  box-shadow: 0 6px 24px rgba(30, 36, 40, 0.3);
}
.toast-bad { background: var(--red); }

dialog { border: none; border-radius: var(--r-md); padding: 0; max-width: min(96vw, 640px); width: 100%; box-shadow: 0 20px 60px rgba(30, 36, 40, 0.35); }
dialog::backdrop { background: rgba(30, 36, 40, 0.55); }
.dialog-body { padding: 20px; display: grid; gap: 14px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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