/* Photuris Livraison — espace client. Les couleurs et polices viennent de config/brand.json (variables CSS). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--fond); color: var(--texte);
  font-family: var(--police-texte); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; }
h1, h2, h3 { font-family: var(--police-titres); font-weight: 400; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; }
h3 { font-size: 1.35rem; }
p { margin: 0; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.texte-doux { color: var(--texte-doux); }
.sur-titre { text-transform: uppercase; letter-spacing: .28em; font-size: .7rem; color: var(--accent); margin-bottom: .9rem; }
.erreur { color: #f08c7a; min-height: 1.3em; font-size: .92rem; }
.logo { height: 48px; width: auto; max-width: 280px; object-fit: contain; }
.logo-petit { height: 34px; opacity: .9; }
.logo-barre { height: 32px; }

/* ---- halos lumineux (ambiance luciole) */
.halo { position: fixed; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0; opacity: .55; }
.halo-a { width: 60vw; height: 60vw; left: -20vw; top: -25vw; background: radial-gradient(circle, var(--accent) 0%, transparent 65%); opacity: .16; }
.halo-b { width: 45vw; height: 45vw; right: -15vw; bottom: -15vw; background: radial-gradient(circle, var(--accent-doux) 0%, transparent 65%); opacity: .10; }

/* ---- boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: 999px; border: 1px solid var(--ligne);
  background: var(--surface); color: var(--texte); text-decoration: none; cursor: pointer;
  font-size: .92rem; letter-spacing: .02em; transition: transform .15s ease, background .2s, border-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.bouton:hover { transform: translateY(-1px); border-color: var(--accent); }
.bouton:disabled { opacity: .55; cursor: default; transform: none; }
.bouton-plein { background: var(--accent); color: #141008; border-color: var(--accent); font-weight: 500; }
.bouton-plein:hover { background: var(--accent-doux); border-color: var(--accent-doux); box-shadow: 0 10px 30px -12px var(--accent); }
.bouton-discret { background: transparent; }
.bouton-icone { padding: .6rem; width: 40px; height: 40px; }
.bouton-rond { width: 56px; height: 56px; padding: 0; border-radius: 50%; }
.bouton-petit { padding: .45rem .9rem; font-size: .82rem; }

/* ---- formulaires */
label { display: block; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
label.champ { text-transform: none; letter-spacing: 0; font-size: .9rem; margin-top: 1.1rem; }
input, textarea {
  display: block; width: 100%; margin-top: .45rem; padding: .85rem 1rem;
  background: var(--fond); color: var(--texte); border: 1px solid var(--ligne); border-radius: 12px;
  font: inherit; font-size: 1rem; outline: none; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.case { display: flex; gap: .7rem; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: .88rem; margin-top: 1.1rem; color: var(--texte-doux); }
.case input { width: 18px; height: 18px; margin: .15rem 0 0; accent-color: var(--accent); }
.ligne-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 640px) { .ligne-deux { grid-template-columns: 1fr; } }

/* ================= CONNEXION */
.page-connexion { display: grid; place-items: center; padding: 24px 16px; }
.connexion {
  position: relative; z-index: 1; width: min(980px, 100%);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.connexion-simple { grid-template-columns: 1fr; max-width: 520px; }
.connexion-marque .accroche { font-family: var(--police-titres); font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin-top: 2rem; color: var(--texte); max-width: 20ch; }
.connexion-marque .logo { height: 96px; max-width: 360px; }
.connexion-carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 24px; padding: clamp(1.6rem, 3vw, 2.8rem);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.8);
}
.connexion-carte h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); margin-bottom: .6rem; }
.connexion-carte form { margin-top: 1.6rem; display: grid; gap: 1rem; }
.connexion-carte .bouton { width: 100%; padding: .95rem; }
.connexion-carte .pied { margin-top: 1.4rem; font-size: .78rem; color: var(--texte-doux); }
@media (max-width: 820px) {
  .connexion { grid-template-columns: 1fr; gap: 2rem; }
  .connexion-marque { text-align: center; }
  .connexion-marque .logo { margin: 0 auto; height: 64px; }
  .connexion-marque .accroche { margin: 1rem auto 0; font-size: 1.3rem; }
}

/* ================= GALERIE */
.barre {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem;
  padding: .8rem clamp(16px, 3vw, 40px); background: color-mix(in srgb, var(--fond) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--ligne);
}
.barre-marque { display: flex; align-items: center; text-decoration: none; }
.barre-sections { display: flex; gap: .2rem; overflow-x: auto; flex: 1; scrollbar-width: none; }
.barre-sections::-webkit-scrollbar { display: none; }
.barre-sections a {
  text-decoration: none; padding: .45rem .9rem; border-radius: 999px; font-size: .86rem; color: var(--texte-doux); white-space: nowrap;
}
.barre-sections a:hover, .barre-sections a.actif { color: var(--texte); background: var(--surface-haute); }
.barre-actions { display: flex; gap: .5rem; align-items: center; }
@media (max-width: 760px) {
  .barre { flex-wrap: wrap; gap: .6rem; }
  .barre-sections { order: 3; flex: 0 0 100%; }
  .barre-actions { margin-left: auto; }
  #btnTout span, #btnAvis { display: none; }
}

.hero { position: relative; min-height: 62vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-image { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.02); }
.hero-voile { position: absolute; inset: 0; background: linear-gradient(to top, var(--fond) 8%, color-mix(in srgb, var(--fond) 55%, transparent) 55%, color-mix(in srgb, var(--fond) 25%, transparent) 100%); }
.hero-texte { position: relative; z-index: 1; padding: clamp(2rem, 5vw, 5rem) clamp(16px, 3vw, 40px) 2.5rem; max-width: 900px; }
.hero-message { margin-top: 1.2rem; font-size: 1.1rem; color: var(--texte); max-width: 60ch; white-space: pre-line; opacity: .9; }
.hero-meta { margin-top: 1.2rem; font-size: .82rem; color: var(--texte-doux); letter-spacing: .04em; }
.hero.sans-image { min-height: 42vh; background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 55%); }

.bandeau-vignettes { display: flex; align-items: center; gap: .6rem; margin: 0 clamp(16px, 3vw, 40px); padding: .7rem 1rem; border: 1px solid var(--ligne); border-radius: 12px; color: var(--texte-doux); font-size: .86rem; background: var(--surface); }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.contenu { padding: 1rem clamp(16px, 3vw, 40px) 4rem; display: grid; gap: 4rem; }
.section { scroll-margin-top: 90px; }
.section-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; flex-wrap: wrap; }
.section-tete .infos { color: var(--texte-doux); font-size: .86rem; margin-top: .35rem; letter-spacing: .03em; }
.section-ligne { height: 1px; background: linear-gradient(to right, var(--accent), transparent 60%); margin: .9rem 0 0; width: 72px; }

/* grille justifiée */
.grille { display: flex; flex-wrap: wrap; gap: 10px; }
.grille::after { content: ""; flex-grow: 1000000; }
.tuile {
  position: relative; overflow: hidden; border-radius: 12px; background: var(--surface); cursor: zoom-in;
  height: var(--h); flex-grow: var(--r); flex-basis: calc(var(--r) * var(--h));
}
.tuile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .4s; opacity: 0; }
.tuile img.ok { opacity: 1; }
.tuile:hover img { transform: scale(1.035); }
.tuile .voile { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.65), transparent 45%); opacity: 0; transition: opacity .25s; }
.tuile:hover .voile { opacity: 1; }
.tuile .nom { position: absolute; left: 12px; right: 52px; bottom: 10px; font-size: .78rem; color: #fff; opacity: 0; transition: opacity .25s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuile:hover .nom { opacity: 1; }
.tuile .dl { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .25s, background .2s; text-decoration: none; }
.tuile:hover .dl { opacity: 1; }
.tuile .dl:hover { background: var(--accent); color: #141008; }
.tuile .badge { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .55rem; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.tuile .attente { position: absolute; inset: 0; display: grid; place-items: center; color: var(--texte-doux); font-size: .78rem; background: repeating-linear-gradient(135deg, var(--surface) 0 12px, var(--surface-haute) 12px 24px); }
.tuile.video .lecture { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.tuile.video .lecture span { width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.4); display: grid; place-items: center; color: #fff; font-size: 1.2rem; padding-left: 4px; }

/* fichiers / documents */
.liste-fichiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fichier {
  display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--ligne); text-decoration: none; transition: border-color .2s, transform .15s;
}
.fichier:hover { border-color: var(--accent); transform: translateY(-1px); }
.fichier .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-haute); color: var(--accent); font-size: .68rem; font-weight: 600; letter-spacing: .05em; flex: none; overflow: hidden; }
.fichier .ico img { width: 100%; height: 100%; object-fit: cover; }
.fichier .meta { min-width: 0; flex: 1; }
.fichier .meta b { display: block; font-weight: 500; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fichier .meta small { color: var(--texte-doux); font-size: .78rem; }
.fichier .fleche { color: var(--texte-doux); flex: none; }

.sous-titre { font-size: .72rem; text-transform: uppercase; letter-spacing: .2em; color: var(--texte-doux); margin: 1.6rem 0 .8rem; }

.pied-page { border-top: 1px solid var(--ligne); padding: 2.5rem clamp(16px, 3vw, 40px) 3rem; display: grid; gap: .6rem; justify-items: center; text-align: center; font-size: .86rem; }
.pied-page #btnAvisPied { margin-bottom: 1.2rem; }

/* ================= VISIONNEUSE */
.visionneuse { position: fixed; inset: 0; z-index: 50; background: rgba(6,8,11,.96); display: grid; grid-template-rows: 1fr auto; animation: fondu .2s ease; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.vis-scene { display: grid; place-items: center; padding: 56px 72px 12px; min-height: 0; }
.vis-scene img, .vis-scene video { max-width: 100%; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 6px; box-shadow: 0 40px 100px -40px rgba(0,0,0,1); }
.vis-scene .doc { color: var(--texte-doux); text-align: center; }
.vis-legende { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem clamp(16px, 3vw, 40px) 1.2rem; }
.vis-nom { font-size: .95rem; }
.vis-info { font-size: .78rem; color: var(--texte-doux); }
.vis-action { display: grid; gap: .35rem; justify-items: end; }
.vis-aide { font-size: .74rem; color: var(--texte-doux); max-width: 34ch; text-align: right; min-height: 1em; }
@media (max-width: 700px) { .vis-action { justify-items: start; } .vis-aide { text-align: left; } }
.vis-fermer, .vis-nav { position: absolute; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1; display: grid; place-items: center; transition: background .2s; z-index: 2; }
.vis-fermer:hover, .vis-nav:hover { background: rgba(255,255,255,.16); }
.vis-fermer { top: 14px; right: 16px; font-size: 1rem; }
.vis-nav { top: 50%; transform: translateY(-50%); font-size: 2rem; padding-bottom: 4px; }
.vis-prec { left: 14px; } .vis-suiv { right: 14px; }
@media (max-width: 700px) {
  .vis-scene { padding: 56px 12px 8px; }
  .vis-nav { top: 42%; transform: translateY(-50%); width: 38px; height: 38px; font-size: 1.6rem; background: rgba(0,0,0,.45); }
  .vis-prec { left: 8px; } .vis-suiv { right: 8px; }
  .vis-legende { flex-direction: column; align-items: flex-start; }
}

/* ================= MODALE AVIS */
.modale { position: fixed; inset: 0; z-index: 60; background: rgba(6,8,11,.8); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; overflow-y: auto; animation: fondu .2s ease; }
.modale-carte { position: relative; width: min(680px, 100%); background: var(--surface); border: 1px solid var(--ligne); border-radius: 24px; padding: clamp(1.4rem, 3vw, 2.6rem); margin: auto; }
.modale-fermer { position: absolute; top: 14px; right: 14px; background: transparent; border: 0; color: var(--texte-doux); font-size: 1rem; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.modale-fermer:hover { background: var(--surface-haute); color: var(--texte); }
.modale-carte h2 { margin-bottom: .5rem; }
.modale-carte .bouton-plein { margin-top: 1.4rem; width: 100%; padding: .95rem; }

.etoiles { display: flex; gap: .3rem; margin: 1.4rem 0 .4rem; }
.etoiles button { background: transparent; border: 0; cursor: pointer; font-size: 2rem; line-height: 1; color: var(--ligne); padding: .1rem; transition: transform .15s, color .15s; }
.etoiles button.on, .etoiles button:hover { color: var(--accent); transform: scale(1.1); }

.vocal { margin-top: 1.4rem; padding: 1.1rem 1.2rem; border: 1px dashed var(--ligne); border-radius: 16px; }
.vocal-titre { font-size: .9rem; margin-bottom: .7rem; }
.vocal-ligne { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.vocal-etat { color: var(--texte-doux); font-size: .88rem; }
.vocal .bouton-rond.enregistre { background: #d0483a; border-color: #d0483a; color: #fff; animation: pulse-rouge 1.2s infinite; }
@keyframes pulse-rouge { 0%,100% { box-shadow: 0 0 0 0 rgba(208,72,58,.5); } 50% { box-shadow: 0 0 0 10px rgba(208,72,58,0); } }
.vocal audio { height: 40px; flex: 1; min-width: 200px; }
