/* CINETOOLS sur téléphone — mêmes couleurs que l'application des postes. */
@font-face { font-family: 'Fredoka'; src: url('fonts/fredoka.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Figtree'; src: url('fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }

:root {
  --nuit: #081339; --nuit-2: #0D1D57; --nuit-3: #13297A; --abysse: #030720;
  --encre: #F4F7FF; --encre-2: #B7C4EE; --encre-3: #7F90C6;
  --trait: rgba(132, 168, 255, .16); --trait-fort: rgba(132, 168, 255, .30);
  --vert: #2DDF5B; --rouge: #FB2131; --jaune: #FDD101; --bleu: #47A0FB; --outremer: #2A6DF2; --attention: #FFB020;
  --accent: var(--outremer);
  --f-titre: 'Fredoka', 'Figtree', system-ui, sans-serif;
  --f-texte: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --haut: env(safe-area-inset-top, 0px); --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse 120% 70% at 50% 0%, #0F2670 0%, var(--nuit) 55%, var(--abysse) 100%) fixed var(--nuit);
  color: var(--encre); font: 16px/1.45 var(--f-texte); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
a { color: var(--bleu); }
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.demarrage { flex: 1; display: grid; place-items: center; }
.demarrage img { animation: souffle 1.6s ease-in-out infinite; }
@keyframes souffle { 50% { transform: scale(.94); opacity: .75; } }

/* ------------------------------------------------------------------ en-tête et onglets */
.entete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(var(--haut) + 12px) 18px 12px;
  background: linear-gradient(180deg, rgba(8, 19, 57, .97) 70%, rgba(8, 19, 57, 0)); }
.entete img { width: 34px; height: auto; }
.entete h1 { margin: 0; font: 600 21px/1 var(--f-titre); letter-spacing: .01em; flex: 1; }
.lien-etat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--encre-2); }
.lien-etat i { width: 9px; height: 9px; border-radius: 50%; background: var(--encre-3); }
.lien-etat.vif i { background: var(--vert); box-shadow: 0 0 0 4px rgba(45, 223, 91, .16); }
.contenu { flex: 1; padding: 4px 16px calc(var(--bas) + 96px); max-width: 680px; width: 100%; margin: 0 auto; }
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(var(--bas) + 8px); background: rgba(6, 14, 44, .94); border-top: 1px solid var(--trait);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.onglets a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; color: var(--encre-3); text-decoration: none;
  font-size: 12px; font-weight: 600; border-radius: 12px; }
.onglets a svg { width: 25px; height: 25px; }
.onglets a.actif { color: var(--encre); }
.onglets a.actif svg { color: var(--accent); }

/* ------------------------------------------------------------------ blocs */
h2 { font: 600 19px/1.2 var(--f-titre); margin: 22px 4px 10px; }
h2 small { font: 500 14px var(--f-texte); color: var(--encre-3); margin-left: 6px; }
.plaque { background: linear-gradient(180deg, var(--nuit-3), var(--nuit-2)); border-radius: 22px; padding: 16px;
  box-shadow: inset 0 1px 0 rgba(160, 195, 255, .22), 0 18px 36px -22px rgba(0, 0, 10, .9); }
.plaque + .plaque { margin-top: 12px; }
.creux { background: rgba(3, 9, 34, .45); border-radius: 18px; padding: 16px; border: 1px dashed var(--trait-fort); color: var(--encre-2); }
.discret { color: var(--encre-3); }
.petit { font-size: 13.5px; }
.vide { text-align: center; padding: 34px 18px; color: var(--encre-2); }
.vide img { width: 84px; height: auto; filter: drop-shadow(0 14px 14px rgba(0, 0, 18, .55)); }
.vide h3 { margin: 10px 0 6px; font: 600 19px var(--f-titre); color: var(--encre); }
.vide p { margin: 0 auto; max-width: 34ch; }

/* ------------------------------------------------------------------ activité */
.activite { display: block; position: relative; overflow: hidden; text-decoration: none; color: inherit; padding-left: 20px; }
.activite::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--accent); }
.activite__tete { display: flex; align-items: center; gap: 10px; }
.activite__tete img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.activite__titre { font-weight: 700; font-size: 16.5px; line-height: 1.25; overflow-wrap: anywhere; }
.activite__qui { font-size: 13px; color: var(--encre-2); }
.activite__texte { margin-top: 10px; font-size: 14px; color: var(--encre-2); overflow-wrap: anywhere; }
.barre { height: 10px; border-radius: 6px; background: rgba(3, 9, 34, .6); overflow: hidden; margin-top: 12px; }
.barre i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, white));
  transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.barre.indet i { width: 35%; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.chiffres { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; font-size: 13px; color: var(--encre-2); }
.chiffres b { color: var(--encre); font-weight: 700; }
.pastille { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  background: rgba(132, 168, 255, .14); color: var(--encre-2); white-space: nowrap; }
.pastille.ok { background: rgba(45, 223, 91, .16); color: #7CF29B; }
.pastille.danger { background: rgba(251, 33, 49, .18); color: #FF8790; }
.pastille.attention { background: rgba(255, 176, 32, .18); color: #FFD27A; }
.pastille.vif { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--encre); }

/* détail */
.retour { display: inline-flex; align-items: center; gap: 4px; margin: 4px 0 6px; color: var(--encre-2); text-decoration: none; font-weight: 600; }
.grand-chiffre { font: 600 54px/1 var(--f-titre); letter-spacing: -.01em; margin-top: 14px; }
.grille { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.case { background: rgba(3, 9, 34, .42); border-radius: 14px; padding: 10px 12px; }
.case span { display: block; font-size: 12px; color: var(--encre-3); font-weight: 600; }
.case b { font-size: 16px; overflow-wrap: anywhere; }
.chemin-long { font-size: 13px; color: var(--encre-2); overflow-wrap: anywhere; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* ------------------------------------------------------------------ boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 15px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 10px 20px -12px rgba(0, 0, 0, .8); }
.btn:active { transform: translateY(1px); filter: brightness(.94); }
.btn[disabled] { opacity: .5; }
.btn.neutre { background: rgba(132, 168, 255, .16); color: var(--encre); }
.btn.danger { background: var(--rouge); }
.btn.large { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.champ { display: block; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 15px; border: 1px solid var(--trait-fort);
  background: rgba(3, 9, 34, .6); font-size: 18px; outline: none; }
.champ:focus { border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(71, 160, 251, .2); }
.champ.code { font: 600 30px/1 var(--f-titre); letter-spacing: .14em; text-align: center; }
label.legende { display: block; margin: 16px 2px 7px; font-weight: 700; font-size: 14px; color: var(--encre-2); }
.erreur { color: #FF8790; font-weight: 600; margin-top: 12px; min-height: 1.4em; }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(71, 160, 251, .12); color: var(--encre-2); font-size: 14px; }
.note b { color: var(--encre); }

/* ------------------------------------------------------------------ appairage */
.appairage { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--haut) + 28px) 22px calc(var(--bas) + 28px);
  max-width: 460px; margin: 0 auto; width: 100%; }
.appairage .logo { width: 132px; height: auto; display: block; margin: 0 auto 6px; filter: drop-shadow(0 18px 24px rgba(0, 0, 20, .6)); }
.appairage h1 { text-align: center; font: 600 28px/1.15 var(--f-titre); margin: 8px 0 8px; }
.appairage p.intro { text-align: center; color: var(--encre-2); margin: 0 0 8px; }

/* ------------------------------------------------------------------ listes */
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--trait); text-decoration: none; color: inherit; }
.ligne:last-child { border-bottom: 0; }
.ligne > svg { width: 20px; height: 20px; flex: none; color: var(--encre-3); }
.ligne__icone { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: rgba(132, 168, 255, .12); }
.ligne__icone svg { width: 23px; height: 23px; color: var(--encre-2); }
.ligne__icone img { width: 34px; height: 34px; object-fit: contain; }
.ligne__corps { flex: 1; min-width: 0; }
.ligne__titre { font-weight: 700; overflow-wrap: anywhere; }
.ligne__sous { font-size: 13px; color: var(--encre-3); overflow-wrap: anywhere; }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--encre-3); display: inline-block; margin-right: 6px; vertical-align: 1px; }
.point.vif { background: var(--vert); }
.barre-fichiers { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.barre-fichiers .btn { min-height: 42px; padding: 0 16px; font-size: 15px; }
.barre-fichiers .btn svg { width: 18px; height: 18px; }
.fil { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 2px 12px; font-size: 14px; color: var(--encre-3); }
.fil a { color: var(--encre-2); text-decoration: none; font-weight: 600; }
.bascule { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--trait); }
.bascule:last-child { border-bottom: 0; }
.bascule input { width: 50px; height: 30px; appearance: none; -webkit-appearance: none; border-radius: 99px; background: rgba(132, 168, 255, .22);
  position: relative; flex: none; transition: background .2s; }
.bascule input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.bascule input:checked { background: var(--vert); }
.bascule input:checked::after { transform: translateX(20px); }
.toast { position: fixed; left: 50%; bottom: calc(var(--bas) + 92px); transform: translateX(-50%); z-index: 9; padding: 12px 18px; border-radius: 14px;
  background: #F4F7FF; color: #0D1D57; font-weight: 700; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
