:root {
  --bc-bg: #08120d;
  --bc-bg-soft: #0d1d15;
  --bc-panel: #10261b;
  --bc-panel-2: #133022;
  --bc-green: #3fd37a;
  --bc-green-soft: #78eaa7;
  --bc-text: #e7fff0;
  --bc-muted: #9eb9ab;
  --bc-border: rgba(111, 255, 177, 0.2);
}

html,
body {
  min-height: 100%;
}

body.bc-theme-dark {
  color: var(--bc-text);
  background:
    radial-gradient(circle at 8% 12%, rgba(63, 211, 122, 0.15), transparent 45%),
    radial-gradient(circle at 90% 5%, rgba(63, 211, 122, 0.11), transparent 35%),
    linear-gradient(140deg, var(--bc-bg), #050a08 72%);
}

a {
  color: var(--bc-green-soft);
}

a:hover {
  color: #c9ffd9;
}

/* Layout */
.bc-page-layout {
  min-height: 100vh;
}

.bc-sidebar {
  background: linear-gradient(180deg, rgba(8, 20, 14, 0.96), rgba(9, 23, 16, 0.98));
  border-right: 1px solid var(--bc-border);
}

.bc-sidebar .navbar-brand {
  width: 100%;
  justify-content: flex-start;
  padding-inline: 0;
}

.bc-sidebar .navbar-nav .nav-link {
  color: var(--bc-muted);
  border: 1px solid transparent;
  border-radius: 12px;
  margin-bottom: 0.35rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.bc-sidebar .navbar-nav .nav-link:hover,
.bc-sidebar .navbar-nav .nav-link.active {
  color: var(--bc-text);
  border-color: var(--bc-border);
  background: rgba(63, 211, 122, 0.12);
  transform: translateX(2px);
}

.bc-sidebar-footer {
  border-top: 1px dashed var(--bc-border);
  padding-top: 1rem;
}

.bc-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--bc-border);
  color: var(--bc-muted);
  font-size: 0.85rem;
}

.bc-topbar {
  background: rgba(8, 20, 14, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bc-border);
}

.bc-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--bc-text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.bc-brand img {
  width: 30px;
  height: 30px;
}

.bc-content-stack > * {
  opacity: 0;
  transform: translateY(8px);
  animation: bc-rise 0.42s ease forwards;
}

.bc-content-stack > *:nth-child(2) {
  animation-delay: 0.06s;
}

.bc-content-stack > *:nth-child(3) {
  animation-delay: 0.1s;
}

/* Surfaces */
.bc-surface {
  background: linear-gradient(180deg, rgba(19, 48, 34, 0.85), rgba(13, 29, 21, 0.85));
  border: 1px solid var(--bc-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bc-surface:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 255, 177, 0.32);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.34);
}

.bc-animate-in {
  opacity: 0;
  transform: translateY(8px);
  animation: bc-rise 0.45s ease forwards;
}

.bc-page-title {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  font-weight: 700;
  margin: 0;
}

.bc-page-subtitle {
  color: var(--bc-muted);
  margin: 0.25rem 0 0;
}

.card,
.table,
.form-control,
.form-select,
.input-group-text,
.alert,
.navbar {
  border-color: var(--bc-border) !important;
}

.card,
.form-control,
.form-select,
.input-group-text {
  background-color: rgba(11, 26, 18, 0.82) !important;
  color: var(--bc-text) !important;
}

.form-control::placeholder {
  color: #7ea693;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(63, 211, 122, 0.65) !important;
  box-shadow: 0 0 0 0.2rem rgba(63, 211, 122, 0.2) !important;
}

.table {
  color: var(--bc-text);
}

.table > :not(caption) > * > * {
  background-color: transparent;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(8, 22, 15, 0.6);
}

.table tbody tr {
  transition: transform 0.16s ease, background-color 0.16s ease;
}

.table tbody tr:hover {
  transform: translateX(2px);
}

.text-muted,
.small,
small {
  color: var(--bc-muted) !important;
}

.alert-success {
  background: rgba(27, 74, 45, 0.8);
  color: #ccffdf;
}

.alert-danger {
  background: rgba(88, 23, 23, 0.8);
  color: #ffd3d3;
}

.alert-warning {
  background: rgba(96, 73, 18, 0.75);
  color: #fff0c9;
}

.btn-primary {
  --tblr-btn-bg: #2dbf6b;
  --tblr-btn-border-color: #2dbf6b;
  --tblr-btn-hover-bg: #27a95f;
  --tblr-btn-hover-border-color: #27a95f;
  --tblr-btn-active-bg: #238f52;
  --tblr-btn-active-border-color: #238f52;
}

.btn-outline-secondary {
  --tblr-btn-color: #c6e8d2;
  --tblr-btn-border-color: rgba(198, 232, 210, 0.35);
  --tblr-btn-hover-color: #08120d;
  --tblr-btn-hover-bg: #c6e8d2;
}

.badge.bc-badge {
  border: 1px solid var(--bc-border);
  background: rgba(63, 211, 122, 0.14);
  color: #b7ffd3;
}

.bc-status {
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  display: inline-flex;
  border: 1px solid transparent;
}

.bc-status-0 { background: rgba(129, 146, 157, 0.18); color: #d2dde3; border-color: rgba(200, 210, 218, 0.35); }
.bc-status-1 { background: rgba(255, 180, 60, 0.18); color: #ffd89a; border-color: rgba(255, 203, 124, 0.35); }
.bc-status-2 { background: rgba(63, 211, 122, 0.18); color: #b6ffd2; border-color: rgba(125, 241, 172, 0.35); }
.bc-status-3 { background: rgba(227, 86, 86, 0.18); color: #ffc3c3; border-color: rgba(255, 149, 149, 0.35); }
.bc-status-4 { background: rgba(122, 130, 219, 0.18); color: #d4d8ff; border-color: rgba(154, 164, 255, 0.35); }

/* Auth */
.bc-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bc-auth-grid {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.bc-auth-hero,
.bc-auth-card {
  border-radius: 20px;
  border: 1px solid var(--bc-border);
  background: linear-gradient(180deg, rgba(19, 48, 34, 0.9), rgba(10, 23, 16, 0.95));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
}

.bc-auth-hero {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bc-auth-card {
  padding: 2rem;
}

.bc-auth-logo {
  width: min(260px, 100%);
}

.bc-auth-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.bc-auth-points li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--bc-muted);
}

.bc-auth-points i {
  color: var(--bc-green-soft);
}

.bc-metric {
  border: 1px solid var(--bc-border);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(9, 21, 15, 0.7);
}

.bc-metric .label {
  font-size: 0.75rem;
  color: var(--bc-muted);
}

.bc-metric .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #d6ffe7;
}

/* Animations */
@keyframes bc-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .bc-auth-grid {
    grid-template-columns: 1fr;
  }

  .bc-auth-hero {
    order: 2;
  }

  .bc-auth-card {
    order: 1;
  }

  .bc-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--bc-border);
  }

  .bc-sidebar .navbar-brand {
    margin-right: auto;
  }
}

@media (max-width: 576px) {
  .bc-page-title {
    font-size: 1.2rem;
  }

  .bc-auth-hero,
  .bc-auth-card {
    padding: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Replaces inline style="animation-delay" (blocked by the CSP). */
.bc-delay-1 {
  animation-delay: 0.08s;
}

/* Certification list (SIP-005): rows wrap instead of scrolling horizontally. */
.bc-request {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem 1.5rem;
}
.bc-request-main {
  flex: 1 1 16rem;
  min-width: 0;
}
.bc-request-status {
  flex: 1 1 12rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.bc-request-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

/* Reserve the scrollbar space: no layout jump when a scrollbar appears. */
html {
  scrollbar-gutter: stable;
}
