/* ============================================================
   Régie — direction « Barbe à papa », choisie par Val le 15/09/2026.
   Rose, lilas et bleu bébé ; cartes blanches très arrondies ;
   Shrikhand pour le logo, Quicksand pour tout le reste.
   Le texte reste foncé sur les pastels : lisible avant tout.
   ============================================================ */
:root {
  --rose: #FF6FB5;
  --rose-fonce: #D94A92;
  --rose-pale: #FFC8E6;
  --lilas: #D9D2FF;
  --bleu-bebe: #C6EBFF;
  --menthe: #C9F2DE;
  --fond: #F4F6FF;
  --carte: #FFFFFF;
  --encre: #2E2445;
  --encre-douce: #6E5F92;
  --filet: #E6E1F7;
  --ombre: 0 4px 18px rgba(140, 110, 220, .14);
  --ombre-bouton: 0 6px 18px rgba(255, 111, 181, .38);
  --erreur: #B3261E;
  --erreur-pale: #FFE3E6;
  --attention: #7A5200;
  --attention-pale: #FFF1C9;
  --succes: #1F6B47;
  --succes-pale: #D6F5E6;
  --rayon: 22px;
  --police: 'Quicksand', 'Segoe UI', Arial, sans-serif;
  --logo: 'Shrikhand', 'Quicksand', cursive;
}
* { box-sizing: border-box; }
html { background: var(--fond); }
body { margin: 0; font: 500 16px/1.55 var(--police); color: var(--encre); background: linear-gradient(170deg, #FFE9F5 0, #EEEAFF 320px, var(--fond) 640px) no-repeat, var(--fond); min-height: 100vh; }
a { color: var(--rose-fonce); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; margin-top: 1.2em; }
img, video { max-width: 100%; }
.doux { color: var(--encre-douce); }
.petit { font-size: .88rem; }
.nombres { font-variant-numeric: tabular-nums; white-space: nowrap; }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }

/* --- Barre du haut --- */
.barre { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 14px 20px; background: rgba(255, 255, 255, .78); backdrop-filter: blur(8px); border-bottom: 1px solid var(--filet); position: sticky; top: 0; z-index: 10; }
.logo { font-family: var(--logo); font-size: 1.9rem; color: var(--rose); text-decoration: none; text-shadow: 0 2px 0 #fff; line-height: 1; }
.logo--grand { font-size: 3.4rem; font-weight: 400; margin: 0; }
.menu { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.menu a { text-decoration: none; color: var(--encre); padding: 7px 14px; border-radius: 999px; font-weight: 600; }
.menu a:hover { background: var(--lilas); }
.menu a.actif { background: var(--rose-pale); color: #8A1F5C; }
.deconnexion { margin: 0; }
.bandeau-simule { margin: 0; padding: 8px 20px; background: var(--bleu-bebe); color: #1D5A80; font-weight: 600; font-size: .9rem; text-align: center; }

/* --- Page --- */
.page { max-width: 1180px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 56px; display: grid; gap: 22px; }
.tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.tete p { margin: 0; }
.surtitre { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--rose-fonce); margin: 0 0 4px; }
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px 22px; min-width: 0; }
.carte > :last-child { margin-bottom: 0; }
.centre { text-align: center; max-width: 560px; margin: 40px auto; }
.pied { text-align: center; color: var(--encre-douce); font-size: .85rem; padding: 0 16px 28px; }

/* --- Boutons --- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; padding: 10px 20px; font: 700 .95rem var(--police); background: var(--rose); color: #fff; text-decoration: none; cursor: pointer; box-shadow: var(--ombre-bouton); white-space: nowrap; }
.bouton:hover { background: var(--rose-fonce); }
.bouton--doux { background: #fff; color: var(--encre); box-shadow: 0 2px 10px rgba(140, 110, 220, .16); }
.bouton--doux:hover { background: var(--lilas); }
.bouton--danger { background: #fff; color: var(--erreur); box-shadow: 0 2px 10px rgba(179, 38, 30, .14); }
.bouton--danger:hover { background: var(--erreur-pale); }
.lien { background: none; border: 0; padding: 0; font: 600 .92rem var(--police); color: var(--rose-fonce); text-decoration: underline; cursor: pointer; }
.lien--danger { color: var(--erreur); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.actions form { margin: 0; }
.navigation-mois { display: flex; gap: 8px; }

/* --- Messages --- */
.flash, .encart { margin: 0; padding: 12px 16px; border-radius: 16px; font-weight: 600; }
.flash ul { margin: 6px 0 0; padding-left: 1.2em; font-weight: 500; }
.flash--succes { background: var(--succes-pale); color: var(--succes); }
.flash--erreur, .encart--erreur { background: var(--erreur-pale); color: var(--erreur); }
.flash--info, .encart { background: var(--bleu-bebe); color: #1D5A80; }
.encart--attention { background: var(--attention-pale); color: var(--attention); }
.erreur-texte { color: var(--erreur); }
.attention-texte { color: var(--attention); font-weight: 700; }

/* --- Pastilles d'état --- */
.statut { display: inline-block; border-radius: 999px; padding: 2px 11px; font-size: .78rem; font-weight: 700; background: var(--lilas); color: #4A3A99; }
.statut--publiee, .statut--publie { background: var(--succes-pale); color: var(--succes); }
.statut--erreur, .statut--partielle { background: var(--erreur-pale); color: var(--erreur); }
.statut--programmee, .statut--attente { background: var(--bleu-bebe); color: #1D5A80; }
.statut--en_cours { background: var(--attention-pale); color: var(--attention); }
.statut--brouillon, .statut--annulee, .statut--annule { background: #EEEAF6; color: var(--encre-douce); }

/* --- Connexion --- */
.connexion { position: relative; max-width: 420px; margin: 8vh auto 0; padding: 36px 32px; text-align: center; border-radius: 30px; background: linear-gradient(160deg, #FFC8E6, #D9D2FF 55%, #C6EBFF); box-shadow: 0 10px 40px rgba(140, 110, 220, .22); overflow: hidden; }
.connexion .pile { display: grid; gap: 10px; text-align: left; margin-top: 18px; }
.connexion input { width: 100%; }
.connexion .demo { border-top: 1px dashed rgba(46, 36, 69, .2); padding-top: 16px; }
.eclat { position: absolute; width: 16px; height: 16px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.eclat--1 { top: 22px; right: 34px; }
.eclat--2 { top: 70px; right: 84px; transform: scale(.55); }

/* --- Champs --- */
input[type=text], input[type=password], input[type=date], input[type=time], select, textarea { font: 500 1rem var(--police); color: var(--encre); background: #fff; border: 1.5px solid var(--filet); border-radius: 14px; padding: 10px 12px; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--rose); outline: none; box-shadow: 0 0 0 4px rgba(255, 111, 181, .18); }
.ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.ligne--large { gap: 14px; }
label { font-weight: 600; }

/* --- Calendrier --- */
.legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .9rem; }
.legende li { display: flex; align-items: center; gap: 7px; }
.legende i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(140, 110, 220, .3); }
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendrier__jour-semaine { text-align: center; font-size: .8rem; font-weight: 700; color: var(--encre-douce); text-transform: uppercase; letter-spacing: .05em; }
.case { background: #fff; border-radius: 18px; min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 2px 12px rgba(140, 110, 220, .1); min-width: 0; }
.case--hors { background: rgba(255, 255, 255, .5); box-shadow: none; }
.case--hors .case__numero { color: #B9B0D2; }
.case--aujourdhui { outline: 2.5px solid var(--rose); }
.case__numero { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: var(--encre); font-weight: 700; font-size: .88rem; padding: 2px 6px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.case__numero:hover { background: var(--rose-pale); }
.case__plus { opacity: 0; color: var(--rose-fonce); font-size: 1.1rem; }
.case__numero:hover .case__plus, .case__numero:focus .case__plus { opacity: 1; }
.pastille { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 5px; text-decoration: none; border-radius: 11px; padding: 4px 7px; font-size: .74rem; font-weight: 700; line-height: 1.2; min-width: 0; }
.pastille__heure { font-variant-numeric: tabular-nums; }
.pastille__texte { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.point { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid currentColor; }
.point--publiee { background: currentColor; }
.point--erreur, .point--partielle { background: var(--erreur); border-color: var(--erreur); }
.point--en_cours { background: #F0B400; border-color: #F0B400; }
@media (max-width: 760px) {
  .calendrier { grid-template-columns: 1fr; }
  .calendrier__jour-semaine, .case--hors { display: none; }
  .case { min-height: 0; }
}
.liste { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

/* --- Éditeur --- */
.formulaire { display: grid; gap: 18px; }
.grille-comptes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.choix-compte { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 18px; background: #fff; border: 2px solid var(--filet); cursor: pointer; font-weight: 500; }
.choix-compte:has(input:checked) { background: var(--fond); border-color: var(--texte); box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--fond-compte, var(--fond)) 0%, transparent); }
.choix-compte input { width: 20px; height: 20px; accent-color: var(--rose); flex: none; }
.choix-compte__corps { display: grid; }
.choix-compte__corps span { font-size: .84rem; color: var(--encre-douce); }
.choix-compte:has(input:checked) { background: var(--fond); }
.choix-compte { --fond: #EDE9FF; }
.choix-compte:has(input:checked) { background: var(--fond); color: var(--texte); }
.pilules { display: flex; flex-wrap: wrap; gap: 10px; }
.pilule { cursor: pointer; }
.pilule input { position: absolute; opacity: 0; pointer-events: none; }
.pilule span { display: grid; padding: 10px 18px; border-radius: 18px; background: #fff; border: 2px solid var(--filet); min-width: 130px; }
.pilule small { color: var(--encre-douce); font-weight: 500; }
.pilule input:checked + span { background: var(--rose-pale); border-color: var(--rose); color: #8A1F5C; }
.pilule input:focus-visible + span { outline: 3px solid var(--rose); outline-offset: 2px; }
.grille-medias { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.choix-media { position: relative; padding: 0; border: 3px solid transparent; border-radius: 16px; overflow: hidden; background: var(--lilas); cursor: pointer; aspect-ratio: 4 / 5; max-width: 100%; }
.choix-media img, .choix-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.choix-media[aria-pressed=true] { border-color: var(--rose); box-shadow: var(--ombre-bouton); }
.choix-media__ordre { position: absolute; top: 6px; left: 6px; min-width: 26px; height: 26px; border-radius: 999px; background: var(--rose); color: #fff; font-weight: 700; display: none; align-items: center; justify-content: center; padding: 0 6px; }
.choix-media[aria-pressed=true] .choix-media__ordre { display: flex; }
.choix-media__video { position: absolute; bottom: 6px; right: 6px; background: rgba(46, 36, 69, .75); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.ligne-date { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 14px; }
.ligne-date label { display: grid; gap: 4px; }
.ligne-date[aria-disabled=true] { opacity: .45; }

/* --- Fiche --- */
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 860px) { .deux-colonnes { grid-template-columns: 1fr; } }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.vignettes figure { margin: 0; position: relative; }
.vignettes img, .vignettes video { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; display: block; }
.vignettes figcaption { position: absolute; top: 6px; left: 6px; background: var(--rose); color: #fff; font-weight: 700; font-size: .78rem; border-radius: 999px; padding: 1px 9px; }
.texte-envoye { white-space: pre-wrap; word-break: break-word; font: 500 .95rem var(--police); background: var(--fond); border-radius: 14px; padding: 12px 14px; margin: 0; }
.envois { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.envoi { background: var(--fond); border-radius: 16px; padding: 12px 14px; border-left: 6px solid var(--fond); }
.envoi { --fond: #EDE9FF; }
.envoi__tete { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.envoi p { margin: 4px 0 0; }

/* --- Comptes et bibliothèque --- */
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.compte__tete { display: flex; gap: 12px; align-items: center; }
.compte__tete h2 { margin: 0; }
.compte__tete p { margin: 0; }
.compte__reseau { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--fond); color: var(--texte); flex: none; }
.compte { --fond: #EDE9FF; --texte: #4A3A99; }
.compte form { margin: 8px 0 0; }
.grille-bibliotheque { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.media { margin: 0; padding: 10px; display: grid; gap: 8px; }
.media img, .media video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--lilas); }
.media figcaption { display: grid; gap: 2px; }
.media figcaption strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.media form { margin: 4px 0 0; }

/* --- Journal --- */
.tableau-defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--encre-douce); padding: 8px 10px; border-bottom: 2px solid var(--filet); }
.tableau td { padding: 10px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau details { margin-top: 6px; }
.tableau pre { white-space: pre-wrap; word-break: break-all; font-size: .78rem; background: var(--fond); border-radius: 10px; padding: 8px 10px; max-height: 260px; overflow: auto; margin: 6px 0 0; }
code { background: var(--fond); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.texte-long { max-width: 760px; }

/* --- Fenêtre de confirmation (jamais window.confirm) --- */
dialog.confirmation { border: 0; border-radius: 24px; padding: 24px; max-width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(46, 36, 69, .3); color: var(--encre); font-family: var(--police); }
dialog.confirmation::backdrop { background: rgba(46, 36, 69, .35); }
dialog.confirmation p { margin: 0 0 18px; font-weight: 600; }
