/* Mon Cercle Asso — interface. Polices servies localement (Lato, licence OFL). */
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bleu: #17325c; --bleu-2: #21437a; --bleu-clair: #e7eef8;
  --accent: #E8743B; --accent-fonce: #b9531f;
  --fond: #f6f3ee; --carte: #ffffff; --ligne: #e4ddd2;
  --texte: #1d2530; --doux: #56606e; --vert: #1f7a4d; --vert-clair: #e3f3ea;
  --rouge: #b3261e; --rouge-clair: #fbe9e7; --jaune-clair: #fdf3dc; --jaune: #8a5a00;
  --rayon: 14px; --ombre: 0 1px 2px rgba(23,50,92,.06), 0 4px 14px rgba(23,50,92,.06);
  --lat: 268px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16.5px;
  line-height: 1.5; color: var(--texte); background: var(--fond); }
a { color: var(--bleu-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--bleu); }
h1 { font-size: 1.65rem; } h2 { font-size: 1.22rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.25em; }
.ic .plein, .ic circle.plein { fill: currentColor; stroke: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.evitement { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: .6em 1em; border-radius: 8px; }
.evitement:focus { left: 8px; }

/* -------- structure */
.entete { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem;
  padding-top: max(.55rem, env(safe-area-inset-top)); background: var(--bleu); color: #fff; }
.marque { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; min-width: 0; }
.marque-nom { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { border-radius: 10px; object-fit: contain; }
.entete-actions { margin-left: auto; display: flex; gap: .25rem; }
.bouton-icone { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 12px; color: #fff; }
.bouton-icone:hover { background: rgba(255,255,255,.12); }
.pastille { position: absolute; top: 4px; right: 3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; line-height: 19px; text-align: center; }
.puce-espace { font-size: .8rem; color: #fff; background: rgba(255,255,255,.16); padding: .25em .7em; border-radius: 99px; text-decoration: none; white-space: nowrap; }
.lateral { display: none; }
.contenu { padding: 1rem .9rem calc(90px + env(safe-area-inset-bottom)); max-width: 1180px; margin: 0 auto; outline: none; }
.bas { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--ligne); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(23,50,92,.07); }
.bas a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .55rem 0 .5rem; min-height: 60px;
  color: var(--doux); text-decoration: none; font-size: .78rem; font-weight: 700; }
.bas a .ic { width: 1.55em; height: 1.55em; }
.bas a[aria-current="page"] { color: var(--bleu); }
.bas a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bas .point { position: absolute; top: 9px; right: calc(50% - 16px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.onglets-espace { display: flex; gap: .4rem; overflow-x: auto; margin: -.2rem -.9rem 1rem; padding: 0 .9rem .2rem; scrollbar-width: none; }
.onglets-espace a { flex: none; padding: .5em .95em; border-radius: 99px; background: #fff; border: 1px solid var(--ligne);
  color: var(--bleu); text-decoration: none; font-weight: 700; font-size: .9rem; }
.onglets-espace a[aria-current="page"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }

@media (min-width: 900px) {
  .entete { display: none; }
  .bas { display: none; }
  .onglets-espace { display: none; }
  .lateral { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--lat); background: var(--bleu);
    color: #dfe7f3; padding: 1.1rem .8rem; overflow-y: auto; }
  .contenu { margin-left: var(--lat); padding: 1.8rem 2.2rem 3rem; max-width: calc(1180px + var(--lat)); }
  body { background: var(--fond); }
}
.marque-laterale { padding: .2rem .5rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: .8rem; color: #fff; }
.marque-laterale strong { display: block; font-size: 1.08rem; }
.marque-laterale small { display: block; color: #b8c6dc; font-size: .78rem; line-height: 1.3; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; align-items: center; gap: .7rem; padding: .62rem .75rem; margin: 1px 0; border-radius: 10px; color: #dfe7f3;
  text-decoration: none; font-weight: 700; font-size: .96rem; }
.menu a:hover { background: rgba(255,255,255,.08); color: #fff; }
.menu a[aria-current="page"], .menu a.actif { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.pastille-menu { margin-left: auto; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 .5em; font-size: .75rem; }
.menu-titre { margin: 1.2rem .75rem .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: #93a6c4; font-weight: 700; }
.sous-menu { list-style: none; margin: 0 0 .4rem 2.3rem; padding: 0; border-left: 1px solid rgba(255,255,255,.16); }
.sous-menu a { padding: .38rem .7rem; font-weight: 400; font-size: .9rem; }
.sous-menu a[aria-current="page"] { box-shadow: none; background: none; color: #fff; font-weight: 700; }
.deconnexion { margin-top: auto; display: flex; align-items: center; gap: .55rem; padding: .9rem .5rem 0; border-top: 1px solid rgba(255,255,255,.12); }
.deconnexion .qui { font-size: .88rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deconnexion .lien { color: #b8c6dc; font-size: .8rem; }
.avatar { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .85rem; flex: none; }

/* -------- éléments */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.1rem 1.15rem; margin-bottom: 1rem; border: 1px solid #ece6dc; }
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }
.titre-page { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1.1rem; }
.titre-page h1 { margin: 0; flex: 1 1 auto; }
.surtitre { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-fonce); margin-bottom: .25rem; }
.doux { color: var(--doux); }
.petit { font-size: .88rem; }
.grille { display: grid; gap: 1rem; }
@media (min-width: 900px) { .grille-2 { grid-template-columns: 1fr 1fr; } .grille-3 { grid-template-columns: repeat(3, 1fr); } .grille-2-1 { grid-template-columns: 2fr 1fr; } }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem 0; border-top: 1px solid var(--ligne); }
.liste > li:first-child { border-top: 0; padding-top: .2rem; }
.liste .corps { flex: 1; min-width: 0; }
.liste .corps > a { font-weight: 700; text-decoration: none; color: var(--bleu); }
.liste .corps > a:hover { text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; color: var(--doux); font-size: .88rem; margin-top: .15rem; }
.meta span { display: inline-flex; align-items: center; gap: .3rem; }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .65em 1.15em;
  border-radius: 12px; border: 1.5px solid var(--bleu); background: #fff; color: var(--bleu); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center; }
.bouton:hover { background: var(--bleu-clair); }
.bouton-principal { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton-principal:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); }
.bouton-bleu { background: var(--bleu); color: #fff; }
.bouton-bleu:hover { background: var(--bleu-2); }
.bouton-danger { border-color: var(--rouge); color: var(--rouge); }
.bouton-petit { min-height: 40px; padding: .4em .85em; font-size: .92rem; border-radius: 10px; }
.bouton[disabled], .bouton.en-cours { opacity: .65; cursor: progress; }
.lien { background: none; border: 0; padding: 0; font: inherit; color: var(--bleu-2); text-decoration: underline; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .8rem; }
.actions-doubles { display: grid; gap: .7rem; }
@media (min-width: 600px) { .actions-doubles { grid-template-columns: 1fr 1fr; } }
.action-explicite { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem; border-radius: 12px; border: 1.5px solid var(--ligne);
  background: #fff; text-decoration: none; color: var(--texte); }
.action-explicite:hover { border-color: var(--bleu); }
.action-explicite strong { display: block; color: var(--bleu); font-size: 1.02rem; }
.action-explicite .ic { width: 1.7em; height: 1.7em; color: var(--accent-fonce); margin-top: .1rem; }

/* prochaine activité */
.prochaine { background: linear-gradient(135deg, var(--bleu) 0%, #2a5194 100%); color: #fff; border: 0; padding: 1.3rem 1.25rem; }
.prochaine h2 { color: #fff; font-size: 1.45rem; margin: .1rem 0 .55rem; }
.prochaine .surtitre { color: #ffd2b8; }
.prochaine .meta { color: #dce6f5; font-size: .98rem; gap: .35rem 1.2rem; }
.rsvp { display: grid; grid-template-columns: 1fr; gap: .55rem; margin-top: 1.1rem; }
@media (min-width: 560px) { .rsvp { grid-template-columns: repeat(3, 1fr); } }
.rsvp button { min-height: 52px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; border: 2px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.rsvp button:hover { background: rgba(255,255,255,.18); }
.rsvp button[aria-pressed="true"] { background: #fff; color: var(--bleu); border-color: #fff; }
.rsvp button.oui[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.carte:not(.prochaine) .rsvp button { border-color: var(--bleu); color: var(--bleu); background: #fff; }
.carte:not(.prochaine) .rsvp button[aria-pressed="true"] { background: var(--bleu); color: #fff; }
.carte:not(.prochaine) .rsvp button.oui[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); }
.reponse-actuelle { margin: .7rem 0 0; font-size: .92rem; color: #dce6f5; }

.date-bloc { flex: none; width: 54px; text-align: center; border-radius: 12px; background: var(--bleu-clair); color: var(--bleu); padding: .35rem 0; line-height: 1.1; }
.date-bloc b { display: block; font-size: 1.35rem; }
.date-bloc small { font-size: .72rem; text-transform: uppercase; font-weight: 700; }

/* visibilité */
.vis { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; padding: .22em .7em; border-radius: 99px; line-height: 1.35; }
.vis::before { content: ""; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }
.vis-prive { background: #eceae6; color: #4a4f57; }
.vis-partage { background: var(--bleu-clair); color: var(--bleu); }
.vis-tous { background: var(--vert-clair); color: var(--vert); }
.vis-retiree { background: var(--rouge-clair); color: var(--rouge); }
.etiquette { display: inline-block; font-size: .76rem; font-weight: 700; padding: .15em .6em; border-radius: 6px; background: #f0ebe3; color: #5d503d; }
.etiquette-importante { background: #fde4d6; color: var(--accent-fonce); }
.etiquette-ok { background: var(--vert-clair); color: var(--vert); }
.etiquette-alerte { background: var(--rouge-clair); color: var(--rouge); }
.etiquette-attente { background: var(--jaune-clair); color: var(--jaune); }

/* messages et états */
.messages:empty { display: none; }
.message { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 12px; margin-bottom: .8rem; font-weight: 700; }
.message span { flex: 1; }
.message-success { background: var(--vert-clair); color: #155b39; }
.message-error, .message-warning { background: var(--rouge-clair); color: #8c1d16; }
.message-info { background: var(--bleu-clair); color: var(--bleu); }
.fermer { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: inherit; cursor: pointer; min-width: 32px; min-height: 32px; }
.vide { text-align: center; padding: 1.5rem 1rem; color: var(--doux); }
.vide .ic { width: 2.4rem; height: 2.4rem; color: #b6ab99; display: block; margin: 0 auto .5rem; }
.vide p { margin: 0 0 .6rem; }
.bandeau-reseau { position: sticky; top: 0; z-index: 50; display: flex; gap: .6rem; align-items: center; padding: .7rem 1rem;
  background: #fde4d6; color: #7a3410; font-weight: 700; }
.bandeau-reseau[hidden] { display: none; }
.barre-chargement { position: fixed; z-index: 60; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); transition: width 8s cubic-bezier(.1,.7,.3,1); }
body.charge .barre-chargement { width: 85%; }
.encadre { border-radius: 12px; padding: .9rem 1rem; background: var(--bleu-clair); color: var(--bleu); margin-bottom: 1rem; }
.encadre-alerte { background: var(--jaune-clair); color: #6b4700; }
.encadre-prive { background: #f1eee9; color: #4a4f57; }

/* formulaires */
.formulaire { display: grid; gap: 1rem; }
.champ-bloc label, .legende { display: block; font-weight: 700; margin-bottom: .35rem; }
.champ, .champ-bloc input:not([type=checkbox]):not([type=radio]), .champ-bloc select, .champ-bloc textarea {
  width: 100%; min-height: 48px; padding: .65em .8em; border: 1.5px solid #cfc6b8; border-radius: 10px; background: #fff; font: inherit; color: var(--texte); }
textarea.champ { min-height: 110px; resize: vertical; }
input[type=color].champ { padding: .3em; height: 48px; max-width: 120px; }
.champ:focus { border-color: var(--bleu-2); outline: 3px solid rgba(33,67,122,.18); }
.aide { color: var(--doux); font-size: .86rem; margin-top: .3rem; }
.erreur-champ { color: var(--rouge); font-weight: 700; font-size: .9rem; margin-top: .3rem; }
.champ-bloc.en-erreur .champ { border-color: var(--rouge); background: #fffafa; }
.erreurs-form { background: var(--rouge-clair); color: #8c1d16; border-radius: 12px; padding: .8rem 1rem; font-weight: 700; }
.erreurs-form ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.choix-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.choix-liste label, label.case { display: flex; gap: .65rem; align-items: center; min-height: 46px; padding: .45rem .75rem; border: 1.5px solid var(--ligne);
  border-radius: 10px; background: #fff; font-weight: 400; cursor: pointer; margin: 0; }
.choix-liste input, label.case input { width: 22px; height: 22px; accent-color: var(--bleu); flex: none; }
label.case:has(input:checked) { border-color: var(--bleu); background: var(--bleu-clair); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }

/* tableaux larges et lignes empilées sur mobile */
.tableau-conteneur { overflow: visible; }
table.tableau { width: 100%; border-collapse: collapse; background: #fff; }
.tableau th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); padding: .6rem .7rem; border-bottom: 2px solid var(--ligne); }
.tableau td { padding: .7rem; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau tr:hover td { background: #fbf9f5; }
.tableau .nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recette { color: var(--vert); font-weight: 700; } .depense { color: var(--rouge); font-weight: 700; }
@media (max-width: 899px) {
  table.empilable, .empilable tbody, .empilable tr, .empilable td { display: block; width: 100%; }
  .empilable thead { display: none; }
  .empilable tr { display: flex; flex-direction: column; border: 1px solid var(--ligne); border-radius: 12px; margin-bottom: .7rem; padding: .55rem .8rem; background: #fff; }
  .empilable td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .empilable td::before { content: attr(data-label); font-weight: 700; color: var(--doux); text-align: left; font-size: .86rem; }
  .empilable td.principal { order: -1; display: block; text-align: left; font-weight: 700; font-size: 1.02rem; padding-bottom: .35rem; }
  .empilable td.principal::before { content: none; }
  .empilable .nombre { text-align: right; }
}
.chiffres { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffre { background: #fff; border: 1px solid var(--ligne); border-radius: 12px; padding: .85rem .95rem; }
.chiffre small { display: block; color: var(--doux); font-weight: 700; font-size: .82rem; }
.chiffre b { display: block; font-size: 1.35rem; color: var(--bleu); font-variant-numeric: tabular-nums; margin-top: .15rem; }
.jauge { height: 10px; border-radius: 6px; background: #ece6dc; overflow: hidden; margin-top: .6rem; }
.jauge i { display: block; height: 100%; background: var(--vert); border-radius: 6px; }
.filtres { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; margin-bottom: 1rem; }
.filtres label { font-size: .82rem; font-weight: 700; color: var(--doux); display: block; margin-bottom: .2rem; }

.texte-publication { white-space: pre-line; font-size: 1.02rem; }
.piece { display: flex; gap: .7rem; align-items: center; padding: .65rem .8rem; border: 1px solid var(--ligne); border-radius: 10px; background: #fff; margin-bottom: .45rem; text-decoration: none; color: var(--texte); }
.piece:hover { border-color: var(--bleu); }
.piece .nomf { flex: 1; min-width: 0; font-weight: 700; color: var(--bleu); overflow-wrap: anywhere; }
.commentaire { padding: .75rem 0; border-top: 1px solid var(--ligne); }
.commentaire .qui { font-weight: 700; }
.etapes { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 0; list-style: none; counter-reset: e; }
.etapes li { counter-increment: e; padding: .35em .8em; border-radius: 99px; background: #fff; border: 1px solid var(--ligne); font-size: .86rem; font-weight: 700; color: var(--doux); }
.etapes li::before { content: counter(e) ". "; }
.etapes li[aria-current="step"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.apercu-adherent { border: 3px dashed var(--accent); border-radius: 18px; padding: .8rem; background: var(--fond); }
.apercu-adherent > .bandeau { font-weight: 700; color: var(--accent-fonce); margin-bottom: .6rem; display: flex; gap: .4rem; align-items: center; }
.espaces-choix { display: grid; gap: .8rem; }
@media (min-width: 700px) { .espaces-choix { grid-template-columns: repeat(2, 1fr); } }
.espace-carte { display: flex; gap: 1rem; align-items: center; padding: 1.1rem; border-radius: var(--rayon); background: #fff; border: 1.5px solid var(--ligne); text-decoration: none; color: var(--texte); min-height: 84px; }
.espace-carte:hover { border-color: var(--bleu); box-shadow: var(--ombre); }
.espace-carte .ic { width: 2.2rem; height: 2.2rem; color: var(--bleu); }
.espace-carte strong { display: block; color: var(--bleu); font-size: 1.08rem; }
.page-publique { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; background: linear-gradient(160deg, var(--bleu) 0%, #2a5194 55%, var(--fond) 55.1%); }
.page-publique .contenu { margin: 0; padding: 0; width: 100%; max-width: 440px; }
.page-publique .carte { padding: 1.6rem 1.4rem; }
.page-publique .marque-centre { text-align: center; color: #fff; margin-bottom: 1.1rem; }
.page-publique .marque-centre img { width: 72px; height: 72px; border-radius: 18px; background: #fff; }
.page-publique .marque-centre h1 { color: #fff; margin: .5rem 0 .1rem; }
.page-publique .marque-centre p { color: #d5e0f1; margin: 0; }
.bienvenue { border-left: 5px solid var(--accent); }
.reperes { display: grid; gap: .55rem; margin: .7rem 0 .4rem; padding: 0; list-style: none; }
@media (min-width: 700px) { .reperes { grid-template-columns: repeat(4, 1fr); } }
.reperes li { display: flex; gap: .55rem; align-items: flex-start; background: var(--fond); border-radius: 10px; padding: .6rem .7rem; font-size: .92rem; }
.reperes .ic { color: var(--accent-fonce); margin-top: .1rem; }
.resume-dest { max-height: 220px; overflow: auto; }
details > summary { cursor: pointer; font-weight: 700; color: var(--bleu-2); min-height: 40px; display: flex; align-items: center; }
.separateur { height: 1px; background: var(--ligne); margin: 1rem 0; border: 0; }
@media print { .lateral, .bas, .entete, .actions, .onglets-espace { display: none !important; } .contenu { margin: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
