/* ============================================================================
   Becomunity Système Media Linker — Design system partagé (« Épuré / Pro »)
   Réutilisé par : espace membre, wiki, panel admin, paywall, chatbot.
   Palette alignée sur public/index.html (accent indigo).
   ========================================================================== */
:root {
  color-scheme: light;
  --bg:        #f8fafc;
  --bg-soft:   #f1f5f9;
  --card:      #ffffff;
  --text:      #0f172a;
  --muted:     #64748b;
  --faint:     #94a3b8;
  --line:      #e2e8f0;
  --line-soft: #eef2f7;
  --accent:    #6366f1;
  --accent-2:  #8b5cf6;
  --accent-soft:#eef0fe;
  --accent-ink:#4f46e5;
  --ok:        #16a34a;
  --ok-soft:   #eafaf0;
  --warn:      #92400e;
  --warn-soft: #fffbeb;
  --danger:    #dc2626;
  --danger-soft:#fef2f2;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow:    0 4px 16px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px rgba(15,23,42,.14);
  --grad:      linear-gradient(135deg, #6366f1, #8b5cf6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ----- Layout ----- */
.bca-container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.bca-narrow   { max-width: 760px; }
.bca-main     { padding: 32px 0 80px; }
.bca-grid     { display: grid; gap: 16px; }
.bca-grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.bca-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 820px) { .bca-grid.cols-2, .bca-grid.cols-3 { grid-template-columns: 1fr; } }

/* ----- Top bar ----- */
.bca-topbar {
  position: sticky; top: 0; z-index: 40;
  height: 60px; display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.bca-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.bca-brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--grad);
  display: grid; place-items: center; color: #fff; box-shadow: 0 6px 16px rgba(91,91,214,.28);
}
.bca-brand .logo svg { width: 17px; height: 17px; }
.bca-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.bca-nav a {
  padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px;
}
.bca-nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.bca-nav a.active { color: var(--accent-ink); background: var(--accent-soft); }

/* ----- Buttons ----- */
.bca-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap; text-decoration: none;
}
.bca-btn:active { transform: scale(.98); }
.bca-btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(91,91,214,.28); }
.bca-btn-primary:hover { text-decoration: none; box-shadow: 0 10px 26px rgba(91,91,214,.36); }
.bca-btn-secondary { background: var(--card); color: var(--text); border-color: var(--line); }
.bca-btn-secondary:hover { background: var(--bg-soft); text-decoration: none; }
.bca-btn-ghost { background: transparent; color: var(--muted); }
.bca-btn-ghost:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.bca-btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.bca-btn[disabled] { opacity: .55; cursor: not-allowed; }
.bca-btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.bca-btn-block { width: 100%; }

/* ----- Cards ----- */
.bca-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.bca-card-pad { padding: 20px; }
.bca-card-hover { transition: box-shadow .18s ease, transform .12s ease, border-color .18s ease; }
.bca-card-hover:hover { box-shadow: var(--shadow); border-color: #dcdff5; transform: translateY(-1px); }

/* ----- Typo helpers ----- */
.bca-h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.bca-h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
.bca-sub { color: var(--muted); font-size: 15px; margin: 0; }
.bca-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.bca-muted { color: var(--muted); }

/* ----- Badges ----- */
.bca-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink);
}
.bca-badge.ok { background: var(--ok-soft); color: var(--ok); }
.bca-badge.warn { background: var(--warn-soft); color: var(--warn); }
.bca-badge.new { background: var(--grad); color: #fff; }

/* ----- Inputs ----- */
.bca-field { display: block; margin-bottom: 14px; }
.bca-label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.bca-input, .bca-textarea, .bca-select {
  width: 100%; font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.bca-input:focus, .bca-textarea:focus, .bca-select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}
.bca-textarea { min-height: 120px; resize: vertical; }
.bca-hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ----- Table (admin) ----- */
.bca-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bca-table th, .bca-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.bca-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.bca-table tr:hover td { background: var(--bg-soft); }

/* ----- Empty state ----- */
.bca-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.bca-empty .ico { font-size: 34px; margin-bottom: 8px; }

/* ----- Lock / paywall ----- */
.bca-lock { max-width: 460px; margin: 8vh auto; text-align: center; }
.bca-lock .seal { width: 64px; height: 64px; border-radius: 18px; background: var(--grad); display: grid; place-items: center; margin: 0 auto 18px; box-shadow: var(--shadow); }
.bca-lock .seal svg { width: 30px; height: 30px; color: #fff; }

/* ----- Prose (wiki / markdown rendu) ----- */
.bca-prose { font-size: 15.5px; color: #1f2937; }
.bca-prose h1 { font-size: 26px; font-weight: 800; margin: 24px 0 10px; letter-spacing: -.02em; }
.bca-prose h2 { font-size: 20px; font-weight: 800; margin: 22px 0 8px; }
.bca-prose h3 { font-size: 16.5px; font-weight: 700; margin: 18px 0 6px; }
.bca-prose p { margin: 0 0 12px; }
.bca-prose ul, .bca-prose ol { margin: 0 0 12px; padding-left: 22px; }
.bca-prose li { margin: 4px 0; }
.bca-prose code { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: 13px; }
.bca-prose pre { background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.bca-prose pre code { background: none; border: none; color: inherit; }
.bca-prose blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }

/* ----- Toast ----- */
.bca-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; transition: opacity .2s ease, transform .2s ease;
}
.bca-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.bca-toast.err { background: var(--danger); }

/* ----- Utilities ----- */
.bca-row { display: flex; align-items: center; gap: 10px; }
.bca-row.wrap { flex-wrap: wrap; }
.bca-spacer { flex: 1; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.hidden { display: none !important; }
