/* Visites chez Maman — feuille de style unique.
   Concue pour de gros caracteres, un fort contraste, et aucun defilement
   horizontal sur telephone. Uniquement du flexbox, pour rester compatible
   avec les navigateurs anciens. */

:root {
  --fond:        #f4f6f8;
  --carte:       #ffffff;
  --texte:       #16191d;
  --texte-doux:  #565f6b;
  --trait:       #d3d9e0;
  --accent:      #1d4f7c;
  --accent-clair:#e7eff6;
  --vert:        #1c6b3f;
  --vert-clair:  #e3f3ea;
  --orange:      #8a4b00;
  --orange-clair:#fdf0dd;
  --rouge:       #9b1c1c;
  --rouge-clair: #fbe6e6;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1 { font-size: 1.7rem; line-height: 1.25; margin: 1.2rem 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; }
p  { margin: 0.6rem 0; }
a  { color: var(--accent); }

/* ----------------------------------------------------------- barre du haut */

.barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: var(--accent);
  color: #fff;
}
.marque { color: #fff; font-weight: 700; text-decoration: none; font-size: 1.05rem; }
.qui { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 0.95rem; }
.lien {
  background: none; border: 0; padding: 0.2rem;
  color: #fff; text-decoration: underline; font: inherit; cursor: pointer;
}

/* ----------------------------------------------------------- onglets */

.onglets {
  display: flex;
  background: #16405f;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.onglets a {
  flex: 1 0 auto;
  padding: 0.85rem 0.9rem;
  text-align: center;
  color: #cfe0ee;
  text-decoration: none;
  font-size: 0.98rem;
  white-space: nowrap;
  border-bottom: 4px solid transparent;
}
.onglets a.actif { color: #fff; font-weight: 700; border-bottom-color: #fff; }

/* ----------------------------------------------------------- boutons */

.actions { display: flex; flex-direction: column; gap: 0.9rem; margin: 1.5rem 0; }

.bouton {
  display: block;
  min-height: 60px;
  padding: 1rem 1.2rem;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--carte);
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.bouton.principal { background: var(--accent); color: #fff; }

/* ----------------------------------------------------------- bandeaux */

.bandeau {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border-left: 6px solid;
  margin: 1rem 0;
}
.bandeau.vert   { background: var(--vert-clair);   border-color: var(--vert);   color: var(--vert); }
.bandeau.orange { background: var(--orange-clair); border-color: var(--orange); color: var(--orange); }
.bandeau.rouge  { background: var(--rouge-clair);  border-color: var(--rouge);  color: var(--rouge); }
.bandeau.bleu   { background: var(--accent-clair); border-color: var(--accent); color: var(--accent); }

.etat { color: var(--texte-doux); margin-top: 0; }
.discret { color: var(--texte-doux); font-size: 0.95rem; }

/* ----------------------------------------------------------- totaux du mois */

.totaux { list-style: none; margin: 1rem 0; padding: 0; }
.totaux li {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 10px;
  margin-bottom: 0.5rem;
}
.totaux .nom     { flex: 1 1 auto; font-weight: 600; }
.totaux .detail  { color: var(--texte-doux); font-size: 0.95rem; }
.totaux .montant { font-size: 1.25rem; font-weight: 700; white-space: nowrap; }
.totaux .total   { background: var(--accent-clair); border-color: var(--accent); }

/* ----------------------------------------------------------- une visite */

.visite, .mois {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
}
.visite.en-alerte { border-color: var(--orange); border-left-width: 6px; }

.ligne1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
}
.ligne1 .date    { font-weight: 700; }
.ligne1 .qui     { flex: 1 1 auto; color: var(--texte-doux); }
.ligne1 .montant { font-size: 1.2rem; font-weight: 700; white-space: nowrap; }

.description { margin: 0.4rem 0 0.2rem; }
/* Le detail d'une visite se lit comme un ticket de caisse : un libelle a
   gauche, sa valeur a droite, et le total detache par un trait. Chaque
   montant affiche est celui du classeur ; le calcul se refait de tete. */
.details { margin: 0.7rem 0 0; padding: 0; }
.details > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-top: 1px solid var(--fond);
}
.details > div:first-child { border-top: 0; padding-top: 0; }
.details dt { margin: 0; color: var(--texte-doux); font-size: 0.95rem; }
.details dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.details .somme {
  margin-top: 0.25rem;
  padding-top: 0.6rem;
  border-top: 2px solid var(--trait);
}
.details .somme dt { color: var(--texte); font-size: 1rem; font-weight: 700; }
.details .somme dd { font-size: 1.15rem; font-weight: 700; }
.note { margin: 0.5rem 0 0; font-size: 0.95rem; color: var(--texte-doux); }
.note.alerte { color: var(--orange); font-weight: 600; }

/* ----------------------------------------------------------- petites actions */

.demande { margin: 0.6rem 0 0; }
.lien-action {
  display: inline-block;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--carte);
  color: var(--accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.lien-action:hover { background: var(--accent-clair); }

/* ----------------------------------------------------------- historique */

.mois .ligne1 .date { font-size: 1.15rem; }
.remboursements { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.remboursements li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  margin-top: 0.4rem;
  background: var(--fond);
  border-left: 5px solid var(--trait);
}
.remboursements .nom     { font-weight: 600; min-width: 5.5rem; }
.remboursements .montant { font-weight: 700; white-space: nowrap; }
.remboursements .statut  { flex: 1 0 100%; font-size: 0.95rem; }
.remboursements .demande { flex: 1 0 100%; }
.remboursements .paye    { border-left-color: var(--vert); }
.remboursements .paye .statut { color: var(--vert); }
.remboursements .du      { border-left-color: var(--orange); }
.remboursements .du .statut   { color: var(--orange); font-weight: 600; }

/* ----------------------------------------------------------- aide */

.forfaits { list-style: none; margin: 0.8rem 0; padding: 0; }
.forfaits li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 8px;
  margin-bottom: 0.4rem;
}

/* ----------------------------------------------------------- encodage */

iframe { width: 100%; border: 0; background: var(--carte); border-radius: 10px; }

/* ----------------------------------------------------------- connexion */

body.centre { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.connexion {
  width: 100%;
  max-width: 26rem;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 14px;
  padding: 1.8rem 1.5rem;
  margin: 1rem;
}
.connexion h1 { margin-top: 0; }
.connexion label { display: block; font-weight: 600; margin: 1.2rem 0 0.4rem; }
.connexion input {
  width: 100%;
  min-height: 56px;
  padding: 0.7rem 0.9rem;
  font-size: 1.15rem;
  border: 2px solid var(--trait);
  border-radius: 10px;
  background: #fff;
  color: var(--texte);
}
.connexion input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.connexion .bouton { width: 100%; margin-top: 1.2rem; }
.alerte { color: var(--rouge); font-weight: 600; }

/* ----------------------------------------------------------- pied */

footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem 2.5rem;
  color: var(--texte-doux);
  font-size: 0.9rem;
}

/* ----------------------------------------------------------- grands ecrans */

@media (min-width: 40rem) {
  body { font-size: 19px; }
  .actions { flex-direction: row; }
  .actions .bouton { flex: 1; }
  .remboursements .statut { flex: 1 1 auto; text-align: right; }
}
