/* LT9 Réseau : couleurs du logo, pensé d'abord pour le téléphone.
   Titres et chiffres en Bitter (police à empattements carrés, libre, servie par LT9 lui-même). */
@font-face {
  font-family: "Bitter"; src: url("../fonts/bitter.599efe8b9f4e.woff") format("woff");
  font-weight: 100 900; font-display: swap;
}
:root {
  --titre: "Bitter", Georgia, serif;
  --marine: #113150;
  --marine-clair: #e7edf5;
  --rouge: #b23235;
  --rouge-clair: #fbeaea;
  --encre: #15202e;
  --doux: #5c6b7c;
  --ligne: #dde3ec;
  --fond: #eef2f7;
  --blanc: #fff;
  --ok: #2e7d32;
  --rayon: 16px;
  --rayon-petit: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.with-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
a { color: var(--marine); }

/* Bandeau du haut */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--blanc) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ligne);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--marine); font: 700 20px/1 var(--titre); letter-spacing: -.01em; }
.brand em { font-style: normal; color: var(--rouge); font-weight: 500; }

main { max-width: 680px; margin: 0 auto; padding: 20px 16px 32px; }
h1, h2, h3 { font-family: var(--titre); letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 6px 0 8px; color: var(--marine); }
h2 { font-size: 19px; font-weight: 600; margin: 28px 0 10px; color: var(--marine); }
.today { margin: 0; color: var(--rouge); font-weight: 600; font-size: 15px; }
.today::first-letter { text-transform: uppercase; }
.lead, .muted { color: var(--doux); }
.small { font-size: 14px; }

/* Barre d'onglets en bas */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--blanc); border-top: 1px solid var(--ligne);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabs a, .tabs .soon {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--doux); text-decoration: none; padding: 6px 0 4px;
}
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--marine); font-weight: 800; }
.tabs a.on::before { content: ""; position: absolute; top: -7px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--rouge); }
.tabs a.on svg { stroke: var(--rouge); }
.tabs .soon { opacity: .4; }

/* Cartes */
.card { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 14px 16px; }
.clubs { display: grid; gap: 10px; margin: 16px 0; }
/* Les clubs en fanions : bande rouge à gauche, comme le ruban d'un blason. */
.club {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--marine); color: #fff; border-radius: var(--rayon); padding: 18px 18px 18px 26px; text-decoration: none;
}
.club::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--rouge); }
.club::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, .06); pointer-events: none;
}
.club h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.2; }
.club p { margin: 3px 0 0; font-size: 14px; opacity: .85; }
.club .count { position: relative; font: 700 36px/1 var(--titre); text-align: right; font-variant-numeric: lining-nums; }
.club .count small { display: block; font: 600 12px/1.4 system-ui, -apple-system, sans-serif; opacity: .8; margin-top: 4px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action {
  display: flex; flex-direction: column; gap: 4px; background: var(--blanc); border: 1px solid var(--ligne);
  border-radius: var(--rayon-petit); padding: 14px; text-decoration: none; color: var(--marine); font-weight: 700; line-height: 1.25;
}
.action.main { grid-column: 1 / -1; background: var(--rouge); border-color: var(--rouge); color: #fff; }
.action.main span { color: rgba(255, 255, 255, .85); }
.action span { font-size: 13px; font-weight: 400; color: var(--doux); }
.action.off { opacity: .5; }

/* Formulaires et boutons */
.form { display: grid; gap: 6px; }
.form label { font-weight: 600; margin-top: 10px; }
input, select {
  font: inherit; font-size: 16px; width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--ligne); border-radius: var(--rayon-petit); background: var(--blanc); color: var(--encre);
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(17, 49, 80, .25); outline-offset: 1px; border-color: var(--marine); }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--marine); color: #fff; cursor: pointer; text-decoration: none; width: 100%;
  -webkit-tap-highlight-color: transparent;
}
button:active, .btn:active { filter: brightness(.9); }
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--rouge); outline-offset: 2px; border-radius: 6px; }
button.ghost, .btn.ghost { background: var(--blanc); color: var(--marine); border: 1px solid var(--ligne); }
button.danger { background: var(--rouge-clair); color: var(--rouge); }
.form button { margin-top: 16px; }
.helptext, .form ul { font-size: 13px; color: var(--doux); }
.errorlist { color: var(--rouge); }

/* Connexion */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding-top: 0; }
.login .logo { display: block; width: 120px; height: 120px; margin: 0 auto 12px; }
.login h1 { font-size: 34px; }
.login h1 { text-align: center; }
.login .lead { text-align: center; margin-bottom: 18px; }

/* Messages */
.notice { background: var(--marine-clair); color: var(--marine); padding: 12px 14px; border-radius: var(--rayon-petit); font-weight: 600; border-left: 4px solid currentColor; }
.notice.error, .error { background: var(--rouge-clair); color: var(--rouge); }
.notice.success { background: #e8f5e9; color: var(--ok); }
.error { padding: 10px 12px; border-radius: 10px; }

/* Annuaire */
.search { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 14px 0 6px; position: sticky; top: 61px; background: var(--fond); padding: 6px 0; z-index: 5; }
.list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--marine-clair); color: var(--marine);
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.person strong { display: block; line-height: 1.25; }
.person .muted { font-size: 14px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chips form { margin: 0; }
.chip {
  width: auto; min-height: 36px; padding: 0 14px; font-size: 13px; font-weight: 700; border-radius: 999px;
  background: var(--blanc); color: var(--marine); border: 1.5px solid var(--marine);
}
.chip.on { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.chip.on::before { content: "✓"; }
.sync { margin: 8px 0 0; }

@media (min-width: 700px) {
  .clubs { grid-template-columns: 1fr 1fr; }
  .search { grid-template-columns: 1fr 220px auto; }
  .search button { width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .chip, .action, .club { transition: transform .12s ease; }
  .chip:active, .action:active, .club:active { transform: scale(.97); }
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.center { text-align: center; }
.meeting { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; text-decoration: none; color: var(--encre); }
.meeting strong { display: block; }
.meeting .muted { display: block; }
.date { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 58px; border-radius: var(--rayon-petit); background: var(--marine); color: #fff; font-size: 12px; font-weight: 600; border-top: 5px solid var(--rouge); }
.date b { font: 700 24px/1 var(--titre); }
.meeting.past .date { background: var(--marine-clair); color: var(--marine); }
textarea { font: inherit; font-size: 16px; width: 100%; padding: 10px 14px; border: 1px solid var(--ligne); border-radius: 12px; }
.form > div { display: grid; gap: 6px; margin-top: 10px; }
.form > div > label { font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--blanc); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 10px; text-align: center; font-size: 13px; color: var(--doux); }
.stat b { display: block; font: 700 28px/1.2 var(--titre); color: var(--marine); }
.stat small { display: block; }
.stat.yes b { color: var(--ok); }
.stat.no b { color: var(--rouge); }
.chip.status-oui.on { background: var(--ok); border-color: var(--ok); }
.chip.status-attente.on { background: var(--doux); border-color: var(--doux); }
.respond .logo { display: block; margin: 8px auto 4px; }
.answer { display: grid; gap: 10px; margin: 16px 0 8px; }
.answer button { min-height: 56px; font-size: 18px; }
.answer .chosen { outline: 3px solid var(--rouge); outline-offset: 2px; }
.notice.warning { background: #fff4e5; color: #8a4b00; }
.logo-preview { display: flex; justify-content: center; }
.logo-preview img { width: 96px; height: 96px; object-fit: contain; border-radius: 50%; background: #fff; border: 1px solid var(--ligne); }
.club-logo { width: 48px; height: 48px; flex: none; object-fit: contain; border-radius: 50%; background: #fff; }
.club .who { display: flex; align-items: center; gap: 12px; }
.club-line { display: flex; align-items: center; gap: 12px; }
.club-line .club-logo { border: 1px solid var(--ligne); }
.club-logo-big { object-fit: contain; border-radius: 50%; background: #fff; border: 1px solid var(--ligne); }
.form ul#id_clubs, .form div#id_clubs { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.form input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; vertical-align: middle; margin-right: 8px; accent-color: var(--rouge); }
.nonfield, .form .errorlist.nonfield { background: var(--rouge-clair); padding: 10px 12px; border-radius: 10px; list-style: none; }
.thanks { padding-top: 40px; }
.thanks h1 { font-size: 36px; }
.big-answer { font-size: 20px; font-weight: 700; color: var(--marine); }
.name { color: var(--encre); text-decoration: none; }
.score { display: flex; align-items: center; gap: 16px; margin: 12px 0; }
.ring { width: 92px; height: 92px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--rouge) calc(var(--p) * 1%), var(--marine-clair) 0); }
.ring b { width: 70px; height: 70px; border-radius: 50%; background: var(--blanc); display: grid; place-items: center; font: 700 21px var(--titre); color: var(--marine); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; }
.bar { height: 10px; border-radius: 999px; background: var(--marine-clair); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; }
.bar i.good { background: var(--ok); }
.bar i.mid { background: #e8590c; }
.bar i.low { background: var(--rouge); }
.pct { text-align: right; color: var(--doux); }
.gap { display: grid; gap: 4px; text-decoration: none; color: var(--encre); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--rouge); background: var(--rouge-clair); padding: 3px 10px; border-radius: 999px; }
.doc { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: var(--encre); }
.doc strong, .doc .muted { display: block; }
.kind { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: var(--marine-clair); color: var(--marine); }
.kind.facture { background: var(--rouge-clair); color: var(--rouge); }
.amount { font: 700 17px var(--titre); color: var(--marine); white-space: nowrap; font-variant-numeric: tabular-nums; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.line strong, .line .muted { display: block; }
.line form { grid-column: 1 / -1; }
.totals { display: grid; gap: 6px; margin: 12px 0; }
.totals div { display: flex; justify-content: space-between; }
.totals .ttc { border-top: 1px solid var(--ligne); padding-top: 8px; font: 700 20px var(--titre); color: var(--marine); }
select[size] { min-height: 200px; padding: 6px; }
.free-line { margin-top: 10px; }
.free-line summary { cursor: pointer; font-weight: 600; color: var(--marine); }
.picks { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 2px; max-height: 55vh; overflow-y: auto; }
.picks label { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border-bottom: 1px solid var(--ligne); font-weight: 400; margin: 0; }
.pos { color: var(--ok) !important; }
.neg { color: var(--rouge) !important; }
/* Huit jeux de couleurs (Profil → Couleurs). */
[data-theme="foret"] { --marine: #1f4d2b; --marine-clair: #e6f0e8; --rouge: #c0582b; --rouge-clair: #fbece4; --fond: #f4f7f3; }
[data-theme="ocean"] { --marine: #0b4f7c; --marine-clair: #e3f0f9; --rouge: #e07a1f; --rouge-clair: #fdf0e3; --fond: #f3f8fb; }
[data-theme="prune"] { --marine: #4a1f5c; --marine-clair: #f0e7f4; --rouge: #c2186b; --rouge-clair: #fbe6f0; --fond: #f8f4f9; }
[data-theme="ardoise"] { --marine: #2f3a45; --marine-clair: #e9edf1; --rouge: #2a7de1; --rouge-clair: #e5f0fc; --fond: #f5f6f8; }
[data-theme="terracotta"] { --marine: #6b2e1f; --marine-clair: #f6ebe6; --rouge: #c9822b; --rouge-clair: #fbf1e3; --fond: #faf6f3; }
[data-theme="lagon"] { --marine: #0f5e5a; --marine-clair: #e2f3f1; --rouge: #e4573d; --rouge-clair: #fce9e5; --fond: #f2f8f7; }
[data-theme="nuit"] { --marine: #8fb4ff; --marine-clair: #1d2a40; --rouge: #ff7a7a; --rouge-clair: #3a2026; --fond: #0f1622; --blanc: #182235; --encre: #e6ecf5; --doux: #9fb0c6; --ligne: #2a3850; }
[data-theme="nuit"] .club, [data-theme="nuit"] .date, [data-theme="nuit"] .action.main, [data-theme="nuit"] .action.main span, [data-theme="nuit"] button:not(.ghost):not(.chip):not(.danger):not(.theme-pick), [data-theme="nuit"] .btn:not(.ghost) { color: #0f1622; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-pick { width: 100%; justify-content: flex-start; background: var(--blanc); color: var(--encre); border: 1.5px solid var(--ligne); font-weight: 600; margin: 0; }
.theme-pick.on { border-color: var(--rouge); outline: 2px solid var(--rouge); }
.swatches { display: inline-flex; gap: 3px; }
.swatches i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
[data-swatch="lt9"] .s1 { background: #113150; } [data-swatch="lt9"] .s2 { background: #b23235; } [data-swatch="lt9"] .s3 { background: #e7edf5; }
[data-swatch="foret"] .s1 { background: #1f4d2b; } [data-swatch="foret"] .s2 { background: #c0582b; } [data-swatch="foret"] .s3 { background: #e6f0e8; }
[data-swatch="ocean"] .s1 { background: #0b4f7c; } [data-swatch="ocean"] .s2 { background: #e07a1f; } [data-swatch="ocean"] .s3 { background: #e3f0f9; }
[data-swatch="prune"] .s1 { background: #4a1f5c; } [data-swatch="prune"] .s2 { background: #c2186b; } [data-swatch="prune"] .s3 { background: #f0e7f4; }
[data-swatch="ardoise"] .s1 { background: #2f3a45; } [data-swatch="ardoise"] .s2 { background: #2a7de1; } [data-swatch="ardoise"] .s3 { background: #e9edf1; }
[data-swatch="terracotta"] .s1 { background: #6b2e1f; } [data-swatch="terracotta"] .s2 { background: #c9822b; } [data-swatch="terracotta"] .s3 { background: #f6ebe6; }
[data-swatch="lagon"] .s1 { background: #0f5e5a; } [data-swatch="lagon"] .s2 { background: #e4573d; } [data-swatch="lagon"] .s3 { background: #e2f3f1; }
[data-swatch="nuit"] .s1 { background: #0f1622; } [data-swatch="nuit"] .s2 { background: #8fb4ff; } [data-swatch="nuit"] .s3 { background: #ff7a7a; }
.renewal { display: block; text-decoration: none; margin: 10px 0; }
.chip.status-non.on { background: var(--rouge); border-color: var(--rouge); }
.remove-link { display: inline-block; margin: 4px 0 0 6px; color: var(--rouge); }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; font: 600 19px var(--titre); color: var(--marine); }
.month-nav a { text-decoration: none; font-size: 28px; padding: 0 14px; color: var(--marine); }
.receipt-photo { display: block; width: 100%; max-height: 360px; object-fit: contain; border-radius: var(--rayon); background: var(--blanc); border: 1px solid var(--ligne); margin: 8px 0; }
.nophoto { color: var(--rouge); font-style: normal; font-weight: 700; }
.form > div[hidden] { display: none; }
.ai-filled { background: var(--marine-clair); border-color: var(--marine); }

/* Écrans vides : une phrase qui dit quoi faire. */
.empty { text-align: center; padding: 22px 16px; border-style: dashed; color: var(--doux); }
.empty a { font-weight: 700; }
/* Petit en-tête des écrans de réponse et de connexion. */
.respond h1 { font-size: 28px; }
.respond .muted.center { font-weight: 600; color: var(--rouge); margin-bottom: 0; }
.answer button:first-child { background: var(--rouge); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[data-theme="nuit"] .notice.warning { background: #3a2a12; color: #ffc77a; }
[data-theme="nuit"] .notice.success { background: #16301c; color: #8fdc9a; }
