/* ==========================================================================
   Botspress - design tokens and the few components Tailwind alone cannot do.

   Tailwind (CDN) does the layout; this file holds the palette, the gradients,
   the card surface and the handful of pieces that need real CSS: the verdict
   bar, the disclosure checklists, and the focus states.

   One dark theme, deliberately. A marketplace that swaps themes half-way
   tends to look like two different products; this one commits to a dark
   surface, high contrast text, and a single accent gradient used everywhere
   something is live, verified or actionable.
   ========================================================================== */

:root {
  --bg:            #070b18;
  --bg-soft:       #0b1122;
  --surface:       #101830;
  --surface-2:     #16203c;
  --border:        rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.30);

  --text:          #e8edf9;
  --text-muted:    #93a1bd;
  --text-dim:      #6b7a99;

  --accent:        #6366f1;
  --accent-2:      #22d3ee;
  --accent-soft:   rgba(99, 102, 241, 0.14);

  --ok:            #34d399;
  --warn:          #fbbf24;
  --bad:           #f87171;

  --radius:        14px;
  --radius-sm:     10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
}

/* A soft glow behind the top of every page - the only decoration, kept subtle
   so it never competes with the content. */
body::before {
  content: "";
  position: fixed;
  inset: -30% 0 auto 0;
  height: 60vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(99, 102, 241, 0.20), transparent 70%),
    radial-gradient(50% 50% at 80% 10%, rgba(34, 211, 238, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

/* --- surfaces ----------------------------------------------------------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)) , var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card-hover { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
}

.glass { background: rgba(16, 24, 48, 0.72); backdrop-filter: blur(14px); }

.hairline { border-color: var(--border); }

/* --- text --------------------------------------------------------------- */
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }

.gradient-text {
  background: linear-gradient(92deg, #a5b4fc, #67e8f9 55%, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600; font-size: .875rem;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.14); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; filter: none; }

.btn-primary {
  border: none;
  background: linear-gradient(92deg, var(--accent), var(--accent-2));
  color: #06101f;
  font-weight: 700;
}
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-danger { background: rgba(248,113,113,.14); border-color: rgba(248,113,113,.4); color: #fecaca; }
.btn-sm { padding: .4rem .7rem; font-size: .8rem; }
.btn-block { width: 100%; }

/* --- forms -------------------------------------------------------------- */
.input, .textarea, .select {
  width: 100%;
  padding: .65rem .8rem;
  background: rgba(6, 11, 24, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
}
.textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-muted);
         text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.hint { font-size: .78rem; color: var(--text-dim); margin-top: .35rem; }

.checkbox { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); margin-top: .15rem; }

/* --- chips & badges ----------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--border); background: rgba(255,255,255,.04);
  color: var(--text-muted);
}
.chip-ok    { color: #a7f3d0; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.12); }
.chip-warn  { color: #fde68a; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.12); }
.chip-bad   { color: #fecaca; border-color: rgba(248,113,113,.35); background: rgba(248,113,113,.12); }
.chip-info  { color: #bfdbfe; border-color: rgba(96,165,250,.35); background: rgba(96,165,250,.12); }
.chip-verified {
  color: #c7d2fe;
  border-color: rgba(99,102,241,.45);
  background: linear-gradient(92deg, rgba(99,102,241,.22), rgba(34,211,238,.18));
}

/* --- disclosure checklists --------------------------------------------- */
.disclosure { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.disclosure li {
  display: grid; grid-template-columns: 1.25rem 1fr; gap: .6rem;
  align-items: start; font-size: .9rem; line-height: 1.5; color: var(--text);
}
.disclosure .mark { font-weight: 700; line-height: 1.5; }
.disclosure-does .mark      { color: var(--ok); }
.disclosure-does_not .mark  { color: var(--bad); }
.disclosure-requirement .mark,
.disclosure-limitation .mark { color: var(--warn); }

.section-does_not { border-color: rgba(248,113,113,.28); }
.section-does     { border-color: rgba(52,211,153,.25); }

/* --- verdict bar -------------------------------------------------------- */
.verdict-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden;
               border: 1px solid var(--border); background: rgba(6,11,24,.6); }
.verdict-bar span { display: block; height: 100%; }
.verdict-contradicted { background: linear-gradient(90deg, #f87171, #fb7185); }
.verdict-consistent   { background: linear-gradient(90deg, #34d399, #4ade80); }
.verdict-no_basis     { background: linear-gradient(90deg, #64748b, #94a3b8); }
.verdict-skipped      { background: linear-gradient(90deg, #475569, #64748b); }

.legend { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: .7rem; font-size: .78rem; }
.legend i { display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .35rem; }

/* --- stat tiles --------------------------------------------------------- */
.tile { padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
        background: rgba(6,11,24,.45); }
.tile .value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.tile .name  { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }

.delta-up   { color: var(--ok); font-size: .74rem; }
.delta-down { color: var(--warn); font-size: .74rem; }
.delta-flat { color: var(--text-dim); font-size: .74rem; }

/* --- activity feed ------------------------------------------------------ */
.feed { display: grid; gap: .65rem; }
.feed-item {
  padding: .8rem .95rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: rgba(6,11,24,.4);
  border-left: 3px solid var(--border-strong);
}
.feed-item.v-contradicted { border-left-color: var(--bad); }
.feed-item.v-consistent   { border-left-color: var(--ok); }
.feed-item.v-no_basis     { border-left-color: #94a3b8; }
.feed-item.v-skipped      { border-left-color: #475569; }
.feed-item pre {
  white-space: pre-wrap; word-break: break-word; margin: .5rem 0 0;
  font-family: "JetBrains Mono", monospace; font-size: .78rem;
  color: var(--text-muted); line-height: 1.5;
}

/* --- tables ------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th {
  text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); font-weight: 600; padding: .55rem .7rem;
  border-bottom: 1px solid var(--border);
}
.table td { padding: .6rem .7rem; border-bottom: 1px solid rgba(148,163,184,.08); vertical-align: top; }
.table tr:hover td { background: rgba(255,255,255,.015); }

/* --- flash -------------------------------------------------------------- */
.flash { border-radius: var(--radius-sm); padding: .75rem 1rem; font-size: .88rem;
         border: 1px solid var(--border); margin-bottom: .6rem; }
.flash-ok    { background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.32); color: #d1fae5; }
.flash-error { background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.32); color: #fee2e2; }

/* --- sparkline ---------------------------------------------------------- */
.sparkline { width: 100%; height: 48px; color: var(--accent-2); display: block; }

/* --- nav ---------------------------------------------------------------- */
.nav-link { padding: .45rem .7rem; border-radius: 8px; font-size: .875rem; color: var(--text-muted); }
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--text); background: rgba(255,255,255,.07); }

/* --- misc --------------------------------------------------------------- */
.divider { height: 1px; background: var(--border); border: 0; }
.stat-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0;
            border-bottom: 1px dashed rgba(148,163,184,.15); font-size: .88rem; }
.stat-row:last-child { border-bottom: 0; }

/* --- landing hero ------------------------------------------------------- */
/* One soft wash of colour behind the headline. Purely decorative, so it is
   hidden from assistive tech and never carries meaning. */
.hero-glow {
  position: absolute; inset: -30% 0 auto 0; height: 620px; pointer-events: none;
  background:
    radial-gradient(45% 55% at 22% 30%, rgba(99,102,241,.24), transparent 70%),
    radial-gradient(35% 45% at 72% 12%, rgba(34,211,238,.16), transparent 70%);
  filter: blur(8px);
}

/* --- browse filters ----------------------------------------------------- */
/* Below 1024px the filter panel is collapsed until asked for; from 1024px up
   it is always open and the toggle disappears. Alpine drives the attribute. */
.filters-panel { display: grid; gap: 1.25rem; }
@media (max-width: 1023px) {
  .filters-panel[data-collapsed="true"] { display: none; }
}
@media (min-width: 1024px) {
  .filters-toggle { display: none; }
}

::selection { background: rgba(99,102,241,.4); }

@media (max-width: 640px) {
  .tile .value { font-size: 1.35rem; }
}
