/* Espace adhérent CPGA, charte alignée sur cpga-asso.com.
   Public plutôt âgé et non technique : texte grand, contrastes forts,
   gros boutons, aucune dépendance à JavaScript. */

:root {
  --brand: #1e3a6b;
  --brand-hi: #2b4f8e;
  --paper: #f4f2ee;
  --card: #ffffff;
  --line: #e4e0d8;
  --ink: #211f1c;
  --ink-2: #4d4941;
  --ink-3: #6f6a62;
  --ok: #1e6b3a;
  --ok-bg: #eaf5ee;
  --err: #a8322b;
  --err-bg: #faeeed;
  --warn-bg: #fdf6e3;
  --warn: #8a6d1a;
}

/* Marque de l'APGA (classe posée sur <body> selon le domaine appelé).
   Couleur provisoire, à aligner sur apga-asso.com. */
body.entite-APGA {
  --brand: #2e5e4e;
  --brand-hi: #3c7a66;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--brand); }

.entete {
  background: var(--brand);
  color: #fff;
  padding: 14px 0;
}
.entete .interieur {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.entete .logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  text-decoration: none;
}
.entete .sous-titre { font-size: 14px; opacity: 0.85; }
.entete form { margin: 0; }

.page {
  max-width: 720px;
  margin: 28px auto 60px;
  padding: 0 16px;
}
.page.etroite { max-width: 480px; }

h1 { font-size: 26px; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 26px 0 10px; }

.carte {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 18px;
}

.champ { margin-bottom: 18px; }
.champ label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.champ .aide {
  font-size: 14.5px;
  color: var(--ink-3);
  margin-top: 5px;
}
.champ input {
  width: 100%;
  font-size: 18px;
  padding: 12px 14px;
  border: 1px solid #c9c4ba;
  border-radius: 8px;
  background: #fdfcfa;
}
.champ input:focus {
  outline: 3px solid rgba(43, 79, 142, 0.35);
  border-color: var(--brand);
}

.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 600;
  padding: 13px 26px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-hi); }
.btn.large { width: 100%; }
.btn.secondaire {
  background: #fff;
  color: var(--ink);
  border: 1px solid #c9c4ba;
  font-weight: 500;
}
.btn.secondaire:hover { background: #f7f5f1; }
.btn.discret {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 15px;
  padding: 8px 14px;
}
.btn.discret:hover { background: rgba(255, 255, 255, 0.12); }

/* Plusieurs actions à la suite : jamais collées, et empilées sur mobile. */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.actions form { margin: 0; }
.actions .btn { flex: 0 1 auto; }

/* Action secondaire : présentée comme une pastille cliquable plutôt qu'un
   lien souligné au fil du texte, plus facile à viser pour un public âgé. */
.lien-bouton,
.liens-secondaires a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 18px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.lien-bouton:hover,
.liens-secondaires a:hover {
  border-color: var(--brand);
  background: #f7f9fd;
}
.lien-bouton:focus-visible,
.liens-secondaires a:focus-visible { outline: 3px solid rgba(43, 79, 142, 0.35); }
.lien-bouton.petit { font-size: 14.5px; padding: 5px 13px; }

.message-erreur {
  background: var(--err-bg);
  border: 1px solid var(--err);
  color: var(--err);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.message-ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok);
  color: var(--ok);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.message-attente {
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.liens-secondaires {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* Le lien d'aide sous un champ (« je réside à l'étranger ») respire sous
   l'explication qui le précède ; teinté pour ne pas se confondre avec la
   saisie blanche juste au-dessus. */
.champ .aide .lien-bouton {
  margin-top: 8px;
  background: #f3f6fc;
  border-color: #d6dfef;
}
.champ .aide .lien-bouton:hover { background: #e9effa; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Choix du moyen de connexion : un gros bouton par canal */
.canaux form { margin: 0 0 12px; }
.canal {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  background: var(--card);
  border: 1px solid #c9c4ba;
  border-radius: 12px;
  padding: 16px 18px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}
.canal:hover { border-color: var(--brand); background: #f7f9fd; }
.canal:disabled { cursor: not-allowed; opacity: 0.65; background: #f3f1ed; }
.canal .canal-libelle { font-weight: 700; font-size: 18px; }
.canal .canal-valeur { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15.5px; color: var(--ink-2); }
.canal .canal-note { font-size: 14.5px; color: var(--ink-3); }

/* Cotisations */
.cotisation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.cotisation:first-of-type { border-top: 0; padding-top: 0; }
.cotisation .detail { font-size: 15px; color: var(--ink-3); }
.cotisation .montant {
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}
/* Une session de paiement vient d'être ouverte : pas de second bouton
   (deux autorisations = adhérent débité deux fois), un état et un lien. */
.paiement-en-cours {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: var(--warn);
}
.identite { color: var(--ink-2); margin-bottom: 20px; }

/* Tableaux (historique des cotisations) */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--ink-2); font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.4px; }

.pied {
  max-width: 720px;
  margin: 0 auto 40px;
  padding: 24px 16px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 14px;
  text-align: center;
}
.pied p { margin: 0 0 8px; }
.pied p:last-child { margin-bottom: 0; }

.discret { color: var(--ink-3); font-size: 14px; }

/* Reçu de paiement (imprimable) */
.recu-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.recu-marque { font-size: 24px; font-weight: 700; color: var(--brand); }
.recu-sous { font-size: 14px; color: var(--ink-3); }
.recu-titre { font-size: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.recu-montant { font-size: 22px; font-weight: 700; }
.recu-mention { font-size: 14px; color: var(--ink-3); margin: 22px 0 0; }

@media print {
  body { background: #fff; font-size: 14px; }
  .entete, .pied, .no-print, .liens-secondaires { display: none !important; }
  .page { margin: 0; max-width: none; padding: 0; }
  .carte { border: 0; padding: 0; box-shadow: none; }
}
