@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/manrope-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/manrope-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/manrope-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/manrope-latin-700-normal.woff2) format("woff2"); }

/* Charte Campoverde Conseil : vert forêt, ivoire, laiton, pierre */
:root {
  color-scheme: light dark;
  --bg: #F7F3EA;
  --surface: #FFFFFF;
  --ink: #1F3A2E;
  --muted: #5F5A50;
  --line: #E5DCCB;
  --accent: #1F3A2E;
  --accent-ink: #F7F3EA;
  --accent-soft: #E6EDE8;
  --brass: #A8834A;
  --brass-ink: #7A5C2E;
  --good: #2C7A4B;
  --good-soft: #E3F1E7;
  --bad: #A8352B;
  --bad-soft: #F8E7E4;
  --warn: #8A5A00;
  --warn-soft: #F7EEDC;
  --imp: #8A1F4F;
  --imp-soft: #F6E5EC;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(31, 58, 46, .05), 0 8px 24px rgba(31, 58, 46, .05);
  --font: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121C17;
    --surface: #1A2822;
    --ink: #EFE9DC;
    --muted: #B3AC9E;
    --line: #2E3E36;
    --accent: #9CCBB0;
    --accent-ink: #10201A;
    --accent-soft: #1F3A2E;
    --brass: #C9A66B;
    --brass-ink: #D9BC86;
    --good: #7FD3A0;
    --good-soft: #17352A;
    --bad: #FF9A8C;
    --bad-soft: #3D211D;
    --warn: #F0B860;
    --warn-soft: #3A2D16;
    --imp: #FF9CC6;
    --imp-soft: #3B1B2B;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-family: var(--serif); font-size: clamp(2rem, 3.6vw, 2.7rem); font-weight: 600; letter-spacing: 0; }
h2 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code { background: var(--accent-soft); padding: .1em .35em; border-radius: 6px; }
code.big { font-size: 1.3rem; letter-spacing: .04em; }

.wrap { width: min(1100px, 100% - 32px); margin-inline: auto; }
.main { padding: 28px 0 56px; min-height: 70vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; justify-content: center; }
.lead { font-size: 1.12rem; }
.eyebrow { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-ink); margin-bottom: .4em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: inherit; }
.sec { margin-top: 34px; font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.source { margin-top: 32px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }

/* En-tête */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.mark { display: block; flex: none; color: var(--ink); }
.auth-side .mark { margin-bottom: 18px; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; }
.slogan { font-family: var(--serif); font-style: italic; font-size: 1.6rem !important; color: var(--ink) !important; margin-bottom: .3em; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .linkish { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 9px; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .linkish:hover { background: var(--bg); color: var(--ink); }
.nav a.on { color: var(--ink); background: var(--accent-soft); }
form.inline { display: inline; margin: 0; }
.foot { display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; padding: 18px 0 30px; border-top: 1px solid var(--line); }

/* Blocs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.narrow { max-width: 560px; margin: 40px auto; }
.card.danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.card.empty { text-align: center; padding: 40px 22px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.stack > .card:last-child { margin-bottom: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.spread { justify-content: space-between; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--brass); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.warn { border-color: var(--warn); color: var(--warn); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* Formulaires */
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--ink); font: inherit; font-weight: 400; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin: 4px 0 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 2px; margin: 0 0 16px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 6px; }
.good-label { color: var(--good); }
.good-label input { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.section-edit { background: var(--bg); }
.section-edit input, .section-edit textarea { background: var(--surface); }

/* Messages */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--good-soft); color: var(--ink); border-left: 4px solid var(--good); }
.flash.err { background: var(--bad-soft); border-color: var(--bad); }
.flash.info { background: var(--warn-soft); border-color: var(--warn); }
.reveal { background: var(--warn-soft); border: 1px solid var(--warn); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.reveal p { margin: .5em 0 0; }

/* Connexion */
body.bare .main { display: grid; place-items: center; min-height: 92vh; padding: 24px 0; }
.auth { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; width: 100%; }
.auth-side h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.auth-side p { color: var(--muted); font-size: 1.1rem; max-width: 34ch; }
.auth-card { padding: 30px; margin: 0; }
.auth-card .btn { width: 100%; margin-top: 4px; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; gap: 20px; } }

/* Accueil apprenant */
.hello { margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.fcard { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.fcard h2 { font-family: var(--serif); font-size: 1.8rem; font-weight: 600; margin-bottom: .3em; }
.fcard h2 a { color: var(--ink); text-decoration: none; }
.fcard h2 a:hover { color: var(--accent); }
.fcard .muted { margin: 0; }
.fcard-top { flex: 1; }
.fcard-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .9rem; color: var(--muted); }

.meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.meter i { display: block; height: 100%; background: var(--brass); border-radius: 99px; }

/* Parcours */
.fhead { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 10px; }
@media (max-width: 820px) { .fhead { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 10px; }
.stats.wide { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.8rem; font-family: var(--serif); font-weight: 600; }
.stat span { font-size: .82rem; color: var(--muted); }
.today { margin-top: 22px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); padding: 24px 26px; }
.today .eyebrow { color: var(--brass); opacity: 1; }
.today h2 { font-family: var(--serif); font-size: 2rem; font-weight: 600; }
.today .btn { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 45%, transparent); }
.today .btn.primary { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.today.done { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }

.modules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mod a { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.mod a:hover { border-color: var(--accent); }
.mod .num { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.mod.done .num { background: var(--good); border-color: var(--good); color: var(--surface); }
.mod.next a { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mod.next .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mod .mt { font-weight: 600; }
.mod .mt small { display: block; font-weight: 400; color: var(--muted); font-size: .84rem; }
.mod .ms { font-size: .86rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 600px) { .mod a { grid-template-columns: 40px 1fr; } .mod .ms { grid-column: 2; } }

/* Fiche */
.fiche { max-width: 760px; margin: 0 auto; }
.fiche-h { border-bottom: 1px solid var(--line); margin-bottom: 20px; padding-bottom: 8px; }
.ess { background: var(--accent-soft); border-top: 2px solid var(--brass); border-radius: 0; padding: 16px 20px; font-size: 1.05rem; margin-bottom: 26px; }
.ess b { display: block; font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--brass-ink); margin-bottom: 4px; }
.fs { padding: 4px 0 10px; border-bottom: 1px dashed var(--line); margin-bottom: 18px; }
.fs h2 { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; }
.fs p { font-size: 1.03rem; }
.fs strong { color: var(--ink); font-weight: 700; }
.fiche-f { margin-top: 26px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tag { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.tag.imp { background: var(--imp-soft); border-color: transparent; color: var(--imp); }
.tag.ok { background: var(--good-soft); border-color: transparent; color: var(--good); }
.tag.ghost { background: transparent; }

/* Quiz */
.quiz { max-width: 780px; margin: 0 auto; padding: 28px; }
.qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.qhead h1 { font-size: 1.35rem; }
.qcount { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.qprog { display: flex; gap: 4px; margin: 6px 0 18px; }
.qprog i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.qprog i.c { background: var(--accent); opacity: .45; }
.qprog i.g { background: var(--good); }
.qprog i.b { background: var(--bad); }
.qtext { font-family: var(--serif); font-size: 1.65rem; font-weight: 600; margin: 8px 0 18px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.opt:disabled { cursor: default; }
.opt .key { flex: none; width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: .85rem; font-weight: 700; background: var(--bg); border: 1px solid var(--line); }
.opt.good { border-color: var(--good); background: var(--good-soft); }
.opt.good .key { background: var(--good); color: var(--surface); border-color: var(--good); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.opt.bad .key { background: var(--bad); color: var(--surface); border-color: var(--bad); }
.opt:disabled:not(.good):not(.bad) { opacity: .6; }
.exp { margin-top: 18px; padding: 14px 18px; border-radius: 12px; background: var(--good-soft); border-left: 4px solid var(--good); }
.exp.ko { background: var(--bad-soft); border-color: var(--bad); }
.exp small { display: block; margin-top: 8px; color: var(--muted); }
.qfoot { margin-top: 22px; }
.result { text-align: center; padding: 10px 0; }
.score { font-family: var(--serif); font-size: 4.2rem; font-weight: 600; line-height: 1.1; margin: 10px 0; }
.score span { font-size: 2rem; color: var(--muted); }

/* Administration */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -6px 0 22px; }
.tabs a { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: .94rem; }
.tabs a.on { color: var(--ink); border-color: var(--brass); }
.tablewrap { overflow-x: auto; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card .tablewrap { border: 0; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--bg); }
tr:last-child td { border-bottom: 0; }
tr.off td { opacity: .55; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions a { margin-right: 12px; white-space: nowrap; }
td.w-meter { min-width: 160px; }
table.edit td { padding: 6px 8px; }
table.edit input { margin: 0; padding: 7px 9px; }
.w-code { min-width: 90px; }
.w-src { min-width: 140px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.adm-list, .qlist { padding-left: 0; list-style: none; margin: 0 0 14px; }
.adm-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.adm-list .ord { width: 64px; margin: 0; padding: 6px 8px; }
.adm-list a { flex: 1; }
.qlist li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.qlist li span { display: block; }
.qlist li.off a { color: var(--muted); }

@media print {
  .top, .foot, .fiche-f, .crumbs { display: none; }
  body { background: #fff; }
}

/* Chiffres alignés pour la police de titre (lisibilité des numéros de critères et des scores) */
h1, h2, h3, .qtext, .stat b, .score, .brand-name, .fcard h2, .today h2, .sec { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
