/* GestioCommunity — socle de style commun (charte issue du logo) */

:root {
  --terracotta: #c2601f;
  --terracotta-dark: #a44e15;
  --terracotta-soft: #f6e7db;
  --amber: #f0a52c;
  --amber-soft: #fdf0d8;
  --teal: #14666b;
  --teal-dark: #0d4a4e;
  --teal-soft: #dff0ef;
  --brown: #4a2c28;
  --cream: #fcf8f3;
  --paper: #ffffff;
  --ink: #241b16;
  --ink-2: #56463d;
  --muted: #8a7a70;
  --line: #e8ded3;
  --line-strong: #d8cabb;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --success: #1f7a4d;
  --success-soft: #e3f3ea;
  --warning: #a2620a;
  --warning-soft: #fdf1dc;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(74, 44, 40, .07);
  --shadow-sm: 0 2px 8px rgba(74, 44, 40, .08);
  --shadow: 0 8px 24px -8px rgba(74, 44, 40, .18);
  --shadow-lg: 0 24px 60px -24px rgba(74, 44, 40, .35);

  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;

  --header-h: 74px;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

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

.btn {
  --btn-bg: var(--terracotta);
  --btn-fg: #fff;
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .62rem 1.1rem;
  min-height: 42px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-weight: 600;
  font-size: .93rem;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible { outline: 3px solid rgba(20, 102, 107, .35); outline-offset: 2px; }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
.btn--ghost:hover { --btn-bg: #fff; }
.btn--teal { --btn-bg: var(--teal); }
.btn--soft { --btn-bg: var(--terracotta-soft); --btn-fg: var(--terracotta-dark); }
.btn--danger { --btn-bg: var(--danger); }
.btn--danger-soft { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); }
.btn--sm { min-height: 34px; padding: .34rem .7rem; font-size: .84rem; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--icon { padding: .5rem; min-height: 38px; min-width: 38px; }

/* ---------- Formulaires ---------- */

.field { margin-bottom: 1rem; }
.field > label, .label {
  display: block;
  margin-bottom: .3rem;
  font-size: .81rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.input, select, textarea, input[type='text'], input[type='email'], input[type='password'],
input[type='date'], input[type='time'], input[type='tel'], input[type='number'], input[type='search'] {
  width: 100%;
  padding: .6rem .75rem;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .93rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, select:focus, textarea:focus, input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 102, 107, .13);
}
input[type='checkbox'], input[type='radio'] { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); cursor: pointer; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.field--row { display: flex; align-items: center; gap: .55rem; }
.field--row label { margin: 0; font-weight: 500; font-size: .9rem; color: var(--ink); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; }

/* ---------- Cartes ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
.card__title { margin: 0; font-size: 1rem; font-weight: 700; }
.card__body { padding: 1.1rem; }

/* ---------- Badges & pastilles ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  background: var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge--teal { background: var(--teal-soft); color: var(--teal-dark); }
.badge--amber { background: var(--amber-soft); color: var(--warning); }
.badge--terracotta { background: var(--terracotta-soft); color: var(--terracotta-dark); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--success { background: var(--success-soft); color: var(--success); }

/* ---------- Alertes ---------- */

.alert {
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: .9rem;
  margin-bottom: 1rem;
}
.alert--error { background: var(--danger-soft); border-color: #f0c4c0; color: #7c1a15; }
.alert--success { background: var(--success-soft); border-color: #bfe0cd; color: #145536; }
.alert--info { background: var(--teal-soft); border-color: #bfdedd; color: var(--teal-dark); }
.alert--warning { background: var(--warning-soft); border-color: #f0d6a8; color: #7a4a06; }

/* ---------- Utilitaires ---------- */

.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.strong { font-weight: 700; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.brandmark { display: flex; align-items: center; gap: .65rem; font-weight: 700; }
.brandmark img { width: 54px; height: 54px; border-radius: 13px; }
.brandmark span { font-size: 1.18rem; letter-spacing: -.02em; color: var(--ink); }

@media (min-width: 720px) {
  .brandmark img { width: 60px; height: 60px; }
  .brandmark span { font-size: 1.28rem; }
}

/* ---------- Notifications flottantes ---------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  font-size: .89rem;
  box-shadow: var(--shadow);
  animation: toast-in .22s ease-out;
}
.toast--error { background: var(--danger); }
.toast--success { background: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (min-width: 860px) {
  .toasts { left: auto; right: 22px; bottom: 22px; transform: none; }
}

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