/* Pages publiques de qr.superbud.fr — vues après un scan, souvent sur mobile. */

:root {
    --ink: #1a1a1a;
    --ink-soft: #555;
    --ink-faint: #8a8a86;
    --line: #ececec;
    --accent: #0C7A45;
    --accent-weak: #eef7f1;
    --surface: #fff;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--surface);
    color: var(--ink);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* En-tête */
.vp-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 16px;
    color: #fff;
}
.vp-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .18);
    display: grid;
    place-items: center;
    flex: none;
}
.vp-header b { font-size: 15px; }
/* Logo téléversé : hauteur bornée, largeur libre, jamais déformé. */
.vp-logo-img { height: 30px; width: auto; max-width: min(60vw, 240px); display: block; }
/* Contraste : inversion des couleurs du logo (option par page). */
.vp-logo-invert { filter: invert(1); }
/* Position du contenu de l'en-tête (gauche par défaut). */
.vp-header--center { justify-content: center; }
.vp-header--right  { justify-content: flex-end; }

/* Bandeau produit */
.vp-cover {
    position: relative;
    background: linear-gradient(135deg, #2AA35F, #0C4C2E);
    color: #fff;
    padding: 34px 16px 18px;
    overflow: hidden;
}
.vp-cover h1 {
    position: relative;
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    text-wrap: balance;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

/* Avec une photo, le titre doit rester lisible quelle que soit l'image :
   un voile sombre est appliqué par-dessus. */
.vp-cover-image { padding-top: 120px; }
.vp-cover-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, .72) 0%, rgba(0, 0, 0, .25) 55%, rgba(0, 0, 0, .1) 100%);
}
.vp-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.vp-cover-image h1 { z-index: 1; }

.vp-body {
    padding: 16px;
    max-width: 720px;
    margin: 0 auto;
    width: 100%;
}

/* Onglets — de simples liens : la page fonctionne sans JavaScript. */
.vp-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
}
.vp-tabs a {
    padding: 10px 0;
    margin-right: 22px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--ink-faint);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    gap: 7px;
}
.vp-tabs a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.vp-tabs .cnt {
    background: var(--accent-weak);
    color: var(--accent);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
}

/* Description */
.vp-desc { font-size: 15px; color: var(--ink-soft); }
.vp-desc h2, .vp-desc h3, .vp-desc h4 {
    color: var(--ink);
    font-size: 16px;
    margin: 18px 0 6px;
}
.vp-desc h2:first-child, .vp-desc h3:first-child, .vp-desc h4:first-child { margin-top: 0; }
.vp-desc p { margin: 0 0 10px; }
.vp-desc ul, .vp-desc ol { margin: 10px 0; padding-left: 20px; }
.vp-desc li { margin: 3px 0; }
.vp-desc a { color: var(--accent); }

/* Spécificités — liste compacte en tête de la description. */
.vp-specs {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.vp-spec {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14.5px;
    line-height: 1.35;
    color: var(--ink);
}
.vp-spec-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: none;
}
/* Sans icône, on garde le retrait pour aligner les valeurs entre elles. */
.vp-spec-icon--none { display: inline-block; }
.vp-spec-label { color: var(--ink-soft); }
.vp-spec-value { font-weight: 700; }
/* Inséré dans la description (via le jeton {%-specificites-%}) : les règles
   génériques de liste de .vp-desc (indentation, marges) ne doivent pas
   s'appliquer — le bloc doit rester aligné comme le texte, sans puce ni retrait. */
.vp-desc .vp-specs { list-style: none; margin: 14px 0 0; padding: 0; }
.vp-desc .vp-spec { margin: 0; }

/* Sélecteur d'analyses */
.pdf-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}
.pdf-tab {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid #e6e6e2;
    border-radius: 8px;
    background: #fff;
    font-size: 13.5px;
    color: var(--ink);
    text-decoration: none;
}
.pdf-tab.active {
    border-color: var(--accent);
    background: var(--accent-weak);
}
.pdf-tab b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.pdf-tab .muted { color: var(--ink-faint); font-size: 12px; }
.pdf-icon {
    flex: none;
    width: 30px;
    height: 24px;
    border-radius: 5px;
    background: #f7dedb;
    color: #b23a31;
    font-size: 9px;
    font-weight: 800;
    display: grid;
    place-items: center;
    letter-spacing: .04em;
}

/* Visionneuse */
.pdf-viewer {
    border: 1px solid #e6e6e2;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f3f1;
}
.pdf-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #eaeae7;
    border-bottom: 1px solid #ddd;
    font-size: 12.5px;
    color: var(--ink-soft);
}
.pdf-toolbar .pt-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.pdf-toolbar .pt-action {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.pdf-frame {
    display: block;
    width: 100%;
    height: 60vh;
    min-height: 380px;
    border: 0;
    background: #f3f3f1;
}
/* Catalogue : document unique, cadre plus haut que les analyses. */
.pdf-frame--full { height: 78vh; min-height: 460px; }

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    padding: 13px 18px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    text-decoration: none;
}
.btn-download:hover { filter: brightness(1.07); }

/* Action secondaire (téléchargement) : discrète face au bouton d'ouverture. */
.btn-download.btn-ghost {
    background: #fff;
    color: var(--accent);
    border: 1px solid #d7e7de;
}
.btn-download.btn-ghost:hover { filter: none; background: var(--accent-weak); }

.empty { color: var(--ink-faint); }

/* Messages d'erreur */
.vp-message {
    max-width: 520px;
    margin: 0 auto;
    padding: 56px 20px;
    text-align: center;
}
.vp-message h1 {
    font-size: 22px;
    margin: 0 0 10px;
    text-wrap: balance;
}
.vp-message p { color: var(--ink-soft); margin: 0 0 10px; }
.code-echo code {
    background: #f2f2ef;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 13px;
}

/* Pied de page */
.vp-footer {
    padding: 18px 16px;
    border-top: 1px solid var(--line);
    background: #f7f7f5;
    font-size: 12px;
    color: var(--ink-faint);
    text-align: center;
}
/* Pictogrammes, au-dessus du pied de page : icône seule, le titre = alternative. */
.vp-pictos {
    display: flex; flex-wrap: wrap; gap: 14px;
    justify-content: center; align-items: center;
    padding: 0 16px 15px;
}
.vp-picto { height: 34px; width: auto; max-width: 72px; object-fit: contain; display: block; }
.vp-footer .vp-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-bottom: 9px;
}
.vp-footer .vp-links a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
}
.vp-footer .vp-links a:hover { text-decoration: underline; }
.vp-footer p { margin: 0; }

@media (min-width: 720px) {
    .vp-cover { padding: 46px 16px 24px; }
    .vp-cover h1 { font-size: 27px; max-width: 720px; margin: 0 auto; }
    .vp-header { padding: 14px 24px; }
}

/* --- Page légale (politique de confidentialité) --- */
.vp-legal {
    max-width: 760px; margin: 0 auto; padding: 30px 22px 64px;
    line-height: 1.65; color: var(--ink);
}
.vp-legal h1 { font-size: 1.7rem; line-height: 1.2; margin: 0 0 6px; }
.vp-legal h2 { font-size: 1.18rem; margin: 30px 0 10px; }
.vp-legal h3 { font-size: 1rem; margin: 20px 0 6px; color: var(--ink-soft); }
.vp-legal p { margin: 0 0 12px; color: var(--ink-soft); }
.vp-legal ul, .vp-legal ol { margin: 0 0 12px; padding-left: 22px; color: var(--ink-soft); }
.vp-legal li { margin: 5px 0; }
.vp-legal strong { color: var(--ink); }
.vp-legal a { color: var(--accent); }
