/* ==========================================================================
   Rapport PDF Domain Check : plaquette de 2 pages A4 sur le modèle du flyer
   Sentinel Audit365 (recto : bande, chiffres clés, cartes ; verso : priorités,
   colonnes-cartes, grande bande d'appel).
   Feuille chargée avec media="print". Toutes les règles visent le document
   dédié #print-report construit par report.js : l'impression des autres pages
   du site (et de l'accueil sans résultat) n'est pas modifiée.
   ========================================================================== */

/* Pages : pleine page sans marge (fonds perdus) pour le rapport. La règle sans nom vaut aussi marge 0, car la
   boîte de dialogue d'impression de Chrome et Edge (marges « Par défaut ») peut s'y référer : le rapport reste
   alors bord à bord. Les autres pages du site impriment sur une page nommée « site » avec leurs marges habituelles. */
@page { size: A4; margin: 0; }
@page report { size: A4; margin: 0; }
@page site { margin: 10mm; }
body:not(:has(#print-report)) { page: site; }

/* --- Seul le rapport s'imprime ------------------------------------------------------------------ */
body:has(#print-report) { display: block; min-height: 0; margin: 0; background: #fff; }
body:has(#print-report) > :not(main) { display: none !important; }
body:has(#print-report) main { display: block; margin: 0; padding: 0; view-transition-name: none; }
/* .tool en bloc : la propriété page (page: report) ne s'applique qu'aux boîtes de bloc du flux normal. */
body:has(#print-report) .tool { display: block; padding: 0; background: none; overflow: visible; }
body:has(#print-report) .tool::before,
body:has(#print-report) .tool::after { display: none; }
body:has(#print-report) .tool > .container { max-width: none; margin: 0; padding: 0; }
body:has(#print-report) .tool > .container > :not(#result) { display: none !important; }
body:has(#print-report) #result { max-width: none; margin: 0; }
#result > :not(#print-report) { display: none !important; }

#print-report {
  display: block;
  page: report;
  font-family: var(--font-text);
  font-size: 10pt;
  line-height: 1.4;
  color: var(--ink-2);
  text-align: left;
}
#print-report,
#print-report *,
#print-report *::before,
#print-report *::after {
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  animation: none !important;
  transition: none !important;
}
:where(#print-report) :where(p, h2, ul, ol) { margin: 0; padding: 0; list-style: none; }
:where(#print-report) .icon { display: block; flex: none; fill: none; stroke: currentColor; }

/* --- Pages A4 ---------------------------------------------------------------------------------- */
.pr-page {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 210mm;
  height: 297mm;
  overflow: hidden;
  background: #fff;
  break-inside: avoid;
  break-after: page;
}
.pr-page:last-child { break-after: auto; }

/* Titres de section et sous-titres (communs aux deux pages) */
.pr-h { margin: 9mm 14mm 0; font-family: var(--font-title); font-size: 17pt; font-weight: 800; line-height: 1.15; color: var(--navy); }
.pr-sub { margin: 1.4mm 14mm 0; font-size: 10pt; line-height: 1.4; color: var(--ink-2); }

/* Point d'état coloré */
.pr-dot { display: inline-block; flex: none; width: 2.6mm; height: 2.6mm; background: #8a9bb0; border-radius: 50%; }
.pr-dot--good { background: #059669; }
.pr-dot--improve { background: #d97706; }
.pr-dot--critical { background: #dc2626; }
.pr-dot--na,
.pr-dot--off { background: #8a9bb0; }

/* ==========================================================================
   Page 1 (recto)
   ========================================================================== */

/* --- Bande bleu marine : logo, pilule, titre, accroche ----------------------------------------- */
.pr-band {
  position: relative;
  z-index: 0;
  flex: none;
  padding: 12mm 14mm 11mm;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 70%);
}
.pr-band__arc {
  position: absolute;
  z-index: -1;
  top: -50mm;
  right: -30mm;
  width: 92mm;
  height: 92mm;
  background: var(--cyan);
  border-radius: 50%;
}
.pr-band__top { display: flex; align-items: center; justify-content: space-between; gap: 8mm; }
.pr-band__logo { width: auto; height: 11mm; }
.pr-pill {
  padding: 2.2mm 5.5mm;
  font-family: var(--font-title);
  font-size: 8.5pt;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--navy);
  background: #fff;
  border-radius: 999px;
}
.pr-title {
  margin-top: 11mm;
  font-family: var(--font-title);
  font-size: 46pt;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
}
.pr-title__accent { color: var(--cyan); }
.pr-rule { display: block; width: 26mm; height: 1.6mm; margin-top: 5mm; background: var(--cyan); border-radius: 1mm; }
.pr-hook { margin-top: 6mm; font-family: var(--font-title); font-size: 17pt; font-weight: 700; line-height: 1.25; color: #fff; }
.pr-hook__domain { color: var(--cyan-light); overflow-wrap: anywhere; }
.pr-lead { max-width: 165mm; margin-top: 3.5mm; font-size: 12pt; line-height: 1.45; color: #dbe8f4; }

/* --- 4 chiffres clés ------------------------------------------------------------------------- */
.pr-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10mm 14mm 0; }
.pr-kpi { display: flex; flex-direction: column; align-items: center; padding: 0 3mm; text-align: center; border-left: 0.3mm solid var(--mist); }
.pr-kpi:first-child { border-left: 0; }
.pr-kpi__value {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 13mm;
  font-family: var(--font-title);
  font-size: 36pt;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.pr-kpi--text .pr-kpi__value { padding-bottom: 1mm; font-size: 13.5pt; line-height: 1.15; letter-spacing: 0; text-wrap: balance; overflow-wrap: anywhere; }
.pr-kpi__label { max-width: 40mm; margin-top: 2.2mm; font-family: var(--font-title); font-size: 9pt; font-weight: 500; line-height: 1.3; color: var(--ink-2); }

/* --- Une carte bleu très clair par pilier (grille 2-2-1) --------------------------------------- */
.pr-cards { display: grid; flex: 0 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5mm; min-height: 0; margin: 5mm 14mm 0; overflow: hidden; }
.pr-card { display: flex; gap: 4.5mm; padding: 4.5mm 5.5mm; background: var(--ice); border-radius: 10px; }
.pr-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pr-card__icon { display: grid; flex: none; place-items: center; width: 11.5mm; height: 11.5mm; color: #fff; background: var(--navy); border-radius: 50%; }
.pr-card__icon .icon { width: 5.6mm; height: 5.6mm; }
.pr-card__body { flex: 1; min-width: 0; }
.pr-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 3mm; font-family: var(--font-title); font-weight: 800; color: var(--navy); }
.pr-card__name { font-size: 13pt; line-height: 1.2; }
.pr-card__score { font-size: 13pt; line-height: 1.2; white-space: nowrap; }
.pr-card__score small { font-size: 8pt; font-weight: 600; color: var(--ink-2); }
.pr-card__state { display: flex; align-items: center; gap: 1.8mm; margin-top: 0.6mm; font-family: var(--font-title); font-size: 8.5pt; font-weight: 600; color: var(--ink-2); }
.pr-card__state::first-letter { text-transform: uppercase; }
.pr-card__text { display: -webkit-box; margin-top: 1.6mm; overflow: hidden; font-size: 9.3pt; line-height: 1.4; color: var(--ink-2); -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }

/* --- Bande de pied (filet cyan au-dessus) ----------------------------------------------------- */
.pr-foot {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 6mm;
  margin-top: auto;
  padding: 7.5mm 14mm;
  font-family: var(--font-title);
  color: #fff;
  background: linear-gradient(90deg, var(--navy) 0%, var(--blue) 100%);
  border-top: 1.4mm solid var(--cyan);
}
.pr-foot__left { font-size: 11pt; font-weight: 800; }
.pr-foot__right { font-size: 10pt; font-weight: 700; white-space: nowrap; }

/* ==========================================================================
   Page 2 (verso)
   ========================================================================== */
.pr-page--back::before { content: ""; display: block; flex: none; height: 2mm; background: var(--cyan); }
.pr-page--back .pr-h { margin-top: 6.5mm; }

/* --- En-tête : logo, séparateur, domaine (sans signature, demande de l'utilisateur) ------------------- */
.pr-head { display: flex; flex: none; align-items: center; gap: 4.5mm; margin: 0; padding: 5mm 14mm; background: var(--ice); border-bottom: 0.3mm solid var(--mist); }
.pr-head__logo { width: auto; height: 10mm; }
.pr-head__sep { flex: none; width: 0.35mm; height: 9mm; background: var(--mist); }
.pr-head__title { flex: 1; min-width: 0; font-family: var(--font-title); font-size: 11.5pt; font-weight: 700; line-height: 1.3; color: var(--blue); overflow-wrap: anywhere; }

/* --- Vos priorités : cercles numérotés reliés par un trait cyan ------------------------------------ */
.pr-prio { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.pr-steps { display: grid; gap: 2.6mm; margin: 4.5mm 14mm 0; }
.pr-step { position: relative; display: grid; grid-template-columns: 9mm minmax(0, 1fr); gap: 4mm; align-items: start; }
.pr-step:not(:last-child)::after { content: ""; position: absolute; top: 9mm; bottom: -2.6mm; left: 4.2mm; width: 0.6mm; background: var(--cyan); }
.pr-step__num {
  display: grid;
  place-items: center;
  width: 9mm;
  height: 9mm;
  font-family: var(--font-title);
  font-size: 11pt;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
  border-radius: 50%;
}
.pr-step:last-child .pr-step__num { color: var(--navy-900); background: var(--cyan); }
.pr-step__body { padding-top: 0.8mm; }
.pr-step__title { display: -webkit-box; overflow: hidden; font-family: var(--font-title); font-size: 10pt; font-weight: 700; line-height: 1.3; color: var(--navy); -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.pr-step__tag {
  display: inline-block;
  margin-right: 2mm;
  padding: 0.3mm 1.8mm;
  font-size: 7pt;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.4mm;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
}
.pr-step--crit .pr-step__tag { background: #b91c1c; }
.pr-step__action { display: -webkit-box; margin-top: 0.9mm; overflow: hidden; font-size: 8.8pt; line-height: 1.4; color: var(--ink-2); -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.pr-record { margin-top: 1.6mm; padding: 1.8mm 3mm; background: var(--ice); border-radius: 6px; }
.pr-record__meta { font-family: var(--font-title); font-size: 7pt; font-weight: 700; color: var(--blue); overflow-wrap: anywhere; }
.pr-record__value {
  display: block;
  margin-top: 0.5mm;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 8pt;
  line-height: 1.4;
  color: var(--navy-900);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pr-more { flex: none; margin: 2.5mm 14mm 0 27mm; font-size: 8.8pt; font-weight: 700; color: var(--blue); }

/* Aucune priorité (ou rien de vérifié) : pilule à coche et texte court */
.pr-none { display: flex; flex-wrap: wrap; align-items: center; gap: 3mm 5mm; margin: 4.5mm 14mm 0; }
.pr-none__pill,
.pr-pill-check {
  display: inline-flex;
  align-items: center;
  gap: 1.8mm;
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--navy);
  border: 0.45mm solid var(--navy);
  border-radius: 999px;
}
.pr-none__pill { padding: 2mm 5mm; font-size: 10.5pt; }
.pr-none__pill .icon { width: 4.2mm; height: 4.2mm; color: var(--cyan-ink); stroke-width: 3; }
.pr-none__text { flex: 1 1 80mm; font-size: 9.5pt; line-height: 1.4; }

/* --- Faits établis : pilules à bord bleu marine ------------------------------------------------- */
.pr-pills { display: flex; flex: none; flex-wrap: wrap; justify-content: center; gap: 2mm 2.5mm; margin: auto 12mm 0; padding-top: 5mm; }
.pr-pill-check { max-width: 100%; padding: 1.4mm 3.6mm; font-size: 8.2pt; line-height: 1.25; }
.pr-pill-check .icon { width: 3.6mm; height: 3.6mm; stroke-width: 3; }
.pr-pill-check span { overflow-wrap: anywhere; }

/* --- 5 contrôles : colonnes-cartes ------------------------------------------------------------ */
.pr-cols { display: grid; flex: none; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3mm; margin: 4mm 14mm 9mm; }
.pr-col { display: flex; flex-direction: column; overflow: hidden; background: var(--ice); border-radius: 10px; }
.pr-col__head { padding: 3mm 3.5mm; background: var(--blue); }
.pr-col__name { font-family: var(--font-title); font-size: 11pt; font-weight: 800; line-height: 1.2; color: #fff; }
.pr-col__score { display: flex; align-items: center; gap: 1.5mm; margin-top: 0.6mm; font-family: var(--font-title); font-size: 8.5pt; font-weight: 500; color: #cfe0ef; }
.pr-col__list { display: grid; align-content: start; gap: 1.8mm; padding: 3mm 3.5mm 3.5mm; }
.pr-col__list li { position: relative; padding-left: 3.2mm; font-size: 8.3pt; line-height: 1.35; color: var(--ink); overflow-wrap: anywhere; }
.pr-col__list li::before { content: ""; position: absolute; top: 1.3mm; left: 0; width: 1.6mm; height: 1.6mm; background: var(--cyan); }

/* --- Grande bande bleu marine : Sentinel Audit365 ou aide SF2i, puis contact --------------------- */
.pr-cta {
  flex: none;
  margin-top: auto;
  padding: 7mm 14mm 5mm;
  color: #dbe8f4;
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 100%);
}
.pr-cta__title { font-family: var(--font-title); font-size: 15.5pt; font-weight: 800; line-height: 1.2; color: #fff; }
.pr-cta__lead { margin-top: 1.2mm; font-family: var(--font-title); font-size: 10.5pt; font-weight: 700; line-height: 1.35; color: var(--cyan); }
.pr-cta__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6mm; margin-top: 4.5mm; }
.pr-cta__steps li { display: flex; gap: 3mm; align-items: flex-start; }
.pr-cta__num {
  display: grid;
  flex: none;
  place-items: center;
  width: 8.5mm;
  height: 8.5mm;
  font-family: var(--font-title);
  font-size: 11pt;
  font-weight: 800;
  color: var(--navy-900);
  background: var(--cyan);
  border-radius: 50%;
}
.pr-cta__steps p { font-size: 8.7pt; line-height: 1.4; color: #dbe8f4; }
.pr-cta__steps strong { display: block; font-family: var(--font-title); font-size: 10.5pt; font-weight: 700; line-height: 1.25; color: #fff; }
.pr-cta__steps strong + span { display: block; margin-top: 0.6mm; }
.pr-cta__steps strong + span::first-letter { text-transform: uppercase; }
.pr-cta__link { margin-top: 3.5mm; font-family: var(--font-title); font-size: 10pt; font-weight: 700; color: var(--cyan-light); }
.pr-cta__bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6mm;
  margin-top: 4mm;
  padding-top: 3.2mm;
  border-top: 0.3mm solid rgb(255 255 255 / 0.25);
}
.pr-cta__contact { font-family: var(--font-title); font-size: 11pt; font-weight: 800; color: #fff; white-space: nowrap; }
.pr-cta__territories { font-size: 9pt; color: #dbe8f4; text-align: right; }
.pr-cta__url { margin-top: 1.5mm; font-size: 7.5pt; line-height: 1.35; color: #a9bfd4; overflow-wrap: anywhere; }

/* Garde-fous de hauteur : un enregistrement sur 3 lignes, une puce sur 5 lignes au plus. */
.pr-record__value { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
.pr-col__list li { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5; }

/* Couleurs de niveau, comme à l'écran (bon >= 80 vert, à améliorer 50-79 orange, critique < 50 rouge, sinon gris).
   Grand chiffre : teintes de la jauge (grand texte, contraste >= 3:1) ; notes des cartes : teintes des pastilles
   (>= 5:1 sur fond bleu très clair) ; en-têtes bleus des colonnes : variantes claires (>= 4,5:1 sur #18568d). */
.pr-kpi--score.pr-lv--good .pr-kpi__value { color: #059669; }
.pr-kpi--score.pr-lv--improve .pr-kpi__value { color: #d97706; }
.pr-kpi--score.pr-lv--critical .pr-kpi__value { color: #dc2626; }
.pr-card__score.pr-lv--good { color: var(--ok); }
.pr-card__score.pr-lv--improve { color: var(--warn); }
.pr-card__score.pr-lv--critical { color: var(--ko); }
.pr-col__score.pr-lv--good,
.pr-col__score.pr-lv--improve,
.pr-col__score.pr-lv--critical { font-weight: 700; }
.pr-col__score.pr-lv--good { color: #86efac; }
.pr-col__score.pr-lv--improve { color: #fdba74; }
.pr-col__score.pr-lv--critical { color: #fecaca; }

/* Verso : la place libre est répartie à parts égales au-dessus des pilules, du titre des contrôles et de la
   grande bande (marges automatiques), avec un espacement minimal fixe (marges intérieures). */
.pr-page--back .pr-h--checks { margin-top: auto; padding-top: 6.5mm; }
