/* CBWatch shared design system.
 *
 * Extracted from what used to be duplicated <style> blocks in every page
 * (index.html, dashboard.html, compliance.html, ...) — each page kept
 * drifting slightly out of sync with the others because there was no
 * single source of truth for shared values. This file IS that source of
 * truth now: every page links it and then only defines page-specific
 * rules in its own <style> block (a scan-result card here, a domain-card
 * grid there) — never the shared tokens/components below.
 *
 * This is a refinement pass on the existing dark navy/teal identity, not
 * a rebrand — same --bg/--panel/--accent hex values as before, same IBM
 * Plex fonts. What changed: a real typographic + spacing scale instead of
 * ad hoc px values repeated with small inconsistencies across pages,
 * layered shadows/depth on panels instead of flat fills, a subtle
 * radial-glow page background instead of a flat one, and consistent
 * hover/interaction treatment on buttons and cards.
 */

:root {
  /* --- Colour tokens (unchanged values, same brand) --- */
  --bg: #0B1220;
  --bg-glow: #0F1B30; /* used only in the radial gradient behind the page — see body{} below */
  --panel: #131D30;
  --panel-raised: #17233A; /* one step lighter than --panel — for a card sitting on top of another panel */
  --panel-border: #23324A;
  --panel-border-soft: rgba(35, 50, 74, 0.6);
  --ink: #E7ECF3;
  --ink-dim: #8B9AB3;
  --accent: #4FD1C5;
  --accent-2: #6EE7DB; /* lighter end of the accent gradient used on primary buttons */
  --accent-dim: #2A5A55;

  --crit: #E4574C;
  --high: #E8965A;
  --med:  #E0B84C;
  --low:  #6FB37A;
  --info: #6B7A94;

  --mono: 'IBM Plex Mono', 'SF Mono', Consolas, monospace;
  --sans: 'IBM Plex Sans', -apple-system, Segoe UI, sans-serif;

  /* --- Type scale --- */
  --fs-xs: 11.5px;
  --fs-sm: 13px;
  --fs-base: 14.5px;
  --fs-md: 15.5px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 30px;
  --fs-3xl: 38px;

  /* --- Spacing scale (4px unit) --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Layered shadow used on every raised panel — a tight contact shadow
     plus a softer ambient one underneath it, rather than one flat blur.
     This is most of what makes a dark-theme panel read as "raised" instead
     of just "a rectangle with a border." */
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -8px rgba(0, 0, 0, 0.45);
  --shadow-panel-hover: 0 2px 4px rgba(0, 0, 0, 0.4), 0 20px 44px -10px rgba(0, 0, 0, 0.55);
  --shadow-glow-accent: 0 0 0 1px var(--accent-dim), 0 8px 24px -6px rgba(79, 209, 197, 0.25);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  /* A very soft radial glow near the top of the page, rather than a flat
     fill — reads as considered/premium instead of a plain block of colour,
     without being loud enough to fight with content or hurt legibility. */
  background:
    radial-gradient(880px 420px at 50% -10%, var(--bg-glow) 0%, transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: var(--accent-dim); color: var(--ink); }

a { color: inherit; }

/* --- Shared page shell -------------------------------------------------- */

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-7) 20px 80px;
}

.wrap { width: 100%; max-width: 720px; }
.wrap-wide { width: 100%; max-width: 1000px; margin: 0 auto; }

.topnav-login {
  position: fixed;
  top: 20px;
  right: 20px;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color 0.15s;
}
.topnav-login:hover { color: var(--accent); }

/* --- Top site navigation (public marketing pages) ---------------------------
   A row of pill-shaped buttons across the top of the page — Home, Pricing,
   Guides, Methodology, About, Contact, Privacy, Terms — rather than only
   the small underlined links in the footer. Sits above each page's own
   .mark/header, inside .wrap so it shares the page's max-width and side
   gutters. */

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.site-nav a {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
}
.site-nav a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.site-nav a.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* --- Eyebrow / section mark ---------------------------------------------- */

.mark {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.mark::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

/* --- Headings ------------------------------------------------------------- */

h1 {
  font-size: var(--fs-3xl);
  font-weight: 650;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.sub {
  color: var(--ink-dim);
  font-size: var(--fs-md);
  line-height: 1.6;
  max-width: 520px;
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: 650;
  margin: 0 0 var(--sp-1);
  letter-spacing: -0.005em;
}
.section-desc {
  color: var(--ink-dim);
  font-size: var(--fs-base);
  line-height: 1.55;
  margin: 0 0 var(--sp-4);
}

/* --- Panels / cards -------------------------------------------------------
   The base look every raised surface in the product shares: dark panel
   fill, hairline border, layered shadow, and a 1px inner top highlight
   (an inset box-shadow, not a second border) that catches a little light
   along the top edge the way a slightly glossy raised surface would. */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.panel-interactive {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.panel-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-panel-hover), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-color: var(--panel-border-soft);
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
  /* Sensible default sizing so any button using just .btn (no page-specific
     height/padding override) still gets real dimensions instead of quietly
     collapsing to the browser's own ~1px/6px default button padding — that
     happened to the homepage's "Download PDF report" button (20px tall,
     visibly smaller than every other button) until this default was added.
     Buttons with their own explicit padding/height (#scan-btn, the trial
     popup CTA, .modal-actions .btn, etc.) simply override these. */
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-base);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #062421;
  box-shadow: var(--shadow-glow-accent);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 0 0 1px var(--accent), 0 10px 28px -6px rgba(79, 209, 197, 0.38); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--ink);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--ink-dim);
}
.btn-ghost:hover { border-color: var(--ink-dim); color: var(--ink); }

/* --- Small text link (used for secondary in-card actions) ------------------ */

.mini-link {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: var(--fs-sm);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s;
}
.mini-link:hover { color: var(--accent); }
/* Sept a11y audit (#7): a .danger link (account delete, domain remove,
   team-member remove) previously only turned red on :hover — at rest it
   read as an ordinary link, indistinguishable from any other text link on
   the page, despite marking a genuinely destructive action. Now red at
   rest too (dimmed slightly so :hover still reads as more emphasized),
   fixed 26 Sept. */
.mini-link.danger { color: var(--crit); opacity: 0.82; }
.mini-link.danger:hover { opacity: 1; }

/* --- Grade badge (used on the homepage scorecard, dashboard, compliance) --- */

.grade-badge {
  font-family: var(--mono);
  font-weight: 700;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--accent-dim);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* --- Tags / badges ---------------------------------------------------------- */

.tag {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(139, 154, 179, 0.12);
  color: var(--ink-dim);
  white-space: nowrap;
}

.status-pill {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 3px 9px;
  border-radius: 6px;
  flex-shrink: 0;
}
.status-pill.status-bad  { background: rgba(228, 87, 76, 0.15); color: #F5B4AD; }
.status-pill.status-good { background: rgba(111, 179, 122, 0.15); color: #A9D6B2; }
.status-pill.status-warn { background: rgba(232, 150, 90, 0.15); color: #F0C09A; }

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

footer {
  margin-top: var(--sp-8);
  color: var(--ink-dim);
  font-size: var(--fs-xs);
  text-align: center;
  line-height: 1.6;
}
footer .footer-links { margin-top: var(--sp-2); }
footer .footer-links a { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 2px; margin: 0 8px; transition: color 0.15s; }
footer .footer-links a:hover { color: var(--accent); }

/* --- Disclaimer text (compliance/insurance/cyber-essentials footers) -------- */

.disclaimer {
  color: var(--ink-dim);
  font-size: var(--fs-xs);
  line-height: 1.55;
  margin-top: var(--sp-2);
}

[hidden] { display: none !important; }
