/* ==========================================================================
   Midnight Signal - components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons. One primary per view. accent-strong behind white for AA contrast.
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.96875rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.12s var(--ease), color 0.2s var(--ease);
}

.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-strong);
  color: #FFFFFF;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #1A54CE;
  color: #FFFFFF;
}

.btn--secondary {
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn--secondary:hover,
.btn--secondary:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.btn--ghost { color: var(--accent); padding-inline: 0; }
.btn--ghost:hover { color: #5B91FF; }

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

/* --------------------------------------------------------------------------
   Badges. Factual labels only, never a marketing claim.
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--neutral { background: rgba(164, 190, 255, 0.10); color: var(--ink-muted); }
.badge--success { background: rgba(47, 191, 143, 0.14); color: var(--success); }
.badge--warning { background: rgba(242, 179, 61, 0.14); color: var(--warning); }

/* --------------------------------------------------------------------------
   Cards. Only where the panel carries real hierarchy.
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  position: relative;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background-color 0.25s var(--ease);
}

.card--raised { background: var(--surface-raised); border-color: var(--border-strong); }

a.card:hover,
.card--link:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.card h3 { margin-bottom: var(--space-sm); }
.card p { color: var(--ink-muted); }

.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  margin-bottom: var(--space-md);
}

/* --------------------------------------------------------------------------
   Header. Two tiers: utility bar on bg, main nav on surface.
   -------------------------------------------------------------------------- */

.bcs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 18, 38, 0.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--border);
}

/* Tier one */
.bcs-utility {
  border-bottom: 1px solid var(--border);
}

.bcs-utility__inner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  min-height: 66px;
  padding-block: 10px;
}

.bcs-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  color: var(--ink);
}

.bcs-brand:hover { color: var(--ink); }

.bcs-brand__mark { flex-shrink: 0; }

.bcs-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.bcs-brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.bcs-brand__sub {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Search */
.bcs-search {
  flex: 1 1 auto;
  max-width: 460px;
  margin-inline: auto;
  position: relative;
}

.bcs-search__field {
  width: 100%;
  padding: 10px 44px 10px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.bcs-search__field::placeholder { color: var(--ink-muted); opacity: 1; }

.bcs-search__field:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-raised);
}

.bcs-search__submit {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.bcs-search__submit:hover { color: var(--ink); background: var(--accent-soft); }

.bcs-utility__actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.bcs-iconlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.bcs-iconlink:hover {
  color: var(--ink);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

/* Tier two */
.bcs-nav { background: rgba(11, 25, 51, 0.72); }

.bcs-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 54px;
}

.bcs-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}

.bcs-menu li { position: relative; }

.bcs-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 15px 14px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.bcs-menu > li > a:hover { color: var(--ink); }

.bcs-menu > li.current-menu-item > a,
.bcs-menu > li.current_page_item > a,
.bcs-menu > li.current-menu-ancestor > a,
.bcs-menu > li.is-active > a {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Dropdown */
.bcs-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 232px;
  padding: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 110;
}

.bcs-menu li:hover > .sub-menu,
.bcs-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bcs-menu .sub-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.bcs-menu .sub-menu a:hover { color: var(--ink); background: var(--accent-soft); }

/* Mobile toggle */
.bcs-burger {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.bcs-burger__bars { display: block; width: 18px; height: 11px; position: relative; }
.bcs-burger__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.18s var(--ease);
}
.bcs-burger__bars span:nth-child(1) { top: 0; }
.bcs-burger__bars span:nth-child(2) { top: 50%; margin-top: -0.75px; }
.bcs-burger__bars span:nth-child(3) { bottom: 0; }

.bcs-burger[aria-expanded="true"] .bcs-burger__bars span:nth-child(1) { transform: translateY(4.75px) rotate(45deg); }
.bcs-burger[aria-expanded="true"] .bcs-burger__bars span:nth-child(2) { opacity: 0; }
.bcs-burger[aria-expanded="true"] .bcs-burger__bars span:nth-child(3) { transform: translateY(-4.75px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.bcs-footer {
  margin-top: var(--space-xxl);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.bcs-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-xl) var(--space-lg);
  padding-block: clamp(44px, 4vw, 72px);
}

.bcs-footer h2 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: var(--space-md);
}

.bcs-footer__links li + li { margin-top: 10px; }

.bcs-footer__links a {
  font-size: 0.9375rem;
  color: var(--ink-muted);
  transition: color 0.18s var(--ease);
}

.bcs-footer__links a:hover { color: var(--ink); }

.bcs-footer__about p {
  margin-top: var(--space-md);
  color: var(--ink-muted);
  font-size: 0.9375rem;
  max-width: 38ch;
}

.bcs-footer__social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.bcs-footer__bar {
  border-top: 1px solid var(--border);
  padding-block: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.bcs-footer__bar a { color: var(--ink-muted); }
.bcs-footer__bar a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Comparison tables. Scroll horizontally, sticky first column.
   -------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.cmp {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.cmp caption {
  caption-side: top;
  text-align: left;
  padding: var(--space-md) var(--space-lg) 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.cmp th, .cmp td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.cmp thead th {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  background: var(--surface-raised);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}

.cmp tbody tr:nth-child(even) { background: rgba(16, 35, 71, 0.4); }
.cmp tbody tr:last-child th, .cmp tbody tr:last-child td { border-bottom: 0; }

.cmp tbody th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  min-width: 160px;
}

.cmp tbody tr:nth-child(even) th { background: #0D1E3B; }

.cmp td { color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   FAQ accordion. Native details/summary, so it works without JS.
   -------------------------------------------------------------------------- */

.faq { border-top: 1px solid var(--border); }

.faq__item { border-bottom: 1px solid var(--border); }

.faq__q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 20px 0;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.35;
  color: var(--ink);
  list-style: none;
  transition: color 0.18s var(--ease);
}

.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--accent); }

.faq__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  position: relative;
  color: var(--accent);
}

.faq__icon::before,
.faq__icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s var(--ease), opacity 0.22s var(--ease);
}

.faq__icon::before { top: 10px; left: 3px; width: 16px; height: 2px; }
.faq__icon::after { top: 3px; left: 10px; width: 2px; height: 16px; }

.faq__item[open] .faq__icon::after { opacity: 0; transform: rotate(90deg); }

.faq__a { padding-bottom: 22px; color: var(--ink-muted); max-width: var(--measure); }
.faq__a > * + * { margin-top: var(--space-md); }

/* --------------------------------------------------------------------------
   Callouts. Functional use of warning and danger.
   -------------------------------------------------------------------------- */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: var(--space-md) var(--space-lg);
}

.callout > * + * { margin-top: var(--space-sm); }
.callout p { color: var(--ink-muted); }

.callout__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--ink);
}

.callout--warning { border-left-color: var(--warning); }
.callout--risk { border-left-color: var(--danger); }
.callout--note { border-left-color: var(--cyan); }

/* --------------------------------------------------------------------------
   Provider tile. Real marks, unaltered, consistent optical size.
   -------------------------------------------------------------------------- */

.logo-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(244, 247, 255, 0.05);
  overflow: hidden;
}

.logo-tile img, .logo-tile svg {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.logo-tile--lg { width: 68px; height: 68px; }
.logo-tile--lg img, .logo-tile--lg svg { width: 40px; height: 40px; }

/* Typographic fallback until real provider marks are supplied. */
.logo-tile__mono {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  color: var(--ink-muted);
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.field { display: block; }
.field + .field { margin-top: var(--space-md); }

.field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
}

.input, .textarea, .select {
  width: 100%;
  padding: 12px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.input::placeholder, .textarea::placeholder { color: var(--ink-muted); opacity: 1; }

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-raised);
}

.textarea { min-height: 150px; resize: vertical; }

/* --------------------------------------------------------------------------
   Responsive. Every multi-column block collapses at 768px.
   -------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .bcs-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .bcs-search { max-width: none; }
  .bcs-burger { display: inline-flex; }

  .bcs-nav__inner { justify-content: flex-start; }

  .bcs-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-sm);
    background: var(--surface-raised);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
  }

  .bcs-menu.is-open { display: flex; }

  .bcs-menu > li > a {
    padding: 13px var(--space-md);
    border-bottom: 0;
    border-radius: 8px;
    font-size: 1rem;
  }

  .bcs-menu > li.current-menu-item > a,
  .bcs-menu > li.current_page_item > a,
  .bcs-menu > li.is-active > a {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .bcs-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    margin: 2px 0 6px var(--space-md);
    padding: 4px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
  }
}

@media (max-width: 768px) {
  :root { --gutter: 18px; }

  .bcs-utility__inner {
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    min-height: 0;
  }

  .bcs-search { order: 3; flex-basis: 100%; }
  .bcs-utility__actions { margin-left: auto; }

  .bcs-footer__grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .bcs-footer__bar { justify-content: flex-start; }

  .card { padding: var(--space-lg) var(--space-md); }
}

@media (max-width: 420px) {
  .btn { width: 100%; }
  .btn--ghost { width: auto; }
  .btn-row { gap: 10px; }
}
