/* Pages légales publiques — stack vertical (indépendant du flex login-shell) */

:root {
  --legal-font: "Outfit", system-ui, sans-serif;
  --legal-display: "Sora", "Outfit", system-ui, sans-serif;
  --legal-text: #e8eef8;
  --legal-muted: rgba(226, 232, 240, 0.78);
  --legal-accent: rgba(250, 204, 21, 0.92);
  --legal-border: rgba(250, 204, 21, 0.22);
  --legal-card-bg: rgba(8, 12, 22, 0.72);
  --legal-page-max: 40rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body.legal-page {
  margin: 0;
  min-height: 100%;
}

body.legal-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--legal-font);
  color: var(--legal-text);
  background: #07080c;
  /* Pas de overflow-x:hidden comme seul remède : le layout doit tenir dans la largeur */
}

.legal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/images/login-bg-classic.jpg") center / cover no-repeat;
}

.legal-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(7, 8, 12, 0.55) 0%,
      rgba(7, 8, 12, 0.72) 35%,
      rgba(7, 8, 12, 0.88) 70%,
      rgba(7, 8, 12, 0.94) 100%
    );
}

.legal-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--legal-page-max);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 28px) 40px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
}

.legal-header {
  padding: 22px 20px 18px;
  border-radius: 18px;
  border: 1px solid var(--legal-border);
  background: var(--legal-card-bg);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-width: 0;
}

.legal-header h1 {
  margin: 0;
  font-family: var(--legal-display);
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-lead {
  margin: 10px 0 0;
  color: var(--legal-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.legal-section {
  padding: 16px 18px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 12, 22, 0.58);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 0;
}

.legal-section h2 {
  margin: 0 0 10px;
  font-family: var(--legal-display);
  font-size: clamp(1.02rem, 3.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--legal-accent);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-section p,
.legal-section li {
  color: var(--legal-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.legal-section p {
  margin: 0 0 10px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0;
  padding: 0 0 0 1.15rem;
  list-style: disc;
}

.legal-section li {
  margin: 0 0 8px;
  padding-left: 0.15rem;
}

.legal-section li:last-child {
  margin-bottom: 0;
}

.legal-section a {
  color: #93c5fd;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.legal-section a:hover,
.legal-section a:focus-visible {
  color: #bfdbfe;
}

.legal-section a:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.65);
  outline-offset: 2px;
  border-radius: 2px;
}

.legal-section strong,
.legal-section em {
  color: #f1f5f9;
}

.legal-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 6px;
  padding: 0.12em 0.4em;
  overflow-wrap: anywhere;
}

/* Tableau juridique → blocs empilés (évite overflow horizontal sur mobile) */
.legal-kv-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.legal-kv {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.28);
  min-width: 0;
}

.legal-kv-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.75);
}

.legal-kv-value {
  color: var(--legal-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 640px) {
  .legal-kv {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 8px 14px;
    align-items: start;
  }
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(8, 12, 22, 0.5);
  min-width: 0;
}

.legal-nav a {
  color: var(--legal-accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
  text-decoration: underline;
}

.legal-nav a:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.65);
  outline-offset: 2px;
  border-radius: 2px;
}

.legal-nav-sep {
  color: rgba(148, 163, 184, 0.55);
  user-select: none;
}

/* Formulaires compte (mot de passe / suppression) — présentation seule */
.legal-shell--narrow {
  max-width: 28rem;
}

.legal-panel {
  min-width: 0;
}

.legal-panel--danger {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(40, 12, 14, 0.55);
}

.legal-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.legal-alert--error,
.legal-section .error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.legal-alert--success,
.legal-section .success {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
}

.legal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.legal-form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.75);
  min-width: 0;
}

.legal-form-label strong {
  color: #f8fafc;
  letter-spacing: 0.04em;
}

.legal-form-label input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.38);
  color: #f8fafc;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  min-width: 0;
}

.legal-form-label input:focus {
  outline: none;
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.14);
  background: rgba(2, 6, 23, 0.5);
}

.legal-form-label input:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.65);
  outline-offset: 2px;
}

.legal-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 4px;
  padding: 12px 16px;
  border-radius: 14px;
  font-family: var(--legal-display);
  font-size: 1.02rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.legal-btn:active {
  transform: scale(0.98);
}

.legal-btn:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.75);
  outline-offset: 3px;
}

.legal-btn--primary {
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: linear-gradient(180deg, #f5d76e 0%, #d4a017 55%, #b45309 100%);
  color: #1c1204;
  box-shadow:
    0 10px 28px rgba(180, 83, 9, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.legal-btn--primary:hover {
  filter: brightness(1.05);
}

.legal-btn--danger {
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: linear-gradient(180deg, #f87171 0%, #dc2626 55%, #991b1b 100%);
  color: #fff5f5;
  box-shadow:
    0 10px 28px rgba(185, 28, 28, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.legal-btn--danger:hover {
  filter: brightness(1.05);
}

@media (max-width: 720px) {
  .legal-bg {
    background-image: url("/images/login-bg-mobile.jpg");
    background-position: center top;
  }

  .legal-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(7, 8, 12, 0.35) 0%,
        rgba(7, 8, 12, 0.7) 28%,
        rgba(7, 8, 12, 0.9) 100%
      );
  }

  .legal-shell {
    padding: 16px 14px 28px;
    gap: 12px;
  }

  .legal-header {
    padding: 18px 16px 14px;
    border-radius: 16px;
  }

  .legal-section {
    padding: 14px 14px 12px;
    border-radius: 12px;
  }

  .legal-section ul {
    padding-left: 1.05rem;
  }
}
