/* Styles de la série « Nombres complexes » (4 chapitres), scopés sous
   .fiche-complexes pour ne pas interférer avec le reste du site. */

.fiche-complexes{
  --navy-900: #0b1e3f;
  --navy-800: #142a52;
  --navy-700: #1e3a6d;
  --navy-600: #2a4d82;
  --gold: #d4a94a;
  --gold-dark: #b8872e;

  --green-line: #2e7d32;
  --green-bg: #eef7ee;
  --green-text: #1b5e20;

  --purple-line: #6a3fa0;
  --purple-bg: #f4eefc;
  --purple-text: #4a2378;

  --orange-line: #d97a1f;
  --orange-bg: #fff4e8;
  --orange-text: #9a4e0d;

  --blue-line: #1f6fb2;
  --blue-bg: #eaf3fb;
  --blue-text: #14548a;

  --red-line: #c0392b;
  --red-bg: #fdecea;
  --red-text: #922015;

  --gray-line: #5c6b7a;
  --gray-bg: #f4f6f8;

  --ink: #1c2530;
  --ink-soft: #48566a;
  --paper: #ffffff;
  --page-bg: #eef1f6;
}
.fiche-complexes *{ box-sizing: border-box; }
.fiche-complexes{ scroll-behavior: smooth; }
.fiche-complexes{
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--page-bg);
  line-height: 1.6;
  font-size: 16px;
}
.fiche-complexes{
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 40px rgba(11, 30, 63, 0.08);
  min-height: 100vh;
}
.fiche-complexes .hero{
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 55%, var(--navy-600) 100%);
  color: #fff;
  padding: 48px 56px 40px;
  position: relative;
  overflow: hidden;
}
.fiche-complexes .hero::after{
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,169,74,0.18) 0%, rgba(212,169,74,0) 70%);
}
.fiche-complexes .hero .eyebrow{
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12.5px;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}
.fiche-complexes .hero h1{
  margin: 0 0 6px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.fiche-complexes .hero .subtitle{
  font-size: 16.5px;
  color: #cfd9ee;
  font-weight: 400;
}
.fiche-complexes .chapter-nav{
  display: flex;
  gap: 8px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.fiche-complexes .chapter-nav a{
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: #cfd9ee;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.fiche-complexes .chapter-nav a:hover{ background: rgba(255,255,255,0.16); }
.fiche-complexes .chapter-nav a.current{
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy-900);
}
.fiche-complexes .content{ padding: 40px 56px 70px; }
.fiche-complexes h2.partie{
  color: var(--navy-800);
  font-size: 23px;
  font-weight: 700;
  margin: 46px 0 18px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--navy-700);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.fiche-complexes h2.partie:first-of-type{ margin-top: 8px; }
.fiche-complexes h2.partie .num{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--navy-700);
  color: #fff;
  font-size: 15px;
  padding: 0 8px;
}
.fiche-complexes h3.sous-partie{
  color: var(--navy-700);
  font-size: 18.5px;
  font-weight: 700;
  margin: 30px 0 12px;
}
.fiche-complexes p{ margin: 0 0 14px; color: var(--ink); }
.fiche-complexes .content > p:first-of-type{ font-size: 16.5px; color: var(--ink-soft); }
.fiche-complexes ul, .fiche-complexes ol{ margin: 0 0 14px; padding-left: 22px; }
.fiche-complexes li{ margin-bottom: 5px; }
.fiche-complexes strong{ color: var(--navy-800); }
.fiche-complexes .box{
  border-left: 5px solid;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(11,30,63,0.05);
}
.fiche-complexes .box .box-title{
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fiche-complexes .box .box-title .icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
}
.fiche-complexes .box .katex-display{ margin: 10px 0; }
.fiche-complexes .def{
  border-color: var(--green-line);
  background: var(--green-bg);
}
.fiche-complexes .def .box-title{ color: var(--green-text); }
.fiche-complexes .def .box-title .icon{ background: var(--green-line); }
.fiche-complexes .prop{
  border-color: var(--purple-line);
  background: var(--purple-bg);
}
.fiche-complexes .prop .box-title{ color: var(--purple-text); }
.fiche-complexes .prop .box-title .icon{ background: var(--purple-line); }
.fiche-complexes .methode{
  border-color: var(--orange-line);
  background: var(--orange-bg);
}
.fiche-complexes .methode .box-title{ color: var(--orange-text); }
.fiche-complexes .methode .box-title .icon{ background: var(--orange-line); }
.fiche-complexes .exemple{
  border-color: var(--blue-line);
  background: var(--blue-bg);
}
.fiche-complexes .exemple .box-title{ color: var(--blue-text); }
.fiche-complexes .exemple .box-title .icon{ background: var(--blue-line); }
.fiche-complexes .remarque{
  border-color: var(--red-line);
  background: var(--red-bg);
}
.fiche-complexes .remarque .box-title{ color: var(--red-text); }
.fiche-complexes .remarque .box-title .icon{ background: var(--red-line); }
.fiche-complexes .demo{
  border: 1px dashed #93a2b5;
  border-left: 5px solid var(--gray-line);
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 16px 22px;
  margin: 14px 0 22px;
  font-size: 15px;
  color: var(--ink-soft);
}
.fiche-complexes .demo .box-title{
  color: var(--gray-line);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
  font-style: normal;
}
.fiche-complexes .histoire{
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid #e6d5ad;
  background: #fbf6ea;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 22px 0 32px;
}
.fiche-complexes .histoire .box-title{
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.fiche-complexes .histoire p{ color: #4a4030; font-size: 14.5px; margin-bottom: 8px; }
.fiche-complexes .histoire p:last-child{ margin-bottom: 0; }
.fiche-complexes .retenir{
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  margin: 34px 0;
}
.fiche-complexes .retenir .box-title{
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fiche-complexes .retenir ul{ padding-left: 20px; margin-bottom: 0; }
.fiche-complexes .retenir li{ margin-bottom: 8px; color: #e7ecf7; }
.fiche-complexes .retenir strong{ color: #fff; }
.fiche-complexes .retenir .katex{ color: #fff; }
.fiche-complexes .correction{
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: 14px 18px;
  margin-top: 12px;
}
.fiche-complexes .correction .label{
  font-weight: 700;
  color: var(--orange-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.fiche-complexes table.tbl{
  border-collapse: collapse;
  margin: 14px auto;
  font-size: 14.5px;
}
.fiche-complexes table.tbl th, .fiche-complexes table.tbl td{
  border: 1px solid #cfd6e0;
  padding: 6px 12px;
  text-align: center;
}
.fiche-complexes table.tbl th{ background: var(--navy-700); color: #fff; }
.fiche-complexes table.tbl td.hi{ background: #fdecc8; font-weight: 700; }
.fiche-complexes .figure{
  display: flex;
  justify-content: center;
  margin: 18px 0;
}
.fiche-complexes .figure svg{ max-width: 100%; height: auto; }
.fiche-complexes .figure figcaption{
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 6px;
}
.fiche-complexes .figure-wrap{ text-align: center; }
.fiche-complexes .two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 640px){
.fiche-complexes .two-col{ grid-template-columns: 1fr; }
.fiche-complexes .hero, .fiche-complexes .content{ padding-left: 24px; padding-right: 24px; }
}
.fiche-complexes .footer{
  border-top: 1px solid #e3e8ef;
  padding: 26px 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  background: #f7f9fc;
}
.fiche-complexes .footer .brand{ font-weight: 700; color: var(--navy-800); }
@media print{
.fiche-complexes{ background: #fff; }
.fiche-complexes{ box-shadow: none; max-width: 100%; }
.fiche-complexes .chapter-nav{ display: none; }
.fiche-complexes h2.partie{ break-after: avoid; }
.fiche-complexes .box, .fiche-complexes .demo, .fiche-complexes .histoire, .fiche-complexes .retenir, .fiche-complexes .correction{ break-inside: avoid; }
}