/* Espace client — feuille de style */
:root {
  --accent: #43B581;
  --accent-fonce: #1B7350;
  --encre: #16181A;
  --encre-doux: #4B4E50;
  --papier: #F4F2EC;
  --surface: #FBFAF5;
  --surface-2: #EAE6DD;
  --trait: #D9D3C8;
  --rouge: #A9542E;
  --radius: 6px;
  --ui: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: var(--ui);
  color: var(--encre);
  background: var(--papier);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-fonce); }
a:hover { color: var(--accent); }

.conteneur {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  padding: 2rem clamp(1rem, 4vw, 2rem);
}

/* En-tete */
.tete {
  background: var(--encre);
  color: #fff;
}
.tete-in {
  max-width: 900px;
  margin-inline: auto;
  padding: 0.9rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.marque {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.logo {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
}
.logo svg {
  width: 100%;
  height: 100%;
  color: #fff;
  display: block;
}
.tete-nav { display: flex; gap: 1.2rem; }
.tete-nav a { color: #cfd3cf; text-decoration: none; font-size: 0.85rem; }
.tete-nav a:hover { color: #fff; }

/* Pied */
.pied {
  border-top: 1px solid var(--trait);
  font-size: 0.8rem;
  color: var(--encre-doux);
}
.pied .conteneur { padding-block: 1.4rem; }
.pied a { color: var(--encre-doux); }

/* Bouton "remonter en haut" */
.haut {
  position: fixed;
  right: clamp(0.8rem, 3vw, 1.6rem);
  bottom: clamp(0.8rem, 3vw, 1.6rem);
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--encre);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  z-index: 50;
}
.haut:hover { background: var(--accent-fonce); }
.haut[hidden] { display: none; }

/* Titres */
h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
h2::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  flex: none;
}
h3 { font-size: 1rem; margin-bottom: 0.3rem; }
p.sous { color: var(--encre-doux); margin-bottom: 1.5rem; }

/* Section repliable (<details class="repli">) */
.repli {
  border: 1px solid var(--trait);
  border-radius: var(--radius);
  background: var(--surface);
  margin-top: 2rem;
}
.repli > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.repli > summary::-webkit-details-marker { display: none; }
.repli > summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  flex: none;
}
.repli > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--encre-doux);
  transition: transform 0.15s ease;
}
.repli[open] > summary::after { transform: rotate(180deg); }
.repli[open] > summary { border-bottom: 1px solid var(--trait); }
.repli > summary:hover { color: var(--accent-fonce); }
.repli-compte { font-weight: 400; font-size: 0.85rem; color: var(--encre-doux); }
.repli-corps { padding: 1.1rem; }
.repli-corps > h2:first-child,
.repli-corps > form:first-child { margin-top: 0; }

/* Fil d'ariane */
.ariane {
  font-size: 0.85rem;
  color: var(--encre-doux);
  margin-bottom: 1.2rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.ariane span { color: var(--trait); }
.ariane a { color: var(--accent-fonce); text-decoration: underline; text-underline-offset: 2px; }
.ariane a:hover { color: var(--accent); }
.ariane .ici { color: var(--encre); font-weight: 600; }

/* Cartes / listes */
.carte {
  background: var(--surface);
  border: 1px solid var(--trait);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-bottom: 1rem;
}
.carte-tete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.liste { list-style: none; }
.liste li {
  border: 1px solid var(--trait);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.liste .meta { color: var(--encre-doux); font-size: 0.85rem; }

/* Rangée entièrement cliquable : le lien "couvrant" s'étale sur toute la ligne. */
.liste li.rangee-lien { position: relative; transition: border-color .12s ease, background .12s ease; }
.liste li.rangee-lien:hover { border-color: var(--accent); background: #fff; }
.lien-couvrant { text-decoration: none; }
.lien-couvrant::after { content: ""; position: absolute; inset: 0; }
/* Les vrais contrôles restent au-dessus du lien couvrant ; les puces
   décoratives (span.btn) laissent le clic passer. */
.liste li.rangee-lien form,
.liste li.rangee-lien a.btn,
.liste li.rangee-lien button { position: relative; z-index: 1; }
.liste li.rangee-lien span.btn { pointer-events: none; }

.vide {
  color: var(--encre-doux);
  font-style: italic;
  padding: 1rem 0;
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--encre);
  border-radius: var(--radius);
  background: var(--encre);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--accent-fonce); border-color: var(--accent-fonce); color: #fff; }
.btn-clair {
  background: transparent;
  color: var(--encre);
  border-color: var(--trait);
}
.btn-clair:hover { border-color: var(--accent); background: transparent; color: var(--accent-fonce); }
.btn-petit { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-danger { border-color: var(--rouge); color: var(--rouge); background: transparent; }
.btn-danger:hover { background: var(--rouge); color: #fff; }

.actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }

/* Formulaires */
form.pile { display: grid; gap: 1rem; max-width: 420px; }
form.pile > button { justify-self: start; }
form.large { max-width: 100%; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=file], textarea, select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  border: 1px solid var(--trait);
  border-radius: var(--radius);
  background: #fff;
}
textarea { min-height: 5rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.aide { font-size: 0.8rem; color: var(--encre-doux); margin-top: 0.2rem; font-weight: 400; }

.case {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin: 0;
  cursor: pointer;
}
.case input { width: auto; margin: 0; }

/* Encadres */
.flash {
  padding: 0.8rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
  border-left: 3px solid;
}
.flash-ok { background: #E4F0E9; border-color: var(--accent); }
.flash-err { background: #F3E2DA; border-color: var(--rouge); }

.boite-lien {
  background: var(--surface-2);
  border: 1px dashed var(--trait);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  word-break: break-all;
}
.boite-lien code { font-family: "IBM Plex Mono", ui-monospace, monospace; }

/* Connexion */
.centre {
  max-width: 380px;
  margin: 3rem auto;
}
.centre h1 { text-align: center; }
.centre p.sous { text-align: center; }

/* Visionneuse PDF */
/* PDF rendu en pages (voir.php) */
.pdf-pages {
  margin-top: 1.2rem;
  padding: 1.2rem clamp(0.25rem, 2vw, 1rem);
  background: var(--surface-2);
  border: 1px solid var(--trait);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 60vh;
}
.pdf-page {
  position: relative;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.16);
  flex: none;
}
.pdf-page canvas { display: block; }
.pdf-liens { position: absolute; inset: 0; }
.pdf-lien {
  position: absolute;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
}
.pdf-lien:hover { background: rgba(67, 181, 129, 0.22); }
.pdf-lien:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pdf-etat { margin: auto; color: var(--encre-doux); font-size: 0.9rem; }

table.grille { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.grille th, table.grille td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--trait);
}
table.grille th { color: var(--encre-doux); font-weight: 600; }
