/* =========================================================
   DALLE RÉTICULÉE — Feuille de style principale
   ========================================================= */

:root {
  --primary:   #1a3a5c;
  --accent:    #e8861a;
  --light:     #f5f7fa;
  --white:     #ffffff;
  --gray:      #6c757d;
  --dark:      #212529;
  --border:    #dee2e6;
  --shadow:    0 4px 20px rgba(0,0,0,.10);
  --radius:    8px;
  --font-sans: 'Segoe UI', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--dark);
  background: var(--white);
  line-height: 1.7;
  font-size: 16px;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── HEADER ─────────────────────────────────────── */
header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

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

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: .5rem;
}

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

nav ul {
  list-style: none;
  display: flex;
  gap: .25rem;
}

nav a {
  color: rgba(255,255,255,.85);
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-size: .92rem;
  transition: background .2s, color .2s;
}

nav a:hover,
nav a.active {
  background: var(--accent);
  color: var(--white);
  text-decoration: none;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform .3s;
}

/* ── HERO ────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5f8a 60%, #3a7abd 100%);
  color: var(--white);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-label {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: .3rem .9rem;
  border-radius: 20px;
  margin-bottom: 1.2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.15rem;
  opacity: .9;
  max-width: 680px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 2rem;
  border-radius: 40px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform .2s, box-shadow .2s;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.2); text-decoration: none; }

.btn-primary { background: var(--accent); color: var(--white); }
.btn-outline  { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.6); }
.btn-outline:hover { border-color: var(--white); color: var(--white); }

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ── BREADCRUMB ──────────────────────────────────── */
.breadcrumb {
  background: var(--light);
  padding: .7rem 1.5rem;
  font-size: .87rem;
  color: var(--gray);
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { margin: 0 .4rem; }

/* ── SECTIONS ────────────────────────────────────── */
.section { padding: 4.5rem 1.5rem; }
.section-alt { background: var(--light); }

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

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-tag {
  display: inline-block;
  background: rgba(232,134,26,.12);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: .3rem .9rem;
  border-radius: 20px;
  margin-bottom: .8rem;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: .75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .6rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: .5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 680px;
  margin: 0 auto;
}

/* ── GRID CARDS ──────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.75rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(0,0,0,.15); }

.card-body { padding: 1.75rem; }

.card-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--primary), #2c7bb6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}
.card-icon svg { width: 28px; height: 28px; fill: var(--white); }

.card-nav {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-nav img, .card-nav .card-img-placeholder {
  width: 100%;
  height: 200px;
  object-fit: cover;
}
.card-img-placeholder {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5f8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-nav .card-body { flex: 1; }
.card-nav .card-link {
  display: block;
  padding: 1rem 1.75rem;
  background: var(--light);
  color: var(--primary);
  font-weight: 700;
  font-size: .9rem;
  border-top: 1px solid var(--border);
  transition: background .2s;
}
.card-nav .card-link:hover { background: var(--accent); color: var(--white); text-decoration: none; }
.card-nav .card-link::after { content: ' →'; }

/* ── STAT BOXES ──────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.5rem;
  text-align: center;
}
.stat-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  box-shadow: var(--shadow);
}
.stat-num {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stat-label { font-size: .9rem; color: var(--gray); margin-top: .4rem; }

/* ── TWO-COL TEXT+IMAGE ──────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.two-col.reverse { direction: rtl; }
.two-col.reverse > * { direction: ltr; }

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .two-col.reverse { direction: ltr; }
}

/* ── DIAGRAM / ILLUSTRATION ──────────────────────── */
.diagram-box {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.diagram-box figcaption {
  font-size: .85rem;
  color: var(--gray);
  margin-top: 1rem;
  font-style: italic;
}

/* ── TABLE ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th {
  background: var(--primary);
  color: var(--white);
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 700;
}
td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--light); }
tr:hover td { background: rgba(232,134,26,.06); }

/* ── ACCORDION ───────────────────────────────────── */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.accordion-btn {
  width: 100%;
  background: var(--white);
  border: none;
  padding: 1.1rem 1.5rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .2s;
}
.accordion-btn:hover { background: var(--light); }
.accordion-btn .chevron { transition: transform .3s; font-style: normal; }
.accordion-btn.open .chevron { transform: rotate(180deg); }
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  background: var(--light);
}
.accordion-body-inner { padding: 1.25rem 1.5rem; }

/* ── HIGHLIGHT BOX ───────────────────────────────── */
.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5f8a 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}
.highlight h2 { color: var(--white); }
.highlight p  { opacity: .9; max-width: 600px; margin: .75rem auto 1.5rem; }

/* ── BREADCRUMB LIST ─────────────────────────────── */
ol.bc { display: flex; flex-wrap: wrap; list-style: none; }
ol.bc li + li::before { content: '›'; margin: 0 .4rem; color: var(--gray); }

/* ── STEP LIST ───────────────────────────────────── */
.steps { counter-reset: step; }
.step-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}
.step-num {
  width: 52px;
  height: 52px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}

/* ── LIST ICON ───────────────────────────────────── */
.list-check { list-style: none; }
.list-check li {
  padding-left: 1.75rem;
  position: relative;
  margin-bottom: .5rem;
}
.list-check li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ── FORMULA BOX ─────────────────────────────────── */
.formula {
  background: #1a1a2e;
  color: #e8e8e8;
  font-family: 'Courier New', monospace;
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  overflow-x: auto;
  font-size: .95rem;
  line-height: 2;
}
.formula .comment { color: #6da5c0; }

/* ── BADGE ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.badge-primary { background: rgba(26,58,92,.12); color: var(--primary); }
.badge-accent  { background: rgba(232,134,26,.12); color: var(--accent); }
.badge-green   { background: rgba(40,167,69,.12);  color: #28a745; }

/* ── FOOTER ──────────────────────────────────────── */
footer {
  background: #0f2236;
  color: rgba(255,255,255,.7);
  padding: 3.5rem 1.5rem 1.5rem;
}
.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-logo { font-size: 1.2rem; font-weight: 700; color: var(--white); margin-bottom: .75rem; }
.footer-logo span { color: var(--accent); }
.footer-desc { font-size: .9rem; line-height: 1.7; }
.footer-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--white);
  margin-bottom: 1rem;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: .5rem; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: var(--accent); }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  nav ul { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--primary); padding: 1rem; gap: .25rem; }
  nav ul.open { display: flex; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3.5rem 1.25rem 3rem; }
  .section { padding: 3rem 1.25rem; }
}

/* ── PAGE HEADER (inner pages) ───────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5f8a 100%);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  color: var(--white);
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; color: var(--white); margin-bottom: .75rem; }
.page-hero p  { opacity: .9; max-width: 640px; margin: 0 auto; font-size: 1.05rem; }

/* ── TOOLTIP DEFINITION ──────────────────────────── */
abbr[title] { text-decoration: underline dotted var(--accent); cursor: help; }

/* ── SCROLL-TO-TOP ───────────────────────────────── */
#topBtn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .3s;
  z-index: 200;
}
#topBtn.visible { opacity: 1; }
