/* ------------------------------------------------------------------
   Portail client — design system
   Base : bleu profond "opérateur", entrée numérique en mono.
------------------------------------------------------------------ */

:root {
  --fond: #eef2f6;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --encre: #16202c;
  --encre-douce: #5c6b7a;
  --primaire: #145a8c;
  --primaire-fonce: #0e4269;
  --ok: #1e9e6a;
  --ok-fond: #e7f5ee;
  --trait: #d5dee7;
  --danger: #c6483b;
  --danger-fond: #fbecea;

  --rayon: 12px;
  --rayon-s: 8px;
  --ombre: 0 10px 30px -18px rgba(16, 41, 66, 0.45);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--encre);
  background: var(--fond);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}

a { color: var(--primaire); }

/* ---------- Écran d'accès centré (connexion client + admin) ---------- */

.acces {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.carte-acces {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}

.carte-acces__bandeau {
  height: 4px;
  background: linear-gradient(90deg, var(--primaire), var(--ok));
}

.carte-acces__corps { padding: 32px 28px 28px; }

.marque {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primaire-fonce);
}

.acces h1 {
  font-size: 1.6rem;
  line-height: 1.2;
  margin: 14px 0 6px;
  font-weight: 700;
}

.acces__note {
  color: var(--encre-douce);
  font-size: 0.95rem;
  margin: 0 0 22px;
}

/* ---------- Formulaires ---------- */

.champ { margin-bottom: 18px; }

.champ label {
  display: block;
  font-size: 0.9rem;
  color: var(--encre-douce);
  margin-bottom: 7px;
}

.saisie {
  width: 100%;
  padding: 14px 15px;
  font-size: 1.05rem;
  border: 1.5px solid var(--trait);
  border-radius: var(--rayon-s);
  background: var(--surface-2);
  color: var(--encre);
  transition: border-color 0.12s ease, background 0.12s ease;
}

.saisie:focus {
  outline: none;
  border-color: var(--primaire);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20, 90, 140, 0.14);
}

.saisie--tel {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-align: center;
}

.bouton {
  width: 100%;
  padding: 14px 16px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff;
  background: var(--primaire);
  border: none;
  border-radius: var(--rayon-s);
  cursor: pointer;
  transition: background 0.12s ease;
}

.bouton:hover { background: var(--primaire-fonce); }
.bouton:focus-visible { outline: 3px solid rgba(20, 90, 140, 0.4); outline-offset: 2px; }

.bouton--sec {
  width: auto;
  color: var(--primaire);
  background: transparent;
  border: 1.5px solid var(--trait);
}
.bouton--sec:hover { background: var(--surface-2); }

.bouton--danger {
  width: auto;
  padding: 8px 12px;
  font-size: 0.88rem;
  color: var(--danger);
  background: transparent;
  border: 1.5px solid var(--trait);
}
.bouton--danger:hover { background: var(--danger-fond); border-color: var(--danger); }

/* ---------- Messages ---------- */

.alerte {
  padding: 11px 14px;
  border-radius: var(--rayon-s);
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.alerte--err { background: var(--danger-fond); color: #8a2f25; }
.alerte--ok { background: var(--ok-fond); color: #14764e; }

/* ---------- En-tête connecté ---------- */

.barre {
  background: var(--surface);
  border-bottom: 1px solid var(--trait);
}
.barre__inner {
  max-width: none;
  margin: 0;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.barre .marque { font-size: 1.1rem; }
.barre__lien {
  color: var(--encre-douce);
  text-decoration: none;
  font-size: 0.92rem;
}
.barre__lien:hover { color: var(--primaire); }
.barre__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.barre__lien--actif { color: var(--primaire); font-weight: 600; }

/* Édition d'une prestation dans les réglages */
.prestation {
  border: 1px solid var(--trait);
  border-radius: var(--rayon-s);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  background: var(--surface-2);
}
.prestation--ajout { background: #eef5ef; border-color: #bfe0cc; }
.prestation__titre { margin: 0 0 12px; font-size: 1rem; }
.prestation__actions { display: flex; gap: 10px; }
.prestation__suppr { margin-top: 10px; }
.bouton--compact { width: auto; padding: 9px 16px; font-size: 0.92rem; }

/* ---------- Contenu principal ---------- */

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.salutation { font-size: 1.9rem; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.salutation__num { color: var(--encre-douce); font-size: 0.98rem; margin: 0 0 32px; }

.titre-section {
  font-size: 0.82rem;
  color: var(--encre-douce);
  font-weight: 600;
  margin: 36px 0 14px;
}

/* Services : liste à filet d'accent à gauche (pas des cartes clonées) */
.services { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
.service {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-left: 3px solid var(--primaire);
  border-radius: var(--rayon-s);
  padding: 18px 20px;
}
.service h3 { margin: 0 0 6px; font-size: 1.05rem; }
.service p { margin: 0; color: var(--encre-douce); font-size: 0.95rem; }

/* ---------- Cartes produits / offres (client) ---------- */
.section-titre {
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--primaire-fonce);
  letter-spacing: 0;
  margin: 46px 0 18px;
}
.produits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 8px 0 4px;
}
.produit {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: var(--ombre);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.produit:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(16, 41, 66, 0.55); }
.produit__media {
  display: block;
  width: 100%;
  background: #f2f5f8;
  overflow: hidden;
}
.produit__img { width: 100%; height: auto; display: block; }
.produit__corps { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1 1 auto; }
.produit__titre { margin: 0 0 6px; font-size: 1.1rem; color: var(--primaire-fonce); }
.produit__texte { margin: 0 0 10px; color: var(--encre-douce); font-size: 0.92rem; }
.produit__prix { font-size: 1.5rem; font-weight: 700; color: var(--encre); margin: 6px 0 16px; }
.produit__btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 16px;
  background: var(--ok);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--rayon-s);
  transition: background 0.12s ease;
}
.produit__btn:hover { background: #16794f; }
.produit__btn-ico { flex: 0 0 auto; }

/* ---------- Panier ---------- */
.barre__droite { display: flex; align-items: center; gap: 18px; }
.panier-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  background: var(--surface-2); color: var(--primaire-fonce);
  border: 1px solid var(--trait); border-radius: 50%;
  cursor: pointer; transition: background 0.12s ease;
}
.panier-btn:hover { background: #e8eef4; }
.panier-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--ok); color: #fff;
  border-radius: 10px; font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.panier-badge[hidden] { display: none; }

.panier-overlay {
  position: fixed; inset: 0; z-index: 2147483646;
  background: rgba(11, 22, 34, 0.55);
  display: flex; justify-content: flex-end;
}
.panier-overlay[hidden] { display: none; }
.panier {
  width: 100%; max-width: 400px; height: 100%;
  background: var(--fond);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.5);
  animation: panier-in 0.25s ease;
}
@keyframes panier-in { from { transform: translateX(30px); opacity: 0.6; } to { transform: translateX(0); opacity: 1; } }
.panier__tete {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px; background: var(--surface); border-bottom: 1px solid var(--trait);
}
.panier__tete h3 { margin: 0; font-size: 1.15rem; }
.panier__close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--surface-2); color: var(--encre-douce);
  font-size: 0.95rem; cursor: pointer;
}
.panier__close:hover { background: #e8eef4; color: var(--danger); }
.panier__items { flex: 1 1 auto; overflow-y: auto; padding: 16px 22px; }
.panier__vide { color: var(--encre-douce); text-align: center; margin-top: 30px; }
.panier__item { padding: 14px 0; border-bottom: 1px solid var(--trait); }
.panier__nom { font-weight: 600; margin-bottom: 8px; }
.panier__detail { display: block; font-weight: 400; font-size: 0.85rem; color: var(--encre-douce); margin-top: 3px; }
.panier__ligne2 { display: flex; align-items: center; gap: 12px; }
.panier__qty { display: inline-flex; align-items: center; gap: 10px; }
.panier__qty button {
  width: 28px; height: 28px; border: 1px solid var(--trait);
  background: var(--surface); border-radius: 6px; cursor: pointer;
  font-size: 1rem; line-height: 1; color: var(--encre);
}
.panier__qty button:hover { background: var(--surface-2); }
.panier__qty span { min-width: 20px; text-align: center; font-weight: 600; }
.panier__prix { margin-left: auto; font-weight: 700; font-family: "IBM Plex Mono", monospace; }
.panier__x {
  width: 26px; height: 26px; border: none; background: transparent;
  color: var(--encre-douce); font-size: 1.1rem; cursor: pointer; border-radius: 6px;
}
.panier__x:hover { color: var(--danger); background: var(--danger-fond); }
.panier__pied { padding: 18px 22px 22px; background: var(--surface); border-top: 1px solid var(--trait); }
.panier__total-ligne {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 1.05rem; margin-bottom: 16px;
}
.panier__total-ligne span:last-child { font-size: 1.35rem; font-weight: 700; }
.panier__paiement { display: flex; flex-direction: column; gap: 10px; }
.pay {
  display: block; text-align: center; padding: 13px 16px;
  border-radius: var(--rayon-s); font-weight: 600; text-decoration: none; color: #fff;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.pay:hover { transform: translateY(-1px); filter: brightness(1.05); }
.pay--revolut { background: #0666eb; }
.pay--paypal { background: #003087; }
.pay--wa { background: #25d366; color: #06331d; }
.panier__note { color: var(--encre-douce); font-size: 0.9rem; text-align: center; margin: 0; }

@media (max-width: 620px) {
  .barre__droite { gap: 12px; }
  .panier { max-width: 100%; }
}

/* ---------- Tutos vidéo (client) ---------- */
.tutos { display: grid; gap: 20px; grid-template-columns: repeat(2, 1fr); }
.tuto { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon-s); overflow: hidden; }
.tuto__video { position: relative; width: 100%; padding-top: 56.25%; background: #000; }
.tuto__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tuto__titre { margin: 14px 16px 4px; font-size: 1.05rem; }
.tuto__desc { margin: 0 16px 16px; color: var(--encre-douce); font-size: 0.94rem; }

/* ---------- Listes admin (affiches / tutos) ---------- */
.affiche-admin, .tuto-admin {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--trait);
}
.affiche-admin:last-of-type, .tuto-admin:last-of-type { border-bottom: none; }
.affiche-admin__img, .tuto-admin__vignette {
  width: 120px; height: 68px; object-fit: cover;
  border-radius: 6px; background: var(--surface-2); flex: 0 0 auto;
}
.affiche-admin__corps, .tuto-admin__corps { flex: 1 1 auto; min-width: 0; }
.affiche-admin__corps p, .tuto-admin__corps p { margin: 4px 0 0; color: var(--encre-douce); font-size: 0.92rem; }
.affiche-admin__lien { font-family: "IBM Plex Mono", monospace; font-size: 0.85rem !important; word-break: break-all; }
.affiche-admin__suppr, .tuto-admin__suppr { flex: 0 0 auto; margin: 0; }

/* Prix dans la liste admin */
.affiche-admin__prix { font-weight: 700 !important; color: var(--encre) !important; }

/* Cartes d'édition d'affiche (admin) */
.affiche-edit {
  display: flex;
  gap: 16px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-s);
  background: var(--surface-2);
}
.affiche-edit__img {
  width: 90px; height: auto; border-radius: 6px;
  flex: 0 0 auto; align-self: flex-start;
  border: 1px solid var(--trait);
}
.affiche-edit__corps { flex: 1 1 auto; min-width: 0; }
.affiche-edit__corps .champ { margin-bottom: 10px; }
.affiche-edit__grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.affiche-edit__suppr { margin-top: 10px; }
@media (max-width: 620px) {
  .affiche-edit { flex-direction: column; }
  .affiche-edit__img { width: 70px; }
  .affiche-edit__grille { grid-template-columns: 1fr; }
}

/* ---------- Bulle d'accueil du support (au-dessus du chat) ---------- */
.support-hint {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 998;
  max-width: 190px;
  background: #fff;
  color: var(--encre);
  border: 1px solid var(--trait);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 28px 9px 12px;
  box-shadow: 0 12px 30px -12px rgba(16, 41, 66, 0.5);
  font-size: 0.8rem;
  line-height: 1.35;
  cursor: pointer;
  animation: hint-in 0.28s ease;
}
.support-hint[hidden] { display: none; }
.support-hint__close {
  position: absolute;
  top: 7px;
  right: 9px;
  color: var(--encre-douce);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
}
.support-hint__close:hover { color: var(--danger); }
@keyframes hint-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 620px) {
  .support-hint { right: 14px; bottom: 80px; max-width: 165px; font-size: 0.76rem; padding: 8px 24px 8px 11px; }
}

/* ---------- Bouton Commander (vente) + fenêtre overlay ---------- */
.cta-vente { margin: 0 0 8px; }
.btn-vente {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #fff;
  background: var(--ok);
  border: none;
  border-radius: var(--rayon-s);
  cursor: pointer;
  box-shadow: 0 10px 24px -12px rgba(30, 158, 106, 0.8);
  transition: background 0.12s ease, transform 0.12s ease;
}
.btn-vente:hover { background: #16794f; transform: translateY(-1px); }
.btn-vente svg { flex: 0 0 auto; }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(11, 22, 34, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay[hidden] { display: none; }
.overlay__box {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: min(80vh, 680px);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.overlay__box iframe { width: 100%; height: 100%; border: 0; display: block; }
.overlay__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(11, 22, 34, 0.85);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.overlay__close:hover { background: var(--danger); }

@media (max-width: 620px) {
  .overlay { padding: 0; }
  .overlay__box { max-width: 100%; height: 100%; border-radius: 0; }
}

/* ---------- Mur de posters défilant (client) ---------- */
.jellyfin { margin-top: 20px; }
.jellyfin__text { color: var(--encre-douce); max-width: 720px; margin: 0 0 20px; }
.marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 4px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: defile 70s linear infinite;
}
.marquee__track--rev {
  margin-top: 16px;
  animation-name: defile-rev;
  animation-duration: 80s;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track img {
  height: 280px;
  width: auto;
  border-radius: 8px;
  display: block;
  box-shadow: 0 8px 20px -10px rgba(16, 41, 66, 0.5);
}
@keyframes defile {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes defile-rev {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

/* ---------- Galerie admin ---------- */
.galerie-admin { display: flex; flex-wrap: wrap; gap: 12px; }
.galerie-admin__item { position: relative; }
.galerie-admin__item img {
  height: 130px; width: auto; border-radius: 6px; display: block;
  border: 1px solid var(--trait);
}
.galerie-admin__item form { position: absolute; top: 6px; right: 6px; margin: 0; }
.galerie-admin__x {
  width: 26px; height: 26px; border: none; border-radius: 50%;
  background: rgba(20, 20, 20, 0.75); color: #fff; cursor: pointer;
  font-size: 0.8rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.galerie-admin__x:hover { background: var(--danger); }

/* Bloc « Nous joindre » — épuré et centré */
.joindre {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 36px 28px;
  box-shadow: var(--ombre);
  text-align: center;
}
.joindre__kicker {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--encre-douce);
  font-weight: 600;
  margin-bottom: 8px;
}
.joindre__titre { margin: 0 0 6px; font-size: 1.35rem; color: var(--encre); }
.joindre__sub { margin: 0 0 22px; color: var(--encre-douce); font-size: 0.95rem; }
.joindre__wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #25d366; color: #06331d; font-weight: 700;
  padding: 14px 28px; border-radius: var(--rayon-s);
  text-decoration: none; font-size: 1.02rem;
  transition: background 0.12s ease, transform 0.12s ease;
}
.joindre__wa:hover { background: #1fb857; transform: translateY(-1px); }
.joindre__wa svg { flex: 0 0 auto; }
.joindre__tel { display: block; margin-top: 16px; font-size: 0.86rem; color: var(--encre-douce); }
.joindre__tel a { color: var(--primaire); font-weight: 600; text-decoration: none; }
.joindre__tel a:hover { text-decoration: underline; }

/* ---------- Tableau admin ---------- */

.panneau {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 22px 22px;
  margin-bottom: 22px;
}
.panneau h2 { margin: 0 0 14px; font-size: 1.1rem; }

.form-ajout { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-ajout .champ { margin: 0; flex: 1 1 180px; }
.form-ajout .bouton { width: auto; flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--trait);
  font-size: 0.94rem;
  vertical-align: middle;
}
th { color: var(--encre-douce); font-weight: 600; font-size: 0.82rem; }
td.num { font-family: "IBM Plex Mono", monospace; }
tr:last-child td { border-bottom: none; }

.vide {
  color: var(--encre-douce);
  padding: 22px 0;
  text-align: center;
  font-size: 0.95rem;
}

.compte {
  color: var(--encre-douce);
  font-size: 0.88rem;
  margin: 0 0 4px;
}

/* ---------- Divers ---------- */

.centre { text-align: center; }
.pied {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px 40px;
  color: var(--encre-douce);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .produits { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .services { grid-template-columns: 1fr; }
  .tutos { grid-template-columns: 1fr; }
  .produits { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .salutation { font-size: 1.4rem; }
  .produit__titre { font-size: 0.98rem; }
  .produit__prix { font-size: 1.2rem; }
  .marquee__track img { height: 128px; }
  .marquee__track { animation-duration: 28s; }
  .marquee__track--rev { animation-duration: 32s; }
  .contact { padding: 30px 18px; }
  .joindre { padding: 28px 20px; }
  .joindre__titre { font-size: 1.18rem; }
  .joindre__wa { width: 100%; padding: 15px 18px; font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
