/* AISOC in-a-box shared components — buttons, cards, badges, inputs, tables.
   Torq-style dark language: pure-black ground, monochrome white/black,
   white pill CTAs. Consumed by docs-site (marketing + developer docs) and
   the unified portal (kept synced at build time; the portal's standalone
   server output cannot reach outside apps/portal/). */

/* ── buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 16px;
  font: var(--weight-ui) 14px/1.2 var(--font-sans);
  font-feature-settings: var(--font-feature-settings);
  letter-spacing: var(--tracking-tight);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.btn:hover { background: var(--fill); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
}
.btn[disabled] { opacity: 0.45; cursor: wait; }

/* primary: white pill with black text — the Torq signature */
.btn-primary {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.btn-primary:hover {
  background: #e6e6e6;
  color: #000000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.btn-danger {
  background: rgba(229, 72, 77, 0.18);
  color: #ffb9be;
  border: 1px solid rgba(229, 72, 77, 0.4);
}
.btn-danger:hover { background: rgba(229, 72, 77, 0.28); }

.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--r-sm); }

/* ── cards (borderless depth) ─────────────────────────────────────── */
.card {
  background: var(--bg-elevated);
  border: 0;
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--inset-highlight), var(--shadow-raise);
}
.card-raised {
  background: var(--bg-overlay);
  box-shadow: var(--inset-highlight), var(--shadow-ambient);
}
.card-accent {
  box-shadow: var(--inset-highlight), var(--shadow-ambient), var(--glow-accent);
}

.kicker {
  display: block;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 10px;
}

/* ── badges / status pills ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font: var(--weight-ui) 11.5px/1.5 var(--font-sans);
  font-feature-settings: var(--font-feature-settings);
  white-space: nowrap;
  background: var(--fill);
  color: var(--ink-secondary);
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge.bare::before { display: none; }
.badge-ok   { background: var(--ok-bg);   color: var(--ok-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-bad  { background: var(--bad-bg);  color: var(--bad-ink); }
.badge-info { background: var(--fill); color: #ffffff; }

/* ── inputs ───────────────────────────────────────────────────────── */
.input,
input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="search"], textarea, select {
  background: var(--bg-panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 11px;
  font: var(--weight-ui) 13.5px/1.5 var(--font-sans);
  font-feature-settings: var(--font-feature-settings);
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--line-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}
label {
  font: var(--weight-ui) 11.5px/1.4 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
  display: block;
  margin-top: 8px;
}

/* ── tables ───────────────────────────────────────────────────────── */
.table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  font-feature-settings: "tnum" 1, var(--font-feature-settings);
}
.table th, .table td {
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
  border: 0;
  border-bottom: 1px solid var(--line-soft); /* row separators only */
}
.table th {
  font: var(--weight-ui) 11px/1.4 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-tertiary);
}
.table tbody tr:hover { background: var(--fill-faint); }
.table thead th { border-bottom-color: var(--line); }

/* ── misc shared primitives ───────────────────────────────────────── */
.muted  { color: var(--ink-secondary); }
.faint  { color: var(--ink-tertiary); }
.mono   { font-family: var(--font-mono); font-feature-settings: none; }
.right  { text-align: right; }
.divider { border: 0; border-top: 1px solid var(--line-soft); margin: 2em 0; }

kbd, .pathref {
  font: 500 0.85em/1.4 var(--font-mono);
  color: var(--ink-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0.12em 0.4em;
}

::selection { background: rgba(255, 255, 255, 0.25); color: #ffffff; }

/* Global focus ring for anything not restyled above. */
a:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--line-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* Scrollbars: quiet, dark-native. */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
