/* Nouveau site Amicale HEO, sur le modèle de l'appli : mêmes jetons que app/src/theme/colors.ts.
   Ordinateur : navigation en haut, contenu en deux colonnes. Téléphone : onglets en bas, comme l'appli.
   Maquette validée : docs/design/site/index.html */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(../fonts/Inter_400Regular.ttf) format('truetype') }
@font-face { font-family: 'Inter'; font-weight: 500; font-display: swap; src: url(../fonts/Inter_500Medium.ttf) format('truetype') }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(../fonts/Inter_600SemiBold.ttf) format('truetype') }
@font-face { font-family: 'Outfit'; font-weight: 600; font-display: swap; src: url(../fonts/Outfit_600SemiBold.ttf) format('truetype') }
@font-face { font-family: 'Outfit'; font-weight: 700; font-display: swap; src: url(../fonts/Outfit_700Bold.ttf) format('truetype') }

:root {
  --fond: #FBF7F8; --surface: #FFFFFF; --surface2: #F5EDF1; --texte: #241A22; --doux: #64545F; --trait: #E7DCE2;
  --primaire: #C23F5B; --sur-primaire: #FFFFFF; --accent: #7E4475; --accent-doux: #F7E3EA;
  --succes: #1F7A4D; --succes-doux: #DDF2E6; --alerte: #8A5300; --alerte-doux: #FBEBD3;
  --danger: #B3261E; --carte-adherent: #B8364F;
  --titre: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --police: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --rayon: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #151017; --surface: #211A24; --surface2: #2B2230; --texte: #F5EDF2; --doux: #BBA9B6; --trait: #3A2F3F;
    --primaire: #F28A9C; --sur-primaire: #2A0D16; --accent: #D9A4CF; --accent-doux: #3B2433;
    --succes: #7FD6A6; --succes-doux: #1D3328; --alerte: #F2C27B; --alerte-doux: #3A2C17; --danger: #F2B8B5;
    color-scheme: dark;
  }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 var(--police); min-height: 100vh; display: flex; flex-direction: column }
h1, h2, h3 { font-family: var(--titre); margin: 0; text-wrap: balance; line-height: 1.2 }
h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700 }
h2 { font-size: 20px; font-weight: 600 }
h3 { font-size: 16px; font-weight: 600 }
p { margin: 0 }
a { color: var(--primaire) }
img { max-width: 100% }
.ic { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0 }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px }
.evitement { position: absolute; left: -9999px }
.evitement:focus { left: 16px; top: 16px; z-index: 20; background: var(--surface); padding: 8px 12px }

.gouttiere { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.centre { max-width: 1080px; margin: 0 auto; width: 100% }

/* En-tête et navigation */
.entete { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--trait); padding-top: env(safe-area-inset-top, 0px) }
.entete .centre { display: flex; align-items: center; gap: 20px; height: 64px }
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 700; font-size: 19px; color: var(--texte); text-decoration: none; white-space: nowrap }
.marque img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover }
.liens { display: flex; gap: 4px; flex: 1 }
.liens a, .onglets a { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--doux); font-weight: 500; padding: 8px 12px; border-radius: 12px }
.liens a:hover { background: var(--surface2) }
.liens a[aria-current="page"] { color: var(--primaire); background: var(--accent-doux) }
.profil { display: flex; align-items: center; gap: 10px; color: var(--texte); text-decoration: none; font-weight: 500; margin-left: auto }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-doux); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 14px }
.icone-bouton { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--doux) }
.icone-bouton:hover { background: var(--surface2); color: var(--texte) }
.onglets { display: none }

main { flex: 1; padding-block: 28px 48px }
.pied { border-top: 1px solid var(--trait); padding-block: 20px; color: var(--doux); font-size: 13px }
.pied .centre { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap }
.pied nav { display: flex; gap: 16px; flex-wrap: wrap }
.pied a { color: var(--doux) }

/* Composants communs */
.page { display: flex; flex-direction: column; gap: 24px }
.grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start }
.pile { display: flex; flex-direction: column; gap: 16px; min-width: 0 }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon) }
.carte.remplie { padding: 18px; display: flex; flex-direction: column; gap: 12px }
.section-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px }
.section-titre > span { color: var(--doux); font-size: 14px }
.section-titre.annee { padding-top: 18px; border-top: 2px solid var(--trait); flex-wrap: wrap; row-gap: 2px }
.section-titre.annee > span { white-space: nowrap }
.section-titre.annee.premiere { padding-top: 0; border-top: 0 }
.adhesions-annee { display: flex; align-items: center; gap: 6px; margin: 2px 0 8px }
[hidden] { display: none !important }
.doux { color: var(--doux) }
.petit { font-size: 13px }
.texte-long { white-space: pre-line; max-width: 68ch }
.vide { padding: 18px; color: var(--doux) }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; font: 600 15px var(--police); cursor: pointer; text-decoration: none; background: var(--primaire); color: var(--sur-primaire); text-align: center }
.bouton:hover { filter: brightness(1.06) }
.bouton.secondaire { background: var(--surface2); color: var(--texte) }
.bouton.contour { background: transparent; color: var(--primaire); border: 1.5px solid var(--primaire) }
.bouton.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger) }
.bouton.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 999px; font-weight: 500; min-width: 260px }
.bouton.petit { min-height: 40px; padding: 0 16px; font-size: 14px }
.bouton[disabled] { opacity: .5; cursor: default }
.boutons { display: flex; gap: 10px; flex-wrap: wrap }
.boutons > * { flex: 1 1 180px }
form.en-ligne { display: contents }

.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface2); color: var(--doux); white-space: nowrap; align-self: flex-start }
.pastille.succes { background: var(--succes-doux); color: var(--succes) }
.pastille.alerte { background: var(--alerte-doux); color: var(--alerte) }
.pastille.accent { background: var(--accent-doux); color: var(--accent) }

.bandeau { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; margin-bottom: 20px; background: var(--succes-doux); color: var(--succes); font-weight: 500 }
.bandeau.alerte { background: var(--alerte-doux); color: var(--alerte) }
.page .bandeau { margin-bottom: 0 }

.badge-date { width: 58px; flex-shrink: 0; border-radius: 14px; background: var(--accent-doux); color: var(--accent); text-align: center; padding-block: 8px; font-family: var(--titre) }
.badge-date b { display: block; font-size: 22px; line-height: 1 }
.badge-date span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600 }
.ligne { display: flex; align-items: center; gap: 14px; padding: 14px; text-decoration: none; color: inherit }
.ligne + .ligne { border-top: 1px solid var(--trait) }
.ligne .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.ligne .corps b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
a.ligne:hover { background: var(--surface2) }
a.ligne > .ic:last-child { color: var(--doux) }
.carte > .ligne:first-child { border-radius: var(--rayon) var(--rayon) 0 0 }
.carte > .ligne:last-child { border-radius: 0 0 var(--rayon) var(--rayon) }
.info { display: flex; align-items: center; gap: 10px }
.info .ic { color: var(--primaire) }

.segmente { display: inline-flex; background: var(--surface2); border-radius: 14px; padding: 4px; gap: 4px; align-self: flex-start }
.segmente a { padding: 8px 16px; border-radius: 10px; text-decoration: none; color: var(--doux); font-weight: 600 }
.segmente a[aria-current="page"] { background: var(--surface); color: var(--texte) }

/* Formulaires */
.champ { display: flex; flex-direction: column; gap: 6px }
.champ label { font-weight: 600 }
.champ input, .champ textarea, .champ select { min-height: 48px; border: 1px solid var(--trait); border-radius: 14px; padding: 10px 14px; background: var(--surface); color: var(--texte); font: 16px var(--police); width: 100% }
.champ textarea { min-height: 96px; resize: vertical }
.champ input:focus, .champ textarea:focus { border-color: var(--primaire); outline: none }
.champs-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.case { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0 }
.case input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primaire); flex-shrink: 0 }

/* Accueil */
.bienvenue { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap }
.carte-adherent { border-radius: 20px; background: var(--carte-adherent); color: #FFFFFF; padding: 20px; display: flex; flex-direction: column; gap: 18px; min-height: 190px; justify-content: space-between; text-decoration: none }
.carte-adherent .haut { display: flex; justify-content: space-between; align-items: center; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600 }
.carte-adherent .nom { font-family: var(--titre); font-size: 24px; font-weight: 700 }
.carte-adherent .bas { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; opacity: .92 }
.a-la-une { display: grid; grid-template-columns: 220px minmax(0, 1fr); overflow: hidden }
.affiche { background: linear-gradient(150deg, var(--accent-doux), var(--surface2)); color: var(--accent); display: grid; place-items: center; min-height: 200px; position: relative }
.affiche img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.a-la-une .corps { padding: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0 }
.resume { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px }
.raccourcis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px }
.raccourci { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-decoration: none; color: inherit }
.raccourci .ic { color: var(--primaire) }
.raccourci:hover { border-color: var(--primaire) }

/* Évènement */
.retour { display: inline-flex; align-items: center; gap: 6px; color: var(--doux); text-decoration: none; font-weight: 500; align-self: flex-start }
.couverture { border-radius: 20px; overflow: hidden; background: linear-gradient(135deg, var(--accent-doux), var(--surface2)); color: var(--accent); display: grid; place-items: center; min-height: 200px }
.couverture img { display: block; width: 100%; max-height: 480px; object-fit: cover }
.action { padding: 16px; display: flex; flex-direction: column; gap: 10px }
.action + .action { border-top: 1px solid var(--trait) }
.action .boutons > * { flex: 0 1 auto }
.ligne .pastille { align-self: center }
.action .tete { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap }
.personnes { display: flex; flex-direction: column; background: var(--surface2); border-radius: 12px; font-size: 14px }
.personne { display: flex; gap: 10px; align-items: center; padding: 10px 12px }
.personne + .personne { border-top: 1px solid var(--trait) }
.personne .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px }
.inscription { position: sticky; top: calc(84px + env(safe-area-inset-top, 0px)) }
.compteur { font-family: var(--titre); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums }
.lien-inscrits { color: inherit; text-decoration: none; display: inline-block; border-radius: 8px }
.lien-inscrits .doux { text-decoration: underline; text-underline-offset: 3px }
.lien-inscrits:hover .doux, .lien-inscrits:focus-visible .doux { color: var(--primaire) }
#inscrits { scroll-margin-top: calc(84px + env(safe-area-inset-top, 0px)) }
html { scroll-behavior: smooth }
.inscrits { columns: 2; column-gap: 16px; padding: 0; margin: 0; list-style: none; font-size: 14px }
.inscrits li { padding: 4px 0; break-inside: avoid }

/* Téléphone */
@media (max-width: 760px) {
  .liens, .profil .nom { display: none }
  .entete .centre { height: 56px; gap: 8px }
  main { padding-block: 20px 32px }
  .pied { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) }
  .grille, .a-la-une { grid-template-columns: minmax(0, 1fr) }
  .affiche { min-height: 150px }
  .inscription { position: static }
  .grille > aside { order: -1 }
  .action .boutons > * { flex: 1 1 180px }
  .champs-2 { grid-template-columns: minmax(0, 1fr) }
  .inscrits { columns: 1 }
  .onglets { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--trait);
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)) }
  .onglets a { flex: 1; flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px }
  .onglets a[aria-current="page"] { color: var(--primaire) }
}
@media print { .entete, .onglets, .pied { display: none } }

/* Galerie */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px }
.album { overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column }
.album:hover { border-color: var(--primaire) }
.vignette { aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface2) }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block }
.album .corps { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px }
.photo { padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; max-width: 100%; background: var(--surface2); cursor: zoom-in }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block }
.visionneuse { position: fixed; inset: 0; z-index: 30; background: rgba(12, 8, 12, .94); display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)) }
.visionneuse[hidden] { display: none }
.visionneuse figure { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px }
.visionneuse img { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; border-radius: 8px }
.visionneuse figcaption { color: #F5EDF2; font-size: 14px; text-align: center }
.visionneuse button { background: rgba(255, 255, 255, .12); color: #FFFFFF; border: 0; border-radius: 50%; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0 }
.v-fermer { position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)) }
@media (max-width: 760px) {
  .albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .photos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px }
  .photo { border-radius: 6px }
  .v-nav { display: none !important }
}

/* Choix en cartes (tarif, paiement) : un bouton radio par carte */
.choix { display: grid; gap: 10px }
.choix.deux { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.choix label { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--trait); border-radius: 14px; background: var(--surface); cursor: pointer }
.choix label:has(input:checked) { border-color: var(--primaire); box-shadow: inset 0 0 0 1px var(--primaire) }
.choix input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--primaire); flex-shrink: 0 }
.choix .corps { display: flex; flex-direction: column; gap: 2px; min-width: 0 }
.choix .detail { display: none; white-space: pre-line }
.choix label:has(input:checked) .detail { display: block }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px }
legend { font-weight: 600; padding: 0; margin-bottom: 8px }

/* Bureau */
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.chiffre { padding: 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit }
.chiffre b { font-family: var(--titre); font-size: 28px; line-height: 1.1 }
a.chiffre:hover { border-color: var(--primaire) }
.icone-rond { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-doux); color: var(--accent); display: grid; place-items: center; flex-shrink: 0 }
.recherche { display: flex; align-items: center; gap: 10px; border: 1px solid var(--trait); border-radius: 14px; padding: 0 14px; background: var(--surface); min-height: 50px }
.recherche input { flex: 1; border: 0; background: none; color: var(--texte); font: 16px var(--police); min-width: 0; min-height: 48px }
.recherche input:focus { outline: none }
.segmente.large { flex-wrap: wrap }
details.adherent > summary { list-style: none; cursor: pointer }
details.adherent > summary::-webkit-details-marker { display: none }
details.adherent[open] > summary { border-bottom: 1px solid var(--trait) }
.edition { padding: 16px; display: flex; flex-direction: column; gap: 16px }
.radios { display: flex; flex-wrap: wrap; gap: 8px }
.radios label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--trait); border-radius: 999px; cursor: pointer; background: var(--surface) }
.radios label:has(input:checked) { border-color: var(--primaire); background: var(--accent-doux); color: var(--texte) }
.radios input { accent-color: var(--primaire) }
@media (max-width: 760px) { .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)) } .chiffres > :last-child { grid-column: 1 / -1 } }
.actions-evenement { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 14px }
.apercu-affiche { width: 100%; max-width: 360px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 1px solid var(--trait) }
.photos-bureau { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px }
.photos-bureau figure { margin: 0; display: flex; flex-direction: column; gap: 6px }
.photos-bureau img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface2) }
.photos-bureau figcaption { font-size: 13px; color: var(--doux) }
.restitution { display: grid; grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) minmax(120px, 1fr); gap: 12px; align-items: end; padding-top: 12px; border-top: 1px solid var(--trait) }
.petite-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap }
.lien-danger { background: none; border: 0; color: var(--danger); font: 600 14px var(--police); cursor: pointer; padding: 4px 0 }
details.plier > summary { cursor: pointer; color: var(--primaire); font-weight: 600 }
.totaux { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px }
@media (max-width: 760px) { .restitution { grid-template-columns: 1fr 1fr } .restitution .case { grid-column: 1 / -1 } .totaux { grid-template-columns: 1fr 1fr } }
.bienvenue .boutons { flex: 0 1 auto } .bienvenue .boutons > * { flex: 0 0 auto }
.operation .montant { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; text-align: right }
.operation .montant .pastille { align-self: flex-end }
.plus { color: var(--succes) } .moins { color: var(--danger) }
.icone-rond.plus { background: var(--succes-doux); color: var(--succes) } .icone-rond.moins { background: var(--alerte-doux); color: var(--danger) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* Journal des modifications : avant / après de chaque champ */
.tableau-journal { width: 100%; border-collapse: collapse; font-size: .9rem; table-layout: fixed }
.tableau-journal th, .tableau-journal td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--trait); overflow-wrap: anywhere }
.tableau-journal th { font-weight: 600; color: var(--doux) }
.tableau-journal td:first-child { width: 30%; font-family: ui-monospace, monospace; font-size: .85rem }
.journal .corps b { white-space: normal }
@media (max-width: 600px) { .journal .operation .montant { display: none } }

/* Évènements « En projet : date à préciser », sous l'agenda à venir */
.projets { border-top: 2px dashed var(--trait); padding-top: 20px; margin-top: 8px }
.en-projet .corps b, .en-projet .corps span, .bandeau-projet { font-style: italic }
.mois-projet { padding: 8px 16px 4px; border-top: 1px solid var(--trait); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); font-style: italic }
.mois-projet:first-child { border-top: 0 }
.affiche-mini { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--accent-doux) }

/* Explication de l'ajout à l'écran d'accueil (iPhone) */
.aide-ecran { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 8px 12px 12px }
.aide-ecran[hidden] { display: none }
.aide-ecran img { border-radius: 10px; flex-shrink: 0 }
.aide-ecran button { border: 0; background: none; color: var(--doux); padding: 6px; cursor: pointer; flex-shrink: 0 }
.aide-ecran p { flex: 1; font-size: 14px; line-height: 1.4 }
.aide-ecran p .ic { vertical-align: -3px; color: var(--primaire) }
