/* ===========================================================================
   IFACI Certification — Espace fournisseurs — système de design
   Palette officielle IFACI (vert de marque + bleus institutionnels)
   =========================================================================== */
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/figtree-400.7bfd10a3def3.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/figtree-500.94e34f97c4c6.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/figtree-600.4376f5953b85.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/figtree-700.70aaa6879de5.woff2") format("woff2");
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/figtree-800.6d348a4f382c.woff2") format("woff2");
}

:root {
  /* Marque IFACI */
  --green: #39b54a;
  --green-600: #2f9c3f;
  --green-700: #1f5c28;
  --navy: #00305e;
  --navy-700: #002347;
  --indigo: #323a84;
  --teal: #005584;
  --sky: #eff4ff;

  --ink: #1b2430;
  --muted: #5b6675;
  --line: #e6ecf3;
  --card: #ffffff;
  --bg: #f4f7fb;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,40,80,.04), 0 6px 24px rgba(16,40,80,.06);
  --shadow-lg: 0 10px 40px rgba(16,40,80,.12);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15.5px;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .4rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .8rem; color: var(--navy); }
h3 { font-size: 1rem; font-weight: 700; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Topbar ---------- */
header.site {
  background: linear-gradient(100deg, var(--navy) 0%, var(--navy-700) 60%, var(--indigo) 140%);
  color: #fff;
  padding: .7rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 50;
}
header.site .brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.05rem; color: #fff; letter-spacing: -.01em; }
header.site .brand:hover { text-decoration: none; }
header.site .brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(57,181,74,.25); }
header.site nav { display: flex; align-items: center; gap: .3rem; }
header.site nav a { color: #d8e2f0; font-size: .92rem; padding: .4rem .7rem; border-radius: 8px; }
header.site nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* Sélecteur de mode (façon Airbnb) */
.mode-switch { display: inline-flex; background: rgba(255,255,255,.12); border-radius: 999px; padding: 3px; gap: 2px; }
.mode-switch button { border: none; background: transparent; color: #d8e2f0; font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .8rem; border-radius: 999px; cursor: pointer; }
.mode-switch button.active { background: #fff; color: var(--navy); }
.mode-switch button:not(.active):hover { color: #fff; }

/* ---------- Layout ---------- */
.container { max-width: 960px; margin: 2rem auto; padding: 0 1.2rem; }
.container.wide { max-width: 1240px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; margin-bottom: 1.3rem; box-shadow: var(--shadow);
}
.page-head { margin-bottom: 1.4rem; }

/* ---------- Hub : cartes d'espaces ---------- */
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.section-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .4rem;
  transition: transform .15s ease, box-shadow .15s ease; text-decoration: none; color: var(--ink);
}
.section-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.section-card .ring-wrap { display: flex; align-items: center; gap: 1rem; }
.section-card h3 { color: var(--navy); }
.section-card .go { margin-top: .6rem; color: var(--green-600); font-weight: 700; font-size: .9rem; }

/* Anneau de progression (CSS pur, conic-gradient) */
.ring {
  --p: 0; --size: 64px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none;
  background: conic-gradient(var(--green) calc(var(--p) * 1%), #e7edf4 0);
  display: grid; place-items: center;
}
.ring::after {
  content: attr(data-label); width: calc(var(--size) - 14px); height: calc(var(--size) - 14px);
  background: #fff; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: .82rem; color: var(--navy);
}
.ring.full { background: conic-gradient(var(--green) 100%, var(--green) 0); }

/* Grande barre de progression */
.progress { background: #e7edf4; border-radius: 999px; height: 12px; overflow: hidden; margin: .7rem 0 0; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--green-600)); border-radius: 999px; transition: width .4s ease; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; font-size: .92rem; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=file], textarea, select {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink); transition: border-color .12s, box-shadow .12s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(57,181,74,.18); }
.helptext { color: var(--muted); font-size: .82rem; margin-top: .25rem; }
.errorlist { color: #b91c1c; list-style: none; padding: 0; margin: .3rem 0; font-size: .85rem; }
.field { margin-bottom: .5rem; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; background: var(--green); color: #fff;
  border: none; padding: .65rem 1.2rem; border-radius: var(--radius-sm); font-size: .95rem;
  font-weight: 700; cursor: pointer; font-family: inherit; transition: background .12s, transform .05s;
}
.btn:hover { background: var(--green-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef2f7; color: var(--navy); }
.btn.secondary:hover { background: #e2e9f2; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--navy); background: #fff; }
.btn.danger { background: #fff; color: #b91c1c; border: 1.5px solid #f3c7c7; padding: .35rem .7rem; font-size: .82rem; }
.btn.danger:hover { background: #fdf2f2; }
.btn-row { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge.draft { background: #eef2f7; color: #475569; }
.badge.incomplete { background: #fff4e5; color: #b45309; }
.badge.complete { background: #e3f7e7; color: var(--green-700); }
.badge.archived { background: #e5e7eb; color: #374151; }
.badge.na { background: #eef0ff; color: var(--indigo); }
.badge.ok { background: #e3f7e7; color: var(--green-700); }

/* ---------- Tableaux ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .65rem .55rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
tbody tr:hover td { background: #f8fbff; }

/* ---------- Pièces (documents) ---------- */
.doc-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1.1rem; margin-bottom: 1rem; background: #fcfdff; }
.doc-item.done { border-color: #cdebd3; background: #f6fcf7; }
.doc-files { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .35rem; }
.doc-files li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; font-size: .9rem; }
.na-fields { margin-top: .6rem; padding-left: 1rem; border-left: 3px solid var(--line); }
.check-row { font-weight: 500; margin-top: .7rem; display: flex; align-items: center; gap: .45rem; }
.check-row input { width: auto; }

/* ---------- Barre d'outils ---------- */
.toolbar { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin-bottom: 1.2rem; }
.toolbar .grow { flex: 1; min-width: 220px; }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.messages li { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: .5rem; font-weight: 500; }
.messages li.success { background: #e3f7e7; color: var(--green-700); }
.messages li.error { background: #fee2e2; color: #991b1b; }
.messages li.info, .messages li.warning { background: #fff4e5; color: #b45309; }

/* ---------- Accueil public ---------- */
.hero { background: linear-gradient(120deg, var(--navy), var(--indigo)); color: #fff; border-radius: var(--radius); padding: 2.4rem; box-shadow: var(--shadow-lg); }
.hero h1 { color: #fff; font-size: 2rem; }
.hero p { color: #d8e2f0; max-width: 56ch; }
.hero .btn.secondary { background: rgba(255,255,255,.14); color: #fff; }
.hero .btn.secondary:hover { background: rgba(255,255,255,.24); }

footer.site { text-align: center; color: var(--muted); font-size: .84rem; padding: 2.5rem 1rem; }

@media (max-width: 600px) {
  header.site { flex-wrap: wrap; }
  .container { margin: 1.2rem auto; }
}
