@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..900&display=swap");
:root {
  color-scheme: light dark;
  --bg: #f4f5f7; --card: #ffffff; --ink: #17181c; --muted: #6a6d75;
  --line: #e3e5ea; --accent: #b3261e; --accent-ink: #ffffff; --ok: #2e7d32;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161615; --card: #22221f; --ink: #ecebe6; --muted: #a3a29c; --line: #34332f; }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: var(--bg); color: var(--ink); padding: 1rem; }
.card { background: var(--card); width: 100%; max-width: 26rem; padding: 2rem; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card.wide { max-width: 36rem; }
h1 { margin: 0 0 .25rem; font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
p { line-height: 1.5; color: var(--muted); margin: .5rem 0 1rem; }
label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .35rem; }
input { width: 100%; font: inherit; padding: .7rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
input.code { font-size: 1.5rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
button, .button { display: inline-block; width: 100%; margin-top: .9rem; font: inherit; font-weight: 600; padding: .75rem 1rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-align: center; text-decoration: none; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: .6; cursor: wait; }
.msg { margin-top: 1rem; padding: .75rem; border-radius: 8px; background: rgba(127,127,127,.12); font-size: .95rem; line-height: 1.45; word-break: break-word; }
.msg.error { background: rgba(179,38,30,.12); color: var(--accent); }
.msg.ok { background: rgba(46,125,50,.12); color: var(--ok); }
.hidden { display: none; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9rem; }
.secret { display: block; padding: .6rem; border-radius: 8px; background: rgba(127,127,127,.12); letter-spacing: .08em; word-break: break-all; }
ul.clubs { padding-left: 1.1rem; }
.small { font-size: .85rem; }
a { color: var(--accent); }

button.danger, button.secondary.danger { background: #c62828; color: #fff; border-color: #c62828; }
.avatar{display:inline-flex;align-items:center;justify-content:center;flex:none;border-radius:50%;overflow:hidden;background:#ebe5dc;color:#6b5d4d;font-weight:700;text-transform:uppercase}
.avatar img{width:100%;height:100%;object-fit:cover}
.snake{display:inline-flex;vertical-align:-3px;margin-left:.2rem}


/* ── Thème modernisé ── */
.card { border-radius: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 8px rgba(16,24,40,.05); border: 1px solid var(--line); }
input, select, textarea { border-radius: 10px !important; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(179,38,30,.15); }
button, .button { border-radius: 10px; transition: filter .15s, transform .05s; }
button:hover, .button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
h2 { letter-spacing: -.01em; }

/* ── Menu du club : latéral sur ordinateur, tiroir sur cellulaire ── */
body.withnav { display: block; padding: 1.25rem 1.25rem 4rem 17.5rem; }
.sidenav { position: fixed; inset: 0 auto 0 0; width: 16rem; display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem .8rem; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; z-index: 30; }
.sidenav .brand, .topbar .brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); padding: .2rem .5rem; }
.sidenav .brand img, .topbar .brand img { height: 36px; width: auto; border-radius: 8px; }
.sidenav .brand strong { font-size: .98rem; line-height: 1.2; }
.sidenav .menu { display: flex; flex-direction: column; gap: .15rem; }
.sidenav a.section { display: flex; align-items: center; gap: .7rem; padding: .6rem .75rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.sidenav a.section svg, .burger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sidenav a.section:hover { background: rgba(127,127,127,.08); }
.sidenav a.section.on { background: var(--accent); color: #fff; }
.sidenav .subs { display: flex; flex-direction: column; margin: .2rem 0 .4rem 1.6rem; padding-left: .7rem; border-left: 2px solid var(--line); }
.sidenav .subs a { padding: .4rem .6rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.sidenav .subs a:hover { color: var(--ink); }
.sidenav .subs a.on { color: var(--accent); font-weight: 600; background: rgba(179,38,30,.07); }
.sidenav .account { margin-top: auto; padding: .8rem .6rem 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.sidenav .account .who { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav .account a { text-decoration: none; }
.badge { display: inline-block; min-width: 1.25rem; margin-left: auto; padding: 0 .4rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; line-height: 1.25rem; text-align: center; font-weight: 700; }
.sidenav a.section.on .badge { background: #fff; color: var(--accent); }
.subs .badge, .chips .badge { margin-left: .4rem; }
.topbar, .chips, .shade { display: none; }

@media (max-width: 900px) {
  body.withnav { padding: 4.25rem .8rem 4rem; }
  .topbar { display: flex; align-items: center; gap: .5rem; position: fixed; inset: 0 0 auto 0; height: 3.5rem; padding: 0 .6rem; background: var(--card); border-bottom: 1px solid var(--line); z-index: 25; }
  .topbar .brand strong { display: none; }
  .topbar .pagename { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .burger { position: relative; width: 2.6rem; height: 2.6rem; margin: 0; padding: .5rem; background: transparent; color: var(--ink); border-radius: 10px; flex: none; }
  .burger .dot { position: absolute; top: .45rem; right: .45rem; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }
  .sidenav { transform: translateX(-105%); transition: transform .2s ease; width: min(18rem, 85vw); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
  body.navopen .sidenav { transform: none; }
  body.navopen .shade { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 28; }
  .chips { display: flex; gap: .4rem; overflow-x: auto; padding: .1rem 0 .7rem; margin: -.4rem 0 .2rem; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chips a { flex: none; padding: .45rem .9rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; white-space: nowrap; }
  .chips a.on { background: var(--accent); border-color: var(--accent); color: #fff; }
  table { display: block; overflow-x: auto; }
}
@media print { .sidenav, .topbar, .chips, .shade { display: none !important; } body.withnav { padding: 0; } }

/* ── Pages publiques (accueil du club, inscription, portail membre) ── */
body.public { display: block; padding: 0 0 4rem; }
.hero { position: relative; color: #fff; background: #1f2430 center / cover no-repeat; padding: 2.2rem 1rem 4.6rem; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,14,20,.5), rgba(12,14,20,.78)); }
.hero > * { position: relative; }
.hero .logo { width: 104px; height: 104px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.hero h1 { color: #fff; margin: .75rem 0 .25rem; font-size: 1.65rem; letter-spacing: -.02em; }
.hero p { color: rgba(255,255,255,.86); margin: 0 auto; max-width: 34rem; }
body.public .wrap { max-width: 40rem; margin: -3.2rem auto 0; padding: 0 1rem; position: relative; }
body.public #banner { display: none !important; }
body.public section.card h2 { margin-top: 0; }
body.public form { counter-reset: step; }
body.public form > section.card > h2::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-right: .6rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .9rem; vertical-align: 2px; }
.public-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 2rem; }
.bigcards { display: grid; gap: .9rem; }
a.bigcard { display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.25rem; border-radius: 16px; background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: 0 2px 10px rgba(16,24,40,.06); transition: transform .1s, border-color .15s; }
a.bigcard:hover { border-color: var(--accent); transform: translateY(-1px); }
a.bigcard .ico { flex: none; width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; background: rgba(179,38,30,.1); color: var(--accent); }
a.bigcard .ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.bigcard.primary .ico { background: var(--accent); color: #fff; }
a.bigcard strong { display: block; font-size: 1.08rem; }
a.bigcard span { color: var(--muted); font-size: .9rem; }
a.bigcard .go { margin-left: auto; color: var(--muted); font-size: 1.4rem; }
@media (max-width: 540px) { .hero { padding: 1.7rem 1rem 4.2rem; } .hero h1 { font-size: 1.38rem; } .hero .logo { width: 72px; height: 72px; } body.public section.card { padding: 1.3rem 1.1rem; } }
.bigcard .kicker { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .75; margin-bottom: .1rem; }
/* Accueil du club : bannière pleine largeur, cartes côte à côte sur grand écran. */
body.public .hero { width: 100%; max-width: none; margin: 0; }
body.public .hero h1 { text-shadow: 0 2px 12px rgba(0,0,0,.35); }
body.public .wrap.home { max-width: 58rem; }
@media (min-width: 760px) {
  body.public .hero { min-height: 22rem; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1.5rem 6rem; }
  body.public .hero h1 { font-size: 2.4rem; }
  body.public .hero p { font-size: 1.1rem; }
  body.public .hero .logo { width: 132px; height: 132px; }
  body.public .wrap.home { margin-top: -3rem; }
  /* La bannière garde son format (aucun recadrage du haut ou du bas), sans dépasser 80 % de l'écran. */
  body.public .hero { aspect-ratio: var(--banner-ratio, auto); max-height: 80vh; background-position: center; }
  .home .bigcards { grid-template-columns: 1fr 1fr; gap: 1.2rem; }
  .home a.bigcard { flex-direction: column; align-items: flex-start; padding: 1.6rem 1.6rem 1.4rem; min-height: 12rem; }
  .home a.bigcard .ico { width: 3.4rem; height: 3.4rem; margin-bottom: .4rem; }
  .home a.bigcard strong { font-size: 1.3rem; margin: .15rem 0 .25rem; }
  .home a.bigcard .go { margin: auto 0 0; align-self: flex-end; font-size: 1.6rem; }
}
/* Accueil : la bannière s'affiche seule (sans voile ni texte) ; logo et nom du club en dessous, logo à cheval sur la bannière. */
body.public .hero.photo { padding: 0; min-height: 9rem; }
body.public .hero.photo::before { display: none; }
.identity { position: relative; text-align: center; padding: 0 1rem; margin-top: -56px; }
.identity .logo { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 6px 16px rgba(0,0,0,.35)); }
.identity h1 { margin: .5rem 0 .2rem; font-size: 1.6rem; letter-spacing: -.02em; color: var(--ink); }
.identity p { margin: 0 auto; color: var(--muted); }
body.public .wrap.home { margin-top: 1.6rem; }
@media (min-width: 760px) {
  body.public .hero.photo { min-height: 0; padding: 0; }
  .identity { margin-top: -80px; }
  .identity .logo { width: 160px; height: 160px; }
  .identity h1 { font-size: 2.3rem; }
  .identity p { font-size: 1.08rem; }
  body.public .wrap.home { margin-top: 2rem; }
}
/* Accueil : bouton du personnel, discret mais dans le style des cartes. */
.staff { display: flex; justify-content: center; margin-top: 1.4rem; }
a.staffbtn { display: inline-flex; align-items: center; gap: .8rem; padding: .85rem 1.2rem; min-width: min(100%, 24rem); border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none; box-shadow: 0 2px 10px rgba(16,24,40,.05); transition: border-color .15s, transform .1s; }
a.staffbtn:hover { border-color: var(--accent); transform: translateY(-1px); }
a.staffbtn svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.staffbtn strong { display: block; font-size: 1rem; }
a.staffbtn small { display: block; color: var(--muted); font-size: .84rem; }
a.staffbtn .go { margin-left: auto; color: var(--muted); font-size: 1.3rem; }
/* Menu de changement de club (personnes ayant plusieurs clubs) */
.clubswitch { position: relative; }
.clubswitch > summary { list-style: none; cursor: pointer; }
.clubswitch > summary::-webkit-details-marker { display: none; }
.clubswitch .caret { margin-left: auto; color: var(--muted); font-size: .9rem; }
.clubswitch .clubs { margin: .3rem 0 .8rem; padding: .3rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(16,24,40,.12); }
.clubswitch .clubs a { display: flex; align-items: center; gap: .55rem; padding: .5rem .55rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.clubswitch .clubs a:hover { background: rgba(127,127,127,.08); }
.clubswitch .clubs a.on { font-weight: 700; color: var(--accent); }
.clubswitch .clubs img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; flex: none; }

/* Bandeau d'état du club (soutien, abonnement) */
.cpbanner { position: sticky; top: 0; z-index: 50; display: flex; gap: .8rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .55rem 1rem; font-size: .9rem; text-align: center; background: #e3f2fd; color: #0d3c61; }
.cpbanner.support { background: #4a148c; color: #fff; }
.cpbanner.warn { background: #fff3e0; color: #7a3e00; }
.cpbanner.stop { background: #ffebee; color: #8e1b1b; }
.cpbanner button { width: auto; margin: 0; padding: .25rem .7rem; font-size: .82rem; background: #fff; color: #4a148c; border: 0; border-radius: 6px; }

/* ── Identité Dojango : ceinture, Archivo, noir et rouge ── */
:root { --bg: #f5f6f8; --card: #ffffff; --ink: #15171c; --muted: #5d6370; --line: #dfe2e8; --accent: #c8102e; --mat: #1f4e8c; --btn: #15171c; --btn-ink: #ffffff;
  --w: #f2f2ee; --y: #f2c200; --g: #1f8a4c; --b: #1f4e8c; --r: #c8102e; --k: #15171c;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif; }
@media (prefers-color-scheme: dark) { :root { --bg: #121317; --card: #1c1d22; --ink: #ecedf0; --muted: #a2a6b0; --line: #2f3138; --btn: #ecedf0; --btn-ink: #15171c; } }
body { font-family: inherit; }
body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 6px; z-index: 60; background: linear-gradient(90deg, var(--w) 0 16.66%, var(--y) 0 33.33%, var(--g) 0 50%, var(--b) 0 66.66%, var(--r) 0 83.33%, var(--k) 0); }
h1 { font-weight: 900; font-stretch: 118%; letter-spacing: -.025em; line-height: 1.05; }
h2, h3 { font-weight: 800; font-stretch: 110%; letter-spacing: -.01em; }
.card { border-radius: 6px; box-shadow: none; border: 1px solid var(--line); }
input, select, textarea { border-radius: 4px !important; border: 2px solid var(--line); }
input:focus, select:focus, textarea:focus { border-color: var(--mat) !important; box-shadow: none; }
:focus-visible { outline: 3px solid var(--mat); outline-offset: 2px; }
button, .button { border-radius: 4px; background: var(--btn); color: var(--btn-ink); border: 2px solid var(--btn); font-weight: 700; transition: background .15s, border-color .15s; }
button:hover, .button:hover { filter: none; background: var(--accent); border-color: var(--accent); color: #fff; }
button.secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
button.secondary:hover { background: var(--ink); border-color: var(--ink); color: var(--card); }
button.danger, button.secondary.danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg { border-radius: 0; border-left: 4px solid var(--muted); }
.msg.error { border-left-color: var(--accent); }
.msg.ok { border-left-color: var(--g); color: var(--g); }
a { color: var(--mat); }
@media (prefers-color-scheme: dark) { a { color: #8fb4ea; } }
.sidenav { top: 6px; }
.sidenav .brand strong { font-weight: 900; font-stretch: 112%; }
.sidenav .brand img, .topbar .brand img { border-radius: 4px; }
.sidenav a.section { border-radius: 4px; }
.sidenav a.section.on { background: var(--btn); color: var(--btn-ink); box-shadow: inset 4px 0 0 var(--accent); }
.sidenav a.section.on .badge { background: var(--accent); color: #fff; }
.sidenav .subs { border-left-width: 2px; }
.sidenav .subs a { border-radius: 4px; }
.sidenav .subs a.on { color: var(--ink); background: transparent; font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav .account a { color: var(--ink); }
.badge { border-radius: 3px; }
.clubswitch .clubs { border-radius: 6px; }
.clubswitch .clubs a.on { color: var(--ink); }
@media (max-width: 900px) {
  .topbar { top: 6px; }
  .burger { background: transparent; border: 0; color: var(--ink); }
  .burger:hover { background: transparent; color: var(--ink); }
  .chips a { border-radius: 4px; }
  .chips a.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
  body.withnav { padding-top: 4.6rem; }
}
.hero h1 { font-weight: 900; }
body.public form > section.card > h2::before { border-radius: 3px; background: var(--btn); color: var(--btn-ink); }
a.bigcard, a.staffbtn { border-radius: 6px; box-shadow: none; border: 2px solid var(--line); }
a.bigcard:hover, a.staffbtn:hover { border-color: var(--ink); transform: none; }
a.bigcard .ico { border-radius: 4px; background: transparent; color: var(--ink); border: 2px solid var(--line); }
a.bigcard.primary { border-color: var(--ink); }
a.bigcard.primary .ico { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
a.bigcard strong, a.staffbtn strong { font-weight: 800; font-stretch: 110%; }
.bigcard .kicker { text-transform: none; letter-spacing: 0; font-size: .82rem; }
.identity h1 { font-weight: 900; font-stretch: 118%; }
@media print { body::before { display: none; } }
