/* Charte commune de l'Atelier 0.6 : couleurs, typographie, boutons, cartes. */

@font-face { font-family: Poppins; src: url(../fonts/poppins-medium.woff) format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-bold.woff) format('woff'); font-weight: 700; font-display: swap; }

:root {
  --ui-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --title-font: Poppins, var(--ui-font);
  --bg: #f4f2ec;
  --bg-2: #ebe8df;
  --paper: #ffffff;
  --ink: #1d2b36;
  --ink-2: #4c5c69;
  --muted: #6d7b86;
  --line: #dcd8cd;
  --line-2: #e9e6de;
  --brand: #1f6f78;
  --brand-deep: #144e55;
  --brand-soft: #e1f0ee;
  --brand-ink: #0f3d43;
  --sun: #f2b33d;
  --sun-soft: #fff4d9;
  --coral: #e0654a;
  --coral-soft: #fde9e3;
  --leaf: #2e9d62;
  --leaf-soft: #e2f4e9;
  --plum: #7456c2;
  --plum-soft: #efeafb;
  --sky: #3a6fd8;
  --sky-soft: #e6eefc;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgb(30 40 50 / 6%), 0 6px 24px rgb(30 40 50 / 7%);
  --shadow-lift: 0 2px 4px rgb(30 40 50 / 8%), 0 14px 34px rgb(30 40 50 / 12%);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #f2b33d;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--ui-font); }
h1, h2, h3, h4 { font-family: var(--title-font); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
a { color: var(--brand-deep); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.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: 44px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--title-font);
  font-weight: 500;
  font-size: 15.5px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover:not(:disabled) { border-color: #bdb8aa; background: #fbfaf7; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-deep); border-color: var(--brand-deep); }
.btn.sun { background: var(--sun); border-color: var(--sun); color: #3a2b00; }
.btn.danger { color: #a33a26; border-color: #efc5ba; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover:not(:disabled) { background: rgb(0 0 0 / 5%); border-color: transparent; }
.btn.big { min-height: 54px; padding: 10px 26px; font-size: 18px; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: 13.5px; }
.btn .ico { width: 1.15em; height: 1.15em; flex: none; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: rgb(0 0 0 / 6%); }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }

/* ---------- champs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 16.5px;
}
textarea.input { min-height: 120px; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15.5px; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); margin-top: 1px; flex: none; }

/* ---------- cartes et étiquettes */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 13px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }
.tag.sun { background: var(--sun-soft); color: #7a5600; }
.tag.leaf { background: var(--leaf-soft); color: #1d6b41; }
.tag.coral { background: var(--coral-soft); color: #9a3a25; }
.tag.plum { background: var(--plum-soft); color: #4f3596; }
.tag.sky { background: var(--sky-soft); color: #244d9e; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--title-font); font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }

/* ---------- notifications */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 200; background: #1d2b36; color: #fff; border-radius: 14px; padding: 12px 20px; font-size: 15.5px; box-shadow: var(--shadow-lift); transition: .25s; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: #9a3a25; }

/* ---------- fenêtres */
dialog.modal { border: 0; border-radius: 22px; padding: 0; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px rgb(10 20 40 / 35%); color: var(--ink); }
dialog.modal.wide { width: min(1100px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgb(15 25 40 / 45%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h2 { font-size: 21px; flex: 1; }
.modal-body { padding: 18px 22px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 22px 20px; border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff; }

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