/* ============================================================
   GoTakoo — Feuille de style des pages juridiques
   https://gotakoo.palmisphere.com
   ============================================================ */

/* --- Google Fonts ------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* --- Variables --------------------------------------------- */
:root {
  --color-primary: #0074D9;
  --color-primary-dark: #005BB5;
  --color-primary-medium: #0063C1;
  --color-accent: #FF851B;
  --color-text: #333333;
  --color-text-light: #555555;
  --color-text-muted: #777777;
  --color-bg: #FFFFFF;
  --color-bg-alt: #F5F9FE;
  --color-bg-nav: #005BB5;
  --color-border: #D0D5DD;
  --color-link: #0074D9;
  --color-link-hover: #005BB5;
  --font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --max-width: 960px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* --- Skip to content --------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-weight: 600;
}

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

/* --- Header / Navigation ----------------------------------- */
.site-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 60%, var(--color-primary-medium) 100%);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-logo:hover,
.site-logo:focus {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
}

.site-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.site-logo .logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.site-logo .logo-accent {
  color: var(--color-accent);
}

/* Navigation toggle (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 1px;
  transition: transform 0.3s ease;
}

/* Navigation links */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  text-decoration: none;
}

.site-nav a.active {
  background: rgba(255,255,255,0.18);
  color: #ffffff;
  font-weight: 600;
}

.site-nav .nav-app-link {
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 600;
  margin-left: 0.5rem;
}

.site-nav .nav-app-link:hover,
.site-nav .nav-app-link:focus {
  background: #E07010;
  color: #ffffff;
}

/* --- Main content ------------------------------------------ */
.legal-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* --- Page title -------------------------------------------- */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border);
}

/* --- Table of Contents ------------------------------------- */
.toc {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.toc-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding-left: 0;
}

.toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 0.35rem;
}

.toc ol li::before {
  content: counter(toc-counter) ". ";
  font-weight: 600;
  color: var(--color-primary);
}

.toc ol li a {
  font-size: 0.95rem;
}

/* --- Articles & Sections ----------------------------------- */
.legal-article {
  margin-bottom: 2.5rem;
}

.legal-article h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #E0E0E0;
  line-height: 1.3;
}

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

.legal-article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.legal-article p {
  margin-bottom: 1rem;
}

.legal-article ul,
.legal-article ol {
  margin-bottom: 1rem;
  padding-left: 1.75rem;
}

.legal-article li {
  margin-bottom: 0.4rem;
}

.legal-article li::marker {
  color: var(--color-primary);
}

/* --- Placeholder markers ----------------------------------- */
.placeholder {
  background: #FFF3E0;
  color: #E65100;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
}

/* --- Tables ------------------------------------------------ */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.legal-table thead {
  background: var(--color-primary);
  color: #ffffff;
}

.legal-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.legal-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
}

.legal-table tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

.legal-table tbody tr:hover {
  background: #E3F0FC;
}

/* --- Info / Alert boxes ------------------------------------ */
.info-box {
  background: #E3F0FC;
  border-left: 4px solid var(--color-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

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

.warning-box {
  background: #FFF3E0;
  border-left: 4px solid var(--color-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

/* --- FAQ --------------------------------------------------- */
.faq-category {
  margin-bottom: 2.5rem;
}

.faq-category h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #E0E0E0;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow-sm);
}

.faq-item details {
  padding: 0;
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background 0.2s ease;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--color-bg-alt);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  transition: transform 0.2s ease, background 0.2s ease;
}

.faq-item details[open] summary::before {
  content: "\2212";
  background: var(--color-primary);
  color: #fff;
  transform: rotate(180deg);
}

.faq-item summary:hover {
  background: var(--color-bg-alt);
}

.faq-item .faq-answer {
  padding: 0 1.25rem 1.25rem 3.25rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

.faq-item .faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-item .faq-answer ul {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.faq-item .faq-answer li {
  margin-bottom: 0.3rem;
}

/* --- Footer ------------------------------------------------ */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-brand {
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  padding: 0;
}

.footer-legal-links a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.footer-legal-links a:hover {
  color: var(--color-primary);
}

.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.8rem;
}

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.6rem 0.75rem;
    border-radius: 0;
    font-size: 0.95rem;
  }

  .site-nav .nav-app-link {
    margin-left: 0;
    margin-top: 0.5rem;
    text-align: center;
    border-radius: var(--radius);
  }

  .header-inner {
    padding: 0 1rem;
  }

  .legal-main {
    padding: 1.5rem 1rem 3rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .toc {
    padding: 1rem 1.25rem;
  }

  .legal-article h2 {
    font-size: 1.2rem;
  }

  .legal-table {
    font-size: 0.85rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.5rem 0.6rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-legal-links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .legal-article h2 {
    font-size: 1.1rem;
  }

  .legal-table th,
  .legal-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* --- Print styles ------------------------------------------ */
@media print {
  .site-header,
  .nav-toggle,
  .site-nav,
  .site-footer {
    display: none !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .legal-main {
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .page-title {
    font-size: 18pt;
    color: #000;
  }

  .legal-article h2 {
    font-size: 14pt;
    color: #000;
    border-bottom-color: #ccc;
  }

  .legal-article h3 {
    font-size: 12pt;
  }

  .toc {
    background: none;
    border: 1px solid #ccc;
  }

  .legal-table {
    font-size: 9pt;
  }

  .legal-table thead {
    background: #eee;
    color: #000;
  }

  .info-box,
  .warning-box {
    border-left-width: 3px;
    background: none;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }

  .site-nav a[href]::after,
  .footer-legal-links a[href]::after {
    content: none;
  }

  .faq-item details {
    display: block;
  }

  .faq-item details[open] summary ~ * {
    display: block;
  }
}
