/* Boîte mail piégée */
.bm { --bm-ink: #0f172a; --bm-muted: #64748b; --bm-line: #e2e8f0; --bm-accent: #2563eb; --bm-ok: #15803d; --bm-ok-bg: #f0fdf4; --bm-ko: #b91c1c; --bm-ko-bg: #fef2f2;
  --bm-mid: #b45309; --bm-mid-bg: #fffbeb; color: var(--bm-ink); background: var(--site-bg, #f1f5f9); min-height: 70vh; }   /* fond : dégradé de Typographie */
.bm *, .bm *::before, .bm *::after { box-sizing: border-box; }
.bm-wrap { max-width: 1320px; margin: 0 auto; padding: 0 2rem; }   /* même largeur que l'en-tête du site (.nav-inner) */
/* En-tête aligné sur les Défis et l'escape game : fond nuit, halo de couleur, chiffres en ligne */
.bm-hero { background: radial-gradient(1200px 400px at 85% -10%, rgba(59, 130, 246, .38), transparent 60%), linear-gradient(135deg, #020617 0%, #0f172a 55%, #1e3a8a 100%); color: #fff; padding: 28px 0 30px; }
.bm-back { margin: 0 0 12px; font-size: .85rem; }
.bm-back a, .bm-lead a { color: #93c5fd; }
.bm-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #93c5fd; margin: 0 0 .4rem; }
.bm-hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; letter-spacing: -.02em; color: #fff; margin: 0 0 8px; }
.bm-hero h1 .bi { color: #60a5fa; }
.bm-lead { color: rgba(255, 255, 255, .78); max-width: 760px; margin: 0 0 20px; line-height: 1.6; }
.bm-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 34px; }
.bm-stats strong { display: block; color: #fff; font-size: 1.55rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bm-stats span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255, 255, 255, .55); margin-top: 5px; }
.bm-stats > div:nth-child(2) strong { font-size: 1.1rem; padding-top: .25rem; white-space: nowrap; }   /* le rang, comme dans les Défis */
.bm-body { padding-top: 1.5rem; padding-bottom: 3rem; }
.bm-card { background: #fff; border: 1px solid var(--bm-line); border-radius: 16px; padding: clamp(1.1rem, 3vw, 1.8rem); box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.bm-muted { color: var(--bm-muted); }
.bm .small { font-size: .85rem; }
.bm .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.bm-section-title { font-size: 1.15rem; font-weight: 800; margin: 1.6rem 0 .8rem; }
.bm-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.bm-btn { display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1.1rem; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--bm-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.bm-btn:hover { border-color: var(--bm-accent); color: var(--bm-accent); }
.bm-btn.primary { background: var(--bm-accent); border-color: var(--bm-accent); color: #fff; }
.bm-btn.primary:hover { background: #1d4ed8; color: #fff; }
.bm-btn.ghost { background: transparent; }
.bm-btn.sm { padding: .4rem .8rem; font-size: .85rem; }
.bm button:focus-visible, .bm a:focus-visible, .bm [role="button"]:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
.bm-stars { color: #f59e0b; white-space: nowrap; }

/* Accueil */
.bm-rules h2 { font-size: 1.2rem; font-weight: 800; margin: 0 0 1rem; }
.bm-rules-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.bm-rules-grid > div { background: #f8fafc; border-radius: 12px; padding: 1rem; }
.bm-rules-grid i { font-size: 1.4rem; color: var(--bm-accent); }
.bm-rules-grid strong { display: block; margin: .4rem 0 .3rem; }
.bm-rules-grid p { margin: 0; font-size: .9rem; line-height: 1.5; color: #334155; }
.bm-levels { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bm-level { background: #fff; border: 1px solid var(--bm-line); border-top: 4px solid var(--bm-accent); border-radius: 14px; padding: 1.2rem; display: flex; flex-direction: column; }
.bm-level.is-locked { opacity: .65; border-top-color: #cbd5e1; }
.bm-level h3 { font-size: 1.1rem; font-weight: 800; margin: .7rem 0 .3rem; }
.bm-level p { margin: 0 0 .4rem; }
.bm-level .bm-actions { margin-top: auto; padding-top: .6rem; }
.bm-level-top { display: flex; align-items: center; justify-content: space-between; }
.bm-level-num { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #dbeafe; color: var(--bm-accent); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.bm-new { font-size: .72rem; font-weight: 700; color: #fff; background: #f59e0b; border-radius: 999px; padding: .15rem .6rem; }
.bm-best { font-size: .88rem; }
.bm-best i { color: #d97706; }
.bm-badges { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.bm-badges li { display: flex; gap: .7rem; align-items: center; background: #fff; border: 1px solid var(--bm-line); border-radius: 12px; padding: .7rem .9rem; opacity: .6; }
.bm-badges li.is-earned { opacity: 1; border-color: #fcd34d; background: #fffbeb; }
.bm-badges strong { display: block; font-size: .92rem; }
.bm-badges small { color: var(--bm-muted); }
.bm-medal { flex-shrink: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: #94a3b8; }
.is-earned .bm-medal { background: linear-gradient(135deg, #fde047, #d97706); }
.bm-more { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.bm-login { margin-top: 1rem; }

/* Barre du niveau */
.bm-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; background: #fff; border: 1px solid var(--bm-line); border-radius: 14px; padding: .7rem 1rem; margin-bottom: 1rem; }
.bm-topbar > div:first-child span { display: block; font-size: .82rem; color: var(--bm-muted); }
.bm-gauge { display: flex; align-items: center; gap: .5rem; flex: 1 1 220px; }
.bm-gauge i { color: var(--bm-ok); font-size: 1.2rem; }
.bm-gauge-bar { flex: 1; height: 10px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.bm-gauge-bar span { display: block; height: 100%; background: var(--bm-ok); transition: width .5s; }
.bm-gauge-bar span.is-mid { background: #f59e0b; }
.bm-gauge-bar span.is-low { background: #dc2626; }
.bm-points { font-size: 1rem; }
.bm-points i { color: #f59e0b; }
.bm-topbar .bm-btn { margin-left: auto; }

/* Messagerie */
.bm-client { display: grid; grid-template-columns: 300px 1fr; background: #fff; border: 1px solid var(--bm-line); border-radius: 16px; overflow: hidden; min-height: 560px; box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.bm-list { border-right: 1px solid var(--bm-line); background: #f8fafc; }
.bm-list-head { padding: .8rem 1rem; font-weight: 800; border-bottom: 1px solid var(--bm-line); }
.bm-item { display: grid; grid-template-columns: 1.4rem 1fr auto; gap: .4rem; align-items: start; width: 100%; text-align: left; padding: .75rem .9rem; border: 0; border-bottom: 1px solid var(--bm-line); background: transparent; font: inherit; color: inherit; cursor: pointer; }
.bm-item:hover:not(:disabled) { background: #eff6ff; }
.bm-item.is-open { background: #dbeafe; box-shadow: inset 3px 0 0 var(--bm-accent); }
.bm-item:disabled { cursor: default; opacity: .5; }
.bm-item.is-unread .bm-item-from, .bm-item.is-unread .bm-item-subj { font-weight: 800; }
.bm-item-main { min-width: 0; }
.bm-item-from { display: block; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item-subj { display: block; font-size: .8rem; color: var(--bm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-item-time { font-size: .75rem; color: var(--bm-muted); }
.bm-item-status .ok { color: var(--bm-ok); }
.bm-item-status .ko { color: var(--bm-ko); }
.bm-item-status .new { color: var(--bm-accent); font-size: 1.6rem; line-height: .6; }
.bm-read { padding: 1.2rem 1.4rem; min-width: 0; display: flex; flex-direction: column; }
.bm-mail-head h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 .8rem; line-height: 1.35; }
.bm-mail-meta { display: flex; gap: .8rem; align-items: center; padding-bottom: .9rem; border-bottom: 1px solid var(--bm-line); word-break: break-word; }
.bm-avatar { flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: #e0e7ff; color: #3730a3; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.bm-mail-body { padding: 1rem 0; line-height: 1.65; flex: 1; }
.bm-mail-body p { margin: 0 0 .8rem; }
.bm-spot { cursor: pointer; border-radius: 6px; padding: .05rem .2rem; border: 2px solid transparent; transition: background .15s; }
.bm-spot:hover { background: #fef9c3; border-color: #fde047; }
.bm-spot.is-found { background: #fee2e2; border-color: #f87171; }
.bm-spot.is-missed { background: #ffedd5; border-color: #fb923c; border-style: dashed; }
.bm-spot.is-wrong { background: #f1f5f9; border-color: #94a3b8; text-decoration: line-through; text-decoration-color: #94a3b8; }
.bm-fake-link { color: #fff; background: #2563eb; padding: .5rem 1rem; border-radius: 6px; font-weight: 700; display: inline-block; }
.bm-mail-cta .bm-spot { display: inline-block; padding: .25rem; }
.bm-atts { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: .6rem; border-top: 1px dashed var(--bm-line); }
.bm-spot.is-att { border: 1px solid #cbd5e1; background: #f8fafc; padding: .45rem .7rem; font-size: .88rem; }
.bm-spot.is-att.is-found { border: 2px solid #f87171; background: #fee2e2; }
.bm-spot.is-att.is-missed { border: 2px dashed #fb923c; background: #ffedd5; }
.bm-qr-wrap .bm-spot { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; padding: .5rem; }
.bm-qr { width: 120px; height: 120px; background:
  conic-gradient(#0f172a 25%, #fff 0 50%, #0f172a 0 75%, #fff 0) 0 0 / 24px 24px; border: 8px solid #fff; outline: 2px solid #0f172a; }
.bm-status { font-size: .8rem; color: var(--bm-muted); background: #f1f5f9; border-radius: 8px; padding: .4rem .7rem; margin: .4rem 0 .8rem; word-break: break-all; }
.bm-decide-q { margin: 0 0 .6rem; font-weight: 600; }
.bm-verdicts { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.bm-verdict { font: inherit; font-weight: 700; padding: .8rem; border-radius: 10px; cursor: pointer; border: 2px solid; background: #fff; }
.bm-verdict.v-legit { border-color: #86efac; color: var(--bm-ok); }
.bm-verdict.v-phishing { border-color: #fca5a5; color: var(--bm-ko); }
.bm-verdict.v-fraude { border-color: #fcd34d; color: var(--bm-mid); }
.bm-verdict:hover { filter: brightness(.96); background: #f8fafc; }
.bm-feedback { border-radius: 12px; padding: 1rem 1.1rem; border: 1px solid; }
.bm-feedback.is-ok { background: var(--bm-ok-bg); border-color: #bbf7d0; }
.bm-feedback.is-mid { background: var(--bm-mid-bg); border-color: #fde68a; }
.bm-feedback.is-ko { background: var(--bm-ko-bg); border-color: #fecaca; }
.bm-fb-title { font-weight: 800; font-size: 1.05rem; margin: 0 0 .3rem; }
.is-ok .bm-fb-title { color: var(--bm-ok); } .is-mid .bm-fb-title { color: var(--bm-mid); } .is-ko .bm-fb-title { color: var(--bm-ko); }
.bm-fb-pts { margin: 0 0 .6rem; font-size: .88rem; color: #334155; }
.bm-clues { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .35rem; }
.bm-clues li { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; line-height: 1.5; }
.bm-clues li.is-found i { color: var(--bm-ok); }
.bm-clues li.is-missed i { color: #ea580c; }
.bm-why { margin: 0 0 .6rem; line-height: 1.5; }
.bm-reflex { margin: 0; padding: .6rem .8rem; background: #fff; border-radius: 8px; line-height: 1.5; }
.bm-reflex i { color: #f59e0b; }

/* Bilan */
.bm-end-head { display: flex; gap: 1rem; align-items: center; }
.bm-end-head > i { font-size: 2.8rem; color: var(--bm-accent); }
.bm-end-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.bm-score { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 1.2rem 0; }
.bm-score > div { background: #f8fafc; border: 1px solid var(--bm-line); border-radius: 12px; padding: .8rem 1rem; }
.bm-score strong { display: block; font-size: 1.2rem; font-weight: 800; }
.bm-score span { font-size: .75rem; color: var(--bm-muted); text-transform: uppercase; letter-spacing: .06em; }
.bm-recap { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.bm-recap li { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border: 1px solid var(--bm-line); border-radius: 10px; }
.bm-recap li span { flex: 1; min-width: 0; }
.bm-recap small { display: block; color: var(--bm-muted); word-break: break-all; }
.bm-recap .ok { color: var(--bm-ok); } .bm-recap .ko { color: var(--bm-ko); }

/* Notifications */
.bm-toasts { position: fixed; top: 80px; right: 16px; z-index: 10045; display: grid; gap: .4rem; width: min(280px, calc(100vw - 32px)); }
.bm-toast { display: flex; gap: .6rem; align-items: center; background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .55rem .8rem; box-shadow: 0 10px 30px rgba(2, 6, 23, .3); border-left: 4px solid #60a5fa; font-size: .88rem; animation: bm-in .25s ease; transition: opacity .4s; }
.bm-toast.out { opacity: 0; }
.bm-toast i { color: #93c5fd; font-size: 1.1rem; }
.bm-toast strong { display: block; color: #fff; }
.shake { animation: bm-shake .35s; }
@keyframes bm-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes bm-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 820px) {
  .bm-client { grid-template-columns: 1fr; min-height: 0; }
  .bm-list { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--bm-line); }
  .bm-list-head { display: none; }
  .bm-item { flex: 0 0 200px; border-bottom: 0; border-right: 1px solid var(--bm-line); }
  .bm-read { padding: 1rem; }
  .bm-topbar .bm-btn { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .shake, .bm-toast { animation: none; } }

/* Héros : même style que le tableau de bord (réglages admin/dashboard_hero.php, champs vides = Typographie) */
.bm-hero.bmh { color: var(--td-hero-text, #fff); }
.bm-hero.bmh.is-light { --td-hero-text: var(--c-title, #111c2d); }
.bmh h1 { color: var(--td-hero-text, #fff); }
.bmh h1 .bi { color: var(--td-acc1, var(--gold, #60a5fa)); }
.bmh .bm-kicker { color: var(--td-acc1, var(--c-eyebrow, var(--gold, #93c5fd))); }
.bmh .bm-lead { color: var(--td-hero-text, #fff); opacity: .8; }
.bmh .bm-back a { color: var(--td-hero-text, #fff); opacity: .75; }
.bmh-stats { gap: .75rem; margin: 0; }
.bmh-stats > div { min-width: 96px; text-align: center; padding: .6rem .9rem; border-radius: 12px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.bmh-stats strong { color: var(--td-hero-text, #fff); font-size: 1.6rem; }
.bmh-stats strong small { font-size: .9rem; font-weight: 700; opacity: .6; }
.bmh-stats span { color: var(--td-hero-text, #fff); opacity: .6; margin-top: .35rem; }
.bmh-stats strong span { display: inline; font-size: inherit; text-transform: none; letter-spacing: 0; opacity: 1; margin: 0; }
.bmh-stats > div:nth-child(2) strong { font-size: 1.1rem; padding-top: .3rem; }
.bmh-prog { margin: 1.2rem 0 0; max-width: 640px; }
.bmh-prog-row { display: flex; justify-content: space-between; align-items: baseline; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.bmh-prog-row > span { opacity: .6; }
.bmh-prog-row b { font-size: 1.25rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.bmh-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .15); overflow: hidden; margin: .45rem 0 .4rem; }
.bmh-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--td-acc1, var(--gold, #38bdf8)), var(--td-acc2, var(--gold-lt, #a78bfa))); transition: width 1.2s cubic-bezier(.22, 1, .36, 1); }
.bmh-sub { font-size: .8rem; opacity: .65; margin: 0; }
.bmh.is-light .bmh-stats > div { background: rgba(15, 23, 42, .04); border-color: rgba(15, 23, 42, .1); }
.bmh.is-light .bmh-bar { background: rgba(15, 23, 42, .1); }
@media (max-width: 600px) { .bmh-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
