/* Public website theme (STAT-363): the start page's look on every public page.
   Fixed dark design (html[data-theme-lock="dark"], body.sp-site): near-black with cold cyan, technical but editorial.
   Loaded after custom.css on public pages only; the logged-in portal keeps its own light/dark themes. */

body.sp-site {
  --h-bg: #04070d;
  --h-bg-raised: #070d18;
  --h-surface: rgba(22, 38, 62, 0.9);
  --h-surface-solid: #10203a;
  --h-panel: #0a1524;
  --h-line: rgba(148, 197, 230, 0.14);
  --h-line-strong: rgba(125, 211, 252, 0.34);
  --h-text: #e8eef6;
  --h-muted: #a3b3c6;
  --h-faint: #7d8ea3;
  --h-cyan: #67e8f9;
  --h-cyan-strong: #22d3ee;
  --h-sky: #7dd3fc;
  --h-pass: #65dfb5;
  --h-fail: #ff7d87;
  --h-warn: #f3c969;
  --h-shell: 1240px;
  --h-heading-width: 760px;
  --h-body-width: 560px;

  /* Shared tokens used by custom.css components (topbar, footer, cards). */
  --sp-text: var(--h-text);
  --sp-muted: var(--h-muted);
  --sp-bg: var(--h-bg);
  --sp-primary: var(--h-sky);
  --sp-primary-button: var(--h-sky);
  --sp-primary-button-hover: #bae6fd;
  --sp-accent: var(--h-cyan);
  --sp-card: var(--h-panel);
  --sp-card-bg: #0b1524;
  --sp-card-soft: var(--h-surface);
  --sp-card-border: var(--h-line);
  --sp-card-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --sp-public-shell-max-width: var(--h-shell);

  margin: 0;
  background:
    radial-gradient(1100px 520px at 75% -10%, rgba(14, 116, 144, 0.22), transparent 70%),
    var(--h-bg);
  color: var(--h-text);
}

/* The public site has one fixed theme; the switch belongs to the portal. */
.sp-site [data-theme-toggle] {
  display: none;
}

/* :where() keeps these at the lowest specificity so component styles (buttons, cards) win. */
:where(.sp-site) a {
  color: var(--h-sky);
}

:where(.sp-site) a:hover,
:where(.sp-site) a:focus-visible {
  color: var(--h-cyan);
}

:where(.sp-site) a:focus-visible,
:where(.sp-site) button:focus-visible,
:where(.sp-site) select:focus-visible {
  outline: 2px solid var(--h-cyan);
  outline-offset: 3px;
}

/* ── Buttons (same as the start page) ─────────────────────────── */

.sp-site .btn-primary,
.sp-site .btn-outline-primary {
  box-sizing: border-box;
  min-height: 44px;
  border-radius: 8px;
  font-weight: 600;
}

.sp-site .btn-primary {
  border-color: var(--h-sky);
  background: var(--h-sky);
  color: #03111d;
}

.sp-site .btn-primary:hover,
.sp-site .btn-primary:focus-visible {
  border-color: #bae6fd;
  background: #bae6fd;
  color: #03111d;
}

.sp-site .btn-outline-primary {
  border-color: rgba(226, 232, 240, 0.4);
  background: transparent;
  color: var(--h-text);
}

.sp-site .btn-outline-primary:hover,
.sp-site .btn-outline-primary:focus-visible {
  border-color: var(--h-sky);
  background: rgba(125, 211, 252, 0.08);
  color: var(--h-text);
}

/* ── Topbar and footer ─────────────────────────────────────────── */

.sp-site .sp-public-topbar {
  background: rgba(6, 12, 22, 0.82);
  border-color: var(--h-line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.sp-site .sp-public-topbar .btn-primary,
.sp-site .sp-public-topbar .btn-outline-primary {
  min-height: 40px;
  padding: 0.5rem 1.1rem;
}

.sp-site .sp-public-nav a {
  color: var(--h-text);
}

.sp-site .sp-public-nav a:hover,
.sp-site .sp-public-nav a:focus-visible {
  color: var(--h-cyan);
}

.sp-site .sp-language-select {
  background-color: var(--h-surface);
  border-color: var(--h-line);
  color: var(--h-text);
}

.sp-site .sp-public-footer-inner {
  background: rgba(8, 15, 28, 0.8);
}

/* ── Subpage components (custom.css) in the start page's style ──── */

.sp-site .sp-glass {
  background: var(--h-panel);
  border-color: var(--h-line);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: none;
}

.sp-site .sp-hero-panel {
  background:
    radial-gradient(700px 360px at 85% 0%, rgba(34, 211, 238, 0.1), transparent 70%),
    var(--h-panel);
}

.sp-site .sp-hero-label {
  color: var(--h-cyan);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
}

.sp-site .sp-hero-copy h1,
.sp-site .sp-public-section h2,
.sp-site .sp-public-cta h2,
.sp-site .sp-public-section-header h2 {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--h-text);
  text-wrap: balance;
}

.sp-site .sp-public-card h3,
.sp-site .sp-hero-card h3,
.sp-site .sp-feature-panel h3 {
  color: var(--h-text);
}

.sp-site .sp-hero-lede,
.sp-site .sp-public-card p,
.sp-site .sp-muted {
  color: var(--h-muted);
}

.sp-site .sp-public-card:hover {
  border-color: var(--h-line-strong);
}

.sp-site .sp-inline-icon-row svg,
.sp-site .sp-public-card svg {
  color: var(--h-cyan);
}

.sp-site .sp-hero-card {
  background: linear-gradient(160deg, var(--h-surface-solid), var(--h-panel));
  border-color: var(--h-line-strong);
}

.sp-site .sp-product-badge {
  border-color: rgba(125, 211, 252, 0.4);
  background: rgba(125, 211, 252, 0.1);
  color: var(--h-sky);
}

.sp-site .sp-product-badge-warning {
  border-color: rgba(243, 201, 105, 0.5);
  background: rgba(243, 201, 105, 0.12);
  color: var(--h-warn);
}

.sp-site .sp-product-badge-risk {
  border-color: rgba(255, 125, 135, 0.5);
  background: rgba(255, 125, 135, 0.12);
  color: var(--h-fail);
}

.sp-site .sp-product-shot-image {
  border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .sp-site .sp-public-card {
    transition: none;
  }
}
