body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bandeau {
  border-bottom: 1px solid var(--filet);
}

.bandeau-contenu,
.pied-contenu {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.enseigne {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--bleu);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: min(100%, 22rem);
}

.enseigne img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.enseigne-nom {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.bandeau nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.bandeau nav a {
  color: var(--encre);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  padding: 0.2rem 0;
  transition: border-color var(--transition), color var(--transition);
}

.bandeau nav a:hover,
.bandeau nav a[aria-current='page'] {
  color: var(--bleu);
  border-color: var(--bleu);
}

/* Le bouton d'accès dans la barre garde son apparence de bouton. */
.bandeau nav a.bouton {
  color: var(--blanc);
  border-color: var(--bleu);
  padding: 0.45rem 0.9rem;
}

.bandeau nav a.bouton:hover {
  color: var(--blanc);
  border-color: var(--bleu-moyen);
}

main {
  flex: 1;
}

.pied {
  border-top: 1px solid var(--filet);
  font-size: 0.95rem;
  color: var(--encre-douce);
}

.pied nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.pied a {
  color: var(--encre-douce);
}

/* Site vitrine */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 1rem + 4vw, 4.5rem) 1.5rem clamp(2rem, 1rem + 3vw, 3.5rem);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

.hero-sur-titre {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bleu);
  margin: 0 0 1rem;
}

.hero-texte h1 {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem);
  line-height: 1.12;
  margin: 0 0 1rem;
}

.hero-intro {
  font-size: 1.15rem;
  color: var(--encre-douce);
  max-width: 34rem;
  margin: 0 0 1.75rem;
}

.hero-liens {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.acces {
  background: var(--bleu);
  color: var(--blanc);
  padding: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  scroll-margin-top: 1.5rem;
}

.acces h2 {
  color: var(--blanc);
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.acces p {
  color: #dbe6f7;
  margin-bottom: 0;
}

.acces form {
  margin-top: 1.5rem;
}

.acces label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.champ-code {
  font-family: var(--sans);
  font-size: clamp(1.35rem, 1rem + 1.6vw, 1.9rem) !important;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.85rem 0.5rem !important;
  border: 2px solid var(--blanc) !important;
  color: var(--encre) !important;
  background: var(--blanc) !important;
  font-variant-numeric: tabular-nums;
}

.champ-code::placeholder {
  color: #b4bfd0;
  letter-spacing: 0.16em;
}

.acces .bouton {
  margin-top: 1rem;
  width: 100%;
  font-size: 1.1rem;
  padding: 0.9rem 1.3rem;
  color: var(--bleu);
  background: var(--blanc);
  border-color: var(--blanc);
}

.acces .bouton:hover {
  color: var(--blanc);
  background: var(--bleu-clair);
  border-color: var(--bleu-clair);
}

.acces .erreur-code {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--blanc);
  color: var(--rouge);
  font-weight: 600;
  border-left: 5px solid var(--rouge);
}

.acces-note {
  margin: 1.25rem 0 0;
  font-size: 0.92rem;
  color: #b4c4de;
}

/* Sections de la vitrine */

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) 1.5rem;
}

.section + .section {
  border-top: 1px solid var(--filet);
}

.section-tete {
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.section-tete p {
  color: var(--encre-douce);
  font-size: 1.1rem;
  margin: 0;
}

.section h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.domaines {
  list-style: none;
  margin: 0;
  padding: 0;
}

.domaines li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--filet);
}

.domaines li:last-child {
  border-bottom: 1px solid var(--filet);
}

.domaine-num {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bleu);
  padding-top: 0.15rem;
}

.domaines h3 {
  margin: 0 0 0.3rem;
  font-family: var(--sans);
  font-size: 1.15rem;
}

.domaines p {
  margin: 0;
  color: var(--encre-douce);
  max-width: 44rem;
}

.section-cabinet {
  background: var(--brume);
  max-width: none;
}

.cabinet-grille,
.contact-grille {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: start;
}

.engagements {
  list-style: none;
  margin: 0;
  padding: 0;
}

.engagements li {
  padding: 1rem 0;
  border-top: 1px solid var(--filet);
}

.engagements li:first-child {
  border-top: 0;
  padding-top: 0;
}

.engagements strong {
  display: block;
  color: var(--bleu);
}

.engagements span {
  color: var(--encre-douce);
}

.lien-fleche {
  font-weight: 600;
  text-decoration: none;
}

.lien-fleche:hover {
  text-decoration: underline;
}

.contact-grille .coordonnees dt {
  color: var(--encre-douce);
  font-size: 0.9rem;
  margin-top: 1rem;
}

.contact-grille .coordonnees dt:first-child {
  margin-top: 0;
}

@media (max-width: 820px) {
  .hero,
  .cabinet-grille,
  .contact-grille {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 2rem;
  }
}

/* Pages de texte */

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-large {
  max-width: 60rem;
}

.coordonnees {
  margin: 0;
}

.coordonnees dt {
  font-weight: 600;
  margin-top: 1.1rem;
}

.coordonnees dd {
  margin: 0.15rem 0 0;
  white-space: pre-line;
}

/* Parcours */

.avancement {
  margin-bottom: 2rem;
}

.avancement p {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--encre-douce);
}

.avancement ol {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.avancement li {
  flex: 1;
  height: 5px;
  background: var(--filet);
}

.avancement li.fait {
  background: var(--bleu);
}

.avancement li.courant {
  background: var(--bleu-clair);
}

.ecran .bloc {
  margin-bottom: 1.6rem;
}

.ecran .texte-cadre {
  border-left: 4px solid var(--bleu);
  background: var(--brume);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.ecran .texte-cadre p:last-child {
  margin-bottom: 0;
}

.choix {
  border: 0;
  margin: 0;
  padding: 0;
}

.choix legend {
  padding: 0;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.choix .coche {
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  transition: border-color var(--transition), background var(--transition);
}

.choix .coche:hover {
  border-color: var(--bleu-moyen);
}

.choix .coche:has(input:checked) {
  border-color: var(--bleu);
  background: var(--brume);
}

.phrase-modele {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  user-select: text;
  word-break: break-all;
}

.phrase-modele-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 0.45rem;
}

.ligne-copie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin: 0.55rem 0;
}

.ligne-copie code,
.acces-messagerie code {
  user-select: all;
  word-break: break-all;
}

.rappel-canal {
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--bleu, #1b3a4b);
  background: var(--brume, #f3f6f9);
  margin-bottom: 1.25rem;
}

.lecture-commande-texte {
  flex: 1 1 16rem;
  min-width: 0;
}

.lecture-progression {
  margin: 0 0 0.55rem;
  color: var(--encre);
  max-width: 40rem;
  line-height: 1.35;
}

.lecture-reste {
  color: var(--encre-douce);
  font-weight: 400;
}

.lecture-barre {
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(27, 58, 75, 0.12);
  overflow: hidden;
}

.lecture-barre::after {
  content: '';
  display: block;
  height: 100%;
  width: var(--lecture-pct, 0%);
  background: var(--bleu, #1b3a4b);
  transition: width 0.35s ease;
}

.compteur {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--encre-douce);
}

.compteur.atteint {
  color: var(--vert);
}

.actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* Document */

.alerte-confidentialite {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--bleu);
  background: var(--brume);
  color: var(--encre);
  font-size: 0.95rem;
  line-height: 1.45;
}

.alerte-confidentialite p {
  margin: 0 0 0.45rem;
}

.alerte-confidentialite p:last-child {
  margin-bottom: 0;
}

/* Seuil solennel avant le protocole */
.seuil-protocole {
  margin: 0.5rem 0 1.5rem;
  padding: 2rem 1.6rem 1.6rem;
  border: 1px solid var(--filet);
  background:
    linear-gradient(180deg, rgba(27, 58, 75, 0.06), transparent 42%),
    linear-gradient(135deg, #f7f5f0 0%, #eef2f6 100%);
  box-shadow: 0 18px 40px rgba(20, 35, 50, 0.08);
  position: relative;
  overflow: hidden;
  animation: seuil-entree 0.7s ease-out;
}

.seuil-protocole::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bleu, #1b3a4b);
}

.seuil-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bleu, #1b3a4b);
  font-weight: 600;
}

.seuil-titre {
  margin: 0 0 1.1rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1.2;
  color: var(--encre, #1a1a1a);
  max-width: 18ch;
}

.seuil-corps {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--encre, #1a1a1a);
  max-width: 42rem;
}

.seuil-corps p {
  margin: 0 0 0.85rem;
}

.seuil-corps p:last-child {
  margin-bottom: 0;
}

.seuil-engagement {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(27, 58, 75, 0.15);
}

.aide-juridique {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: #6b3a3a;
}

.coche-refus span {
  color: #7a2e2e;
}

.page-cloture .message-juridique p {
  margin: 0 0 0.7rem;
  white-space: pre-line;
}

.page-cloture .message-juridique p:last-child {
  margin-bottom: 0;
}

@keyframes seuil-entree {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.document {
  position: relative;
  border: 1px solid var(--filet);
  background: #e7ebf2;
  margin-bottom: 2rem;
  /* Lecture en pleine page : pas de fenêtre réduite à 78vh. */
  overflow: visible;
}

.document-protege,
.document-protege * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}

.document-protege .copie-autorisee,
.document-protege .copie-autorisee * {
  -webkit-user-select: text !important;
  user-select: text !important;
}

.document-protege img {
  pointer-events: none;
  -webkit-user-drag: none;
}

.document-pages {
  padding: 0.75rem;
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.document-pages canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--blanc);
  box-shadow: 0 1px 3px rgba(12, 35, 60, 0.25);
}

.document-texte {
  position: relative;
  background: var(--blanc);
  margin: 0.75rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  font-family: var(--serif);
  line-height: 1.65;
}

.document-redige {
  max-width: 46rem;
  margin: 0.75rem auto;
}

.lecture-commande {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.75rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--brume);
}

.document-entete {
  border-bottom: 2px solid var(--bleu);
  padding-bottom: 0.9rem;
  margin-bottom: 1.75rem;
}

.document-logo {
  display: block;
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.document-cabinet {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--bleu);
}

.document-redige h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.document-redige h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.document-redige p {
  margin: 0 0 0.9rem;
  text-align: justify;
}

.document-texte table {
  border-collapse: collapse;
  width: 100%;
}

.document-texte td,
.document-texte th {
  border: 1px solid var(--filet);
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}

.document-image {
  position: relative;
  margin: 0.75rem;
}

.document-image img {
  display: block;
  width: 100%;
}

.filigrane {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-repeat: repeat;
}

.document-etat {
  margin: 0;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--encre-douce);
}

.document-vide {
  padding: 4rem 1.5rem;
  text-align: center;
  color: var(--encre-douce);
  background: var(--blanc);
  margin: 0.75rem;
  border: 2px dashed var(--filet);
}

/* Signature */

.signature-cadre {
  position: relative;
  border: 1px solid #8e9bb0;
  border-radius: var(--rayon);
  background: var(--blanc);
  max-width: 34rem;
}

.signature-cadre canvas {
  display: block;
  width: 100%;
  height: 190px;
  touch-action: none;
  cursor: crosshair;
}

.signature-cadre::after {
  content: '';
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 2.6rem;
  border-bottom: 1px solid var(--filet);
  pointer-events: none;
}

.signature-outils {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 34rem;
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--encre-douce);
}

.en-erreur .signature-cadre {
  border-color: var(--rouge);
}

/* Pièce d'identité */

.guide-piece-intro {
  margin: 0 0 1.25rem;
  color: var(--encre-douce);
}

.depot-voie {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bleu);
}

.depot-titre {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.guide-piece-etapes {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  color: var(--encre);
}

.guide-piece-etapes li {
  margin-bottom: 0.45rem;
}

.guide-piece-etapes li:last-child {
  margin-bottom: 0;
}

.guide-piece-seul-telephone {
  display: none;
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: var(--brume);
}

.depot {
  display: grid;
  grid-template-columns: minmax(14rem, 17rem) 1fr;
  gap: 2rem;
  align-items: start;
}

.depot-zone {
  border: 2px dashed #8e9bb0;
  border-radius: var(--rayon);
  padding: 2.25rem 1.5rem;
  text-align: center;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}

.depot-zone.survol {
  border-color: var(--bleu);
  background: var(--brume);
}

.depot-zone p {
  margin-bottom: 0.9rem;
}

.depot-zone .formats {
  font-size: 0.92rem;
  color: var(--encre-douce);
  margin: 0.9rem 0 0;
}

.depot-zone .bouton-fichier {
  display: inline-block;
  cursor: pointer;
}

.depot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 0.5rem 0 0.25rem;
}

.depot-zone input[type='file'] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.depot-progression {
  height: 6px;
  background: var(--filet);
  margin-top: 1rem;
}

.depot-progression span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--bleu);
  transition: width 200ms linear;
}

.depot-telephone {
  text-align: center;
  padding: 1.1rem 1rem 1.25rem;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: #fff;
}

.depot-telephone .guide-piece-etapes {
  text-align: left;
}

.depot-telephone .formats {
  margin-top: 0.85rem;
  font-size: 0.88rem;
  color: var(--encre-douce);
}

.liste-depots {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
}

.liste-depots li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  margin-bottom: 0.4rem;
  background: var(--brume);
}

.depot-telephone svg {
  display: block;
  width: 11rem;
  height: 11rem;
  margin-bottom: 0.6rem;
}

/* Après signature */

.verrou {
  border: 1px solid var(--filet);
  border-top: 5px solid var(--bleu);
  padding: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1.25rem;
  align-items: start;
}

.verrou svg {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--bleu);
  grid-row: span 3;
}

.verrou h2 {
  margin: 0;
  font-size: 1.5rem;
}

.verrou .date-signature {
  margin: 0;
  color: var(--encre-douce);
}

.verrou .texte {
  margin: 0.75rem 0 0;
}

.liste-signataires,
.liste-historique {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
}

.liste-signataires li,
.liste-historique li {
  padding: 0.75rem 0;
  border-top: 1px solid var(--filet);
}

.liste-signataires li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.liste-signataires .etat {
  color: var(--encre-douce);
}

.liste-signataires .etat.signe {
  color: var(--vert);
  font-weight: 600;
}

/* Aperçu depuis l'admin */

.bandeau-apercu {
  background: var(--encre);
  color: var(--blanc);
  font-size: 0.97rem;
}

.bandeau-apercu div {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.6rem 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

.bandeau-apercu span {
  margin-right: auto;
}

.bandeau-apercu a {
  color: var(--blanc);
  font-weight: 600;
}

/* Téléphone */

.mobile {
  max-width: 30rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.mobile .bouton {
  width: 100%;
  margin-top: 0.75rem;
}

@media (max-width: 860px) {
  .accueil {
    display: block;
    padding-top: 1.25rem;
  }

  .deroule {
    margin-top: 2rem;
  }

  .depot {
    grid-template-columns: 1fr;
  }

  .depot-telephone {
    display: none;
  }

  .guide-piece-seul-telephone {
    display: block;
  }

  .guide-piece-etapes-ordinateur {
    display: none;
  }

  .bandeau nav {
    gap: 1rem;
  }
}

@media print {
  /* Le document se signe en ligne : rien ne doit partir à l'imprimante. */
  .document,
  .document-protege,
  .alerte-confidentialite,
  .signature-cadre {
    display: none !important;
  }

  body::before {
    content: 'Document confidentiel : impression interdite. Consultez et signez uniquement en ligne.';
    display: block;
    padding: 2rem;
    font-family: Georgia, serif;
    font-size: 1.1rem;
  }
}
