/* ============================================================
   RISKHELPER.AI — SHARED DESIGN SYSTEM
   Design tokens, nav, footer, utilities
   Used by: index.html, assessment.html, privacy-policy.html, terms.html
   ============================================================ */

/* ============================================================ TOKENS */
:root {
  /* Core navy — matches logo's darkest indigo */
  --navy: #0C1F4A;
  --navy-mid: #1A3060;
  --navy-light: #243D73;

  /* Accent blue — brighter derivative of logo's #143C8C */
  --blue: #2563EB;
  --blue-dk: #1D4ED8;
  --blue-lt: #EFF6FF;
  --blue-mid: #BFDBFE;

  /* Logo indigo for gradient stops */
  --indigo: #1E3A8A;
  --indigo-dk: #142878;

  /* Page surfaces */
  --bg: #F6F9FC;
  --bg-card: #FFFFFF;
  --border: #E3E8EE;
  --border-dk: #CBD5E1;

  /* Text */
  --text: #0C1F4A;
  --text-mid: #3D5170;
  --text-soft: #64748B;

  --radius: 10px;
  --radius-lg: 16px;
}

/* ============================================================ RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--bg-card);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================ LAYOUT */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
}

.container--narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================================ TYPOGRAPHY */
.display-xl {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(40px, 5.2vw, 68px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #fff;
  font-weight: 400;
}

.display-xl em {
  font-style: italic;
}

h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  font-weight: 400;
  color: var(--navy);
}

h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

p {
  color: var(--text-mid);
  line-height: 1.7;
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-mid);
  max-width: 600px;
}

.overline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
  display: block;
}

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
  border: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.4), 0 2px 8px rgba(37, 99, 235, 0.2);
}

.btn--primary:hover {
  background: var(--blue-dk);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}

.btn--white {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--white:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border-dk);
}

.btn--outline:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn--lg {
  padding: 14px 30px;
  font-size: 16px;
}

.btn-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.btn-group--center {
  justify-content: center;
}

/* ============================================================ NAVIGATION */
nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-wordmark {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.logo-wordmark span {
  color: var(--blue);
}

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  transition: color .15s;
}

.nav-links a:hover {
  color: var(--navy);
}

.nav-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all .2s;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 12px 24px 16px;
}

.nav-mobile a {
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-mid);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.nav-mobile a:last-child {
  border-bottom: none;
}

.nav-mobile.is-open {
  display: flex;
}

/* ============================================================ FOOTER */
footer {
  background: var(--navy);
  padding: 56px 40px 24px;
  max-width: 100%;
}

.footer-top {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  flex: 1.5;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-logo-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.footer-logo-lockup .logo-img {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.footer-logo-lockup .logo-wordmark {
  color: #fff;
}

.footer-logo-lockup .logo-wordmark span {
  color: #93C5FD;
}

.footer-links-group h5 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 14px;
}

.footer-links-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links-group a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color .15s;
}

.footer-links-group a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  max-width: 1080px;
  margin: 20px auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.28);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================================ COOKIE BANNER */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transform: translateY(0);
  transition: transform .3s ease;
}

#cookie-banner.hidden {
  transform: translateY(110%);
}

#cookie-banner p {
  flex: 1;
  min-width: 240px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

#cookie-banner a {
  color: #93C5FD;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all .15s;
}

.cookie-btn--accept {
  background: var(--blue);
  color: #fff;
}

.cookie-btn--accept:hover {
  background: var(--blue-dk);
}

.cookie-btn--reject {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn--reject:hover {
  background: rgba(255, 255, 255, 0.18);
}

.cookie-btn--manage {
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
  padding: 8px 4px;
}

/* ============================================================ RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-actions .btn--outline {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  nav .nav-actions .btn--primary {
    padding: 9px 16px;
    font-size: 13px;
  }

  .footer-top {
    flex-direction: column;
    gap: 28px;
  }

  .container,
  .container--narrow {
    padding: 0 20px;
  }

  .nav-inner {
    padding: 0 20px;
  }

  footer {
    padding: 40px 20px 24px;
  }
}

/* ============================================================ HELP PANELS */
/* Help trigger button */
.help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: 0.375rem;
  vertical-align: middle;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: all 0.2s ease;
}

.help-trigger:hover,
.help-trigger:focus-visible,
.help-trigger[aria-expanded="true"] {
  color: var(--blue);
  background: rgba(37, 99, 235, 0.08);
  /* slight translucent blue */
  transform: scale(1.05);
}

.help-trigger:active {
  transform: scale(0.95);
}

.help-trigger .help-svg {
  width: 18px;
  height: 18px;
}

/* Help panel */
.help-panel {
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-alt, #f3f4f6);
  border-left: 3px solid var(--accent, #1d4ed8);
  border-radius: 0 0.375rem 0.375rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink, #111827);
  font-weight: 400;
}

.help-panel p {
  margin: 0 0 0.75rem;
}

.help-panel p:last-child {
  margin-bottom: 0;
}

.help-why {
  color: var(--ink-soft, #6b7280);
}