/* Page Tesla : thème sombre fixe (écran de voiture, lu d'un coup d'œil), gros éléments, contraste fort.
   Charte du groupe MaNi (docs/charte-graphique.md) : jetons --mani-*, aurore de nuit, verre dépoli, accent indigo → violet.
   Aucune ressource externe. */
:root {
  --mani-nuit: #0a0f1f;
  --mani-accent: #6366f1;
  --mani-accent-2: #a855f7;
  --mani-accent-fort: #a5b4fc;
  --mani-anneau: rgba(99, 102, 241, .28);
  --mani-texte: #f8fafc;
  --mani-carte: rgba(15, 23, 42, .55);
  --mani-carte-bord: rgba(255, 255, 255, .1);
  --mani-champ-bord: rgba(255, 255, 255, .12);
  --mani-rayon: 12px;
  --mani-rayon-carte: 24px;
  --mani-police: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --muted: #cbd5e1;
  --vert: #6ee7b7; --vert-soft: rgba(110, 231, 183, .16);
  --orange: #fbbf24; --orange-soft: rgba(251, 191, 36, .18);
  --rouge: #fca5a5; --rouge-soft: rgba(252, 165, 165, .18);
  --aurore: radial-gradient(60% 50% at 0% 0%, rgba(99, 102, 241, .45), transparent 70%),
            radial-gradient(50% 45% at 100% 0%, rgba(168, 85, 247, .38), transparent 70%),
            radial-gradient(60% 50% at 100% 100%, rgba(34, 211, 238, .22), transparent 70%),
            radial-gradient(45% 40% at 0% 100%, rgba(244, 114, 182, .14), transparent 70%), #0a0f1f;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--mani-nuit); }
body { margin: 0; min-height: 100vh; color: var(--mani-texte); background: transparent; font: 24px/1.35 var(--mani-police);
       user-select: none; -webkit-user-select: none; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--aurore); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { letter-spacing: -.02em; font-weight: 650; margin: 0; }

/* --- connexion ---------------------------------------------------------------------------------------------- */
.connexion { display: grid; place-items: center; }
.carte-code { width: min(560px, 94vw); padding: 40px; text-align: center; background: var(--mani-carte);
              border: 1px solid var(--mani-carte-bord); border-radius: var(--mani-rayon-carte);
              backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
              box-shadow: 0 30px 80px -20px rgba(2, 6, 23, .6); animation: entree .5s ease both; }
.logo { width: 72px; height: 72px; border-radius: 18px; }
.carte-code h1 { font-size: 2rem; margin: 14px 0 18px; }
.points { display: flex; justify-content: center; gap: 18px; margin-bottom: 10px; }
.points span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--mani-accent-fort); }
.points span.plein { background: linear-gradient(135deg, var(--mani-accent), var(--mani-accent-2)); border-color: transparent; }
.message { min-height: 1.6em; margin: 6px 0 14px; color: var(--muted); font-size: 1.1rem; }
.message.erreur { color: var(--rouge); }
.pave { display: grid; grid-template-columns: repeat(3, 140px); gap: 16px; justify-content: center; }
.pave button { height: 120px; min-width: 120px; font-size: 2.6rem; font-weight: 600; border-radius: 28px;
               background: rgba(255, 255, 255, .08); border: 1px solid var(--mani-champ-bord); }
.pave button:active { background: linear-gradient(135deg, var(--mani-accent), var(--mani-accent-2)); border-color: transparent; }
.pave .efface { font-size: 2.2rem; }
.pave button[data-chiffre="0"] { grid-column: 2; }
.secoue { animation: secoue .4s ease; }
@keyframes secoue { 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
@keyframes entree { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- page ---------------------------------------------------------------------------------------------------- */
.haut { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 14px 28px;
        background: var(--mani-carte); border-bottom: 1px solid var(--mani-carte-bord);
        backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); }
.logo-petit { width: 56px; height: 56px; border-radius: 14px; }
.onglets { display: flex; gap: 16px; flex: 1; }
.onglets button { min-width: 260px; height: 80px; font-size: 2rem; font-weight: 650; border-radius: 22px;
                  background: rgba(255, 255, 255, .06); border: 1px solid var(--mani-champ-bord); }
.onglets button[aria-selected="true"] { background: linear-gradient(135deg, var(--mani-accent), var(--mani-accent-2));
                                        border-color: transparent; }
.statut { font-size: 1.1rem; color: var(--muted); }
.statut.erreur { color: var(--rouge); font-weight: 650; }
main { padding: 24px 28px 40px; }
.vue { display: grid; gap: 22px; }
.rangee { display: grid; gap: 22px; }
.rangee.quatre { grid-template-columns: repeat(4, 1fr); }
.rangee.trois { grid-template-columns: repeat(3, 1fr); }
.carte { padding: 24px 28px; background: var(--mani-carte); border: 1px solid var(--mani-carte-bord);
         border-radius: var(--mani-rayon-carte); backdrop-filter: blur(24px) saturate(150%);
         -webkit-backdrop-filter: blur(24px) saturate(150%); box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .7); }
.carte h2 { font-size: 1.15rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.valeur { margin: 10px 0 4px; font-size: 2.6rem; font-weight: 700; line-height: 1.15; }
.detail { margin: 0 0 6px; color: var(--muted); font-size: 1.3rem; min-height: 1.4em; }
.carte[data-niveau="ok"] .valeur { color: var(--vert); }
.carte[data-niveau="alerte"] .valeur { color: var(--orange); }
.carte[data-niveau="indispo"] .valeur { color: var(--muted); }
.boutons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.bouton { flex: 1 1 150px; min-height: 110px; padding: 0 18px; font-size: 1.9rem; font-weight: 650; border-radius: 24px;
          background: rgba(255, 255, 255, .08); border: 2px solid var(--mani-champ-bord); }
.bouton:active { filter: brightness(1.3); }
.bouton.actif { background: linear-gradient(135deg, var(--mani-accent), var(--mani-accent-2)); border-color: transparent; }
.bouton.encours { background: var(--orange-soft); border-color: var(--orange); color: var(--orange); }
.bouton.fait { background: var(--vert-soft); border-color: var(--vert); color: var(--vert); }
.bouton.echec { background: var(--rouge-soft); border-color: var(--rouge); color: var(--rouge); }
.bouton.confirmer { background: var(--orange-soft); border-color: var(--orange); color: var(--orange);
                    animation: appel 1s ease-in-out infinite; }
@keyframes appel { 50% { filter: brightness(1.35); } }
.meteo .jours { display: flex; gap: 18px; margin-top: 10px; }
.jour { flex: 1; padding: 14px; border-radius: 18px; background: rgba(255, 255, 255, .06); display: grid; gap: 2px;
        font-size: 1.25rem; text-align: center; }
.jour strong { font-size: 1.4rem; }

/* --- caméras ------------------------------------------------------------------------------------------------- */
#vue-cameras { grid-template-columns: repeat(3, 1fr); }
.camera { position: relative; padding: 0; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 22px;
          background: rgba(2, 6, 23, .7); border: 1px solid var(--mani-carte-bord); }
.camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera span, .grand span { position: absolute; left: 16px; bottom: 14px; padding: 6px 16px; font-size: 1.5rem;
                            font-weight: 650; border-radius: 14px; background: rgba(2, 6, 23, .75); }
.grand { position: fixed; inset: 0; z-index: 10; background: rgba(2, 6, 23, .94); display: grid; place-items: center; }
.grand img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.grand span { font-size: 2rem; }

@media (max-width: 1100px) {
  .rangee.quatre, .rangee.trois, #vue-cameras { grid-template-columns: 1fr 1fr; }
  .onglets button { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
