/* SOSinfos Cloud : styles communs (maquette). Mêmes couleurs que les autres sites SOSinfos */

:root {
  --fond: #ffffff;
  --fond-doux: #f5f5f7;
  --carte: #ffffff;
  --texte: #1d1d1f;
  --texte-doux: #6e6e73;
  --bordure: #e3e3e8;
  --accent: #0b63d6;
  --accent-fond: #e8f1fd;
  --bouton: #0b63d6;
  --rouge: #c8241b;
  --rouge-fond: #fdecea;
  --orange: #9a5b00;
  --orange-fond: #fff3df;
  --vert: #1e7a3c;
  --vert-fond: #e5f5ea;
  --gris: #8e8e93;
  --gris-fond: #eeeef1;
  --ombre: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #111113;
    --fond-doux: #1a1a1d;
    --carte: #1c1c1f;
    --texte: #f2f2f4;
    --texte-doux: #a1a1a8;
    --bordure: #2e2e33;
    --accent: #6aa5ff;
    --accent-fond: #18263a;
    --bouton: #2a6fdb;
    --rouge: #ff8a80;
    --rouge-fond: #3a1916;
    --orange: #ffc46b;
    --orange-fond: #382a13;
    --vert: #7fd69a;
    --vert-fond: #16301f;
    --gris: #8e8e93;
    --gris-fond: #26262b;
    --ombre: none;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--fond);
  color: var(--texte);
  font-size: 16px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }

.bandeau-maquette {
  background: var(--orange-fond);
  color: var(--orange);
  font-size: 13px;
  text-align: center;
  padding: 6px 16px;
}

/* Boutons */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--bouton);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.bouton:hover { filter: brightness(1.08); text-decoration: none; }
.bouton.secondaire { background: var(--fond-doux); color: var(--texte); border: 1px solid var(--bordure); }
.bouton.danger { background: var(--rouge); }
.bouton[disabled] { opacity: .5; cursor: not-allowed; filter: none; }

/* Champs */
.champ { display: grid; gap: 6px; }
.champ label { font-weight: 600; font-size: 15px; }
.champ input[type="text"], .champ input[type="password"], .champ input[type="email"] {
  width: 100%; font: inherit; font-size: 16px;
  padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--bordure); background: var(--fond); color: var(--texte);
}
.champ input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* Encadrés */
.encadre { border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.encadre.erreur { background: var(--rouge-fond); color: var(--rouge); }
.encadre.alerte { background: var(--orange-fond); color: var(--orange); }
.encadre.info { background: var(--accent-fond); color: var(--accent); }
.encadre b { display: block; margin-bottom: 2px; }

/* Pastilles d'état (voyant de session, services) */
.pastille {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.pastille::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pastille.ok { color: var(--vert); background: var(--vert-fond); }
.pastille.bientot { color: var(--orange); background: var(--orange-fond); }
.pastille.ko { color: var(--rouge); background: var(--rouge-fond); }

/* Logo */
.logo { width: 52px; height: 52px; color: var(--accent); }

/* ===== Cadre des pages connectées ===== */
:root { --largeur-barre: 248px; --hauteur-onglets: 64px; }

.app { min-height: 100dvh; background: var(--fond-doux); }

/* En-tête (iPhone et ordinateur) */
.entete {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 16px;
  background: color-mix(in srgb, var(--fond) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--bordure);
}
.entete h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entete .marque-mobile { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.entete .marque-mobile svg { width: 26px; height: 26px; }
.voyant-session { text-decoration: none !important; }
.deconnexion { color: var(--texte-doux); font-size: 14px; display: none; }
@media (min-width: 900px) { .deconnexion { display: inline; } }

/* Barre latérale (ordinateur) */
.barre { display: none; }

/* Onglets du bas (iPhone) */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--hauteur-onglets) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--fond) 92%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--bordure);
}
.onglets a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--gris); font-size: 11px; font-weight: 500; text-decoration: none;
}
.onglets a svg { width: 24px; height: 24px; }
.onglets a.actif { color: var(--accent); }

.contenu { padding: 16px 16px calc(var(--hauteur-onglets) + env(safe-area-inset-bottom) + 24px); max-width: 1200px; margin: 0 auto; }

.icone { width: 20px; height: 20px; flex: none; }

@media (min-width: 900px) {
  .app { padding-left: var(--largeur-barre); }
  .onglets { display: none; }
  .entete .marque-mobile { display: none; }
  .entete { padding: 0 28px; height: 64px; }
  .entete h1 { font-size: 22px; }
  .contenu { padding: 24px 28px 48px; }

  .barre {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--largeur-barre);
    background: var(--fond); border-right: 1px solid var(--bordure);
    padding: 18px 12px; overflow-y: auto; z-index: 950;
  }
  .barre .marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; font-size: 17px; }
  .barre .marque svg { width: 30px; height: 30px; color: var(--accent); }
  .barre .marque span { color: var(--texte-doux); font-weight: 500; }
  .barre h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); margin: 16px 10px 4px; }
  .barre a {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 10px; border-radius: 9px;
    color: var(--texte); font-size: 15px; text-decoration: none;
  }
  .barre a svg { width: 19px; height: 19px; color: var(--texte-doux); }
  .barre a:hover { background: var(--fond-doux); }
  .barre a.actif { background: var(--accent-fond); color: var(--accent); font-weight: 600; }
  .barre a.actif svg { color: var(--accent); }
  .barre .bas { margin-top: auto; }
}

/* Cartes / blocs */
.carte {
  background: var(--carte); border: 1px solid var(--bordure);
  border-radius: 16px; box-shadow: var(--ombre);
  padding: 16px;
}
.carte-titre { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; }
.carte-titre .icone { color: var(--accent); }
.carte-titre a { margin-left: auto; font-size: 14px; font-weight: 500; }

/* Chargement */
.squelette { display: grid; gap: 10px; }
.squelette span {
  display: block; height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--gris-fond) 25%, var(--fond-doux) 50%, var(--gris-fond) 75%);
  background-size: 200% 100%; animation: brille 1.2s infinite linear;
}
.squelette span:nth-child(2) { width: 80%; }
.squelette span:nth-child(3) { width: 60%; }
@keyframes brille { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.indisponible { display: flex; gap: 10px; align-items: flex-start; color: var(--texte-doux); font-size: 14px; }
.indisponible b { color: var(--rouge); display: block; }

/* Pages de menu des onglets iPhone (Organisation, Fichiers, Plus) */
.menu-hub { max-width: 640px; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.menu-hub h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); margin: 0 0 6px 4px; }
.menu-hub ul { list-style: none; margin: 0; padding: 0; background: var(--carte); border: 1px solid var(--bordure); border-radius: 14px; overflow: hidden; }
.menu-hub li + li { border-top: 1px solid var(--bordure); }
.menu-hub a, .menu-hub button.entree { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--texte); text-decoration: none; width: 100%; border: 0; background: none; font: inherit; cursor: pointer; text-align: left; }
.menu-hub a:hover { background: var(--fond-doux); text-decoration: none; }
.menu-hub .tuile { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.menu-hub .tuile svg { width: 20px; height: 20px; }
.menu-hub .txt { flex: 1; min-width: 0; }
.menu-hub .txt b { display: block; font-size: 16px; font-weight: 600; }
.menu-hub .txt span { display: block; font-size: 13px; color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-hub .chevron { color: var(--gris); font-size: 20px; }
.menu-hub .rouge b { color: var(--rouge); }

/* Bouton de déconnexion (formulaire POST, sans allure de bouton) */
.form-deconnexion { margin: 0; }
button.deconnexion { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; }

/* Voyant iCloud : sur petit écran, l'état long (« non connecté », « expiré ») se résume à la couleur */
@media (max-width: 420px) { .voyant-detail.long { display: none; } }

/* Messages de confirmation (en bas, disparaissent tout seuls) */
.toast { position: fixed; left: 50%; bottom: calc(var(--hauteur-onglets) + env(safe-area-inset-bottom) + 18px); transform: translateX(-50%);
  background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 2000;
  white-space: nowrap; animation: toast 3.2s forwards; }
.toast-erreur { background: var(--rouge); color: #fff; }
@keyframes toast { 0% { opacity: 0; } 8%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (min-width: 900px) { .toast { bottom: 24px; } }
