/* Polices hébergées localement (aucun appel à Google, RGPD) — licences libres Apache 2.0 et SIL OFL, voir fonts/LICENSES.txt */
@font-face { font-family: "Luckiest Guy"; src: url("fonts/luckiest-guy.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
/* ============ Trail Nocturne de la Tourouge — nuit étoilée ============ */
:root {
  --night: #0a0f24;      /* ciel profond */
  --dusk: #141b3d;       /* surfaces */
  --dusk-2: #1c2550;     /* surfaces hautes */
  --chalk: #f2efe4;      /* trait blanc du dessin */
  --mist: #a9aed0;       /* texte secondaire */
  --lamp: #ffd62e;       /* faisceau de frontale */
  --olive: #5c501a;      /* panneau TNT */
  --olive-2: #7a6b25;
  --danger: #ff7a6b;
  --ok: #8fe3a6;
  --radius: 14px;
  --font-display: "Luckiest Guy", "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--night); color: var(--chalk);
  font-family: var(--font-body); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lamp); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }

#sky { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
  background: radial-gradient(ellipse 120% 70% at 70% 0%, #1a2456 0%, var(--night) 60%); }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }

/* ---------- En-tête public ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; gap: 16px; }
.topbar .brand img { height: 46px; display: block; }
.topbar nav { display: flex; gap: 22px; font-weight: 600; }
.topbar nav a { color: var(--chalk); text-decoration: none; }
.topbar nav a:hover { color: var(--lamp); }
@media (max-width: 560px) { .topbar nav { gap: 14px; font-size: .92rem; } .topbar nav .far { display: none; } .topbar .brand img { height: 38px; } }

/* ---------- Hero : le dessin, posé dans la nuit ---------- */
.hero { position: relative; padding: 8px 0 0; }
.hero .art { display: block; width: 100%; max-width: 1200px; margin: 0 auto; }
.hero .beam {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(circle 260px at var(--bx, 62%) var(--by, 30%), rgba(255,214,46,.16), transparent 70%);
  animation: sweep 3.2s ease-out .4s both;
}
@keyframes sweep { from { --bx: 20%; opacity: 0; } 30% { opacity: 1; } to { --bx: 62%; } }
@property --bx { syntax: "<percentage>"; inherits: false; initial-value: 62%; }

.event-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; justify-content: center;
  margin: 10px auto 0; padding: 18px 24px; border-top: 2px solid var(--chalk); border-bottom: 2px solid var(--chalk);
  border-radius: 2px 40px 2px 40px / 2px 10px 2px 10px; /* trait à main levée */
  font-size: 1.1rem;
}
.event-strip b { font-family: var(--font-display); font-weight: 400; color: var(--lamp); font-size: 1.45rem; letter-spacing: .5px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 700 1rem/1 var(--font-body); padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; transition: transform .12s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lamp { background: var(--lamp); color: #1d1a05; }
.btn-lamp:hover { background: #ffe36b; }
.btn-ghost { background: transparent; color: var(--chalk); border-color: rgba(242,239,228,.45); }
.btn-ghost:hover { border-color: var(--chalk); }
.btn-olive { background: var(--olive); color: var(--chalk); }
.btn-olive:hover { background: var(--olive-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255,122,107,.5); }
.btn-danger:hover { background: rgba(255,122,107,.12); }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.btn-big { font-size: 1.2rem; padding: 18px 34px; }

/* ---------- Sections publiques ---------- */
section.block { padding: 64px 0; }
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; color: var(--chalk); font-size: clamp(2rem, 4.5vw, 3rem); }
.lead { color: var(--mist); font-size: 1.1rem; max-width: 60ch; }

/* Le carnet de route : les actus le long d'un sentier */
.trail { position: relative; margin-top: 34px; padding-left: 40px; }
.trail::before {
  content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 3px;
  background: repeating-linear-gradient(to bottom, var(--chalk) 0 14px, transparent 14px 26px); opacity: .55;
}
.stage { position: relative; display: grid; grid-template-columns: 1fr; gap: 6px; padding: 0 0 44px; }
.stage::before {
  content: ""; position: absolute; left: -37px; top: 6px; width: 19px; height: 19px; border-radius: 50%;
  background: var(--night); border: 3px solid var(--lamp); box-shadow: 0 0 18px rgba(255,214,46,.55);
}
.stage.pinned::before { background: var(--lamp); }
.stage time { color: var(--mist); font-size: .92rem; }
.stage h3 { font-size: 1.5rem; margin: 0; }
.stage h3 a { color: var(--chalk); text-decoration: none; }
.stage h3 a:hover { color: var(--lamp); }
.stage .cover { border-radius: 10px; margin: 10px 0 6px; max-height: 340px; width: 100%; object-fit: cover; border: 2px solid rgba(242,239,228,.2); }
.stage p { margin: 0; color: #d9d7e8; max-width: 65ch; }
.empty-trail { color: var(--mist); font-style: italic; }

/* Panneau d'inscription, façon panneau TNT */
.signpost {
  position: relative; background: var(--olive); color: var(--chalk); padding: 36px clamp(22px, 5vw, 48px) 40px;
  border-radius: 18px 60px 22px 18px / 18px 30px 26px 18px; max-width: 760px; margin: 0 auto;
  box-shadow: 0 0 0 3px var(--chalk) inset;
}
.signpost::after { /* pointe de la flèche */
  content: ""; position: absolute; right: -34px; top: 50%; transform: translateY(-50%);
  border-left: 36px solid var(--olive); border-top: 46px solid transparent; border-bottom: 46px solid transparent;
}
.signpost h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.5rem); color: var(--lamp); }
.signpost p { margin-top: 0; }
@media (max-width: 860px) { .signpost::after { display: none; } }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: 5px; }
label .opt { font-weight: 400; color: var(--mist); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--chalk); background: rgba(10,15,36,.6);
  border: 2px solid rgba(242,239,228,.25); border-radius: 10px; padding: 11px 13px;
}
.signpost input { background: rgba(10,15,36,.35); border-color: rgba(242,239,228,.5); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lamp); }
textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .95rem; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--lamp); flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hint { color: var(--mist); font-size: .87rem; margin: 4px 0 0; }

/* ---------- Pages simples (merci, lien, désinscription) ---------- */
.card-page { min-height: 72vh; display: grid; place-items: center; padding: 30px 0 60px; }
.moon-card { text-align: center; max-width: 620px; padding: 40px clamp(20px, 5vw, 46px); background: rgba(20,27,61,.82);
  border: 2px solid rgba(242,239,228,.18); border-radius: 26px; backdrop-filter: blur(6px); }
.moon-card h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.9rem, 5vw, 2.6rem); color: var(--lamp); }
.moon-card p { color: #dcdaf0; }
.moon-card .glyph { display: block; width: 130px; height: auto; margin: 0 auto 16px; filter: drop-shadow(0 0 10px rgba(255,214,46,.55)); }
.moon-card .actions { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 26px; }
.moon-card .small-print { font-size: .85rem; color: var(--mist); margin-top: 22px; }

/* ---------- Article ---------- */
.article { padding: 30px 0 70px; }
.article h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(2rem, 5vw, 3rem); }
.article .cover { width: 100%; border-radius: 14px; margin: 14px 0 24px; border: 2px solid rgba(242,239,228,.2); }
.prose { font-size: 1.08rem; }
.prose img { border-radius: 10px; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1.1em; border-left: 3px solid var(--lamp); color: #dcdaf0; }
.prose h2, .prose h3 { color: var(--lamp); margin-top: 1.4em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid rgba(242,239,228,.2); padding: 6px 10px; }

/* ---------- Flash ---------- */
.flashes { display: grid; gap: 8px; margin: 12px 0; }
.flash { padding: 12px 16px; border-radius: 10px; border: 1px solid; font-weight: 500; }
.flash.ok { border-color: rgba(143,227,166,.45); background: rgba(143,227,166,.1); color: var(--ok); }
.flash.error { border-color: rgba(255,122,107,.5); background: rgba(255,122,107,.1); color: #ffb3a9; }
.flash.info { border-color: rgba(169,174,208,.4); background: rgba(169,174,208,.08); color: var(--mist); }

footer.site { padding: 40px 0 50px; color: var(--mist); font-size: .9rem; border-top: 1px dashed rgba(242,239,228,.2); margin-top: 30px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer.site a { color: var(--mist); }

/* ======================= ADMIN ======================= */
.admin { font-size: 15px; }
.admin #sky { opacity: .45; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: rgba(14,19,48,.92); border-right: 1px solid rgba(242,239,228,.08); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: var(--chalk); text-decoration: none; font-weight: 700; }
.side .brand img { height: 34px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: #cfd2ea; text-decoration: none; font-weight: 500; }
.side nav a:hover { background: rgba(242,239,228,.06); color: var(--chalk); }
.side nav a.active { background: var(--olive); color: var(--chalk); }
.side nav a .count { margin-left: auto; font-size: .78rem; background: rgba(255,214,46,.18); color: var(--lamp); padding: 1px 8px; border-radius: 99px; }
.side .group { color: var(--mist); font-size: .78rem; padding: 16px 12px 6px; }
.side .me { border-top: 1px solid rgba(242,239,228,.08); margin-top: 18px; padding: 14px 12px 0; font-size: .88rem; color: var(--mist); }
.side .me a { color: var(--mist); }
.main { padding: 26px clamp(16px, 3vw, 38px) 60px; min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.page-head h1 { font-size: 1.7rem; margin: 0; }
.page-head .sub { color: var(--mist); margin: 2px 0 0; }
.panel { background: rgba(20,27,61,.88); border: 1px solid rgba(242,239,228,.09); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { font-size: 1.15rem; margin-bottom: 12px; }
.panel.lampish { border-color: rgba(255,214,46,.4); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.cols > .panel { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: rgba(20,27,61,.88); border: 1px solid rgba(242,239,228,.09); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--chalk); }
.stat strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--chalk); }
.stat span { color: var(--mist); font-size: .9rem; }
.stat.hl strong { color: var(--lamp); }
.funnel { display: flex; gap: 6px; flex-wrap: wrap; align-items: stretch; }
.funnel .step { flex: 1 1 120px; padding: 12px 14px; border-radius: 10px; background: rgba(10,15,36,.55); }
.funnel .step strong { font-size: 1.5rem; display: block; }
.funnel .step span { color: var(--mist); font-size: .85rem; }
.funnel .step.yes strong { color: var(--ok); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-weight: 600; color: var(--mist); font-size: .85rem; padding: 8px 10px; border-bottom: 1px solid rgba(242,239,228,.12); }
table.list td { padding: 10px; border-bottom: 1px solid rgba(242,239,228,.06); vertical-align: middle; }
table.list tr:hover td { background: rgba(242,239,228,.025); }
table.list a.row-link { color: var(--chalk); text-decoration: none; font-weight: 600; }
table.list a.row-link:hover { color: var(--lamp); }
.table-wrap { overflow-x: auto; }
.unread td { font-weight: 700; }
.unread td:first-child::before { content: "●"; color: var(--lamp); margin-right: 6px; font-size: .7rem; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: rgba(169,174,208,.15); color: #cfd2ea; white-space: nowrap; }
.tag.nouveau { background: rgba(169,174,208,.15); }
.tag.envoye { background: rgba(255,214,46,.15); color: var(--lamp); }
.tag.oui, .tag.ok, .tag.termine { background: rgba(143,227,166,.15); color: var(--ok); }
.tag.erreur, .tag.off, .tag.interrompu { background: rgba(255,122,107,.15); color: #ffb3a9; }
.tag.envoi { background: rgba(255,214,46,.25); color: var(--lamp); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=search] { width: 240px; padding: 8px 12px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 6px 12px; border-radius: 99px; text-decoration: none; color: #cfd2ea; border: 1px solid rgba(242,239,228,.15); font-size: .88rem; }
.pills a.on { background: var(--chalk); color: var(--night); border-color: var(--chalk); font-weight: 600; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; color: var(--mist); }
.inline { display: inline; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 14px; }
.muted { color: var(--mist); }
.small { font-size: .86rem; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .88em; background: rgba(10,15,36,.6); padding: 1px 6px; border-radius: 5px; }
.mail-frame { width: 100%; min-height: 520px; border: 0; border-radius: 10px; background: #fff; }
.mail-text { white-space: pre-wrap; background: rgba(10,15,36,.5); padding: 16px; border-radius: 10px; font-family: var(--font-body); }
.progress { height: 12px; border-radius: 99px; background: rgba(10,15,36,.7); overflow: hidden; }
.progress > div { height: 100%; background: var(--lamp); transition: width .4s; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.editor textarea { min-height: 420px; font-family: ui-monospace, Menlo, monospace; font-size: .92rem; }
.editor .preview { background: rgba(10,15,36,.5); border-radius: 10px; padding: 14px 18px; min-height: 420px; overflow: auto; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } }
details.danger-zone summary { cursor: pointer; color: #ffb3a9; font-weight: 600; }
.login-box { width: min(420px, 100% - 32px); margin: 10vh auto; }
.login-box .logo { display: block; margin: 0 auto 18px; height: 70px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .group, .side .me { display: none; }
  .side nav a { padding: 7px 10px; font-size: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--mist); text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--chalk); }

/* Épreuves */
.about p { margin: 0 0 .7em; }
.about strong { color: var(--lamp); }

/* Partenaires (site infos) */
.sp-tier { margin-top: 30px; text-align: center; }
.sp-tier h3 { color: var(--mist); font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; }
.sp-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.sp-card { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 220px; padding: 16px; border-radius: 14px;
  background: var(--chalk); color: #1d1d1f; text-decoration: none; border-top: 5px solid #b8b8b8; }
.sp-card img { height: 90px; width: 100%; object-fit: contain; }
.sp-card strong { font-size: .98rem; line-height: 1.25; }
.sp-card span { font-size: .85rem; color: #555; line-height: 1.4; }
a.sp-card:hover { outline: 3px solid var(--lamp); }
.sp-platine .sp-card { width: 280px; border-top-color: #4f5e77; }
.sp-platine .sp-card img { height: 120px; }
.sp-or .sp-card { border-top-color: #fcde04; }
.sp-partenaire .sp-card { width: 180px; border-top-color: transparent; }
.sp-partenaire .sp-card img { height: 70px; }
@media (max-width: 520px) { .sp-card, .sp-platine .sp-card { width: 100%; } }

footer.site .legal-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
fieldset.choice { border: 1px solid rgba(242,239,228,.15); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
fieldset.choice legend { font-weight: 600; padding: 0 6px; }
fieldset.choice .check { margin: 8px 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(242,239,228,.5); cursor: pointer; padding: 0; }
.swatch:hover { border-color: var(--lamp); }
.sponsors-wrap { padding: 40px 0; }
.sponsors-wrap .tntsp h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: .5px; }
.sponsors-wrap .tntsp h3 { font-size: 1rem; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(242,239,228,.25); border-top-color: var(--lamp); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.reveal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-size: .9rem; color: var(--mist); }
