:root {
  --bleu: #34556f;        /* texte principal */
  --bleu-fonce: #28546c;  /* header */
  --bleu-nuit: #1d3c54;   /* accents */
  --orange: #e95e27;      /* marque */
  --gris-fond: #f4f6f8;
  --gris-bord: #e2e8f0;
  --gris-texte: #4a5568;
  --blanc: #ffffff;
  --radius: 10px;
  --ombre: 0 2px 8px rgba(29, 60, 84, .08);
  --ombre-forte: 0 6px 24px rgba(29, 60, 84, .16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--bleu);
  background: var(--gris-fond);
  line-height: 1.5;
}
.conteneur { max-width: 760px; margin: 0 auto; padding: 1rem; }
.entete {
  background: var(--bleu-fonce); color: var(--blanc);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; box-shadow: var(--ombre);
}
.entete img { width: 64px; height: 64px; }
.entete h1 { font-size: 1.25rem; margin: 0; font-weight: 700; }
.carte {
  background: var(--blanc); border: 1px solid var(--gris-bord);
  border-radius: var(--radius); box-shadow: var(--ombre);
  padding: 1.1rem 1.25rem; margin-top: 1rem;
}
.champ { margin-bottom: .85rem; }
.champ:last-child { margin-bottom: 0; }
.champ label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.champ input[type=text], .champ input[type=email], .champ input[type=tel], .champ input[type=file] {
  width: 100%; padding: .6rem .7rem; border: 1px solid var(--gris-bord);
  border-radius: 8px; font-size: 1rem; background: var(--blanc); color: var(--bleu);
}
.champ input:focus { outline: 2px solid var(--orange); border-color: var(--orange); }
.ligne { display: flex; gap: 1rem; flex-wrap: wrap; }
.ligne > .champ { flex: 1 1 220px; }
.reseau { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.reseau input[type=text] { margin-top: .4rem; }
.btn {
  display: inline-block; border: none; border-radius: 8px; cursor: pointer;
  padding: .65rem 1.4rem; font-size: 1rem; font-weight: 600; text-decoration: none;
}
.btn-primaire { background: var(--orange); color: var(--blanc); }
.btn-primaire:hover { background: #d24e1c; }
.btn-secondaire { background: var(--gris-bord); color: var(--bleu); }
.actions { display: flex; gap: .75rem; justify-content: center; margin-top: 1rem; }
.alerte { background: #fdecea; color: #a4322a; border: 1px solid #f5c6c2;
  border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; }
.apercu { margin-top: 1rem; overflow-x: auto; }
.pied { text-align: center; color: var(--gris-texte); font-size: .8rem; margin: 1.2rem 0; }
.pied .eclair {
  width: 1em; height: 1em;
  vertical-align: -.16em;
  fill: #00a0e3;
  filter: drop-shadow(0 0 3px rgba(0, 160, 227, .9)) drop-shadow(0 0 6px rgba(0, 160, 227, .5));
  animation: eclair-glow 3s ease-in-out infinite;
}
@keyframes eclair-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(0, 160, 227, .7)) drop-shadow(0 0 5px rgba(0, 160, 227, .4)); }
  50%      { filter: drop-shadow(0 0 5px rgba(0, 160, 227, 1)) drop-shadow(0 0 10px rgba(0, 160, 227, .65)); }
}
@media (prefers-reduced-motion: reduce) { .pied .eclair { animation: none; } }

/* Page de connexion centrée */
.connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.connexion .carte { width: 100%; max-width: 380px; text-align: center; }
.connexion img { width: 90px; height: 90px; margin-bottom: .5rem; }
.connexion h1 { color: var(--bleu-fonce); font-size: 1.3rem; margin: .2rem 0; }
.connexion .champ { text-align: left; }

.badge { background: var(--bleu-nuit); color: #fff; padding: .25rem .6rem; border-radius: 999px; font-size: .8rem; }
.onglets { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.onglets a { padding: .5rem .9rem; background: var(--blanc); border: 1px solid var(--gris-bord);
  border-radius: 8px; text-decoration: none; color: var(--bleu); font-weight: 600; }
.onglets a:hover { border-color: var(--orange); color: var(--orange); }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; margin-top: .5rem; }
.carte-lien { display: block; padding: 1rem; text-align: center; background: var(--gris-fond);
  border: 1px solid var(--gris-bord); border-radius: 8px; text-decoration: none; color: var(--bleu); font-weight: 600; }
.carte-lien:hover { border-color: var(--orange); color: var(--orange); }
.tableau { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.tableau th, .tableau td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--gris-bord); font-size: .9rem; }
.tableau th { color: var(--gris-texte); font-size: .8rem; text-transform: uppercase; }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-top: .75rem; }
.vignette { border: 1px solid var(--gris-bord); border-radius: 8px; padding: .5rem; text-align: center; background: var(--blanc); }
.vignette.active { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.vignette img { max-width: 100%; height: auto; border-radius: 4px; }
.vignette .meta { font-size: .75rem; color: var(--gris-texte); margin: .3rem 0; word-break: break-all; }
.btn-danger { background: #a4322a; color: #fff; }
.succes { background: #eaf7ee; color: #24663a; border: 1px solid #b7e0c4; border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; }
.filtres { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: .5rem; }

/* Aperçus des signatures (liste admin) — iframe sandbox scalée */
.grille-sigs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin-top: .75rem; }
.sig-carte { border: 1px solid var(--gris-bord); border-radius: 10px; background: #fff; overflow: hidden; box-shadow: var(--ombre); }
.sig-cadre { height: 118px; overflow: hidden; background: #fff; border-bottom: 1px solid var(--gris-bord); }
.sig-frame { border: 0; display: block; width: 151.5%; height: 178px; transform: scale(.66); transform-origin: top left; pointer-events: none; background: #fff; }
.sig-infos { padding: .55rem .65rem; }
.sig-nom { font-size: .72rem; word-break: break-all; }
.sig-actions { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }

/* Grille de photos (onglet Photos, sélection multiple) */
.grille-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .8rem; margin: .75rem 0; }
.photo-carte { border: 1px solid var(--gris-bord); border-radius: 10px; background: #fff; padding: .4rem; text-align: center; position: relative; transition: border-color .12s, box-shadow .12s; }
.photo-carte:hover { border-color: var(--orange); }
.photo-carte:has(input:checked) { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.photo-carte img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; background: var(--gris-fond); }
.photo-carte label { display: block; cursor: pointer; margin: 0; }
.photo-carte .nom { font-size: .66rem; color: var(--gris-texte); word-break: break-all; margin-top: .35rem; line-height: 1.25; }
.photo-carte input[type=checkbox] { position: absolute; top: .5rem; left: .5rem; width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; box-shadow: 0 0 0 2px #fff; border-radius: 3px; }
.barre-selection { position: sticky; top: 0; z-index: 5; background: var(--gris-fond); padding: .5rem 0; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
