/* ----------------------------------------------------------------------------
   Projet     : PolySign — frontal web de signature (Gecom)
   Auteur     : Yann TATARD - Polylogic
   Date       : 09/10/2026
   Version    : 3.1
   Copyright  : (c) 2026 Yann TATARD - Polylogic. Tous droits réservés.
   ----------------------------------------------------------------------------
   Couleurs du site d'origine modernisées : bleu nuit + orange Optimag.
   Les anciennes classes (frameBanner*, saisie_password, b5…) restent pour les pages
   téléphone qui les utilisent encore.
   ---------------------------------------------------------------------------- */

:root {
  --bleu: #1E2A44;
  --bleu-fonce: #141C2F;
  --bleu-clair: #2C3D61;
  --menthe: #5FB49C;
  --orange: #FF9800;
  --orange-fonce: #E68900;
  --orange-pale: #FFF3E0;
  --fond: #F4F6F9;
  --carte: #FFFFFF;
  --bordure: #DDE3EC;
  --texte: #1B2436;
  --libelle: #5F6B80;
  --vert: #2E9E6B;
  --vert-pale: #E3F4EC;
  --degrade: linear-gradient(135deg, #2C3D61 0%, #1E2A44 50%, #141C2F 100%);
  --ombre: 0 1px 2px rgba(20, 28, 47, .06), 0 8px 28px rgba(20, 28, 47, .08);
  --ombre-forte: 0 2px 6px rgba(20, 28, 47, .08), 0 18px 48px rgba(20, 28, 47, .16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--bleu); }
svg { flex-shrink: 0; }

/* =================== Barre du haut (pages connectées) =================== */

.ps-barre {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  color: #fff;
  background: var(--degrade);
  box-shadow: 0 2px 0 var(--orange), 0 6px 18px rgba(20, 28, 47, .18);
}
.ps-barre .ps-logo {
  height: 56px;
  padding: 8px 14px;
  background: #fff;
  border-radius: 10px;
}
.ps-barre .ps-magasin { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ps-barre .ps-magasin b {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-barre .ps-magasin span { font-size: 13px; color: rgba(255, 255, 255, .72); }
.ps-barre .ps-marque {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: .02em;
}
.ps-barre .ps-marque i {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--bleu-fonce);
  background: var(--orange);
}

/* ================================ Boutons ================================ */

button, .ps-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin: 0;
  padding: 0 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1;
  color: var(--bleu-fonce);
  background: var(--orange);
  border: 0;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(255, 152, 0, .28);
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
  -webkit-appearance: none;
}
button:hover, .ps-bouton:hover { background: var(--orange-fonce); }
button:active, .ps-bouton:active { transform: translateY(1px) scale(.99); }

.ps-fantome {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  box-shadow: none;
}
.ps-fantome:hover { background: rgba(255, 255, 255, .24); }

.ps-secondaire {
  color: var(--texte);
  background: #fff;
  border: 1px solid var(--bordure);
  box-shadow: none;
}
.ps-secondaire:hover { background: #EEF1F6; }

/* ============================ Page de connexion ============================ */

body.ps-connexion { display: flex; min-height: 100vh; }

.ps-marque-panneau {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 46%;
  padding: 56px 64px;
  color: #fff;
  background: var(--degrade);
  overflow: hidden;
}
.ps-marque-panneau .ps-paraphe {
  position: absolute;
  inset: auto -40px 8% -40px;
  width: calc(100% + 80px);
  opacity: .16;
}
.ps-marque-panneau .ps-logo {
  align-self: flex-start;
  height: 110px;
  padding: 16px 22px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.ps-marque-panneau h1 {
  margin: 28px 0 8px;
  font-size: 54px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.ps-marque-panneau .ps-trait {
  width: 72px; height: 6px;
  border-radius: 6px;
  background: var(--orange);
}
.ps-marque-panneau p.ps-accroche {
  max-width: 420px;
  margin: 22px 0 30px;
  font-size: 20px;
  color: rgba(255, 255, 255, .9);
}
.ps-atouts { display: flex; flex-direction: column; gap: 14px; }
.ps-atout { display: flex; align-items: center; gap: 14px; font-size: 16px; color: rgba(255, 255, 255, .92); }
.ps-atout i {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--bleu-fonce);
  background: var(--orange);
}

.ps-formulaire-panneau {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.ps-formulaire { width: 100%; max-width: 400px; }
.ps-formulaire .ps-magasin-nom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bleu);
  background: #E7ECF4;
  border-radius: 999px;
}
.ps-formulaire .ps-magasin-nom:empty { display: none; }
.ps-formulaire h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.ps-formulaire .ps-aide { margin: 6px 0 28px; color: var(--libelle); }

.ps-champ { margin-bottom: 16px; }
.ps-champ label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--libelle);
}
.ps-champ .ps-saisie { position: relative; }
.ps-champ .ps-saisie svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--bleu);
  pointer-events: none;
}
.ps-champ input {
  width: 100%;
  height: 52px;
  padding: 0 14px 0 46px;
  font: inherit;
  font-size: 16px;
  color: var(--texte);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.ps-champ input:focus { border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(30, 42, 68, .12); }
.ps-formulaire button { width: 100%; height: 54px; margin-top: 10px; font-size: 16px; }
.ps-formulaire .ps-pied {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--libelle);
}

@media (max-width: 860px) {
  body.ps-connexion { flex-direction: column; }
  .ps-marque-panneau { width: 100%; padding: 32px 24px 36px; }
  .ps-marque-panneau .ps-logo { height: 72px; }
  .ps-marque-panneau h1 { font-size: 38px; margin-top: 20px; }
  .ps-marque-panneau p.ps-accroche { font-size: 16px; margin: 14px 0 0; }
  .ps-atouts { display: none; }
  .ps-formulaire-panneau { padding: 28px 20px 40px; }
}

/* ============================ Liste des documents ============================ */

.ps-page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; }

.ps-titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ps-titre-page h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.ps-titre-page p { margin: 4px 0 0; color: var(--libelle); }

.ps-outils {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.ps-onglets {
  display: inline-flex;
  padding: 4px;
  background: #E3E8F0;
  border-radius: 12px;
}
.ps-onglets button {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  color: var(--texte);
  background: transparent;
  box-shadow: none;
  border-radius: 9px;
}
.ps-onglets button:hover { background: rgba(255, 255, 255, .6); }
.ps-onglets button.actif { color: #fff; background: var(--bleu); box-shadow: 0 2px 8px rgba(30, 42, 68, .25); }
.ps-onglets button .ps-nombre {
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 999px;
  color: var(--bleu-fonce); background: var(--orange);
}
.ps-recherche { position: relative; flex: 1; min-width: 220px; }
.ps-recherche svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--libelle); }
.ps-recherche input {
  width: 100%; height: 46px; padding: 0 14px 0 42px;
  font: inherit; color: var(--texte);
  background: #fff; border: 1px solid var(--bordure); border-radius: 12px; outline: none;
}
.ps-recherche input:focus { border-color: var(--bleu); box-shadow: 0 0 0 4px rgba(30, 42, 68, .12); }

.ps-liste {
  overflow: hidden;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 18px;
  box-shadow: var(--ombre);
}
.ps-ligne {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.4fr) minmax(0, 1.2fr) 130px 120px 24px;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #EDF0F5;
  cursor: pointer;
  transition: background .15s;
}
.ps-ligne:last-child { border-bottom: 0; }
.ps-ligne:hover { background: #FFF7EC; }
.ps-ligne .ps-avatar {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #fff;
  border-radius: 50%;
  background: var(--degrade);
}
.ps-ligne .ps-client b { display: block; font-size: 16px; font-weight: 700; }
.ps-ligne .ps-client span, .ps-ligne .ps-type span { font-size: 13px; color: var(--libelle); }
.ps-ligne .ps-type { display: flex; align-items: center; gap: 8px; color: var(--texte); font-size: 14px; }
.ps-ligne .ps-type svg { color: var(--bleu); }
.ps-ligne .ps-date { font-size: 14px; color: var(--libelle); }
.ps-ligne .ps-fleche { color: #A6B0C2; }

.ps-pastille {
  display: inline-flex; align-items: center; gap: 6px;
  justify-self: start;
  padding: 5px 11px;
  font-size: 13px; font-weight: 650;
  border-radius: 999px;
}
.ps-pastille.a-signer { color: #A65F00; background: var(--orange-pale); }
.ps-pastille.signe { color: var(--vert); background: var(--vert-pale); }

.ps-vide {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--libelle);
}
.ps-vide i {
  width: 72px; height: 72px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
  border-radius: 50%;
  color: #fff;
  background: var(--degrade);
}
.ps-vide b { font-size: 18px; color: var(--texte); }

.ps-maj { margin-top: 14px; font-size: 13px; color: var(--libelle); text-align: center; }

@media (max-width: 760px) {
  .ps-page { padding: 18px 12px 40px; }
  .ps-titre-page h1 { font-size: 24px; }
  .ps-ligne { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; padding: 12px 14px; }
  .ps-ligne .ps-type, .ps-ligne .ps-date, .ps-ligne .ps-fleche { display: none; }
  .ps-ligne .ps-client span.ps-mobile { display: block; }
  .ps-barre { padding: 10px 14px; }
  .ps-barre .ps-logo { height: 44px; padding: 6px 10px; }
  .ps-barre .ps-marque span { display: none; }
}
.ps-ligne .ps-client span.ps-mobile { display: none; }

/* ============================ Document à signer ============================ */

.ps-document { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 1080px) {
  .ps-document { grid-template-columns: minmax(0, 1.3fr) minmax(400px, 1fr); }
}
.ps-carte {
  overflow: hidden;
  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 18px;
  box-shadow: var(--ombre);
}
.ps-carte-entete {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bordure);
}
.ps-carte-entete .ps-etape {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--bleu-fonce);
  border-radius: 50%;
  background: var(--orange);
}
.ps-carte-entete b { font-size: 16px; }
.ps-carte-entete span { font-size: 13px; color: var(--libelle); }
.ps-carte-entete a {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 650; text-decoration: none;
  color: var(--bleu);
}
iframe { display: block; width: 100%; margin: 0; border: 0; }
iframe.ps-pdf { height: 76vh; min-height: 520px; background: #E6EAF0; }
iframe.ps-signature { height: 470px; background: #fff; }
@media (min-width: 1080px) { iframe.ps-signature { height: 76vh; min-height: 520px; } }

/* ============================ Pavé de signature (iframe) ============================ */

body.ps-pave {
  position: absolute;
  inset: 0;
  min-height: 0;
  margin: 0;
  padding: 16px;
  overflow: hidden;
  background: #fff;
}
.ps-pave-haut { position: relative; z-index: 2; pointer-events: none; }
.ps-salut {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: #fff;
  background: var(--degrade);
  border-radius: 14px;
  box-shadow: inset 6px 0 0 var(--orange);
}
.ps-salut i {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--bleu-fonce);
  background: var(--orange);
}
.ps-salut b { display: block; font-size: 15px; }
.ps-salut span { font-size: 13px; color: rgba(255, 255, 255, .85); }
.ps-date-jour {
  margin-left: auto;
  padding: 5px 10px;
  font-size: 13px; font-weight: 700;
  color: var(--bleu-fonce);
  border-radius: 999px;
  background: var(--orange);
}
.ps-cases { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ps-case {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: 12px;
  cursor: pointer;
}
.ps-case input { width: 22px; height: 22px; margin: 0; accent-color: var(--bleu); }

.ps-zone {
  position: absolute;
  z-index: 1;
  left: 16px; right: 16px; bottom: 80px;
  height: 46%;
  border: 2px dashed rgba(30, 42, 68, .28);
  border-radius: 16px;
  pointer-events: none;
}
.ps-zone::after {
  content: "";
  position: absolute;
  left: 22px; right: 22px; bottom: 28%;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 152, 0, .6);
}
.ps-zone::before {
  content: "\2715";
  position: absolute;
  left: 24px; bottom: calc(28% + 8px);
  font-size: 18px; font-weight: 800;
  color: var(--orange);
}
.ps-zone span {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600;
  color: rgba(30, 42, 68, .32);
}

/* 13/10/2026 : le canevas occupe exactement le cadre en pointillés (.ps-zone) : on ne signe plus sur le bandeau ni sur les cases */
body.ps-pave canvas {
  position: absolute;
  z-index: 2;
  left: 16px; right: 16px; bottom: 80px;
  width: calc(100% - 32px);
  height: 46%;
  border: 0;
  border-radius: 16px;
  touch-action: none;
}
body.ps-pave #info {
  position: absolute;
  z-index: 3;
  left: 16px; right: 16px; bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.ps-pave #info #signer { margin-left: auto; min-width: 170px; }

/* ============================ Anciennes classes (pages téléphone) ============================ */

.frameBanner, .frameBanner_phone {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 16px;
  color: #fff; background: var(--degrade);
  border-bottom: 3px solid var(--orange);
}
.frameBanner img, .frameBanner_phone img { height: 44px; width: auto; padding: 4px 8px; background: #fff; border-radius: 8px; }
.frameText, .frameText_phone { flex: 1; font-size: 16px; font-weight: 700; color: #fff; }
.frameTitle, .frameTitle_phone { font-size: 13px; color: #FFCC80; }
pre {
  display: block; max-width: 520px; margin: 40px auto; padding: 28px 24px;
  font-family: inherit; font-size: 18px; font-weight: 600; white-space: pre-wrap; text-align: center;
  color: var(--texte); background: #fff;
  border: 1px solid var(--bordure) !important; border-left: 6px solid var(--vert) !important;
  border-radius: 18px; box-shadow: var(--ombre);
}
.b5 { border-style: solid; }
canvas { border: 0; }
