/* =====================================================================
   TRUST FLOW CHECKER — STYLESHEET
   ===================================================================== */

:root {
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;

  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --bg-elevated: #ffffff;
  --text: #12161f;
  --text-muted: #5a6472;
  --border: #e4e8ee;
  --brand: #2f5eff;
  --brand-dark: #1c3fd6;
  --brand-light: #eef2ff;
  --accent: #14b8a6;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --radius: 14px;
  --radius-sm: 8px;
  --max-w: 1200px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-alt: #10141d;
  --bg-elevated: #151a24;
  --text: #eef1f6;
  --text-muted: #9aa4b2;
  --border: #232a38;
  --brand: #5b7fff;
  --brand-dark: #7a97ff;
  --brand-light: #182042;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  width: 100%;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; }
p { line-height: 1.65; color: var(--text-muted); margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Top Utility Bar ---------- */
.top-bar {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; height: 36px; gap: 12px; overflow: hidden; }
.top-bar .breadcrumb { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-bar .breadcrumb a { color: var(--text-muted); }
.top-bar .breadcrumb a:hover { color: var(--brand); }
.top-bar .breadcrumb span[aria-current] { color: var(--text); font-weight: 500; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  width: 100%;
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--text); flex-shrink: 0; }
.brand .logo-dot { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--brand), var(--accent)); flex-shrink: 0; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; }
.main-nav > ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; align-items: center; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a, .main-nav > ul > li > button {
  display: flex; align-items: center; gap: 4px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text); font-size: 14.5px; font-weight: 500;
}
.main-nav > ul > li > a:hover, .main-nav > ul > li > button:hover, .main-nav > ul > li.open > button { background: var(--bg-alt); color: var(--brand); }
.chev { width: 9px; height: 9px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); margin-top: -3px; transition: transform .18s ease; }
li.open .chev { transform: rotate(-135deg); margin-top: 3px; }

/* Mega menu dropdown — REQUIRED: top must be flush 100%, not calc(100% + 8px) */
.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 90vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: none;
  z-index: 200;
  margin-top: 6px;
}
li.open .mega-menu { display: block; animation: fadeSlide .16s ease; }
@keyframes fadeSlide { from { opacity: 0; transform: translateX(-50%) translateY(-4px);} to { opacity: 1; transform: translateX(-50%) translateY(0);} }
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px; }
.mega-grid a {
  display: block; padding: 7px 8px; border-radius: 7px; color: var(--text); font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mega-grid a:hover { background: var(--brand-light); color: var(--brand); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-alt); display: flex; align-items: center; justify-content: center; color: var(--text);
}
.theme-toggle svg { width: 18px; height: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.hamburger { display: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-alt); align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.hamburger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 56px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-light), transparent); }
.hero-inner { text-align: center; max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand); font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.02em; }
.hero .lead { font-size: 17px; max-width: 620px; margin: 0 auto 28px; }

/* ---------- Checker Card ---------- */
.checker-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 28px; max-width: 640px; margin: 0 auto; text-align: left;
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.input-group { flex: 1; min-width: 220px; position: relative; }
.input-group input {
  width: 100%; padding: 15px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 15px; outline: none; transition: border-color .15s ease;
}
.input-group input:focus { border-color: var(--brand); }
.input-group input.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; min-height: 16px; }
.field-hint { color: var(--text-muted); font-size: 12.5px; margin-top: 8px; }
.honeypot-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }

.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result Section ---------- */
.result-section { display: none; margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--border); }
.result-section.visible { display: block; animation: fadeSlide .25s ease; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.score-tile { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.score-tile .score-num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--brand); }
.score-tile .score-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.verdict-badge { display: inline-flex; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.verdict-low { background: #fee2e2; color: #991b1b; }
.verdict-moderate { background: #fef3c7; color: #92400e; }
.verdict-good { background: #dcfce7; color: #166534; }
.verdict-high { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .verdict-low { background: #3b1414; color: #fca5a5; }
[data-theme="dark"] .verdict-moderate { background: #3a2c0c; color: #fcd34d; }
[data-theme="dark"] .verdict-good { background: #0f2e1c; color: #86efac; }
[data-theme="dark"] .verdict-high { background: #10234a; color: #93c5fd; }
.result-explanation { font-size: 14.5px; }
.result-recs { margin: 0; padding-left: 20px; }
.result-recs li { margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.result-actions .btn { font-size: 13.5px; padding: 9px 14px; }
.result-meta { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

.post-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; justify-content: center; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-top: 14px; display: none; }
.alert.visible { display: block; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
[data-theme="dark"] .alert-error { background: #3b1414; color: #fca5a5; border-color: #5b1e1e; }

/* ---------- Reference Links Strip ---------- */
.ref-strip { padding: 40px 0; background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ref-strip h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); text-align: center; margin-bottom: 18px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; }
.ref-grid a { font-size: 13.5px; padding: 8px 10px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-grid a:hover { background: var(--bg-elevated); }

/* ---------- Generic Section ---------- */
section.page-section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head .kicker { color: var(--brand); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: block; }
.section-head h2 { font-size: clamp(24px, 3.4vw, 34px); }

/* ---------- Features ---------- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 20px; font-weight: 700; }
.feature-card h3 { font-size: 17px; }
.feature-card p { font-size: 14px; margin: 0; }

/* ---------- How it Works ---------- */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: step; }
.step-card { position: relative; padding-left: 4px; }
.step-num { width: 38px; height: 38px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--font-display); margin-bottom: 14px; }
.step-card h3 { font-size: 16.5px; }
.step-card p { font-size: 13.5px; }

/* ---------- Article / SEO copy ---------- */
.article-block { max-width: 780px; margin: 0 auto; }
.article-block p { font-size: 15px; }
.article-block h2 { font-size: 22px; margin-top: 1.2em; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 18px 4px; display: flex; justify-content: space-between; align-items: center; gap: 14px; font-family: var(--font-display); font-weight: 600; font-size: 15.5px; color: var(--text); }
.faq-q .chev { flex-shrink: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.faq-item.open .faq-a { max-height: 240px; }
.faq-a p { padding: 0 4px 18px; font-size: 14.5px; }

/* ---------- CTA ---------- */
.cta-section { background: linear-gradient(135deg, var(--brand), #6d3ff0); border-radius: var(--radius); margin: 0 20px; padding: 52px 32px; text-align: center; color: #fff; }
.cta-section h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); }
.cta-section p { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 26px; }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-buttons .btn-outline { border-color: rgba(255,255,255,.5); color: #fff; }
.cta-buttons .btn-outline:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.cta-buttons .btn-primary { background: #fff; color: var(--brand-dark); }
.cta-buttons .btn-primary:hover { background: #f2f2f2; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 56px 0 24px; margin-top: 70px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer-col h4 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { font-size: 13.5px; color: var(--text); }
.footer-col a:hover { color: var(--brand); }
.footer-brand p { font-size: 13.5px; max-width: 260px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 40px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--text-muted); }
.footer-bottom .legal-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-disclaimer { font-size: 12px; color: var(--text-muted); max-width: 900px; margin: 18px auto 0; text-align: center; line-height: 1.6; }

/* ---------- Cookie Banner ---------- */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin: 0 auto;
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: var(--radius); padding: 18px 20px; z-index: 999; display: none;
}
.cookie-banner.visible { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; animation: fadeSlide .2s ease; }
.cookie-banner p { margin: 0; font-size: 13px; flex: 1; min-width: 200px; }
.cookie-banner .cookie-actions { display: flex; gap: 8px; }
.cookie-banner .btn { padding: 8px 14px; font-size: 13px; }

/* ---------- Toast (share/copy feedback) ---------- */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: var(--radius-sm); font-size: 13.5px; box-shadow: var(--shadow-lg); z-index: 1000; opacity: 0; transform: translateY(10px); transition: all .25s ease; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateY(0); }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .cta-section { margin: 0 12px; padding: 36px 20px; }
  .top-bar .container { font-size: 12px; }
  .checker-card { padding: 20px; }
}

/* Mobile slide-out menu */
.mobile-nav {
  position: fixed; inset: 0; background: var(--bg); z-index: 300; transform: translateX(100%);
  transition: transform .25s ease; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mobile-nav a, .mobile-nav button.mnav-toggle {
  display: block; width: 100%; text-align: left; padding: 13px 10px; border-radius: 8px; border: none;
  background: none; color: var(--text); font-size: 15px; font-weight: 500;
}
.mobile-nav .mnav-group { border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 4px; }
.mobile-nav .mnav-sub { display: none; padding-left: 12px; }
.mobile-nav .mnav-group.open .mnav-sub { display: block; }
