/* ---------- Confidentialité + CGU ---------- */
/* À coller à la fin de style.css */

/* Deux boutons dans le tiroir (retour + légal) */
.drawer-feedback {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-toggle-btn svg {
  flex-shrink: 0;
}

body.legal-open {
  overflow: hidden;
}

.legal-modal {
  position: fixed;
  inset: 0;
  z-index: 120; /* au-dessus de la connexion (30) et du retour client (100) */
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.65);
}

.legal-sheet {
  width: min(100%, 760px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
}
.legal-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.legal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-2);
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.legal-close:hover {
  color: var(--text);
  background: var(--raised);
}
.legal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.legal-tabs {
  display: flex;
  margin: 0 20px;
  border-bottom: 1px solid var(--line);
}
.legal-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 6px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 0.9rem;
  cursor: pointer;
}
.legal-tab:hover {
  color: var(--text);
}
.legal-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.legal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 20px 28px;
  outline: none;
}

.legal-welcome {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-2);
  background: var(--bg);
  color: var(--text-2);
  font-size: 0.92rem;
}
.legal-doc-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.legal-meta {
  margin: 4px 0 18px;
  color: var(--text-3);
  font-size: 0.82rem;
}

.legal-toc {
  margin-bottom: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg);
}
.legal-toc-title {
  margin-bottom: 6px;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.legal-toc ol {
  margin: 0;
  padding-left: 1.4em;
  color: var(--text-3);
  font-size: 0.9rem;
}
.legal-toc li {
  padding: 1px 0;
}
.legal-toc-link {
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}
.legal-toc-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.legal-section {
  padding-top: 22px;
  scroll-margin-top: 4px;
}
.legal-section h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
}
.legal-section p,
.legal-section li {
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.legal-section p + p,
.legal-section p + ul,
.legal-section ul + p {
  margin-top: 10px;
}
.legal-section ul {
  padding-left: 1.2em;
}
.legal-section li {
  margin-top: 6px;
}
.legal-section li::marker {
  color: var(--text-3);
}
.legal-section strong {
  color: var(--text);
  font-weight: 500;
}
.legal-section a,
.legal-welcome a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-next {
  display: block;
  margin-top: 28px;
  padding: 10px 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: none;
  color: var(--text-2);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}
.legal-next:hover {
  border-color: var(--accent);
  color: var(--text);
}

.legal-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.legal-foot-note {
  color: var(--text-3);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Téléphone : la fenêtre passe en plein écran */
@media (max-width: 600px) {
  .legal-modal {
    padding: 0;
    place-items: stretch;
  }
  .legal-sheet {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }
  .legal-head {
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
  }
  .legal-tabs {
    margin: 0 16px;
  }
  .legal-tab {
    font-size: 0.85rem;
  }
  .legal-scroll {
    padding: 16px 16px 24px;
  }
  .legal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .legal-doc-title {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-scroll {
    scroll-behavior: auto;
  }
}

/* Lien Instagram dans le tiroir (même style que les boutons voisins) */
a.feedback-toggle-btn {
  text-decoration: none;
}
