/* Portail Sonalia des entreprises clientes — habillage (22/11/2026).
   --couleur, --accent et --sur-couleur viennent de l'habillage de l'entreprise, posés au chargement par app.js. */
:root {
  --couleur: #17335F; --accent: #FF6B1A; --sur-couleur: #fff;
  --nuit: #141A26; --creme: #F7F5F1; --ivoire: #EFEBE4; --gris: #5B6678; --bord: #DCE2EC; --blanc: #fff;
  --vert-fonce: #1E7A4C; --rouge: #C62F35;
  --teinte: #E9EDF4; --teinte-accent: #F5EEDF;
}
@supports (color: color-mix(in srgb, red 50%, white)) {
  :root { --teinte: color-mix(in srgb, var(--couleur) 11%, #fff); --teinte-accent: color-mix(in srgb, var(--accent) 18%, #fff); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--creme); color: var(--nuit); font: 16px/1.45 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---- Bande du haut : logo + nom, un seul bouton à droite ---- */
.haut { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px; background: var(--couleur); color: var(--sur-couleur); }
.marque { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Le logo = « maison » (25/11/2026, comme chez Instant) : il ramène à l'accueil depuis n'importe quel écran. */
button.marque { background: none; border: 0; padding: 4px 8px 4px 0; margin: -4px 0; min-height: 44px; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button.marque:active .logo { transform: scale(.92); }
body.vers-accueil main { visibility: hidden; }
.logo { height: 38px; width: auto; max-width: 92px; object-fit: contain; flex: none; }
.logo[hidden] { display: none; }
.titre { display: flex; flex-direction: column; min-width: 0; font-weight: 800; font-size: 19px; line-height: 1.1; }
.titre span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titre small { font-weight: 600; font-size: 11.5px; opacity: .7; letter-spacing: .02em; }
.haut-droite { display: flex; align-items: center; gap: 8px; flex: none; }
.retour { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 15px; cursor: pointer; min-height: 40px; }
.retour[hidden], .bulle[hidden], .pastille-nb[hidden] { display: none; }
.bulle { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: inherit; cursor: pointer; }
.bulle svg { width: 21px; height: 21px; }
.pastille-nb { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: var(--nuit); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--couleur); }

main { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(48px + env(safe-area-inset-bottom)); }
main.large { max-width: 760px; padding-top: 0; }
h1 { font-size: 24px; margin: 4px 0 16px; }
h2 { font-size: 18px; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.attente { color: var(--gris); text-align: center; margin-top: 40px; }

/* ---- La scène : le ciel suit le vrai soleil, la météo se pose par-dessus ---- */
.scene { position: relative; height: 250px; margin: 0 -16px; overflow: hidden; border-radius: 0 0 28px 28px; color: #fff; background: #9fcbe8; }
.scene.connexion { height: 210px; }
.scene svg.decor { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene.jour, .scene.matin { color: var(--nuit); }
.salut { position: absolute; left: 20px; right: 20px; top: 22px; z-index: 2; }
.salut h1 { font-weight: 800; font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 1.05; margin: 0; letter-spacing: -.01em; }
.salut h1 i { font-style: italic; color: var(--accent); }
.scene.jour .salut h1 i, .scene.matin .salut h1 i { color: var(--couleur); }
/* couleurs du dessin : le ciel par moment, la maison aux couleurs de l'entreprise */
.d-c1 { stop-color: #9fcbe8; } .d-c2 { stop-color: #e4f2fb; }
.matin .d-c1 { stop-color: #f6c79c; } .matin .d-c2 { stop-color: #fbe6cf; }
.soir .d-c1 { stop-color: #3a2650; } .soir .d-c2 { stop-color: #e0855a; }
.nuit .d-c1 { stop-color: #141b38; } .nuit .d-c2 { stop-color: #4b3a5e; }
.d-colline { fill: #a9c9a0; } .matin .d-colline { fill: #d9a98a; } .soir .d-colline { fill: #4a2a44; } .nuit .d-colline { fill: #2a1e3a; }
.d-colline2 { fill: #c3dbb8; } .matin .d-colline2 { fill: #e7c0a4; } .soir .d-colline2 { fill: #6a3a54; } .nuit .d-colline2 { fill: #3a2c4e; }
.d-sol { fill: #8fb184; } .matin .d-sol { fill: #c78d70; } .soir .d-sol { fill: #2a1a2e; } .nuit .d-sol { fill: #1d1428; }
.d-feuille { fill: #7fae78; } .soir .d-feuille, .nuit .d-feuille { fill: #35284a; }
.d-tronc { fill: #5c3b2e; }
.d-astre { fill: #fff3c4; } .matin .d-astre { fill: #ffd27a; } .soir .d-astre { fill: #ffb27a; opacity: .9; } .nuit .d-astre { fill: #fff6dc; }
.d-nuage { fill: #fff; opacity: .85; } .soir .d-nuage, .nuit .d-nuage { display: none; }
.d-etoiles { display: none; fill: #fff; } .nuit .d-etoiles { display: inline; }
.d-marque { fill: var(--couleur); } .d-accent { fill: var(--accent); } .d-trait { stroke: var(--accent); }
.d-mur { fill: #f2ede5; } .d-mur2 { fill: #e4ddd2; } .d-ombre { fill: rgba(0,0,0,.12); }
.d-vitre { fill: #cfe3f0; } .soir .d-vitre, .nuit .d-vitre { fill: #ffcf6b; }
.d-porte { fill: #2b3140; }
.d-nuages-file { animation: derive 40s ease-in-out infinite alternate; }
@keyframes derive { to { transform: translateX(26px); } }
.d-etoiles circle { animation: scint 3s ease-in-out infinite; }
.d-etoiles circle:nth-child(2n) { animation-delay: 1.2s; } .d-etoiles circle:nth-child(3n) { animation-delay: 2s; }
@keyframes scint { 50% { opacity: .25; } }
.soir .d-lueur, .nuit .d-lueur { animation: lueur 2.6s ease-in-out infinite alternate; }
@keyframes lueur { to { opacity: .75; } }

/* ---- Connexion ---- */
.carte-entree { position: relative; z-index: 3; margin: -30px 0 0; padding: 18px 18px 16px; border-radius: 22px; background: var(--blanc);
  box-shadow: 0 1px 0 var(--bord), 0 14px 34px rgba(20,26,38,.12); }

/* ---- Formulaires ---- */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[inputmode=numeric] { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px;
  border: 1px solid var(--bord); border-radius: 12px; background: var(--blanc); color: var(--nuit); }
.carte-entree input { background: var(--creme); }
input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--couleur); }
.bouton { display: block; width: 100%; margin-top: 20px; padding: 14px; border: 0; border-radius: 14px; background: var(--couleur);
  color: var(--sur-couleur); font-weight: 700; font-size: 17px; cursor: pointer; }
.bouton.discret { background: transparent; color: var(--couleur); border: 1px solid var(--bord); font-weight: 600; }
.bouton:disabled { opacity: .6; }
.erreur { color: var(--rouge); font-weight: 600; margin-top: 12px; }
.erreur:empty { display: none; }
.ok { color: var(--vert-fonce); font-weight: 600; }

/* ---- Accueil : les grandes vignettes illustrées ---- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.tuile { display: flex; flex-direction: column; padding: 0; border: 0; border-radius: 20px; background: var(--blanc); overflow: hidden; text-align: left;
  color: var(--nuit); cursor: pointer; box-shadow: 0 1px 0 var(--bord), 0 6px 16px rgba(20,26,38,.07); transition: transform .15s, box-shadow .15s; }
.tuile[hidden] { display: none; }
.tuile .img { display: block; height: 96px; width: 100%; background: var(--teinte); }
.tuile:nth-child(even) .img { background: var(--teinte-accent); }
.tuile .img svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tuile .txt { display: block; padding: 9px 13px 12px; }
.tuile b { display: block; font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.tuile small { display: block; font-size: 12.5px; color: var(--gris); margin-top: 3px; line-height: 1.3; }
/* Vignette « À faire » : pastille rouge et ligne rouge quand des tâches attendent (01/12/2026). */
.pastille-tache { display: inline-block; vertical-align: 2px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--rouge); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.pastille-tache[hidden] { display: none; }
.tuile small.alerte { color: var(--rouge); font-weight: 700; }
.tuile:not(:disabled):hover, .tuile:not(:disabled):focus-visible { transform: translateY(-3px); box-shadow: 0 1px 0 var(--bord), 0 14px 26px rgba(20,26,38,.12); }
.tuile:not(:disabled):active { transform: scale(.98); }
.tuile:disabled { cursor: default; opacity: .6; }
.tuile.bientot .img { filter: grayscale(1); }
.tuile.gerer { grid-column: 1 / -1; flex-direction: row; align-items: center; background: var(--couleur); color: var(--sur-couleur); }
.tuile.gerer .img { width: 118px; height: 78px; flex: none; background: rgba(255,255,255,.12); }
.tuile.gerer small { color: inherit; opacity: .75; }
.vide { color: var(--gris); }
.tuiles .vide { grid-column: 1 / -1; text-align: center; padding: 24px 0; }
/* couleurs des dessins des vignettes */
.v-ch { fill: #222a38; } .v-cr { fill: #fff; } .v-iv { fill: #f3efe8; } .v-gr { fill: #9aa3b2; } .v-li { fill: #d5dbe5; }
.v-ve { fill: #2f9a62; } .v-ja { fill: #ffd66b; } .v-marque { fill: var(--couleur); } .v-accent { fill: var(--accent); }
.v-t, .v-trait { stroke: #222a38; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.v-trait { fill: none; }
.v-l { fill: none; stroke: #c9cfda; stroke-width: 3; stroke-linecap: round; }
.v-coche { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.v-coche-ve { fill: none; stroke: #2f9a62; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.v-sol { fill: rgba(0,0,0,.07); }
.v-txt { font: 700 16px 'Plus Jakarta Sans', sans-serif; fill: #222a38; }
.v-txt-b { font: 700 10px 'Plus Jakarta Sans', sans-serif; fill: #fff; }
/* animations des dessins */
.a-onde { animation: onde 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes onde { 50% { opacity: .35; transform: scale(1.06); } }
.a-pop { animation: pop 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pop { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.16); } }
.a-flotte { animation: flotte 1.9s ease-in-out infinite; }
@keyframes flotte { 50% { transform: translateY(-5px); } }
.a-balance { animation: balance 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 20% 80%; }
@keyframes balance { 50% { transform: rotate(7deg); } }
.a-aiguille { animation: tour 6s linear infinite; transform-box: view-box; transform-origin: 110px 56px; }
@keyframes tour { to { transform: rotate(360deg); } }
.a-roule { animation: roule .5s ease-in-out infinite alternate; }
@keyframes roule { to { transform: translateY(-1.5px); } }
@media (prefers-reduced-motion: reduce) { .scene *, .tuile * { animation: none !important; } .tuile { transition: none; } }

.pied { margin-top: 28px; }

/* ---- Écrans internes (messages, bibliothèque, idées) : chacun apporte sa feuille de style ---- */
.interne { min-height: 50vh; }

/* ---- Assistant de rédaction (02/12/2026) : badge Bêta de la vignette, bulle ✍️ sur tous les écrans, volet par-dessus ---- */
.tuile.avec-beta { position: relative; }
.tuile .beta { position: absolute; top: 8px; right: 8px; z-index: 1; background: var(--accent); color: var(--nuit); font-size: 10.5px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
/* À gauche : à droite, la messagerie a déjà son bouton « Nouveau message ». */
.bulle-redaction { position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 30;
  width: 54px; height: 54px; border-radius: 50%; border: 0; padding: 0; background: var(--couleur); color: var(--sur-couleur); font-size: 24px;
  line-height: 54px; box-shadow: 0 10px 24px rgba(20,26,38,.3); cursor: pointer; }
.bulle-redaction[hidden], .volet-redaction[hidden] { display: none; }
body.avec-bulle-redaction main { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.volet-redaction { position: fixed; inset: 0; z-index: 60; }
.vr-fond { position: absolute; inset: 0; background: rgba(20,26,38,.45); }
.vr-panneau { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--creme); border-radius: 24px 24px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(20,26,38,.25); }
.vr-fermer { position: sticky; top: 0; float: right; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bord); background: var(--blanc);
  font-size: 18px; cursor: pointer; z-index: 1; }
body.volet-ouvert { overflow: hidden; }
@media (min-width: 900px) { .vr-panneau { left: 50%; right: auto; width: 560px; transform: translateX(-50%); bottom: 24px; border-radius: 24px; } }

/* ---- Accès de l'équipe ---- */
.carte { background: var(--blanc); border: 1px solid var(--bord); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.carte h3 { margin: 0 0 8px; font-size: 17px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.etiquette { font-size: 12px; font-weight: 700; color: var(--couleur); }
.inactif { opacity: .6; }
.case { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-weight: 500; }
.case input { width: 22px; height: 22px; accent-color: var(--couleur); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.petit { border: 1px solid var(--bord); background: var(--creme); color: var(--couleur); border-radius: 999px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; }
.journal { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--gris); }
.journal li { padding: 6px 0; border-bottom: 1px solid var(--bord); }

/* ---- Ordinateur ---- */
@media (min-width: 760px) {
  .scene { height: 290px; margin: 0; border-radius: 0 0 32px 32px; }
  .scene.connexion { height: 240px; }
  .salut { left: 36px; top: 40px; }
  .salut h1 { font-size: 2.8rem; }
  .tuiles { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .tuile .img { height: 120px; }
  .carte-entree { max-width: 440px; margin: -40px auto 0; }
}
