/* CSS_SHA256: f694acdd9ec84c02d7c54fef9593c0576de37b1ca9468d88e096352e3fcc1bf6 */
/* TRACE360 Mapping 5C+ — NIGHT CSS (v1)
   Purpose: stable, reproducible rendering for screen + PDF export.
   Notes:
   - Uses CSS variables (tokens) only. DO NOT hardcode colors in HTML.
   - Designed to keep all blocks centered and avoid page-break glitches.
   - Answer dashed lines workaround uses repeating-linear-gradient (PDF-friendly).
*/

:root{
  /* ====== PAGE / TYPO ====== */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-base: 16px;
  --fs-small: 14px;
  --fs-h1: 42px;
  --fs-h2: 22px;
  --fs-h3: 18px;

  --lh: 1.45;

  /* ====== COLORS (TOKENS) ====== */
  /* Backgrounds */
  --bg: #0b1020;              /* deep night */
  --bg-2: #0a0f1a;            /* darker */
  --card: rgba(18, 26, 44, .78);
  --card-2: rgba(18, 26, 44, .62);

  /* Text */
  --text: #e8edf7;
  --text-2: #c6d0e6;
  --muted: #99a6c8;

  /* Accents */
  --tron-cyan: #00e5ff;
  --tron-blue: #2f7cff;
  --tron-violet: #7a5cff;
  --amber: #ffb020;           /* orange/yellow for section titles */
  --danger: #ff4d6d;          /* used for warnings */

  /* Table */
  --table-head: rgba(25, 35, 60, .92);
  --table-row: rgba(255,255,255,.04);
  --table-border: rgba(255,255,255,.10);

  /* Borders / shadows */
  --border: rgba(255,255,255,.12);
  --border-2: rgba(0,229,255,.22);
  --shadow: 0 18px 50px rgba(0,0,0,.45);
  --glow: 0 0 14px rgba(0,229,255,.25);

  /* Charts */
  --c1: #8aa7ff; /* C1 */
  --c2: #00d1ff; /* C2 */
  --c3: #7bff8a; /* C3 */
  --c4: #ffb020; /* C4 */
  --c5: #ff4d6d; /* C5 */

  /* Radar */
  --radar-grid: rgba(255,255,255,.20);
  --radar-mid: rgba(255,255,255,.78); /* highlight ring (50%) */
  --radar-axis: rgba(255,255,255,.35);
  --radar-fill: rgba(0,209,255,.22);
  --radar-stroke: rgba(0,209,255,.85);

  /* Page metrics */
  --content-max: 980px;
  --radius: 18px;
  --pad: 18px;
}

/* ====== GLOBAL ====== */
html,body{
  height:100%;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(47,124,255,.22), transparent 60%),
              radial-gradient(1000px 520px at 50% 0%, rgba(0,229,255,.12), transparent 62%),
              radial-gradient(900px 520px at 60% 10%, rgba(122,92,255,.12), transparent 70%),
              var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh);
  margin:0;
}

/* Center everything */
.page{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 28px 18px 60px;
}

/* ====== HEADER ====== */
.h-title{
  text-align:center;
  font-size: var(--fs-h1);
  font-weight: 800;
  letter-spacing: .06em;
  margin: 10px 0 6px;
  color: var(--tron-cyan);
  text-shadow: 0 0 16px rgba(0,229,255,.24);
}
.h-subtitle{
  text-align:center;
  color: var(--text-2);
  font-size: 18px;
  margin: 0 0 18px;
}
.h-meta{
  text-align:center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 26px;
}
.badge-lock{
  display:inline-block;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px dashed rgba(0,229,255,.55);
  color: var(--tron-cyan);
  font-size: 12px;
}

/* ====== CARDS / SECTIONS ====== */
.section{
  margin: 18px 0 22px;
}
.section-title{
  font-size: 22px;
  font-weight: 800;
  color: var(--amber);
  margin: 0 0 10px;
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
              var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
  break-inside: avoid;
  page-break-inside: avoid;
}
.card + .card{ margin-top: 14px; }
.note{
  color: var(--text-2);
  font-size: var(--fs-small);
}

/* ====== TABLES ====== */
.table{
  width:100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid var(--table-border);
}
.table thead th{
  background: var(--table-head);
  color: var(--text);
  padding: 10px 10px;
  text-align:center;
  font-weight: 800;
  border-bottom: 1px solid var(--table-border);
}
.table tbody td{
  background: var(--table-row);
  padding: 9px 10px;
  border-top: 1px solid var(--table-border);
}
.table td.left, .table th.left{ text-align:left; }
.table td.center, .table th.center{ text-align:center; }

/* ====== GRID (2 columns) ====== */
.grid-2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 880px){
  .grid-2{ grid-template-columns: 1fr; }
}

/* ====== RADAR WRAP ====== */
.radar-wrap{
  display:flex;
  gap: 16px;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
}
.radar{
  width: 260px;
  height: 220px;
  flex: 0 0 auto;
}
.radar svg{ width:100%; height:100%; display:block; }
.radar-legend{
  color: var(--text-2);
  font-size: 14px;
  max-width: 520px;
}

/* ====== COMPETENCE BAR ====== */
.compbar{
  width:100%;
  border-radius: 999px;
  overflow:hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  height: 10px;
  margin: 10px 0 6px;
  display:flex;
}
.compbar > span{ height:100%; display:block; }
.compbar-labels{
  display:flex;
  justify-content:space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

/* ====== QCM ====== */
.qcm-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items:stretch;
}
.qcm-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: var(--card-2);
  break-inside: avoid;
  page-break-inside: avoid;
}
.qcm-head{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}
.chk{
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 3px;
  display:inline-block;
}
.chk.correct{
  border-color: #a1001f; /* overridden in PROF print if needed */
}
.qcm-title{
  font-weight: 800;
  color: var(--text);
}
.qcm-figure{
  border-radius: 12px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.15);
  display:flex;
  align-items:center;
  justify-content:center;
  min-height: 220px;
}
.qcm-figure img{
  width:100%;
  height:auto;
  display:block;
}

/* ====== ANSWER ZONES (ONLY things allowed to split) ====== */
.answer-zone{ break-inside: auto; page-break-inside: auto; }
.repl2,.repl3,.repl4{
  margin: 10px 0 0;
}
.repl2 .line, .repl3 .line, .repl4 .line{
  height: 18px;
  margin: 8px 0;
  /* PDF-friendly dashed effect */
  background-image: repeating-linear-gradient(
    to right,
    rgba(255,255,255,.38) 0 8px,
    rgba(255,255,255,0) 8px 14px
  );
  background-repeat: repeat-x;
  background-size: auto 0.6pt;
  background-position: 0 100%;
}
.repl3 .line{ height: 20px; }
.repl4 .line{ height: 22px; }

/* ====== MATHJAX ====== */
.mjx-container{ font-size: 1em !important; } /* keep 100% */
.mjx-math{ color: var(--text) !important; }

@media print{
  body{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page{ max-width: none; padding: 0; }
  .card{ box-shadow:none; }
}

/* ====== BUILD STAMP ======
   VERSION: v1.1.8
   P25-12-13 15:40:24 (Europe/Paris)
*/
.buildstamp{
  font-size: 12px;
  opacity: 0.75;
  margin-top: 8px;
}
.compbar-labels span{ text-align:center; }



/* ====== PATCH v1.1.5 — Bar labels centering + pastilles + radar label colors ======
   VERSION: v1.1.8
   P25-12-13 16:00:06 (Europe/Paris)
   Notes:
   - compbar labels are positioned by JS at the center of each colored segment
   - adds .comp-dot pastilles (C1..C5)
   - ensures radar axis labels can use CSS vars for colors
*/

.compbar{ position: relative; }
.compbar-labels{
  position: relative;
  height: 18px;
  margin-top: 6px;
}
.compbar-labels span{
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 12px;
  opacity: 0.9;
}
.compbar-labels span[data-c="C1"]{ color: var(--c1); }
.compbar-labels span[data-c="C2"]{ color: var(--c2); }
.compbar-labels span[data-c="C3"]{ color: var(--c3); }
.compbar-labels span[data-c="C4"]{ color: var(--c4); }
.compbar-labels span[data-c="C5"]{ color: var(--c5); }

/* Pastilles */
.comp-dot{
  display:inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: -1px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.15);
}
.comp-dot[data-c="C1"]{ background: var(--c1); }
.comp-dot[data-c="C2"]{ background: var(--c2); }
.comp-dot[data-c="C3"]{ background: var(--c3); }
.comp-dot[data-c="C4"]{ background: var(--c4); }
.comp-dot[data-c="C5"]{ background: var(--c5); }

/* Radar axis label coloring if JS sets data-c */
svg text.axis-label[data-c="C1"]{ fill: var(--c1); }
svg text.axis-label[data-c="C2"]{ fill: var(--c2); }
svg text.axis-label[data-c="C3"]{ fill: var(--c3); }
svg text.axis-label[data-c="C4"]{ fill: var(--c4); }
svg text.axis-label[data-c="C5"]{ fill: var(--c5); }



/* ====== PATCH v1.1.6 — Bar labels centering (robust) + legend ======
   VERSION: v1.1.8
   P25-12-13 16:13:46 (Europe/Paris)
*/
.compbar{ position: relative; }
.compbar-labels{ position: relative !important; width:100% !important; height: 18px; margin-top: 6px; }
.compbar-labels span{ position: absolute !important; top: 0; transform: translateX(-50%); font-size: 12px; opacity: 0.95; white-space:nowrap; }
.compbar-labels span[data-c="C1"]{ color: var(--c1) !important; }
.compbar-labels span[data-c="C2"]{ color: var(--c2) !important; }
.compbar-labels span[data-c="C3"]{ color: var(--c3) !important; }
.compbar-labels span[data-c="C4"]{ color: var(--c4) !important; }
.compbar-labels span[data-c="C5"]{ color: var(--c5) !important; }

/* Mini legend */
.mini-legend{ display:flex; gap:14px; flex-wrap:wrap; margin: 10px 0 0 0; opacity:0.95; }
.mini-legend .legend-item{ display:flex; align-items:center; gap:6px; font-size:12px; }
.legend-sq{ display:inline-block; width:10px; height:10px; border-radius:3px; box-shadow:0 0 0 1px rgba(255,255,255,0.18); }
.legend-sq[data-c="C1"]{ background:var(--c1); }
.legend-sq[data-c="C2"]{ background:var(--c2); }
.legend-sq[data-c="C3"]{ background:var(--c3); }
.legend-sq[data-c="C4"]{ background:var(--c4); }
.legend-sq[data-c="C5"]{ background:var(--c5); }
.header-sq{ margin-right:8px; vertical-align:-1px; }

/* Radar axis label coloring (fallback, in case inline fill exists) */
svg text.axis-label[data-c="C1"]{ fill: var(--c1) !important; }
svg text.axis-label[data-c="C2"]{ fill: var(--c2) !important; }
svg text.axis-label[data-c="C3"]{ fill: var(--c3) !important; }
svg text.axis-label[data-c="C4"]{ fill: var(--c4) !important; }
svg text.axis-label[data-c="C5"]{ fill: var(--c5) !important; }



/* ====== PATCH v1.1.8 — Radar graduations (25/50/75/100) + mid highlight ======
   VERSION: v1.1.8
   TIMESTAMP: 2025-12-13 16:13:46 (Europe/Paris)
*/
.radar svg .radar-mid { stroke: var(--radar-mid, var(--radar-grid)) !important; stroke-width: 1.8 !important; opacity: 1 !important; }
.radar-scale { margin-top: 6px; font-size: 12px; opacity: 0.9; }
.radar-mid-tag { font-weight: 700; color: var(--radar-mid, var(--text-1)); }

/* === Canon: swatches are squares (not circles) === */
.dot,.legend-swatch,.swatch{ border-radius: 3px !important; }
