/* ═══════════════════════════════════════════
   Fuyano — Pages légales — Feuille partagée
   ═══════════════════════════════════════════ */

/* ── Variables sémantiques ── */
:root {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --text: #000000;
  --text-secondary: #666666;
  --text-muted: #595959;
  --border: #e0e0e0;
  --accent: #000000;
}

html.dark {
  --bg: #000000;
  --surface: #0a0a0a;
  --text: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #808080;
  --border: #262626;
  --accent: #ffffff;
}

/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Canvas = html : Safari iOS le peint derrière ses barres translucides et dans le
   rubber-band — sans lui, sur-scroll en nuit = flash blanc UA. Miroir index.css landing. */
html {
  background: var(--bg);
  overscroll-behavior-y: contain;
}

/* ── Base ── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: no-preference) {
  body {
    transition: background-color 0.2s ease, color 0.2s ease;
  }
}

/* ── Focus visible global ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Skip link a11y ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
}

/* ── Header commun ── */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
}

@supports (background: color-mix(in srgb, red 50%, blue)) {
  .legal-header {
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.legal-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.legal-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: opacity 250ms ease;
}

.legal-logo:hover {
  opacity: 0.8;
}

.legal-logo-icon {
  width: 2rem;
  height: 2rem;
  display: block;
}

.legal-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.legal-header-sep {
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border) 20%,
    var(--border) 80%,
    transparent
  );
  opacity: 0.5;
}

/* ── Toggle thème ── */
.legal-theme-toggle {
  position: relative;
  width: 50px;
  min-height: 44px;
  background: none;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* Track pill */
.legal-theme-toggle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 50px;
  height: 28px;
  transform: translateY(-50%);
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.14);
  transition: background-color 250ms ease;
}

html.dark .legal-theme-toggle::before {
  background-color: rgba(255, 255, 255, 0.14);
}

.legal-theme-toggle:hover::before {
  background-color: rgba(0, 0, 0, 0.22);
}

html.dark .legal-theme-toggle:hover::before {
  background-color: rgba(255, 255, 255, 0.22);
}

/* Thumb */
.legal-theme-toggle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #131426;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: transform 250ms ease, background-color 250ms ease;
}

html.dark .legal-theme-toggle::after {
  transform: translate(22px, -50%);
  background: #ffffff;
}

/* ── Layout principal ── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* ── En-tête de page (titre + date) ── */
.header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* ── Typographie ── */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

ul,
ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--text);
  font-weight: 600;
}

a {
  color: var(--text);
  text-decoration: underline;
}

a:hover {
  opacity: 0.75;
}

code {
  color: var(--text);
  word-break: break-word;
}

.updated {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.section {
  margin-bottom: 2rem;
}

/* ── Info-box ── */
.info-box {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.info-box h3 {
  margin-top: 0;
}

/* Paragraphe d'accroche en tête d'info-box (taille légèrement augmentée). */
.info-box-lead {
  font-size: 1.125rem;
  color: var(--text);
}

/* Séparateur vertical entre sous-blocs d'une même info-box. */
.info-box .gap-top {
  margin-top: 1rem;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #10b981;
  color: #000000;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.badge-warning {
  background: #f59e0b;
}

.badge-danger {
  background: #ef4444;
}

/* ── Contact-block (support.html) ── */
.contact-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.contact-block p {
  margin-bottom: 0;
}

/* ── Tables (cookies.html) ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

caption {
  margin-bottom: 0.75rem;
  color: var(--text);
  font-weight: 600;
  text-align: left;
}

td {
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

/* ── Formulaire (report.html) ── */
form {
  margin-top: 1.5rem;
}

.field {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--text-muted);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.checkbox-field label {
  margin-bottom: 0;
  color: var(--text-secondary);
  font-weight: 400;
}

button[type="submit"] {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

button[type="submit"]:hover {
  opacity: 0.85;
}

button[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.form-status {
  margin-top: 1rem;
  min-height: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.form-status.error {
  color: #ff8a8a;
}

.success {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #2f6f4e;
  border-radius: 8px;
  background: #071a12;
  color: #d7ffe8;
}

.success code {
  color: #ffffff;
  word-break: break-word;
}

/* ── Footer légal ── */
.legal-footer {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
}

.legal-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 0.75rem;
  }
}

/* ── Print ── */
@media print {
  .legal-header,
  .legal-footer,
  .skip-link,
  .legal-theme-toggle {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
