/* © 2026 Alexandre Authier. Coquelicot : palette douce et pâle, typographie arrondie. */
@font-face {
  font-family: 'Nunito';
  src: url('../vendor/fonts/nunito.woff2') format('woff2');
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  /* Fond et texte */
  --creme: #FBF6F1;
  --carte: #FFFFFF;
  --encre: #4A3B47;
  --encre-douce: #85737F;
  --trait: #EFE4DC;
  /* Phases du cycle */
  --regles: #E39AA2;
  --regles-pale: #F7DADC;
  --folliculaire: #F4CDB2;
  --fertile: #A8CFB9;
  --ovulation: #6FAE8C;
  --luteale: #CFC2E6;
  --attente: #E39AA2;
  --retard: #D88A92;
  /* Mise en forme */
  --rayon: 22px;
  --ombre: 0 6px 24px rgba(122, 84, 98, 0.08), 0 1px 3px rgba(122, 84, 98, 0.06);
  --police: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font-family: var(--police);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  /* Un voile rosé en haut, comme un pétale à contre-jour. */
  background: radial-gradient(120% 60% at 50% 0%, #FCEDEE 0%, var(--creme) 70%) fixed;
  padding: env(safe-area-inset-top) 0 calc(76px + env(safe-area-inset-bottom));
}
body.masque > *:not(#verrou) { filter: blur(18px); }

.ecran {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entete {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px 20px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.entete { justify-content: center; }
.marque { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.18em; margin: 0; color: #C9737D; display: flex; align-items: center; gap: 8px; }
.marque img { display: block; }
.fleur img { display: block; margin: 0 auto; }

/* Le diagramme */
.diagramme { position: relative; width: min(100%, 340px); margin: 4px auto 0; aspect-ratio: 1; }
.diagramme svg { width: 100%; height: 100%; overflow: visible; display: block; }
.diagramme .centre {
  position: absolute;
  inset: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
}
.centre .petit { color: var(--encre-douce); font-weight: 600; font-size: 0.85rem; letter-spacing: 0.12em; }
.centre .grand { font-size: 3.6rem; font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.centre .phase { font-weight: 700; font-size: 1rem; margin-top: 8px; color: #B8636D; }
.centre .detail { color: var(--encre-douce); font-size: 0.85rem; font-weight: 600; max-width: 12em; }
.centre .detail:empty { display: none; }

/* À venir : deux pastilles, une date courte chacune */
.a-venir { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bulle {
  background: rgba(255, 255, 255, 0.75); border-radius: 20px; box-shadow: var(--ombre);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
}
.bulle svg { flex: none; }
.bulle span { display: grid; line-height: 1.2; }
.bulle small { font-size: 0.75rem; font-weight: 700; color: var(--encre-douce); }
.bulle b { font-size: 0.98rem; font-weight: 800; white-space: nowrap; }

.jour-cycle { transition: opacity 0.4s ease; }
.aujourdhui { filter: drop-shadow(0 2px 4px rgba(74, 59, 71, 0.22)); }

/* Légende */
.legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 0; margin: 0; list-style: none; }
.legende li { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 650; color: var(--encre-douce); }
.legende i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Cartes « À venir » */
.cartes { display: grid; gap: 10px; }
.carte {
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.carte .pastille { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.carte .titre { font-size: 0.8rem; font-weight: 750; color: var(--encre-douce); text-transform: uppercase; letter-spacing: 0.06em; }
.carte .valeur { font-size: 1.05rem; font-weight: 750; margin-top: 2px; }

.bouton-principal {
  appearance: none;
  border: 0;
  width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  background: #C9737D;
  color: #fff;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(201, 115, 125, 0.3);
  cursor: pointer;
}
.bouton-principal:active { transform: scale(0.98); }

.avertissement { text-align: center; font-size: 0.78rem; color: var(--encre-douce); margin: 0; }

/* Maquette : sélecteur de scénarios, absent de l'app */
.scenarios { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.scenarios button {
  appearance: none;
  border: 1px solid var(--trait);
  background: var(--carte);
  color: var(--encre);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.scenarios button[aria-pressed="true"] { background: var(--encre); color: var(--creme); border-color: var(--encre); }
.scenarios { max-width: 440px; margin: 12px auto 0; padding: 0 20px; }

/* --- Boutons et textes --- */
.bouton-principal.danger { background: #C2555F; box-shadow: none; }
.bouton-secondaire {
  appearance: none; width: 100%; padding: 14px 18px; border-radius: 999px;
  border: 1.5px solid var(--trait); background: var(--carte); color: var(--encre);
  font: inherit; font-weight: 750; font-size: 1rem; cursor: pointer;
}
.bouton-lien {
  appearance: none; border: 0; background: none; color: #C9737D; font: inherit;
  font-weight: 800; font-size: 0.95rem; padding: 8px 4px; cursor: pointer;
}
.bouton-lien.danger { color: #C2555F; }
.pile-actions { display: grid; gap: 8px; }
.pile-actions .bouton-lien { justify-self: center; }
.apprentissage { margin: -6px 0 0; text-align: center; font-size: 0.85rem; color: var(--encre-douce); font-weight: 650; }
.texte { color: var(--encre-douce); font-weight: 600; line-height: 1.45; margin: 0; }

/* --- Onglets --- */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(251, 246, 241, 0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--trait);
}
.onglets button {
  appearance: none; border: 0; background: none; font: inherit; font-size: 0.72rem; font-weight: 750;
  color: var(--encre-douce); display: grid; justify-items: center; gap: 3px; padding: 6px 0; cursor: pointer;
}
.onglets svg { width: 24px; height: 24px; }
.onglets [aria-current="page"] { color: #C9737D; }

.entete-mois { display: flex; align-items: center; justify-content: space-between; }
.entete-mois h2 { margin: 0; font-size: 1.2rem; font-weight: 850; }
.fleche {
  appearance: none; border: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--carte);
  box-shadow: var(--ombre); color: var(--encre); font: inherit; font-size: 1.5rem; font-weight: 700; cursor: pointer;
}
.fleche:disabled { opacity: 0.35; }

/* --- Calendrier --- */
.grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.entete-jour { text-align: center; font-size: 0.75rem; font-weight: 800; color: var(--encre-douce); padding-bottom: 2px; }
.jour {
  position: relative; appearance: none; aspect-ratio: 1; border: 0; border-radius: 50%;
  background: transparent; color: var(--encre); font: inherit; font-weight: 750; font-size: 0.95rem; cursor: pointer;
}
.jour.futur { color: var(--encre-douce); }
.jour.regles { background: #D98993; color: #fff; }
.jour.prevues { background: var(--regles-pale); box-shadow: inset 0 0 0 2px var(--regles); color: var(--encre); border-radius: 50%; }
.jour.fertile { background: #DDEDE3; color: var(--encre); }
.jour.aujourdhui { outline: 2.5px solid var(--encre); outline-offset: 1px; }
.jour .point { position: absolute; bottom: 4px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #A493C8; }
.jour.regles .point { background: #fff; }
.legende i.pointille { background: var(--regles-pale); box-shadow: inset 0 0 0 1.5px var(--regles); }
.legende i.point-legende { background: #A493C8; width: 6px; height: 6px; }

/* --- Journal --- */
.bloc { display: grid; gap: 8px; }
.bloc h3, .groupe h3 { margin: 0; font-size: 0.8rem; font-weight: 850; color: var(--encre-douce); text-transform: uppercase; letter-spacing: 0.07em; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce {
  appearance: none; border: 1.5px solid var(--trait); background: var(--carte); color: var(--encre);
  font: inherit; font-weight: 700; font-size: 0.9rem; padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.puce[aria-pressed="true"] { background: var(--regles-pale); border-color: var(--regles); }
.champ {
  width: 100%; padding: 13px 14px; border-radius: 16px; border: 1.5px solid var(--trait);
  background: var(--carte); color: var(--encre); font: inherit; font-size: 1rem; font-weight: 600;
}
.champ:focus, .champ-heure:focus { outline: 2px solid var(--regles); outline-offset: 1px; }
textarea.champ { resize: vertical; }

/* --- Réglages --- */
.groupe { display: grid; gap: 8px; }
.carte-groupe { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 4px 16px; }
.ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--trait); }
.carte-groupe > :last-child { border-bottom: 0; }
.ligne-titre { font-weight: 750; }
.ligne-detail { font-size: 0.82rem; color: var(--encre-douce); font-weight: 600; margin-top: 2px; }
.texte-groupe { font-size: 0.9rem; color: var(--encre-douce); font-weight: 600; line-height: 1.45; margin: 12px 0; }
.champ-heure { border: 1.5px solid var(--trait); border-radius: 12px; padding: 6px 10px; font: inherit; font-weight: 700; color: var(--encre); background: var(--creme); }
.compteur { display: flex; align-items: center; gap: 8px; flex: none; }
.compteur button {
  appearance: none; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--trait);
  background: var(--creme); color: var(--encre); font: inherit; font-size: 1.2rem; font-weight: 800; cursor: pointer;
}
.compteur-valeur { min-width: 4.8em; text-align: center; font-weight: 800; }
.interrupteur {
  appearance: none; flex: none; width: 50px; height: 30px; border-radius: 999px; border: 0; padding: 3px;
  background: var(--trait); cursor: pointer; transition: background 0.2s;
}
.interrupteur span { display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform 0.2s; }
.interrupteur[aria-checked="true"] { background: var(--ovulation); }
.interrupteur[aria-checked="true"] span { transform: translateX(20px); }

/* --- Feuilles et toast --- */
.voile { position: fixed; inset: 0; z-index: 30; background: rgba(74, 59, 71, 0); transition: background 0.2s; display: flex; align-items: flex-end; }
.voile.ouvert { background: rgba(74, 59, 71, 0.28); }
.feuille {
  width: 100%; max-width: 480px; margin: 0 auto; background: var(--creme); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 12px;
  transform: translateY(100%); transition: transform 0.22s ease-out;
}
.voile.ouvert .feuille { transform: none; }
.feuille h2 { margin: 4px 0 0; font-size: 1.2rem; font-weight: 850; }
.poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--trait); justify-self: center; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions > :only-child { grid-column: 1 / -1; }
.erreur { color: #C2555F; font-weight: 700; font-size: 0.9rem; margin: 0; min-height: 1.2em; }
.toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  background: var(--encre); color: var(--creme); border-radius: 999px; padding: 10px 10px 10px 18px;
  display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 0.92rem; box-shadow: var(--ombre); white-space: nowrap;
}
.toast button { appearance: none; border: 0; background: rgba(255,255,255,.16); color: var(--creme); font: inherit; font-weight: 800; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* --- Premier lancement et code --- */
.plein-ecran { position: fixed; inset: 0; z-index: 50; background: var(--creme); overflow-y: auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.pas { max-width: 420px; margin: 0 auto; padding: 28px 24px; display: grid; gap: 16px; }
.pas h1 { margin: 0; font-size: 1.7rem; font-weight: 850; letter-spacing: -0.02em; }
.etapes { display: flex; gap: 6px; }
.etapes span { height: 5px; flex: 1; border-radius: 3px; background: var(--trait); }
.etapes .actif { background: var(--regles); }
.fleur { font-size: 3.4rem; text-align: center; }
.promesses { margin: 0 auto; padding: 0; list-style: none; display: grid; gap: 12px; font-weight: 650; font-size: 1.05rem; }
.titre-marque { text-align: center; color: #C9737D; font-weight: 700 !important; letter-spacing: 0.18em !important; font-size: 1.6rem !important; }
.pas { text-align: left; }
.pas:has(.titre-marque) { text-align: center; padding-top: 18vh; }
.puce[aria-label] { font-size: 1.15rem; padding: 6px 14px; }
.pas .compteur, .pas .bouton-lien { justify-self: center; }
.verrou-contenu { min-height: 100%; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; }
.points { display: flex; gap: 16px; }
.points span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--regles); }
.points .plein { background: var(--regles); }
.points.secoue { animation: secoue 0.4s; }
@keyframes secoue { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.clavier { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; }
.touche {
  appearance: none; height: 72px; border-radius: 50%; border: 0; background: var(--carte); box-shadow: var(--ombre);
  color: var(--encre); font: inherit; font-size: 1.6rem; font-weight: 750; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) { .feuille, .voile, .interrupteur span { transition: none; } }
