/* ===== LEGAL PAGES STYLES ===== */
/* Matching landing page design */

:root {
  /* Couleurs principales inspirées de l'app */
  --primary: #6366F1;
  --primary-dark: #4F46E5;
  --primary-light: #818CF8;
  --primary-soft: #EEF2FF;

  --secondary: #10B981;
  --secondary-light: #D1FAE5;

  --accent: #2196F3;
  --accent-light: #E3F2FD;

  --gold: #F59E0B;
  --gold-light: #FEF3C7;

  --warning: #FB923C;
  --warning-light: #FFF7ED;

  --error: #EF4444;
  --error-light: #FEF2F2;

  /* Fond clair et moderne */
  --bg-primary: #FAFBFC;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F3F4F6;

  /* Textes */
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --text-inverse: #FFFFFF;

  /* Bordures */
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --gradient-soft: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
}

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
}

.nav-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.nav-logo span {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.nav-links a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ===== HEADER ===== */
.page-header {
  background: var(--gradient-soft);
  padding: 80px 24px 60px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.page-header-container {
  max-width: 700px;
  margin: 0 auto;
}

.page-icon {
  width: 80px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.page-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -1px;
}

.page-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.page-meta {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-tertiary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

/* ===== CONTENT CARD ===== */
.content-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 48px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* ===== TYPOGRAPHY ===== */
h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

h2:first-child {
  margin-top: 0;
}

h2 .section-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  margin: 28px 0 14px;
}

h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 20px 0 10px;
}

p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

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

ul, ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

li {
  margin-bottom: 10px;
  color: var(--text-secondary);
  line-height: 1.7;
}

li strong {
  color: var(--text-primary);
}

/* ===== SPECIAL BOXES ===== */
.info-box {
  background: var(--primary-soft);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.contact-box {
  background: var(--gradient-soft);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 24px 0;
}

.contact-box strong {
  color: var(--primary);
}

.contact-box p:last-child {
  margin-bottom: 0;
}

.highlight-box {
  background: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.highlight-box strong {
  color: var(--gold);
}

.highlight-box p:last-child {
  margin-bottom: 0;
}

.warning-box {
  background: var(--error-light);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-left: 4px solid var(--error);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.warning-box strong {
  color: var(--error);
}

.warning-box p:last-child {
  margin-bottom: 0;
}

.success-box {
  background: var(--secondary-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-left: 4px solid var(--secondary);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
}

.success-box strong {
  color: var(--secondary);
}

.success-box p:last-child {
  margin-bottom: 0;
}

/* ===== FAQ ITEMS ===== */
.faq-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

.faq-question {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq-question::before {
  content: '❓';
  flex-shrink: 0;
}

.faq-answer {
  color: var(--text-secondary);
  line-height: 1.8;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* ===== STEP BOXES ===== */
.step-box {
  background: var(--secondary-light);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 14px;
  padding: 24px;
  margin: 20px 0;
}

.step-box h3 {
  color: var(--secondary);
  margin-top: 0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-box h3::before {
  content: '✅';
}

.step-box p:last-child,
.step-box ol:last-child,
.step-box ul:last-child {
  margin-bottom: 0;
}

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 14px;
  border: 1px solid var(--border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

table th {
  background: var(--primary);
  color: var(--text-inverse);
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
}

table th:first-child {
  border-radius: 12px 0 0 0;
}

table th:last-child {
  border-radius: 0 12px 0 0;
}

table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

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

table tr:nth-child(even) {
  background: var(--bg-tertiary);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 40px 24px;
  text-align: center;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
  text-decoration: none;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-brand span {
  font-family: 'Fredoka', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-legal {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  font-style: italic;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--text-inverse);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* ===== TABLE OF CONTENTS ===== */
.toc {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 40px;
}

.toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: block;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
}

.toc-list a:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a {
    font-size: 12px;
    padding: 6px 12px;
  }

  .page-header {
    padding: 60px 20px 40px;
  }

  .page-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .main-content {
    padding: 40px 16px;
  }

  .content-card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  h2 {
    font-size: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  h2 .section-icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  h3 {
    font-size: 16px;
  }

  .table-wrapper {
    margin: 16px -20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  table th:first-child,
  table th:last-child {
    border-radius: 0;
  }

  .toc-list {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .nav-logo span {
    display: none;
  }
}
