/* TriDDS — socle visuel commun (appli, pages publiques, admin)
   Direction : signalétique de déchèterie. Couleurs de bacs franches, typographie
   condensée façon panneau, gros contrastes pour un écran lu en plein air, gants aux mains. */

:root {
  --ink: #1b2420;
  --ink-2: #44514a;
  --muted: #5d6a63;
  --line: #d3d9d0;
  --line-2: #e3e7e0;
  --concrete: #e9ece6;
  --paper: #ffffff;
  --paper-2: #f5f7f3;

  --eco: #2e7d32;
  --eco-ink: #ffffff;
  --eco-soft: #e4f1e3;
  --eco-line: #b8d9b6;
  --eco-text: #1f5a23;

  --hors: #f0a01c;
  --hors-ink: #1b2420;
  --hors-soft: #fdf1d8;
  --hors-line: #f1d08e;
  --hors-text: #7a4a00;

  --int: #c62828;
  --int-ink: #ffffff;
  --int-soft: #fbe5e3;
  --int-line: #efb5b0;
  --int-text: #8e1b1b;

  --brand-red: #d3261e;
  --brand-green: #6a9a1f;
  --focus: #2f6fdb;

  --font: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sign: "Barlow Condensed", "Barlow", system-ui, sans-serif;

  --r-s: 8px;
  --r: 12px;
  --r-l: 18px;
  --shadow: 0 1px 2px rgba(27, 36, 32, .06), 0 4px 14px rgba(27, 36, 32, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

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

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

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

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r);
  font-weight: 700; font-size: 16px; line-height: 1.1; text-decoration: none;
  border: 2px solid transparent; transition: transform .08s ease, background-color .15s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2b3832; }
.btn-eco { background: var(--eco); color: var(--eco-ink); }
.btn-hors { background: var(--hors); color: var(--hors-ink); }
.btn-int { background: var(--int); color: var(--int-ink); }
.btn-ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; min-height: 40px; padding: 0 8px; font-weight: 600; }
.btn-danger { background: var(--paper); border-color: var(--int-line); color: var(--int-text); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 18px; border-radius: 14px; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: var(--r-s); }
.btn-icon { width: 48px; padding: 0; }

/* ---------- champs ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--r);
  outline: none; font-size: 16px; transition: border-color .15s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: #6f7a74; }
.hint { font-size: 13px; color: var(--muted); }

/* ---------- pastilles de flux ---------- */
.flux-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; border: 1.5px solid;
}
.flux-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.flux-tag.eco { color: var(--eco-text); background: var(--eco-soft); border-color: var(--eco-line); }
.flux-tag.hors { color: var(--hors-text); background: var(--hors-soft); border-color: var(--hors-line); }
.flux-tag.int { color: var(--int-text); background: var(--int-soft); border-color: var(--int-line); }

/* ---------- messages ---------- */
.note { padding: 12px 14px; border-radius: var(--r); font-size: 15px; line-height: 1.45; border: 1.5px solid var(--line); background: var(--paper); }
.note.eco { background: var(--eco-soft); border-color: var(--eco-line); color: var(--eco-text); }
.note.hors { background: var(--hors-soft); border-color: var(--hors-line); color: var(--hors-text); }
.note.int { background: var(--int-soft); border-color: var(--int-line); color: var(--int-text); }

/* ---------- toast ---------- */
.toast-host { position: fixed; left: 0; right: 0; top: calc(66px + var(--safe-t)); display: grid; justify-items: center; pointer-events: none; z-index: 400; padding: 0 16px; }
.toast {
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r);
  font-weight: 600; font-size: 15px; box-shadow: var(--shadow); max-width: 480px;
  animation: toast-in .2s ease both;
}
.toast.err { background: var(--int); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- feuille (bottom sheet) et dialogues ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 24, .5); z-index: 300; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease both; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 20px 20px 0 0; padding-bottom: var(--safe-b);
  animation: sheet-up .22s cubic-bezier(.2, .8, .2, 1) both;
}
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line-2); }
.sheet-head h2 { flex: 1; font-size: 19px; font-weight: 700; line-height: 1.2; }
.sheet-head p { font-size: 14px; color: var(--muted); }
.sheet-body { padding: 16px; overflow-y: auto; display: grid; gap: 14px; }
.sheet-foot { display: flex; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line-2); }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) {
  .sheet-backdrop { align-items: center; padding: 24px; }
  .sheet { border-radius: 20px; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(0, 0, 0, .12); border-top-color: currentColor; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ico { width: 20px; height: 20px; flex-shrink: 0; }
img.broken { visibility: hidden; }
