:root {
  --bg: #fbfaf7;
  --bg-alt: #f1efe8;
  --text: #1d1d1b;
  --muted: #5f5e58;
  --accent: #2f7d5b;
  --accent-contrast: #ffffff;
  --border: #e2dfd5;
  --card: #ffffff;
  --radius: 14px;
  --maxw: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141513;
    --bg-alt: #1b1d1a;
    --text: #ecebe6;
    --muted: #a3a29b;
    --accent: #5cc195;
    --accent-contrast: #0f1a14;
    --border: #2c2f2a;
    --card: #20221f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141513;
  --bg-alt: #1b1d1a;
  --text: #ecebe6;
  --muted: #a3a29b;
  --accent: #5cc195;
  --accent-contrast: #0f1a14;
  --border: #2c2f2a;
  --card: #20221f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 640px; }
.center { text-align: center; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 1.25rem; align-items: center; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--text); }
.theme-toggle, .nav-toggle {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 1rem;
}
.nav-toggle { display: none; }

/* Hero */
.hero { padding: clamp(64px, 12vw, 128px) 0; }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.accent { color: var(--accent); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn {
  display: inline-block; padding: .7rem 1.2rem; border-radius: 10px;
  background: var(--accent); color: var(--accent-contrast);
  text-decoration: none; font-weight: 600; border: 1px solid var(--accent);
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); }

/* Sections */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }
.section-intro { color: var(--muted); margin-top: -.3rem; margin-bottom: 2rem; }

.two-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 2.5rem; align-items: start; }
.facts { list-style: none; padding: 1.25rem; margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.facts li { padding: .4rem 0; }
.facts strong { margin-right: .5rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
.card p { color: var(--muted); }
.card-link { font-weight: 600; text-decoration: none; }

/* Fourre-tout */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  padding: .4rem .9rem; border-radius: 999px; cursor: pointer; font: inherit;
}
.chip.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.items { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.item {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 1.25rem; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.item h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.item p { margin: 0; color: var(--muted); }
.item[hidden] { display: none; }
.tag {
  flex-shrink: 0; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: .1rem .45rem; margin-top: .15rem;
}

.socials { color: var(--muted); }

.site-footer { padding: 2rem 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); text-align: center; }

/* Mobile */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: .5rem 16px 1rem;
  }
  .nav.open { display: flex; }
  .nav a { padding: .6rem 0; width: 100%; }
  .two-cols { grid-template-columns: 1fr; }
}

/* Hub, formulaires et comptes */
.nav-cta { color: var(--accent) !important; font-weight: 600; }
.hero-small { padding: clamp(40px, 8vw, 80px) 0; }
.muted { color: var(--muted); }
code { background: var(--bg-alt); padding: .1rem .4rem; border-radius: 6px; font-size: .9em; }

.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; margin-bottom: 1.25rem;
}
.panel h1, .panel h2 { margin-bottom: .5rem; }
.panel h2 { font-size: 1.25rem; }

.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
.form small { font-weight: 400; color: var(--muted); }
.form input, .form select {
  font: inherit; padding: .6rem .75rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.form input:focus-visible, .form select:focus-visible, .btn:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.form .btn { cursor: pointer; font: inherit; font-weight: 600; justify-self: start; }
.form .btn:disabled { opacity: .6; cursor: wait; }
.form-links { margin: 0; font-size: .95rem; color: var(--muted); }
.form-inline { grid-template-columns: 1fr 2fr auto; align-items: end; }

.notice {
  padding: .75rem 1rem; border-radius: 10px; margin: 0 0 1rem;
  border: 1px solid var(--border); background: var(--bg-alt);
}
.notice-ok { border-color: var(--accent); }
.notice-error { border-color: #c0392b; }
.notice-warn { border-color: #d68910; }
.notice[hidden] { display: none; }

.app-card { display: flex; flex-direction: column; gap: .25rem; }
.app-card p { flex: 1; margin: 0 0 .5rem; }
.app-card .tag { align-self: flex-start; margin-bottom: .75rem; }
.app-icon { font-size: 2rem; line-height: 1; margin-bottom: .5rem; }

.invites { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .5rem; }
.invites li { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; border-top: 1px solid var(--border); }

@media (max-width: 720px) {
  .form-inline { grid-template-columns: 1fr; }
}
