/* MKRouterKit — Styles v2 */

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

:root {
  --bg:        #0f1117;
  --bg2:       #161b27;
  --surface:   #1a2035;
  --surface2:  #1f2740;
  --border:    rgba(255,255,255,.08);
  --border-md: rgba(255,255,255,.14);
  --text:      #e8eaf0;
  --text2:     #8b93a8;
  --text3:     #545d72;
  --radius:    8px;
  --radius-sm: 5px;
  --accent:    #3b82f6;
  --accent-dim:#1e3a5f;
  --c-green:   #22c55e;
  --c-red:     #ef4444;
  --c-orange:  #f97316;
  --c-yellow:  #eab308;
  --c-blue:    #3b82f6;
  --c-purple:  #a855f7;

  --c-crit:     #ef4444; --c-crit-bg: rgba(239,68,68,.12);  --c-crit-text: #fca5a5;
  --c-high:     #f97316; --c-high-bg: rgba(249,115,22,.12); --c-high-text: #fdba74;
  --c-med:      #eab308; --c-med-bg:  rgba(234,179,8,.12);  --c-med-text:  #fde047;
  --c-low:      #3b82f6; --c-low-bg:  rgba(59,130,246,.12); --c-low-text:  #93c5fd;
  --c-info:     #6b7280; --c-info-bg: rgba(107,114,128,.12);--c-info-text: #d1d5db;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Layout ─────────────────────────────────────────────── */
.container { max-width: 940px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  background: rgba(15,17,23,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: .85rem 0;
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}
.site-logo {
  font-size: 17px; font-weight: 700;
  text-decoration: none; color: var(--text);
  letter-spacing: -.3px;
}
.logo-mk { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav a { font-size: 14px; color: var(--text2); text-decoration: none; transition: color .12s; }
.site-nav a:hover { color: var(--text); }

/* ── Main ───────────────────────────────────────────────── */
.site-main { flex: 1; padding: 2.5rem 0 4rem; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: 13px; color: var(--text3);
}
.site-footer .container { display: flex; align-items: center; justify-content: space-between; }
.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { color: var(--text3); text-decoration: none; }
.footer-nav a:hover { color: var(--text2); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500; padding: 8px 18px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-md);
  background: var(--surface); color: var(--text);
  text-decoration: none; transition: all .12s; white-space: nowrap;
}
.btn:hover  { border-color: var(--border-md); background: var(--surface2); }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #2563eb; border-color: #2563eb; }

.btn-danger {
  background: rgba(239,68,68,.15); color: var(--c-red);
  border-color: rgba(239,68,68,.3);
}
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-sm   { font-size: 13px; padding: 5px 12px; }
.btn-full { width: 100%; text-align: center; display: block; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  margin-bottom: 5px; color: var(--text2);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
textarea {
  width: 100%; padding: 9px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border-md); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); transition: border-color .12s;
}
.form-group input:focus,
.form-group select:focus,
textarea:focus { outline: none; border-color: var(--accent); }

.form-row {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 1rem; font-size: 13px;
}
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.field-error { display: block; font-size: 12px; color: var(--c-red); margin-top: 4px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 1rem; border-left: 3px solid;
}
.alert-error   { background: var(--c-crit-bg); color: var(--c-crit-text); border-color: var(--c-crit); }
.alert-success { background: rgba(34,197,94,.12); color: #86efac; border-color: var(--c-green); }
.alert-info    { background: var(--c-low-bg); color: var(--c-low-text); border-color: var(--c-blue); }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem;
}
.card-title {
  font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 1rem;
}

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding: 2rem 0; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  width: 100%; max-width: 420px;
}
.auth-card h1 { font-size: 20px; margin-bottom: 1.5rem; }
.auth-alt { text-align: center; font-size: 13px; color: var(--text2); margin-top: 1.25rem; }
.auth-alt a    { color: var(--text); }
.auth-desc     { font-size: 14px; color: var(--text2); margin-bottom: 1.25rem; }
.link-muted    { font-size: 13px; color: var(--text3); text-decoration: none; }
.link-muted:hover { color: var(--text2); }
.verify-icon   { font-size: 48px; color: var(--c-green); margin-bottom: .5rem; }

/* ── Home hero ───────────────────────────────────────────── */
.hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-dim); border: 1px solid rgba(59,130,246,.25);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700; line-height: 1.2;
  letter-spacing: -.5px; margin-bottom: 1rem;
  max-width: 640px;
}
.hero h1 span { color: var(--accent); }
.hero-desc {
  font-size: 1.05rem; color: var(--text2); max-width: 520px;
  margin-bottom: 2rem; line-height: 1.65;
}
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Stats bar ───────────────────────────────────────────── */
.stats-bar {
  display: flex; gap: 2rem; flex-wrap: wrap;
  padding: 1.5rem 0; border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.stat-item { }
.stat-num  { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-lbl  { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ── Feature grid ────────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.feature-item {
  background: var(--surface); padding: 1.5rem;
}
.feature-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 1rem;
  background: var(--surface2);
}
.feature-item h3 { font-size: 15px; font-weight: 600; margin-bottom: .4rem; }
.feature-item p  { font-size: 13px; color: var(--text2); line-height: 1.55; }

/* ── Sample findings (home page teaser) ──────────────────── */
.sample-findings { margin-bottom: 2.5rem; }
.sample-findings h2 {
  font-size: 18px; font-weight: 600; margin-bottom: .4rem;
}
.sample-findings .sub {
  font-size: 14px; color: var(--text2); margin-bottom: 1.25rem;
}
.finding-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 6px; background: var(--surface);
  font-size: 13px;
}
.finding-row + .finding-row { border-top: none; margin-top: -1px; border-radius: 0; }
.finding-row:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.finding-row:first-child { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.f-sev {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; white-space: nowrap;
}
.f-sev.crit { background: var(--c-crit-bg); color: var(--c-crit-text); border: 1px solid rgba(239,68,68,.3); }
.f-sev.high { background: var(--c-high-bg); color: var(--c-high-text); border: 1px solid rgba(249,115,22,.3); }
.f-sev.med  { background: var(--c-med-bg);  color: var(--c-med-text);  border: 1px solid rgba(234,179,8,.3);  }
.f-sev.low  { background: var(--c-low-bg);  color: var(--c-low-text);  border: 1px solid rgba(59,130,246,.3); }
.f-sev.info { background: var(--c-info-bg); color: var(--c-info-text); border: 1px solid rgba(107,114,128,.3);}
.f-name     { flex: 1; color: var(--text); }
.f-id       { font-family: monospace; font-size: 11px; color: var(--text3); }
.f-blur     { filter: blur(5px); pointer-events: none; opacity: .5; }

/* ── Audit page ──────────────────────────────────────────── */
textarea.config-input {
  width: 100%; height: 180px;
  font-family: 'SF Mono','Fira Code','Consolas', monospace;
  font-size: 12px; line-height: 1.55; resize: vertical;
  background: var(--bg); border: 1px solid var(--border-md);
  color: var(--text); border-radius: var(--radius-sm); padding: .75rem;
}

.drop-zone {
  border: 2px dashed var(--border-md); border-radius: var(--radius);
  padding: 1.75rem; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; margin-bottom: .75rem;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-dim); }
.drop-zone .dz-icon { font-size: 24px; margin-bottom: .4rem; }
.drop-zone .dz-main { font-size: 14px; font-weight: 500; }
.drop-zone .dz-sub  { font-size: 12px; color: var(--text3); margin-top: 3px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: .75rem; align-items: center; }
.file-name { font-size: 12px; color: var(--text3); margin-left: 4px; }

/* ── Score donut ─────────────────────────────────────────── */
.score-grid { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.score-donut { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.score-donut canvas { position: absolute; top: 0; left: 0; }
.score-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-num { font-size: 22px; font-weight: 700; line-height: 1; }
.score-lbl { font-size: 10px; color: var(--text3); margin-top: 2px; }

.score-breakdown { display: flex; gap: 1rem; flex-wrap: wrap; }
.sbc { text-align: center; }
.sbc-n { font-size: 20px; font-weight: 700; }
.sbc-l { font-size: 11px; color: var(--text2); margin-top: 1px; }
.sbc.crit .sbc-n { color: var(--c-crit); }
.sbc.high .sbc-n { color: var(--c-high); }
.sbc.med  .sbc-n { color: var(--c-med);  }
.sbc.low  .sbc-n { color: var(--c-low);  }
.sbc.info .sbc-n { color: var(--c-info); }

.meta-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: .75rem; }
.pill {
  font-size: 11px; padding: 3px 10px;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); border-radius: 20px;
}

.score-bar-wrap { margin-top: .85rem; }
.score-bar-track { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.score-bar-fill  { height: 100%; border-radius: 2px; transition: width .4s; }
.score-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text3); margin-top: 4px;
}

/* ── Findings list ───────────────────────────────────────── */
.filter-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: .85rem; }
.ftab {
  font-size: 12px; padding: 4px 11px; border-radius: 20px;
  border: 1px solid var(--border); cursor: pointer;
  color: var(--text2); background: transparent; transition: all .12s;
}
.ftab:hover  { background: var(--surface2); color: var(--text); }
.ftab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.finding {
  border-left: 3px solid; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .85rem 1rem; margin-bottom: .5rem;
}
.finding.crit { border-color: var(--c-crit); background: var(--c-crit-bg); }
.finding.high { border-color: var(--c-high); background: var(--c-high-bg); }
.finding.med  { border-color: var(--c-med);  background: var(--c-med-bg);  }
.finding.low  { border-color: var(--c-low);  background: var(--c-low-bg);  }
.finding.info { border-color: var(--c-info); background: var(--c-info-bg); }

.f-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.f-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 120px; }
.f-id    { font-family: monospace; font-size: 10px; color: var(--text3); }
.f-detail { font-size: 13px; color: var(--text2); line-height: 1.55; margin-bottom: 6px; }
.f-rem-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.f-rem {
  font-family: 'SF Mono','Fira Code','Consolas', monospace;
  font-size: 11px; background: rgba(0,0,0,.3);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 10px; color: var(--text2); white-space: pre-wrap; word-break: break-all;
}

.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.badge.crit { background: var(--c-crit-bg); color: var(--c-crit-text); border: 1px solid rgba(239,68,68,.3); }
.badge.high { background: var(--c-high-bg); color: var(--c-high-text); border: 1px solid rgba(249,115,22,.3); }
.badge.med  { background: var(--c-med-bg);  color: var(--c-med-text);  border: 1px solid rgba(234,179,8,.3);  }
.badge.low  { background: var(--c-low-bg);  color: var(--c-low-text);  border: 1px solid rgba(59,130,246,.3); }
.badge.info { background: var(--c-info-bg); color: var(--c-info-text); border: 1px solid rgba(107,114,128,.3);}

.empty { text-align: center; padding: 2rem; color: var(--text3); font-size: 13px; }

/* ── Paywall overlay ─────────────────────────────────────── */
.paywall-wrap { position: relative; }
.paywall-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 60%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding-bottom: 2rem; text-align: center;
  border-radius: var(--radius);
  pointer-events: none;
}
.paywall-overlay > * { pointer-events: all; }
.paywall-box {
  background: var(--surface); border: 1px solid var(--border-md);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  max-width: 380px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.paywall-box h3 { font-size: 16px; margin-bottom: .4rem; }
.paywall-box p  { font-size: 13px; color: var(--text2); margin-bottom: 1rem; }
.paywall-price  { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.paywall-price span { font-size: 14px; color: var(--text3); font-weight: 400; }

/* ── Pricing page ────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-top: 1.5rem;
}
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column;
}
.pricing-card.featured { border-color: var(--accent); }
.pricing-card .badge-featured {
  display: inline-block; font-size: 10px; font-weight: 700;
  background: var(--accent); color: #fff; padding: 2px 8px;
  border-radius: 20px; margin-bottom: .75rem;
}
.pricing-card h3 {
  font-size: 12px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: .5rem;
}
.pricing-card .price {
  font-size: 2rem; font-weight: 700; margin-bottom: .5rem;
}
.pricing-card p { font-size: 13px; color: var(--text2); margin-bottom: 1.25rem; flex: 1; }
.pricing-features { list-style: none; margin-bottom: 1.25rem; }
.pricing-features li { font-size: 13px; color: var(--text2); padding: 3px 0; }
.pricing-features li::before { content: '✓ '; color: var(--c-green); font-weight: 700; }

/* ── Error pages ─────────────────────────────────────────── */
.error-page { text-align: center; padding: 4rem 0; }
.error-code { font-size: 80px; font-weight: 700; color: var(--surface2); line-height: 1; margin-bottom: .5rem; }
.error-page h1 { font-size: 24px; margin-bottom: .5rem; }
.error-page p  { color: var(--text2); margin-bottom: 1.5rem; }

/* ── AI result ───────────────────────────────────────────── */
.ai-result-box {
  margin-top: 1rem; background: rgba(168,85,247,.08);
  border: 1px solid rgba(168,85,247,.25);
  border-radius: var(--radius); padding: 1rem 1.25rem;
}
.ai-result-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: .75rem;
  font-size: 12px; font-weight: 600; color: #d8b4fe;
}
.ai-model-badge {
  font-size: 10px; background: rgba(168,85,247,.15); color: #d8b4fe;
  padding: 2px 8px; border-radius: 20px; border: 1px solid rgba(168,85,247,.25);
}
.ai-content { font-size: 13px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; }

/* ── Consent Banner ──────────────────────────────────────── */
#consent-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface); border-top: 1px solid var(--border-md);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; z-index: 9999;
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
}
.consent-text { font-size: 13px; color: var(--text2); flex: 1; min-width: 200px; }
.consent-text strong { color: var(--text); margin-right: 6px; }
.consent-link { color: var(--text); margin-left: 6px; }
.consent-buttons { display: flex; gap: 8px; flex-shrink: 0; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid var(--border-md); border-top-color: var(--text);
  border-radius: 50%; animation: spin .65s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Notice ──────────────────────────────────────────────── */
.notice {
  font-size: 12px; color: var(--text3); padding: .6rem .85rem;
  background: var(--surface2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-md);
}

.export-row { display: flex; gap: 8px; justify-content: flex-end; }

/* ── Admin ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; padding: 8px 12px;
  background: var(--surface2); color: var(--text3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
tr:hover td { background: var(--surface2); }
.table-actions { display: flex; gap: 6px; }

@media print {
  .site-header .site-nav button,
  #consent-banner { display: none !important; }
}
