/* bpdiagnostic — assistant de diagnostic (design "Atelier" : bleu nuit /
   orange / teal, cf. carte héro bpphonedetect) */

#bpdg-app {
  --bpdg-navy: #0b2b4a;
  --bpdg-navy-2: #123a5f;
  --bpdg-orange: #f07a1f;
  --bpdg-teal: #4dd0c9;
  --bpdg-bg: #f5f7fa;
  --bpdg-line: #e3e9f0;
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #21313f;
}

#bpdg-app * { box-sizing: border-box; }

.bpdg-card {
  background: #fff;
  border: 1px solid var(--bpdg-line);
  border-radius: var(--bpdg-radius, 18px);
  padding: 26px 24px 22px;
  margin: 10px 0 30px;
  box-shadow: 0 10px 34px rgba(11, 43, 74, 0.07);
}

.bpdg-crumb { font-size: 12px; color: #7b8ca0; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.bpdg-crumb-item { font-weight: 600; }
.bpdg-crumb-item--muted { font-weight: 400; }
.bpdg-crumb-sep { color: #c2cedb; }

.bpdg-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  color: var(--bpdg-navy);
  margin: 0 0 10px;
}

.bpdg-sub { font-size: 14.5px; color: #5c6f83; line-height: 1.5; margin: 0 0 14px; }

.bpdg-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--bpdg-navy);
  background: rgba(77, 208, 201, 0.18);
  background: color-mix(in srgb, var(--bpdg-teal) 18%, transparent);
  border: 1px solid rgba(77, 208, 201, 0.5);
  border-color: color-mix(in srgb, var(--bpdg-teal) 50%, transparent);
  border-radius: 99px;
  padding: 4px 11px;
  margin-bottom: 10px;
}
.bpdg-badge--result {
  background: rgba(240, 122, 31, 0.12);
  background: color-mix(in srgb, var(--bpdg-orange) 12%, transparent);
  border-color: rgba(240, 122, 31, 0.45);
  border-color: color-mix(in srgb, var(--bpdg-orange) 45%, transparent);
}

.bpdg-link { color: var(--bpdg-orange); text-decoration: underline; cursor: pointer; }
.bpdg-link:hover { color: #d0640f; }

/* ---- boutons ---- */

.bpdg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin: 6px 8px 6px 0;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.bpdg-btn:active { transform: scale(0.98); }
.bpdg-btn--primary { 
  background: var(--bpdg-orange); 
  color: #fff !important; 
  box-shadow: 0 6px 18px rgba(11, 43, 74, 0.22); 
}
.bpdg-btn--primary.diag_main_btn {
  width: 100%;
}
.bpdg-btn--primary:hover { filter: brightness(0.93); color: #fff; }
.bpdg-btn--ghost { background: #fff; color: var(--bpdg-navy) !important; border: 1.5px solid var(--bpdg-line); }
.bpdg-btn--ghost:hover { border-color: var(--bpdg-navy); }

/* ---- détection / chips ---- */

.bpdg-detect { margin-top: 8px; font-size: 14px; color: #5c6f83; }
.bpdg-detected { background: var(--bpdg-bg); border: 1px solid var(--bpdg-line); border-radius: 14px; padding: 18px; }
.bpdg-detected-label { margin-bottom: 10px; font-size: 20px; color: var(--bpdg-navy); display: flex; flex-direction: column; gap: 6px; }

.bpdg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; max-height: 180px; overflow-y: auto; padding: 2px; }
.bpdg-chip {
  border: 1.5px solid var(--bpdg-line);
  background: #fff;
  border-radius: 99px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--bpdg-navy);
  cursor: pointer;
}
.bpdg-chip:hover { border-color: var(--bpdg-orange); color: var(--bpdg-orange); }
.bpdg-chip--other { border-style: dashed; color: #7b8ca0; }

.bpdg-free { margin-top: 14px; }
.bpdg-free-row { display: flex; gap: 8px; }
.bpdg-input {
  flex: 1;
  border: 1.5px solid var(--bpdg-line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  min-width: 0;
}
.bpdg-input:focus { outline: none; border-color: var(--bpdg-teal); }

/* ---- tuiles panne ---- */

.bpdg-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.bpdg-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  background: var(--bpdg-bg);
  border: 1.5px solid var(--bpdg-line);
  border-radius: 16px;
  padding: 18px 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, transform 0.08s ease;
}
.bpdg-tile:hover { border-color: var(--bpdg-orange); }
.bpdg-tile:active { transform: scale(0.98); }
.bpdg-tile-icon { font-size: 30px; }
.bpdg-tile-label { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 800; font-size: 17px; color: var(--bpdg-navy); }
.bpdg-tile-sub { font-size: 12.5px; color: #7b8ca0; line-height: 1.35; }

/* ---- étapes ---- */

.bpdg-progress { height: 5px; background: var(--bpdg-line); border-radius: 99px; margin: 2px 0 18px; overflow: hidden; }
.bpdg-progress-fill { height: 100%; background: linear-gradient(90deg, var(--bpdg-teal), var(--bpdg-orange)); border-radius: 99px; transition: width 0.3s ease; }

.bpdg-hw {
  background: var(--bpdg-bg);
  border: 1px dashed #c9d5e2;
  border-radius: 14px;
  padding: 16px;
  margin: 4px 0 16px;
}
.bpdg-hw-btn {
  display: inline-block;
  background: var(--bpdg-navy);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  margin: 4px 8px 4px 0;
}
.bpdg-hw-btn:hover { filter: brightness(1.18); }
.bpdg-hw-btn:disabled { opacity: 0.55; cursor: wait; }
.bpdg-hw-btn--ghost { background: #fff; color: var(--bpdg-navy); border: 1.5px solid var(--bpdg-line); }

.bpdg-hint { font-size: 13px; color: #5c6f83; margin: 4px 0 10px; line-height: 1.45; }
.bpdg-zoomlist { margin: 8px 0; padding-left: 4px; list-style: none; }
.bpdg-zoomlist li { font-size: 13px; color: #46596d; margin: 4px 0; }
.bpdg-zoom { display: inline-block; min-width: 74px; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--bpdg-navy); background: #fff; border: 1px solid var(--bpdg-line); border-radius: 6px; padding: 1px 7px; margin-right: 8px; text-align: center; }
.bpdg-hw-info { font-size: 13.5px; color: #46596d; background: #fff; border: 1px solid var(--bpdg-line); border-radius: 10px; padding: 12px; line-height: 1.5; }
.bpdg-warn {
  display: none;
}
.bpdg-hw-badge { margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--bpdg-navy); background: #fff; border: 1px solid var(--bpdg-line); border-radius: 10px; padding: 10px 12px; line-height: 1.4; }
.bpdg-hw-badge--ok { border-color: rgba(28, 168, 108, 0.5); color: #147a4d; background: #f0faf5; }
.bpdg-hw-badge--ko { border-color: rgba(214, 69, 53, 0.45); color: #b23325; background: #fdf3f1; }

/* batterie */
.bpdg-battery-row { display: flex; align-items: center; gap: 14px; }
.bpdg-battery-shell { width: 120px; height: 40px; border: 3px solid var(--bpdg-navy); border-radius: 8px; padding: 3px; position: relative; background: #fff; }
.bpdg-battery-shell::after { content: ''; position: absolute; right: -9px; top: 11px; width: 6px; height: 14px; background: var(--bpdg-navy); border-radius: 0 3px 3px 0; }
.bpdg-battery-fill { height: 100%; background: linear-gradient(90deg, var(--bpdg-teal), #37b3ab); border-radius: 4px; width: 0; transition: width 0.4s ease; }
.bpdg-battery-pct { font-family: 'JetBrains Mono', monospace; font-size: 21px; font-weight: 700; color: var(--bpdg-navy); }
.bpdg-battery-state { font-size: 13px; color: #5c6f83; }

/* micro */
.bpdg-vu { height: 14px; background: #fff; border: 1px solid var(--bpdg-line); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.bpdg-vu-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--bpdg-teal), var(--bpdg-orange)); transition: width 0.06s linear; }
.bpdg-playback audio { width: 100%; margin-top: 4px; }

/* caméra */
.bpdg-video-box { margin-top: 10px; }
.bpdg-video-box video { width: 100%; max-height: 340px; border-radius: 12px; background: #000; display: block; }

/* options */
.bpdg-options { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.bpdg-option {
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--bpdg-line);
  border-radius: 13px;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.12s ease;
}
.bpdg-option:hover { border-color: var(--bpdg-orange); }
.bpdg-option-t { font-size: 15px; font-weight: 700; color: var(--bpdg-navy); }
.bpdg-option-d { font-size: 12.5px; color: #7b8ca0; }

.bpdg-skip { margin-top: 14px; font-size: 13px; color: #9aa9ba; }

/* ---- overlays plein écran (couleurs + tactile) ---- */

.bpdg-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  cursor: pointer;
}
.bpdg-overlay-tip {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: #eee;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 99px;
  padding: 7px 14px;
  pointer-events: none;
  white-space: nowrap;
}
.bpdg-overlay--touch { background: #0b2b4a; cursor: default; }
.bpdg-touch-grid { position: absolute; inset: 0; display: grid; gap: 1px; touch-action: none; }
.bpdg-touch-cell { background: rgba(255, 255, 255, 0.08); }
.bpdg-touch-cell--hit { background: rgba(77, 208, 201, 0.75); }
.bpdg-touch-cell--miss { background: rgba(214, 69, 53, 0.85); }
.bpdg-touch-done {
  position: absolute;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--bpdg-orange, #f07a1f);
  z-index: 1;
}

/* ---- verdict ---- */

.bpdg-verdict-ok { font-size: 46px; margin-bottom: 6px; }
.bpdg-slogan { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: 15px; color: var(--bpdg-orange); margin: -4px 0 14px; }
.bpdg-loading { font-size: 14px; color: #5c6f83; padding: 20px 0; }

/* sélecteur de couleur du téléphone */
.bpdg-colorchooser { background: var(--bpdg-bg); border: 1px solid var(--bpdg-line); border-radius: 14px; padding: 16px; margin: 4px 0 12px; }
.bpdg-colorchooser .bpdg-sub { margin-bottom: 10px; }

/* caractéristiques (temps / difficulté / couleur) */
.bpdg-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.bpdg-meta-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--bpdg-navy);
  background: color-mix(in srgb, var(--bpdg-teal) 16%, #fff);
  border: 1px solid var(--bpdg-line);
  border-radius: 8px;
  padding: 3px 9px;
}

/* carte produit recommandé */
.bpdg-reco {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bpdg-bg);
  border: 1px solid var(--bpdg-line);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.bpdg-reco-media { flex: 0 0 84px; }
.bpdg-reco-media img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--bpdg-line); }
.bpdg-reco-noimg { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; font-size: 34px; background: #fff; border-radius: 10px; border: 1px solid var(--bpdg-line); }
.bpdg-reco-body { flex: 1; min-width: 0; }
.bpdg-reco-name { font-size: 15px; font-weight: 700; color: var(--bpdg-navy); line-height: 1.3; margin-bottom: 2px; }
.bpdg-reco-buy { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 6px; }
.bpdg-reco-price { font-family: 'JetBrains Mono', monospace; font-size: 20px; font-weight: 700; color: var(--bpdg-orange); }
.bpdg-reco-see { font-size: 13px; }

.bpdg-btn--cart { padding: 10px 16px; font-size: 14px; }
.bpdg-btn--sm { padding: 8px 10px; margin: 0; font-size: 15px; }
.bpdg-btn--wide { display: flex; justify-content: center; width: 100%; margin: 0; }

/* blocs tutoriel / outils */
.bpdg-block-title { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 800; font-size: 14px; color: var(--bpdg-navy); margin-bottom: 8px; }
.bpdg-tuto { border-top: 1px solid var(--bpdg-line); margin-top: 12px; padding-top: 12px; }
.bpdg-tuto-link { display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--bpdg-navy); background: #fff; border: 1.5px solid var(--bpdg-line); border-radius: 10px; padding: 8px 12px; margin: 0 8px 6px 0; text-decoration: none; }
.bpdg-tuto-link:hover { border-color: var(--bpdg-orange); color: var(--bpdg-orange); }

.bpdg-tools { border-top: 1px solid var(--bpdg-line); margin-top: 12px; padding-top: 12px; }
.bpdg-tool {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--bpdg-line);
  border-radius: 10px;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: #fff;
}
.bpdg-tool img { width: 40px; height: 40px; object-fit: contain; border-radius: 7px; }
.bpdg-tool-noimg { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.bpdg-tool-name { font-size: 13px; font-weight: 600; color: var(--bpdg-navy); line-height: 1.3; }
.bpdg-tool-price { font-family: 'JetBrains Mono', monospace; font-size: 13.5px; font-weight: 700; color: var(--bpdg-orange); white-space: nowrap; }

.bpdg-part {
  border: 1.5px solid var(--bpdg-line);
  border-radius: 16px;
  padding: 18px 16px;
  margin: 14px 0;
  background: #fff;
}
.bpdg-part--primary { border-color: var(--bpdg-orange); box-shadow: 0 8px 26px rgba(11, 43, 74, 0.12); }
.bpdg-part-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.bpdg-part-icon { font-size: 32px; }
.bpdg-part-rank { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; letter-spacing: 0.13em; color: var(--bpdg-orange); }
.bpdg-part--primary .bpdg-part-rank { color: var(--bpdg-orange); }
.bpdg-part:not(.bpdg-part--primary) .bpdg-part-rank { color: #7b8ca0; }
.bpdg-part-label { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 800; font-size: 20px; color: var(--bpdg-navy); }
.bpdg-part-desc { font-size: 13.5px; color: #5c6f83; line-height: 1.5; margin: 0 0 8px; }

.bpdg-reasons { margin: 0 0 10px; padding-left: 18px; }
.bpdg-reasons li { font-size: 13px; color: #46596d; margin: 3px 0; }

.bpdg-partnote {
  font-size: 13px;
  color: #46596d;
  background: var(--bpdg-bg);
  border: 1px solid var(--bpdg-line);
  border-left: 3px solid var(--bpdg-teal);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 10px;
  line-height: 1.45;
}

.bpdg-products { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: #7b8ca0; }
.bpdg-product {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--bpdg-line);
  border-radius: 12px;
  padding: 8px 12px 8px 8px;
  text-decoration: none;
  background: var(--bpdg-bg);
}
.bpdg-product:hover { border-color: var(--bpdg-orange); }
.bpdg-product img { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; }
.bpdg-product-noimg { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #fff; border-radius: 8px; }
.bpdg-product-name { font-size: 13.5px; font-weight: 600; color: var(--bpdg-navy); line-height: 1.3; }
.bpdg-product-price { font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; color: var(--bpdg-orange); white-space: nowrap; }
.bpdg-product-go { font-size: 12.5px; font-weight: 700; color: var(--bpdg-navy); white-space: nowrap; }

.bpdg-notebox {
  background: #fff9f2;
  border: 1px solid #f3d9b5;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  font-size: 13.5px;
  color: #6b4a17;
}
.bpdg-notes { margin: 6px 0 0; padding-left: 18px; }
.bpdg-notes li { font-size: 13px; margin: 3px 0; line-height: 1.45; }

.bpdg-cat-cta { margin-top: 16px; }

.bpdg-footer { margin-top: 18px; border-top: 1px solid var(--bpdg-line); padding-top: 14px; font-size: 13.5px; }
.bpdg-disclaimer { font-size: 11.5px; color: #9aa9ba; margin: 10px 0 0; line-height: 1.45; }

/* ---- carte d'accroche (home) ---- */
.bpdg-accroche {
  background: linear-gradient(135deg, var(--bpdg-navy) 0%, var(--bpdg-navy-2) 100%);
  border: 0;
  color: #fff;
  text-align: left;
}
.bpdg-accroche .bpdg-badge {
  color: #fff;
  background: color-mix(in srgb, var(--bpdg-teal) 26%, transparent);
  border-color: color-mix(in srgb, var(--bpdg-teal) 60%, transparent);
}
.bpdg-accroche-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
  color: #fff;
  margin: 4px 0 8px;
}
.bpdg-accroche-sub { font-size: 14.5px; color: #c4d3e2; line-height: 1.5; margin: 0 0 16px; max-width: 46ch; }
.bpdg-accroche-cta { margin-bottom: 8px; }
.bpdg-accroche-cta .bpdg-btn--primary { margin: 0; }
.bpdg-accroche-mention { display: block; font-size: 12px; color: #9fb3c8; }

/* ---- modale (ouverte depuis la carte d'accroche) ---- */
.bpdg-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(130px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
}
.bpdg-modal-backdrop { position: fixed; inset: 0; background: rgba(8, 22, 38, 0.55); backdrop-filter: blur(2px); }
.bpdg-modal-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  margin: auto;
}
.bpdg-modal-body { position: relative; }
/* dans la modale, la carte remplit le dialogue (pas de max-width parasite) */
.bpdg-modal-body .bpdg-card { margin: 0; }
.bpdg-modal-close {
  position: absolute;
  top: -6px;
  right: 2px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--bpdg-navy);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(8, 22, 38, 0.3);
}
.bpdg-modal-close:hover { background: #f0f3f7; }

/* spinner */
.bpdg-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid var(--bpdg-line);
  border-top-color: var(--bpdg-orange);
  border-radius: 50%;
  animation: bpdg-spin 0.8s linear infinite;
  vertical-align: -2px;
  margin-right: 4px;
}
@keyframes bpdg-spin { to { transform: rotate(360deg); } }

/* mobile */
@media (max-width: 560px) {
  .bpdg-card { padding: 20px 15px 18px; }
  .bpdg-title { font-size: 22px; }
  .bpdg-accroche-title { font-size: 21px; }
  .bpdg-tiles { grid-template-columns: 1fr; }
  .bpdg-product { grid-template-columns: 40px 1fr auto; }
  .bpdg-product-go { display: none; }
  .bpdg-modal-close { top: 2px; right: 2px; }
  .bpdg-reco { flex-direction: column; }
  .bpdg-reco-media, .bpdg-reco-media img, .bpdg-reco-noimg { width: 100%; height: auto; }
  .bpdg-reco-media img, .bpdg-reco-noimg { max-height: 160px; }
  .bpdg-btn--cart { width: 100%; justify-content: center; }
}
