:root {
  --bg: #070d1a;
  --surface: #0f172a;
  --card: #131e36;
  --card-2: #0c1426;
  --border: #1e2d4d;
  --border-hi: #2b4475;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #38bdf8;
  --accent-2: #2563eb;
  --ok: #4ade80;
  --ok-bg: rgba(20, 83, 45, 0.35);
  --ok-bd: #166534;
  --warn: #fbbf24;
  --warn-bg: rgba(120, 53, 15, 0.35);
  --warn-bd: #92400e;
  --bad: #f87171;
  --bad-bg: rgba(127, 29, 29, 0.4);
  --bad-bd: #991b1b;
  --pro: #60a5fa;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -10%, #13254a 0%, #091122 42%, #060b16 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 18px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 13, 26, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.2px;
  cursor: pointer;
}
.brand:hover { text-decoration: none; }
.brand-sub {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: #0d1d38;
  border: 1px solid #1e3a5f;
  padding: 2px 8px;
  border-radius: 999px;
}
.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px 8px;
  border-radius: 8px;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); text-decoration: none; }

.lang-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.lang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.lang-btn.active {
  background: var(--accent-2);
  color: #fff;
}

/* Main area */
main { padding: 28px 0 48px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
}

.card + .card { margin-top: 16px; }

/* Hero Home */
.hero-home {
  text-align: center;
  padding: 24px 0 18px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.hero-home h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.6vw, 38px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.hero-home h1 span { color: var(--accent); }
.hero-lead {
  max-width: 630px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
}

/* Search box */
.check-form {
  display: flex;
  gap: 8px;
  max-width: 540px;
  margin: 0 auto 14px;
}
.input {
  width: 100%;
  background: var(--card-2);
  border: 1.5px solid var(--border-hi);
  color: var(--text);
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--dim); font-weight: 500; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 11px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
}
.btn:hover:not(:disabled) { opacity: 0.93; text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}
.btn-sec {
  background: #1a2744;
  color: var(--text);
  border: 1px solid var(--border-hi);
}
.btn-sec:hover:not(:disabled) { background: #23355c; }
.btn-ok {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #ffffff;
}
.btn-danger {
  background: #991b1b;
  color: #fecaca;
}
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }

.demo-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

/* Stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 26px 0;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 900; color: var(--accent); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Steps 3-col */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #152b52;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 9px;
}
.step-card h3 { margin: 0 0 6px; font-size: 14.5px; }
.step-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Certificate 1st Screen — максимально чистый и лёгкий! */
.demo-banner {
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #bae6fd;
  border-radius: 11px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}
.fraud-banner {
  background: var(--bad-bg);
  border: 1.5px solid #ef4444;
  color: #fecaca;
  border-radius: 11px;
  padding: 13px 16px;
  margin-bottom: 14px;
  font-size: 13.5px;
  font-weight: 700;
}

.cert-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.cert-code-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
  background: var(--card-2);
  border: 1px solid var(--border-hi);
  padding: 5px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.cert-code-pill:hover { border-color: var(--accent); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
}
.pill-ok { background: var(--ok-bg); color: #86efac; border: 1px solid var(--ok-bd); }
.pill-warn { background: var(--warn-bg); color: #fde68a; border: 1px solid var(--warn-bd); }
.pill-bad { background: var(--bad-bg); color: #fecaca; border: 1px solid var(--bad-bd); }
.pill-muted { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }

.cert-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}
.grade-box {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  background: var(--card-2);
  border: 2.5px solid var(--border-hi);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.grade-box.ok { border-color: #22c55e; color: var(--ok); }
.grade-box.warn { border-color: #f59e0b; color: var(--warn); }
.grade-box.bad { border-color: #ef4444; color: var(--bad); }
.grade-letter { font-size: 32px; font-weight: 900; line-height: 1; }
.grade-score { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; }

.cert-hero-info { flex: 1; min-width: 0; }
.cert-verdict {
  margin: 0 0 6px;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 800;
  line-height: 1.25;
}
.cert-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13.5px;
  color: var(--muted);
}
.cert-submeta strong { color: var(--text); }

/* 4 больших светофора */
.lights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.light-card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 12px;
}
.light-card.ok { border-color: var(--ok-bd); }
.light-card.warn { border-color: var(--warn-bd); }
.light-card.bad { border-color: var(--bad-bd); background: rgba(69, 10, 10, 0.35); }
.light-lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.light-val { font-size: 14px; font-weight: 800; line-height: 1.25; }
.light-sub { font-size: 11.5px; color: var(--dim); margin-top: 3px; }

.ok-txt { color: var(--ok); }
.warn-txt { color: var(--warn); }
.bad-txt { color: var(--bad); }
.muted-txt { color: var(--muted); }

.cert-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cert-cta-row .btn-primary { flex: 1; min-width: 240px; }

/* Аккордеон деталей (свёрнут по умолчанию!) */
.acc-wrap { margin-top: 18px; }
.acc-hint {
  font-size: 12px;
  color: var(--dim);
  margin: 0 0 8px 2px;
  font-weight: 600;
}
details.acc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 9px;
}
details.acc[open] { border-color: var(--border-hi); }
details.acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  user-select: none;
  font-weight: 700;
  font-size: 14px;
}
details.acc > summary::-webkit-details-marker { display: none; }
.acc-left { display: flex; align-items: center; gap: 9px; }
.acc-chev {
  color: var(--accent);
  font-size: 13px;
  transition: transform 0.18s ease;
}
details.acc[open] > summary .acc-chev { transform: rotate(90deg); }
.acc-badge { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.acc-body {
  padding: 6px 16px 16px;
  border-top: 1px solid var(--border);
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(30, 45, 77, 0.55);
  font-size: 13.5px;
}
.kv-row:last-child { border-bottom: none; }
.kv-k { color: var(--muted); }
.kv-v { font-weight: 700; text-align: right; }

.ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.ai-tile {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 10px;
}
.ai-tile.ok { border-color: var(--ok-bd); }
.ai-tile.warn { border-color: var(--warn-bd); }
.ai-tile.bad { border-color: var(--bad-bd); }
.ai-tile.pro { border-color: #2563eb; }
.ai-name { font-size: 13px; font-weight: 700; }
.ai-st { font-size: 12px; font-weight: 700; margin-top: 2px; }

.hash-box {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  margin-top: 8px;
}

/* Diff table (Арбитраж) */
.diff-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13.5px;
}
.diff-table th, .diff-table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
}
.diff-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }

/* PNG Cover Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 7, 18, 0.78);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  padding: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-head h3 { margin: 0; font-size: 17px; }
.cover-canvas-wrap {
  background: #060b16;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  margin: 12px 0;
}
.cover-canvas-wrap canvas { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 0 auto; }

/* Admin & Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 5px;
}
.select, .textarea {
  width: 100%;
  background: var(--card-2);
  border: 1.5px solid var(--border-hi);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
}
.textarea {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  resize: vertical;
}

.notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  color: var(--dim);
  font-size: 12.5px;
}
.footer-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

.hidden { display: none !important; }

@media (max-width: 700px) {
  .lights-grid { grid-template-columns: 1fr 1fr; }
  .stats-strip, .steps-grid, .form-grid { grid-template-columns: 1fr; }
  .check-form { flex-direction: column; }
  .cert-hero { flex-direction: column; text-align: center; }
  .cert-submeta { justify-content: center; }
  .nav-hide-sm { display: none; }
}
