/* BabyBoom — thème sombre aux couleurs du logo */
:root {
  --fond: #000;
  --carte: #161616;
  --bord: #2a2a2a;
  --texte: #f2f2f2;
  --texte-doux: #a8a8a8;
  --rouge: #c8181e;
  --jaune: #e2c33b;
  --vert: #2e8b3e;
  --bleu: #4a9ad4;
  --peau: #e8b97a;
  --rayon: 14px;
  --barre: 64px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.contenu {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px
           calc(var(--barre) + 24px + env(safe-area-inset-bottom));
}

h1 { font-size: 1.6rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 16px;
  margin-bottom: 16px;
}

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--texte-doux); font-size: .95rem; }
input, select, textarea {
  font: inherit;
  color: var(--texte);
  background: #0c0c0c;
  border: 1px solid var(--bord);
  border-radius: 10px;
  padding: 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--jaune); border-color: transparent; }

.bouton {
  font: inherit;
  font-weight: 600;
  color: var(--texte);
  background: #262626;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  min-height: 48px;
  cursor: pointer;
}
.bouton.principal { background: var(--rouge); }
.bouton:active { transform: scale(.98); }

/* Messages */
.flash { border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.flash-erreur { background: #3a0d0f; border: 1px solid var(--rouge); }
.flash-ok { background: #0f2a14; border: 1px solid var(--vert); }

/* Connexion */
.page-connexion .contenu { padding-top: calc(24px + env(safe-area-inset-top)); }
.logo { display: block; width: min(320px, 80vw); margin: 0 auto 20px; }

/* Barre d'onglets */
.onglets {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(12, 12, 12, .96);
  border-top: 1px solid var(--bord);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.onglet {
  flex: 1;
  height: var(--barre);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--texte-doux);
  text-decoration: none;
  font-size: .68rem;
}
.onglet .icone { font-size: 1.35rem; filter: grayscale(1) opacity(.7); }
.onglet.actif { color: var(--jaune); }
.onglet.actif .icone { filter: none; }

/* ---------- Étape 2 : saisie et calendrier ---------- */
.bouton.bloc { display: block; width: 100%; text-align: center; text-decoration: none; margin-bottom: 16px; }
.bouton.petit { min-height: 40px; padding: 10px 14px; font-size: .9rem; margin-top: 12px; }
.lien { color: var(--jaune); }
.centre { text-align: center; }
.sous-titre { margin: 4px 0 8px; color: var(--texte-doux); font-size: .9rem; }
.sous-titre + .puces { margin-bottom: 12px; }

.entete-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.entete-nav h1 { flex: 1; text-align: center; font-size: 1.25rem; margin: 8px 0 16px; }
.fleche {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--carte); border: 1px solid var(--bord);
  color: var(--texte); text-decoration: none; font-size: 1.6rem; line-height: 1;
}

/* Puces (boutons à cocher) */
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { display: inline-flex; flex-direction: row; color: var(--texte); font-size: .95rem; cursor: pointer; }
.puce input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.puce span {
  padding: 9px 14px; border-radius: 999px;
  background: #222; border: 1px solid var(--bord);
  user-select: none; -webkit-user-select: none;
}
.puce input:checked + span { background: #444; border-color: #888; font-weight: 600; }
.puce.rouge input:checked + span { background: var(--rouge); border-color: var(--rouge); }
.puce.rose  input:checked + span { background: #c2185b; border-color: #c2185b; }
.puce.bleu  input:checked + span { background: #1f5f8b; border-color: var(--bleu); }
.puce.jaune input:checked + span { background: #6b5a12; border-color: var(--jaune); }
.puce.vert  input:checked + span { background: var(--vert); border-color: var(--vert); }
.puce input:focus-visible + span { outline: 2px solid var(--jaune); }

.ligne-temp { display: flex; align-items: center; gap: 10px; }
.ligne-temp input { max-width: 140px; font-size: 1.2rem; }

.trace { color: var(--texte-doux); font-size: .85rem; text-align: center; }

.barre-enregistrer {
  position: sticky;
  bottom: calc(var(--barre) + 8px + env(safe-area-inset-bottom));
  padding-top: 8px;
}
.barre-enregistrer .bouton { margin: 0; box-shadow: 0 6px 20px rgba(0,0,0,.6); }

/* Calendrier */
.calendrier { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 12px; }
.entete-jour { text-align: center; color: var(--texte-doux); font-size: .8rem; padding: 4px 0; }
.case {
  position: relative;
  aspect-ratio: 1 / 1.15;
  border-radius: 10px;
  background: var(--carte);
  border: 1px solid var(--bord);
  color: var(--texte);
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 4px 2px;
  overflow: hidden;
}
.case.vide { background: transparent; border-color: transparent; }
.case .num { font-size: .95rem; font-weight: 600; }
.case .marques { font-size: .7rem; line-height: 1.1; text-align: center; margin-top: 2px; }
.case .points { position: absolute; bottom: 4px; display: flex; gap: 3px; }
.case.aujourdhui { outline: 2px solid var(--jaune); outline-offset: -2px; }

.case.regles { background: var(--rouge); border-color: var(--rouge); }
.case.regles-spotting { background: #5a1215; border-color: var(--rouge); }
.case.regles-legere { background: #9b1419; }
.case.regles-abondante { background: #8e0007; }
.case.regles-prevues { border: 2px dashed #e57373; }
.case.fertile { background: #123d1b; border-color: var(--vert); }

.lh { color: #7fe08f; font-size: .62rem; font-weight: 700; }
.pt-temp, .pt-note { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.pt-temp { background: var(--bleu); }
.pt-note { background: var(--jaune); }

.legende ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .92rem; }
.legende em { color: var(--texte-doux); font-size: .8rem; }
.ech { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 4px; }
.ech-regles { background: var(--rouge); }
.ech-prevues { border: 2px dashed #e57373; }
.ech-fertile { background: #123d1b; border: 1px solid var(--vert); }

/* ---------- Étape 3 : résumé des prévisions ---------- */
.resume p { margin: 4px 0; }
.doux { color: var(--texte-doux); font-size: .85rem; }

/* ---------- Étape 4 : écran « Aujourd'hui » ---------- */
.date-du-jour { margin: -10px 0 16px; }
.alerte { border-color: var(--rouge); background: #2a0d0e; }
.alerte-joie { border-color: var(--vert); background: #0f2a14; }
.alerte .bouton { margin-top: 8px; }
.jour-cycle { display: flex; align-items: baseline; gap: 10px; justify-content: center; }
.jour-cycle .grand { font-size: 2.6rem; font-weight: 700; }
.badge-fertile {
  margin: 10px auto 6px; width: fit-content; padding: 8px 18px; border-radius: 999px;
  font-weight: 700; font-size: 1.05rem;
}
.niveau-haut { background: var(--vert); color: #fff; }
.niveau-moyen { background: #1f4d27; color: #d6f0da; }
.niveau-bas { background: #222; color: var(--texte-doux); }
.semaine { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.jour-semaine {
  display: flex; flex-direction: column; align-items: center; padding: 6px 0;
  border-radius: 10px; text-decoration: none; font-size: .8rem;
}
.jour-semaine.niveau-haut, .jour-semaine.niveau-moyen { color: #fff; }
.jour-semaine b { font-size: 1rem; }
.infos .ligne { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--bord); }
.infos .ligne:last-of-type { border-bottom: 0; }
.infos .ligne b { text-align: right; }
.infos .gros { font-size: 1.4rem; color: var(--jaune); }
.avertissement { margin-top: 16px; }

/* ---------- Étape 5 : enfants ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.avatar-M .fond { fill: #cfe8ff; }
.avatar-M .symbole { stroke: #2f7fc0; }
.avatar-F .fond { fill: #ffd9e8; }
.avatar-F .symbole { stroke: #cf5a8c; }
.ligne-enfant { display: flex; align-items: center; gap: 14px; color: var(--texte); text-decoration: none; }
.ligne-enfant .texte { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chevron { color: var(--texte-doux); font-size: 1.6rem; }
.entete-enfant { display: flex; flex-direction: column; align-items: center; margin: -8px 0 12px; }
.entete-enfant h1 { margin: 10px 0 2px; text-align: center; }
.entete-enfant p { margin: 0; }
.sous-onglets { display: flex; gap: 6px; margin-bottom: 16px; }
.sous-onglets a {
  flex: 1; text-align: center; padding: 10px 4px; border-radius: 12px; font-size: .88rem;
  background: var(--carte); border: 1px solid var(--bord); color: var(--texte-doux); text-decoration: none;
}
.sous-onglets a.actif { color: var(--texte); border-color: var(--jaune); font-weight: 600; }
.trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trois > *, .deux > * { min-width: 0; }
.trois input, .deux input, .deux select { min-width: 0; }
.ligne-photo { display: flex; align-items: center; gap: 12px; }
.ligne-photo input { flex: 1; min-width: 0; }
.titre-graphique { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.titre-graphique .pct { color: var(--jaune); }
.graphique { position: relative; height: 240px; }
.historique { list-style: none; margin: 0; padding: 0; }
.historique li { display: flex; justify-content: space-between; align-items: center; gap: 8px;
                 padding: 10px 0; border-bottom: 1px solid var(--bord); font-size: .92rem; }
.historique li:last-child { border-bottom: 0; }
.mini { background: none; border: 0; font-size: 1.1rem; padding: 8px; cursor: pointer; }
.actuelle { text-align: center; }
.actuelle p { margin: 4px 0; }
.grande-taille { font-size: 2.4rem; font-weight: 700; color: var(--jaune); }
.bouton.danger { background: #2a0d0e; color: #ff8a8a; }

/* ---------- Tailles : 4 sous-onglets, menu déroulant ---------- */
.sous-onglets { gap: 4px; }
.sous-onglets a { display: flex; flex-direction: column; align-items: center; gap: 2px;
                  padding: 8px 2px; font-size: .74rem; min-width: 0; }
.sous-onglets .ic { font-size: 1.2rem; }
.grande-taille { font-size: 1.9rem; line-height: 1.2; }
select { appearance: auto; -webkit-appearance: menulist; }

/* ---------- iPhone : champs date / menus dans leur colonne, pas de défilement horizontal ---------- */
html, body { overflow-x: clip; }
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  display: block; min-width: 0; max-width: 100%; min-height: 48px; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
select { min-width: 0; max-width: 100%; min-height: 48px; }
.onglets { transform: translateZ(0); -webkit-transform: translateZ(0); }

/* Comptes : demandes d'accès, accueil Famille */
.flash-info { background: #1d2a3a; border: 1px solid #4a9ad4; }
.onglet { position: relative; }
.pastille {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--rouge); color: #fff; font-size: .68rem; font-weight: 700;
  line-height: 17px; text-align: center; filter: none;
}
.lien-carte { display: block; color: inherit; text-decoration: none; }
.demande { padding: 10px 0; border-top: 1px solid #2a2a2a; }
.demande:first-of-type { border-top: 0; }
.demande p { margin: 0 0 8px; }
.ligne-boutons { display: flex; gap: 8px; margin-bottom: 8px; }
.ligne-boutons select { flex: 1; min-width: 0; }
.bienvenue-famille { margin: 0 0 14px; }
.carte-enfant h3 { margin: 16px 0 8px; font-size: 1rem; }
.carte-enfant .ligne-enfant { padding: 0; margin: 0; border: 0; background: none; }
.anniversaire { margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: #2a240c; }
.tailles-famille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tailles-famille a {
  display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 10px;
  background: #1a1a1a; color: inherit; text-decoration: none; text-align: center; font-size: .85rem;
}
.tailles-famille b { font-size: 1rem; color: var(--jaune); }
.petit { font-size: .72rem; }

/* Anniversaires */
.anniv { display: flex; align-items: center; gap: 14px; }
.anniv-compte { display: flex; flex-direction: column; align-items: center; min-width: 58px; font-size: .75rem; color: var(--texte-doux); }
.anniv-compte .grand { font-size: 1.7rem; font-weight: 700; color: var(--jaune); line-height: 1.1; }
.anniv-texte { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.anniv-texte a { color: inherit; }
.anniv-proche { border-color: var(--jaune); }
.anniv-jour { border-color: var(--jaune); background: #2a240c; }
.carte-anniv { border-color: #5a4a12; }
.assoc { font-size: .78rem; color: var(--jaune); }
.parent-ligne { margin: 10px 0 8px !important; }

/* Liste de courses */
.ajout-course { display: flex; gap: 8px; }
.ajout-course input { flex: 1; min-width: 0; }
.ajout-course .bouton { width: auto; padding: 0 16px; }
.article { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #2a2a2a; }
.article:first-of-type { border-top: 0; }
.article-texte { flex: 1; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.article.achete .article-texte > span:first-child { text-decoration: line-through; opacity: .6; }
.case-a-cocher { background: none; border: 0; color: var(--jaune); font-size: 1.5rem; padding: 0 4px; cursor: pointer; }
.form-photo { margin-top: 8px; }
.mini-bouton { display: inline-block; width: auto; padding: 6px 12px; font-size: .85rem; cursor: pointer; }

/* Onglet « Plus » */
.ligne-plus { align-items: center; }
.icone-plus { font-size: 1.6rem; width: 40px; text-align: center; }
.pastille-ligne { background: var(--rouge); color: #fff; border-radius: 10px; padding: 0 8px; font-size: .8rem; font-weight: 700; }
.ligne-reglage { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ligne-reglage select { width: auto; min-width: 0; max-width: 55%; }

/* Animaux */
.avatar-animal { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #2a240c; font-size: 1.8rem; flex-shrink: 0; }
.boutons-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.bouton-action { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px;
  border-radius: 12px; border: 1px solid var(--bord); background: #1f1f1f; color: var(--texte); font-size: .9rem; cursor: pointer; }
.bouton-action .ic { font-size: 1.8rem; }
.bouton-action:active { background: #2e2e2e; }
.bouton-action.retard { border-color: var(--rouge); background: #2a0d0e; }
.ligne-echeance { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bord); }
.ligne-echeance:first-of-type { border-top: 0; }
.ligne-echeance > span:last-child, .ligne-echeance > b { text-align: right; }
.niveau-retard { color: #ff8a80; }
.niveau-bientot { color: var(--jaune); }
.ligne-alerte { display: block; padding: 6px 0; color: inherit; text-decoration: none; }
.ligne-alerte.niveau-retard { color: #ff8a80; }
.case.soin-fait { background: #123d1b; border-color: var(--vert); }
.case .prevu { display: inline-block; border: 1.5px solid var(--jaune); border-radius: 50%; padding: 0 1px; }

/* Améliorations */
.filtres { display: flex; gap: 6px; margin: 0 0 12px; flex-wrap: wrap; }
.filtres a { padding: 6px 12px; border-radius: 16px; border: 1px solid var(--bord); color: var(--texte-doux); text-decoration: none; font-size: .85rem; }
.filtres a.actif { color: var(--texte); border-color: var(--jaune); }
.ticket { display: flex; align-items: center; gap: 12px; }
.ticket-texte { flex: 1; display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 48px; padding: 6px; border-radius: 10px;
  border: 1px solid var(--bord); background: #1f1f1f; color: var(--texte); cursor: pointer; }
.vote.actif { border-color: var(--jaune); background: #2a240c; }
#commentaires .vote, .carte > form > .vote { flex-direction: row; }
.titre-ticket { margin: 4px 0; font-size: 1.3rem; }
.texte-libre { white-space: pre-wrap; overflow-wrap: anywhere; }

.compte-famille { padding: 12px 0; border-top: 1px solid var(--bord); }
.compte-famille:first-of-type { border-top: 0; }
.compte-famille .formulaire { margin-bottom: 8px; }

/* RDV médicaux */
.bascule { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; }
.bascule a { text-align: center; padding: 8px; border-radius: 9px; color: var(--texte-doux); text-decoration: none; }
.bascule a.actif { background: #2a240c; color: var(--jaune); font-weight: 600; }
.titre-periode { flex: 1; text-align: center; font-size: 1.05rem; margin: 0; }
.jour-rdv { padding: 10px 14px; margin-bottom: 8px; }
.jour-rdv.sans-rdv { opacity: .7; }
.jour-rdv.aujourdhui { border-color: var(--jaune); }
.jour-rdv-titre { display: flex; align-items: center; gap: 8px; }
.jour-rdv-titre b { flex: 1; }
.ajout-jour { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; border: 1px solid var(--bord); color: var(--jaune); text-decoration: none; font-size: 1.2rem; }
.ligne-rdv { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--bord);
  color: inherit; text-decoration: none; }
.jour-rdv-titre + .ligne-rdv, h2 + .ligne-rdv { border-top: 0; }
.ligne-rdv .texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ligne-rdv.passe, .carte.passe { opacity: .55; }
.heure-rdv { display: flex; flex-direction: column; align-items: center; min-width: 64px; text-align: center; }
.rappels-rdv { border-color: var(--bleu); }
.ligne-rdv.proche .heure-rdv { color: var(--jaune); }
.case.a-rdv { border-color: var(--bleu); background: #0f2333; }
.case.choisi { outline: 2px solid var(--bleu); outline-offset: -2px; }
.praticien summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; list-style: none; }
.praticien summary::-webkit-details-marker { display: none; }
.praticien[open] summary { margin-bottom: 10px; }

/* Barre de 6 cases (5 onglets + Plus) */
.onglet > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.onglets.serre .onglet { font-size: .6rem; min-width: 0; }
.onglets.serre .onglet .icone { font-size: 1.25rem; }

/* Aperçu « Voir l'app comme… » */
.bandeau-apercu { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--jaune); color: #000; font-size: .9rem; }
.bandeau-apercu form { margin: 0; }
.bandeau-apercu button { border: 0; border-radius: 8px; padding: 8px 10px; background: #000; color: var(--jaune);
  font-weight: 600; font-size: .85rem; cursor: pointer; white-space: nowrap; }

/* Pépites */
.filtres-pepites input[type=search] { width: 100%; margin-bottom: 8px; }
.filtres-pepites .filtres { margin-bottom: 8px; }
.pepite { border-left: 4px solid var(--jaune); }
.pepite-betise { border-left-color: #e57373; }
.pepite-anecdote { border-left-color: var(--bleu); }
.pepite-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pepite-tete .mini { text-decoration: none; color: var(--texte-doux); }
.pepite-citation { margin: 10px 0 6px; font-size: 1.2rem; font-style: italic; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; }
.pepite-texte { margin: 10px 0 6px; }
.pepite-contexte { margin: 0 0 8px; font-style: italic; }
.pepite-photo { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: 10px; margin: 6px 0 8px; }
.pepite-pied { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pepite-reactions { display: flex; gap: 6px; }
.pepite-reactions form { margin: 0; }
.reaction { min-width: 44px; height: 36px; padding: 0 10px; border-radius: 18px; border: 1px solid var(--bord);
  background: #1f1f1f; color: var(--texte); font-size: .95rem; cursor: pointer; }
.reaction.actif { border-color: var(--jaune); background: #2a240c; }
.souvenir h2 { font-size: 1rem; margin: 4px 0 8px; }
.souvenir { margin-bottom: 16px; }
