/* ==========================================================================
   QORSEC — veille.css : page /veille/ et encart « Dernières alertes » de l'accueil
   Chargé APRÈS site.css (et pages.css sur /veille/). Classes préfixées .vl- (page)
   et .vw- (encart d'accueil). Couleurs : jetons de site.css.
   Couleurs des sources (étiquettes, jamais des boutons) :
     DGSSI vert · CERT-FR indigo · CERT-EU cyan (données) · CISA KEV orange (signalisation).
   ========================================================================== */
:root {
  --vl-dgssi: #15803d; --vl-dgssi-bg: rgba(34, 197, 94, .1);  --vl-dgssi-bd: rgba(21, 128, 61, .28);
  --vl-certfr: #4338ca; --vl-certfr-bg: rgba(99, 102, 241, .1); --vl-certfr-bd: rgba(67, 56, 202, .26);
  --vl-certeu: #0369a1; --vl-certeu-bg: rgba(14, 165, 233, .1); --vl-certeu-bd: rgba(3, 105, 161, .26);
  --vl-kev: #b84d06;    --vl-kev-bg: rgba(220, 94, 9, .09);     --vl-kev-bd: rgba(184, 77, 6, .28);
}

/* ---------------------------------------------------------------- étiquettes de source */
.vl-badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 800; letter-spacing: .04em; line-height: 1.4; white-space: nowrap;
  color: var(--vl-c, var(--ink-500)); background: var(--vl-bg, var(--paper-50)); border: 1px solid var(--vl-bd, var(--border));
}
.vl-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vl-badge--dgssi, .vl-card--dgssi, .vl-flag--dgssi, .vl-srccard--dgssi { --vl-c: var(--vl-dgssi); --vl-bg: var(--vl-dgssi-bg); --vl-bd: var(--vl-dgssi-bd); }
.vl-badge--certfr, .vl-card--certfr, .vl-flag--certfr, .vl-srccard--certfr { --vl-c: var(--vl-certfr); --vl-bg: var(--vl-certfr-bg); --vl-bd: var(--vl-certfr-bd); }
.vl-badge--certeu, .vl-card--certeu, .vl-flag--certeu, .vl-srccard--certeu { --vl-c: var(--vl-certeu); --vl-bg: var(--vl-certeu-bg); --vl-bd: var(--vl-certeu-bd); }
.vl-badge--kev, .vl-card--kev, .vl-flag--kev, .vl-srccard--kev { --vl-c: var(--vl-kev); --vl-bg: var(--vl-kev-bg); --vl-bd: var(--vl-kev-bd); }

.vl-flag {
  display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--vl-c); background: var(--vl-bg); border: 1px solid var(--vl-bd);
}
.theme-dark .vl-flag { color: #fff; background: color-mix(in srgb, var(--vl-c) 55%, transparent); border-color: color-mix(in srgb, var(--vl-c) 80%, #fff 20%); }

/* ---------------------------------------------------------------- héros */
.vl-hero .pg-hero__grid { align-items: start; }
.vl-panel { margin-top: 8px; }
.vl-updated { display: flex; align-items: center; gap: 8px; }
.vl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #8494b6; }
.vl-dot--ok { background: var(--green-500); box-shadow: 0 0 0 3px rgba(34, 197, 94, .22); animation: vl-pulse 2.4s infinite; }
.vl-dot--warn { background: var(--amber-300); box-shadow: 0 0 0 3px rgba(252, 211, 77, .2); }
.vl-dot--ko { background: var(--red-500); box-shadow: 0 0 0 3px rgba(239, 68, 68, .2); }
.vl-dot--wait { background: #8494b6; animation: vl-blink 1.2s infinite; }
@keyframes vl-pulse { 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
@keyframes vl-blink { 50% { opacity: .35; } }
.vl-sources li { padding-block: 11px; }
.vl-src { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vl-src > span:last-child { display: grid; min-width: 0; }
.vl-src__name { font-weight: 800; color: #fff; line-height: 1.3; }
.vl-src__name a { color: inherit; text-decoration: none; }
.vl-src__name a:hover { text-decoration: underline; }
.vl-src__sub { font-size: .78rem; color: #93a4c8; line-height: 1.35; }
.vl-state { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 3px 4px 3px 10px; border-radius: var(--r-pill); font-size: .76rem; font-weight: 800; white-space: nowrap; border: 1px solid; }
.vl-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vl-state > span:first-child { padding-right: 6px; }
.vl-state__n { display: inline-grid; place-items: center; min-width: 26px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .12); color: #fff; font-variant-numeric: tabular-nums; }
.vl-state--ok { color: var(--green-300); background: rgba(34, 197, 94, .12); border-color: rgba(134, 239, 172, .3); }
.vl-state--stale { color: var(--amber-300); background: rgba(217, 119, 6, .14); border-color: rgba(252, 211, 77, .3); }
.vl-state--ko { color: var(--red-300); background: rgba(239, 68, 68, .12); border-color: rgba(252, 165, 165, .3); }
.vl-state--wait { color: #a9b6d3; background: rgba(255, 255, 255, .04); border-color: rgba(169, 182, 211, .3); border-style: dashed; }

/* ---------------------------------------------------------------- barre d'outils */
.vl-toolbar { display: grid; gap: 14px; margin-bottom: 10px; }
.vl-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.vl-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.vl-search { flex: 1 1 300px; min-width: 0; }
.vl-toggle {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill); cursor: pointer;
  background: var(--white); border: 1px solid var(--border); font-size: .9rem; font-weight: 700; color: var(--ink-700); user-select: none;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.vl-toggle:hover { border-color: var(--blue-600); }
.vl-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue-600); }
.vl-toggle:has(input:checked) { border-color: var(--navy-800); background: var(--navy-800); color: #fff; }
.vl-toggle:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
.vl-sort select {
  min-height: 44px; padding: 8px 38px 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--border); background-color: var(--white);
  font-size: .9rem; font-weight: 700; color: var(--ink-700); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%234a5873' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.vl-sort select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.vl-count { margin: 6px 0 14px; }
@media (max-width: 760px) {
  .vl-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
  .vl-tabs::-webkit-scrollbar { display: none; }
  .vl-tabs .pg-filter { flex: none; min-height: 44px; }
  .vl-search { flex-basis: 100%; }
  .vl-toggle { flex: 1 1 auto; justify-content: center; }
  .vl-sort { flex: 1 1 100%; }
  .vl-sort select { width: 100%; }
}

/* ---------------------------------------------------------------- bandeau */
.vl-alert { margin-bottom: 18px; }
.vl-alert__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------------------------------------------------------------- cartes */
.vl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .vl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .vl-list > .vl-empty { grid-column: 1 / -1; } }
.vl-card {
  position: relative; padding: 20px 22px 18px 26px; border-radius: var(--r-lg); background: var(--white);
  border: 1px solid var(--border); box-shadow: var(--sh-1); overflow: hidden;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t) var(--ease);
}
.vl-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--vl-c, var(--border-strong)); }
.vl-card:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); }
.vl-card article { display: flex; flex-direction: column; gap: 10px; min-width: 0; height: 100%; }
.vl-card article > .vl-card__src { margin-top: auto; }
.vl-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vl-kind { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
.vl-ref { font-family: var(--mono); font-size: .78rem; font-weight: 600; color: var(--fg-subtle); overflow-wrap: anywhere; }
.vl-date { margin-left: auto; display: inline-flex; align-items: baseline; gap: 8px; font-size: .82rem; color: var(--fg-subtle); white-space: nowrap; }
.vl-date__rel { font-weight: 800; color: var(--ink-700); }
.vl-date__abs::before { content: "·"; margin-right: 8px; color: var(--ink-400); }
.vl-card__title { margin: 0; font-size: clamp(1.04rem, 1rem + .3vw, 1.2rem); line-height: 1.32; letter-spacing: -.01em; overflow-wrap: anywhere; }
.vl-card__title a { color: var(--ink-900); text-decoration: none; }
.vl-card__title a:hover { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 2px; }
.vl-ext { display: inline-block; width: 14px; height: 14px; margin-left: 6px; vertical-align: -1px; color: var(--ink-400); }
.vl-card__vp { margin: -4px 0 0; font-size: .86rem; font-weight: 700; color: var(--vl-c); }
.vl-card__sum { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--fg-muted); max-width: 95ch; overflow-wrap: anywhere; }
.vl-card__flags { display: flex; flex-wrap: wrap; gap: 8px; }
.vl-flagchip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 800; line-height: 1.5; white-space: nowrap; border: 1px solid;
}
.vl-flagchip svg { width: 14px; height: 14px; flex: none; }
.vl-flagchip--critique { color: var(--red-700); background: #fdeeee; border-color: rgba(185, 28, 28, .28); }
.vl-flagchip--elevee { color: var(--orange-700); background: #fff4ec; border-color: rgba(184, 77, 6, .28); }
.vl-flagchip--moyenne { color: #92400e; background: #fffbeb; border-color: rgba(217, 119, 6, .3); }
.vl-flagchip--faible { color: var(--ink-500); background: var(--paper-50); border-color: var(--border); }
.vl-flagchip--exploited { color: #fff; background: linear-gradient(135deg, #c2410c, var(--orange-600)); border-color: transparent; box-shadow: 0 6px 16px -8px rgba(220, 94, 9, .8); }

/* CVE + EPSS */
.vl-cves { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vl-cves__label { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); margin-right: 2px; }
.vl-cves ul { display: contents; list-style: none; margin: 0; padding: 0; }
.vl-cve { display: inline-flex; align-items: stretch; border-radius: 8px; border: 1px solid var(--border); background: var(--paper-50); overflow: hidden; max-width: 100%; }
.vl-cve__id { display: inline-flex; align-items: center; padding: 4px 9px; font-family: var(--mono); font-size: .78rem; font-weight: 600; color: var(--cyan-700); text-decoration: none; }
.vl-cve__id:hover { text-decoration: underline; background: rgba(14, 165, 233, .08); }
.vl-cve__id:focus-visible, .vl-epss:focus-visible { outline-offset: -2px; }
.vl-epss {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 0; border-left: 1px solid var(--border);
  background: var(--white); font-size: .74rem; font-weight: 800; letter-spacing: .02em; color: var(--ink-700); white-space: nowrap; cursor: pointer;
}
.vl-epss:hover { background: #eef3ff; color: var(--blue-700); }
.vl-epss.is-loading { color: var(--ink-400); cursor: progress; }
.vl-epss.is-ok { cursor: default; font-variant-numeric: tabular-nums; }
.vl-epss.is-ok:hover { color: inherit; }
.vl-epss.is-low, .vl-epss.is-low:hover { color: var(--cyan-700); background: rgba(14, 165, 233, .08); }
.vl-epss.is-mid, .vl-epss.is-mid:hover { color: #92400e; background: #fffbeb; }
.vl-epss.is-high, .vl-epss.is-high:hover { color: var(--red-700); background: #fdeeee; }
.vl-epss.is-none { color: var(--ink-500); cursor: default; }
.vl-epss.is-err { color: var(--red-700); }
.vl-cves__rest { font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.vl-cves__more { padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--border-strong); background: transparent; font-size: .78rem; font-weight: 700; color: var(--blue-600); }
.vl-cves__more:hover { border-color: var(--blue-600); background: #eef3ff; }
.vl-epss-note { margin: -2px 0 0; font-size: .8rem; line-height: 1.5; color: var(--fg-subtle); }
.vl-card__src { padding-top: 10px; border-top: 1px dashed var(--border); font-size: .78rem; line-height: 1.5; color: var(--fg-subtle); }
.vl-card__src a { color: var(--ink-700); font-weight: 700; }
@media (pointer: coarse), (max-width: 760px) {
  .vl-cve__id, .vl-epss, .vl-cves__more { min-height: 40px; }
  .vl-cve__id, .vl-epss { padding-inline: 11px; }
}
@media (max-width: 560px) {
  .vl-card { padding: 18px 16px 16px 20px; }
  .vl-date { margin-left: 0; flex-basis: 100%; }
  .vl-cves__label { flex-basis: 100%; }
}

/* squelettes et états */
.vl-skel { display: grid; gap: 12px; min-height: 150px; }
.vl-skel__bar { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--line-100), #e6ebf4 40%, var(--line-100) 80%); background-size: 300% 100%; animation: vl-shimmer 1.4s infinite linear; }
.vl-skel__bar--s { width: 26%; height: 20px; border-radius: var(--r-pill); }
.vl-skel__bar--l { width: 72%; height: 20px; }
.vl-skel__bar--m { width: 48%; }
@keyframes vl-shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }
.vl-empty { display: grid; justify-items: center; gap: 4px; list-style: none; }
.vl-empty strong { margin-bottom: 0; }
.vl-more { display: flex; justify-content: center; margin-top: 22px; }
.vl-more:has(> [hidden]) { display: none; }
.vl-disclaimer {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; max-width: 980px; margin: 34px auto 0;
  padding: 16px 18px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--border); font-size: .86rem; line-height: 1.55; color: var(--fg-muted);
}
.vl-disclaimer svg { width: 20px; height: 20px; color: var(--cyan-700); margin-top: 1px; }

/* ---------------------------------------------------------------- sources, fonctionnement, limites */
.vl-srccard { gap: 12px; }
.vl-srccard { border-top: 3px solid var(--vl-c); }
.vl-srccard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vl-srccard h3 { font-size: 1.08rem; }
.vl-srccard p { font-size: .93rem; }
.vl-srccard__link { margin-top: auto; padding-top: 4px; font-size: .92rem; }
.vl-how { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.vl-how h3 { margin: 0; }
.vl-steps { grid-template-columns: minmax(0, 1fr); }
.vl-epss-card { background: linear-gradient(160deg, rgba(14, 165, 233, .07), rgba(29, 78, 216, .04) 50%, var(--white) 80%); }
.vl-epss-card__privacy { padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper-50); border: 1px solid var(--border); font-size: .86rem; }
@media (max-width: 900px) { .vl-how { grid-template-columns: minmax(0, 1fr); } }

/* =================================================================== ENCART D'ACCUEIL */
.vw { border-top: 1px solid var(--border); }
.vw__grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.vw__intro h2 { margin-top: 14px; }
.vw__intro .lead { font-size: 1.05rem; }
.vw__updated { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; font-size: .86rem; font-weight: 700; color: var(--fg-subtle); }
.vw__updated.is-example { color: var(--orange-700); }
.vw__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vw-item {
  position: relative; display: grid; gap: 6px; padding: 14px 18px 14px 22px; border-radius: var(--r-md); background: var(--white);
  border: 1px solid var(--border); box-shadow: var(--sh-1); overflow: hidden; transition: box-shadow var(--t), transform var(--t) var(--ease);
}
.vw-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--vl-c); }
.vw-item:hover { box-shadow: var(--sh-2); transform: translateX(2px); }
.vw-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vw-item .vl-card__title { font-size: 1.02rem; }
.vw-item__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.vw-item__foot:empty { display: none; }
.vw-item__cves { font-size: .78rem; font-weight: 700; color: var(--cyan-700); }
@media (max-width: 900px) { .vw__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .vw-item .vl-date { margin-left: auto; flex-basis: auto; } }

/* ---------------------------------------------------------------- mouvement réduit, impression */
@media (prefers-reduced-motion: reduce) {
  .vl-dot--ok, .vl-dot--wait, .vl-skel__bar { animation: none; }
  .vl-card, .vw-item { transition: none; }
  .vw-item:hover { transform: none; }
}
@media print {
  .vl-toolbar, .vl-more, .vl-epss, #recevoir { display: none !important; }
  .vl-card { break-inside: avoid; box-shadow: none; }
}
