/* ==========================================================================
   Page Bubble Parts
   Scène « nuit » (nuance profonde du bleu) + démo recréée de l'extension.
   ========================================================================== */

.page-bp {
    --nuit: #1E293B; /* ardoise, comme les sections sombres de katz-ia.fr */
    --nuit-2: #334155;
    --nuit-trait: rgba(255, 255, 255, 0.12);
    --nuit-texte: rgba(255, 255, 255, 0.68);
    --duree-scene: 7000ms;
}

/* ====== Scène nuit (présentation + installation) ====== */
.scene-nuit {
    position: relative;
    color: #fff;
    background-color: var(--nuit);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-position: -1px -1px;
    background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
    overflow: hidden;
}
.scene-nuit a:not(.btn) { color: #fff; }
.scene-nuit .btn--clair { background: rgba(255, 255, 255, 0.1); color: #fff; }
.scene-nuit .btn--clair:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }

/* ====== Présentation ====== */
/* Tailles bornées aussi par la hauteur d'écran (vh) : la présentation doit tenir
   dans la fenêtre, y compris sur un écran portable ou un 1080p zoomé à 125 %. */
.bp-hero { padding-block: clamp(28px, 5vh, 72px) clamp(56px, 8vw, 104px); }
.bp-hero__logo {
    width: auto;
    height: clamp(44px, min(6vw, 8vh), 72px);
    margin-bottom: clamp(14px, 2.5vh, 28px);
    /* « Parts » est écrit en noir dans le logo : liseré clair pour le fond nuit */
    filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}
.bp-hero h1 {
    font-size: clamp(2.1rem, min(0.9rem + 3.8vw, 7vh + 0.4rem), 4.4rem);
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -0.025em;
    max-width: 18ch;
}
.bp-hero__bas {
    display: grid;
    gap: 28px;
    margin-top: clamp(18px, 3vh, 32px);
    align-items: end;
}
.bp-hero__intro { font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--nuit-texte); max-width: 52ch; }
.bp-hero__note { font-size: 0.9375rem; color: var(--bleu-300); margin-top: 14px; }
@media (min-width: 900px) {
    .bp-hero__bas { grid-template-columns: 1fr auto; }
}

/* ====== Visite guidée : onglets + démo ====== */
.visite {
    display: grid;
    gap: clamp(28px, 4vw, 56px);
    margin-top: clamp(48px, 7vw, 88px);
    align-items: center;
}
.visite__demo { order: -1; }
@media (min-width: 1000px) {
    .visite { grid-template-columns: minmax(280px, 0.7fr) 1.3fr; }
    .visite__demo { order: 0; }
}

.onglets { display: grid; }
.onglet {
    display: block;
    width: 100%;
    text-align: left;
    padding: 16px 0 18px;
    background: none;
    border: 0;
    border-top: 1px solid var(--nuit-trait);
    color: var(--bleu-300);
    cursor: pointer;
}
.onglet:last-child { border-bottom: 1px solid var(--nuit-trait); }
.onglet__titre {
    display: block;
    font-weight: 700;
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
    transition: color 0.2s;
}
.onglet:hover .onglet__titre, .onglet[aria-selected="true"] .onglet__titre { color: #fff; }
.onglet__texte {
    display: none;
    margin-top: 8px;
    color: var(--nuit-texte);
    font-size: 0.975rem;
    line-height: 1.55;
}
.onglet[aria-selected="true"] .onglet__texte { display: block; }
.onglet__barre {
    display: block;
    height: 2px;
    margin-top: 14px;
    background: var(--nuit-trait);
    overflow: hidden;
}
.onglet__barre i {
    display: block;
    height: 100%;
    background: var(--orange-500);
    transform: scaleX(0);
    transform-origin: left;
}
.onglet[aria-selected="false"] .onglet__barre { visibility: hidden; }
.onglet[aria-selected="true"] .onglet__barre i { animation: progression var(--duree-scene) linear both; }
.visite.en-pause .onglet__barre i { animation-play-state: paused; }
.visite.sans-lecture .onglet__barre { display: none; }
@keyframes progression { to { transform: scaleX(1); } }

/* ====== La démo (tout est en em : elle s'adapte à sa largeur) ====== */
.demo-cadre { container-type: inline-size; }
.demo {
    font-size: 1.6cqw;
    border-radius: 0.9em;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 0.5em rgba(255, 255, 255, 0.06), 0 2em 5em rgba(0, 0, 0, 0.35), 0 0 6em rgba(82, 123, 204, 0.25);
    color: var(--bleu-950);
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.3;
}
.demo__barre {
    display: flex;
    align-items: center;
    gap: 1em;
    height: 3.2em;
    padding: 0 1em;
    background: var(--bleu-100);
    border-bottom: 1px solid var(--trait);
}
.demo__points { display: flex; gap: 0.45em; }
.demo__points i { width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--bleu-300); }
.demo__url {
    position: relative;
    flex: 1;
    height: 2em;
    border-radius: 1em;
    background: #fff;
    font-family: var(--mono);
    font-size: 0.95em;
    color: var(--texte-doux);
}
.demo__url span {
    position: absolute;
    left: 1.1em;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}
.demo__ext { width: 1.9em; height: 1.9em; }
.demo__ecran { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; }

.scene {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.scene.actif { opacity: 1; visibility: visible; }
.demo:has(.scene--a.actif) .demo__url .u-a,
.demo:has(.scene--b.actif) .demo__url .u-b,
.demo:has(.scene--c.actif) .demo__url .u-c,
.demo:has(.scene--d.actif) .demo__url .u-d { opacity: 1; }

/* --- Faux webshop (scènes A et C) --- */
.shop__entete {
    display: flex;
    align-items: center;
    gap: 1.2em;
    height: 4.2em;
    padding: 0 1.5em;
    background: var(--bleu-800);
    color: #fff;
}
.shop__logo { font-weight: 800; font-size: 1.15em; letter-spacing: -0.01em; width: 11em; }
.shop__recherche {
    display: flex;
    align-items: center;
    width: 24em;
    height: 2.5em;
    padding: 0 0.8em;
    background: #fff;
    border-radius: 0.3em;
    color: var(--bleu-950);
    font-family: var(--mono);
    font-size: 1.05em;
}
.shop__btn { padding: 0.55em 1em; border-radius: 0.3em; background: var(--orange-500); color: var(--bleu-950); font-weight: 700; }
.shop__grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2em 1.4em; padding: 1.6em 1.5em; }
.shop__produit { display: grid; gap: 0.6em; }
.shop__produit i { display: block; aspect-ratio: 4 / 3; background: var(--bleu-100); border-radius: 0.3em; }
.shop__produit b { display: block; height: 0.7em; background: var(--bleu-100); border-radius: 0.3em; }
.shop__produit b:last-child { width: 60%; }

/* Frappe au clavier : largeur en ch, --n caractères */
.frappe {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    width: calc(var(--n) * 1ch);
}
.frappe + .caret { display: inline-block; width: 1px; height: 1.2em; background: currentColor; opacity: 0; }
.actif .frappe { animation: frappe var(--t, 1s) steps(var(--n)) var(--d, 0.4s) both; }
.actif .frappe + .caret { animation: clignote 0.9s step-end 3; }
@keyframes frappe { from { width: 0; } }
@keyframes clignote { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- Les bulles, fidèles à l'extension --- */
.bulle {
    position: absolute;
    width: 22em;
    padding: 0.9em 1em 1.1em;
    border-radius: 1.6em;
    background: rgba(197, 218, 247, 0.97);
    box-shadow: -0.25em 0.35em 0.7em rgba(0, 0, 0, 0.55);
    text-align: center;
    font-family: Verdana, 'Segoe UI', sans-serif;
    font-size: 0.95em;
    color: #000;
    transform: scale(0);
}
.bulle--violet { background: radial-gradient(circle at bottom right, rgba(164, 91, 227, 0.9), #fff); }
.bulle__titre {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.05em;
    text-shadow: 1px 1px 2px rgba(74, 74, 74, 0.55);
    margin: 0 auto 0.7em;
    max-width: none;
}
.bulle__texte { margin: 0 auto 0.8em; max-width: none; font-size: 0.95em; }
.bulle__liste { list-style: none; padding: 0; display: grid; gap: 0.5em; }
.bulle__liste li { display: flex; align-items: center; justify-content: center; gap: 0.5em; opacity: 0; }
.bouton-rep {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.25em 0.9em;
    border-radius: 0.8em;
    background: #f0f0f0;
    box-shadow: 0.08em 0.08em 0.25em rgba(0, 0, 0, 0.6);
    font-weight: bold;
    white-space: nowrap;
}
.bouton-rep small { font-weight: normal; color: #444; }
.badge {
    padding: 0.15em 0.5em;
    border-radius: 0.4em;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    background: var(--bleu-600);
}
.badge--promo { background: var(--violet-500); }
.badge--stock { background: var(--orange-500); color: #000; }

.actif .bulle { animation: pop_in2 0.35s linear var(--d, 1.6s) both; }
.actif .bulle__liste li { animation: apparait 0.3s ease-out both; }
.actif .bulle__liste li:nth-child(1) { animation-delay: calc(var(--d, 1.6s) + 0.25s); }
.actif .bulle__liste li:nth-child(2) { animation-delay: calc(var(--d, 1.6s) + 0.4s); }
.actif .bulle__liste li:nth-child(3) { animation-delay: calc(var(--d, 1.6s) + 0.55s); }
/* 0 % s'applique pendant tout le délai d'attente (fill both) : la bulle doit y être invisible */
@keyframes pop_in2 {
    0% { transform: scale(0); opacity: 0; }
    1% { transform: scale(0.4); opacity: 1; }
    25% { transform: scale(1.1); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes apparait { from { opacity: 0; transform: translateY(0.4em); } to { opacity: 1; transform: none; } }

/* --- Scène A : webshop --- */
.scene--a .bulle { top: 5.4em; right: 1.6em; transform-origin: top center; }

/* --- Scène B : catalogue constructeur + clic droit --- */
.cat__titre {
    height: 3.4em;
    display: flex;
    align-items: center;
    padding: 0 1.5em;
    background: var(--orange-300);
    font-weight: 700;
}
.cat__schema { position: absolute; left: 1.5em; top: 5em; width: 22em; height: auto; }
.cat__schema .trait { fill: none; stroke: var(--bleu-950); stroke-width: 2; }
.cat__schema .fin { fill: none; stroke: var(--bleu-950); stroke-width: 1; }
.cat__schema .rep circle { fill: #fff; stroke: var(--bleu-950); stroke-width: 1.5; }
.cat__schema .rep text { font: 700 11px Arial, sans-serif; text-anchor: middle; fill: var(--bleu-950); }
.cat__table {
    position: absolute;
    left: 26em;
    top: 5em;
    width: 35em;
    border-collapse: collapse;
    font-size: 0.95em;
}
.cat__table th {
    height: 2.4em;
    padding: 0 0.8em;
    text-align: left;
    background: var(--bleu-100);
    font-weight: 600;
}
.cat__table td { height: 3em; padding: 0 0.8em; border-bottom: 1px solid var(--trait); }
.cat__table td:nth-child(2) { font-family: var(--mono); }
.sel { background: transparent; color: inherit; padding: 0.1em 0.2em; }
.actif .sel { animation: selection 0.2s linear 1.1s both; }
@keyframes selection { to { background: #3875D7; color: #fff; } }

.menu-ctx {
    position: absolute;
    left: 34.5em;
    top: 12.6em;
    width: 18em;
    padding: 0.4em 0;
    background: #fff;
    border: 1px solid var(--trait);
    border-radius: 0.4em;
    box-shadow: 0.2em 0.3em 0.9em rgba(8, 11, 58, 0.3);
    font-size: 0.95em;
    opacity: 0;
}
.menu-ctx div { display: flex; align-items: center; gap: 0.6em; padding: 0.45em 1em; }
.menu-ctx img { width: 1.2em; height: 1.2em; }
.actif .menu-ctx { animation: menu var(--duree-scene) linear both; }
.actif .menu-ctx__bp { animation: survol var(--duree-scene) linear both; }
@keyframes menu { 0%, 25% { opacity: 0; } 26%, 42% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes survol { 0%, 33% { background: #fff; } 34%, 100% { background: var(--bleu-100); } }
.scene--b .bulle { top: 15.5em; left: 36em; --d: 3.1s; transform-origin: top left; }

/* --- Scène C : doute, bulle violette --- */
.scene--c .bulle { top: 5.4em; right: 1.6em; transform-origin: top center; --d: 1.4s; }
.bulle__reponses { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5em; }
.actif .bouton-rep--clic { animation: clic var(--duree-scene) linear both; }
@keyframes clic {
    0%, 47% { background: #f0f0f0; transform: none; }
    48%, 50% { background: rgb(192, 214, 255); transform: scale(0.94); }
    51%, 100% { background: rgb(192, 214, 255); transform: none; }
}

/* --- Scène D : immatriculation → VIN --- */
.acces {
    position: absolute;
    left: 1.5em;
    top: 1.5em;
    width: 28em;
    padding: 1.2em 1.4em 1.4em;
    background: var(--orange-300);
}
.acces__titre { font-weight: 800; font-size: 1.5em; line-height: 1.1; }
.acces__titre small { display: block; font-size: 0.55em; font-weight: 500; }
.acces__ligne { display: flex; gap: 0.5em; margin-top: 0.8em; }
.acces__champ {
    position: relative;
    flex: 1;
    height: 2.4em;
    padding: 0 0.7em;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid var(--bleu-950);
    font-family: var(--mono);
    font-size: 1.05em;
}
.acces__ok { padding: 0 0.9em; display: flex; align-items: center; background: var(--bleu-950); color: #fff; font-weight: 700; }
.acces__vin { position: absolute; left: 0.7em; opacity: 0; }
.actif .acces__plaque { animation: frappe 1s steps(9) 0.3s both, efface 0.3s linear 2s forwards; }
.actif .acces__vin { animation: vin 0.4s ease-out 2.1s both; }
@keyframes efface { to { opacity: 0; } }
@keyframes vin { from { opacity: 0; letter-spacing: 0.3em; } to { opacity: 1; letter-spacing: 0; } }
.modeles { position: absolute; left: 1.5em; top: 14em; width: 28em; display: grid; gap: 0; }
.modeles span { padding: 0.6em 0.8em; border-bottom: 1px solid var(--trait); }
.modeles span:first-child { background: var(--bleu-950); color: #fff; font-weight: 700; }
.vide { position: absolute; left: 32em; top: 1.5em; right: 1.5em; bottom: 1.5em; display: grid; gap: 1em; align-content: start; }
.vide b { display: block; height: 1em; background: var(--bleu-100); border-radius: 0.3em; }
.vide b:nth-child(2n) { width: 70%; }
.scene--d .bulle { top: 11.5em; left: 25em; --d: 2.5s; transform-origin: top left; }

/* --- Pointeur de souris --- */
.curseur {
    position: absolute;
    width: 1.6em;
    height: auto;
    left: 0;
    top: 0;
    filter: drop-shadow(0.1em 0.15em 0.1em rgba(0, 0, 0, 0.35));
    pointer-events: none;
    z-index: 5;
}
.actif .curseur { animation: var(--trajet) var(--duree-scene) ease-in-out both; }
@keyframes trajet-a {
    0%, 30% { left: 58%; top: 88%; }
    48%, 100% { left: 76%; top: 25%; }
}
@keyframes trajet-b {
    0% { left: 40%; top: 86%; }
    12%, 34% { left: 55%; top: 34%; }
    40%, 100% { left: 62%; top: 48%; }
}
@keyframes trajet-c {
    0%, 20% { left: 30%; top: 86%; }
    40%, 100% { left: 72%; top: 33%; }
}
@keyframes trajet-d {
    0% { left: 60%; top: 86%; }
    20%, 100% { left: 42%; top: 24%; }
}

.demo__note { margin-top: 26px; font-size: 0.8125rem; color: var(--bleu-300); }

/* ====== Ce qu'elle change ====== */
.bp-promesse { display: grid; gap: 40px; }
.bp-promesse h2 { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 3rem); max-width: 20ch; }
.garanties { display: grid; margin: 0; }
.garanties > div { padding: 18px 0; border-top: 1px solid var(--trait); }
.garanties > div:last-child { border-bottom: 1px solid var(--trait); }
.garanties dt { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.garanties dd { margin: 0; color: var(--texte-doux); }
@media (min-width: 960px) {
    .bp-promesse { grid-template-columns: 1.1fr 0.9fr; gap: 80px; align-items: start; }
}

/* ====== Là où vous travaillez ====== */
.partout h2 { margin-bottom: 28px; }
.partout__liste {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.1em 0;
    font-size: clamp(1.5rem, 0.9rem + 3vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}
.partout__liste li:not(:last-child)::after {
    content: "/";
    margin: 0 0.35em;
    font-weight: 300;
    color: var(--bleu-300);
}
.partout__liste li:last-child { color: var(--bleu-600); }
.partout p { margin-top: 24px; color: var(--texte-doux); }

/* ====== Les détails ====== */
.details { list-style: none; padding: 0; display: grid; gap: 0; }
.details li {
    display: grid;
    gap: 16px;
    padding: 28px 0;
    border-top: 1px solid var(--trait);
    align-items: center;
}
.details li:last-child { border-bottom: 1px solid var(--trait); }
.details h3 { font-size: 1.25rem; margin-bottom: 4px; }
.details p { color: var(--texte-doux); }
.details__ui { font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.details__ui .bulle { position: static; transform: none; width: auto; display: inline-block; font-size: 12px; }
.panier {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(197, 218, 247, 0.97);
    box-shadow: -2px 3px 6px rgba(0, 0, 0, 0.45);
    font: bold 12px Verdana, sans-serif;
    text-transform: uppercase;
}
.panier b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--orange-500); font-size: 11px; }
.menu-ext {
    display: grid;
    min-width: 220px;
    border: 1px solid var(--trait);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(8, 11, 58, 0.15);
    font: 13px 'Segoe UI', Arial, sans-serif;
    overflow: hidden;
}
.menu-ext span { padding: 8px 12px; border-top: 1px solid var(--bleu-100); }
.menu-ext span:first-child { border: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; background: var(--bleu-100); }
.menu-ext img { width: 18px; height: 18px; }
@media (min-width: 760px) {
    .details li { grid-template-columns: 300px 1fr; gap: 48px; }
}

/* ====== Installation ====== */
.bp-installer { padding-block: clamp(64px, 9vw, 120px); }
.bp-installer h2 { font-size: clamp(2rem, 1.2rem + 3.4vw, 3.8rem); font-weight: 900; }
.bp-installer__intro { color: var(--nuit-texte); margin-top: 14px; }
.bp-installer .groupe-btn { margin-top: 32px; }
.bp-installer__version { margin-top: 16px; font-size: 0.9375rem; color: var(--bleu-300); }
.etapes-bp {
    list-style: none;
    padding: 0;
    counter-reset: etape;
    display: grid;
    gap: 28px;
    margin-top: clamp(48px, 6vw, 72px);
}
.etapes-bp li { counter-increment: etape; padding-top: 18px; border-top: 2px solid var(--nuit-trait); }
.etapes-bp li::before {
    content: counter(etape);
    display: block;
    font-size: 2.6rem;
    font-weight: 900;
    line-height: 1;
    color: var(--orange-500);
    margin-bottom: 12px;
}
.etapes-bp strong { display: block; font-size: 1.1rem; margin-bottom: 6px; }
.etapes-bp p { color: var(--nuit-texte); font-size: 0.975rem; }
.bp-installer__aide { margin-top: 48px; color: var(--nuit-texte); }
@media (min-width: 720px) { .etapes-bp { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .etapes-bp { grid-template-columns: repeat(4, 1fr); } }

/* ====== Mouvement réduit : la démo montre l'état final de chaque scène ====== */
@media (prefers-reduced-motion: reduce) {
    .demo *, .demo *::before, .demo *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition: none !important;
    }
}

/* Les titres héritent de la couleur ardoise de base.css : en blanc sur les sections sombres */
.scene-nuit h1, .scene-nuit h2, .scene-nuit h3 { color: #fff; }
