:root {
  --bg: #0B1220;
  --panel: #131B2E;
  --panel2: #17213A;
  --blue: #6AA1FF;
  --green: #42D392;
  --gold: #FFD166;
  --text: #E8ECF8;
  --muted: #9AA8C7;
  --danger: #FF6B6B;
  --line: rgba(232, 236, 248, 0.12);
  --shadow: 0 24px 70px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: radial-gradient(circle at top left, rgba(106,161,255,.16), transparent 30%), var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .23;
  background-image:
    linear-gradient(rgba(106,161,255,.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(106,161,255,.12) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(11, 18, 32, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--bg);
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: 0 0 28px rgba(106,161,255,.45);
}
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: -3px; }
.nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav a, .footer a { color: var(--muted); text-decoration: none; }
.nav a:hover, .footer a:hover { color: var(--blue); }
.version { color: var(--gold); font-size: 13px; }

main { max-width: 1440px; margin: 0 auto; padding: 0 28px 48px; }
.hero {
  min-height: 580px;
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 28px;
  align-items: center;
  padding: 72px 0 46px;
}
h1 { font-size: clamp(40px, 6vw, 82px); line-height: .96; margin: 0 0 22px; letter-spacing: -.05em; }
h2 { font-size: clamp(26px, 3vw, 40px); line-height: 1.05; margin: 0 0 10px; letter-spacing: -.03em; }
h3 { margin: 12px 0 8px; font-size: 22px; }
p { color: var(--muted); margin: 0; }
.lead { font-size: 20px; max-width: 820px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 800; margin-bottom: 10px; }
.hero-actions, .button-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }

.btn {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 18px;
  color: var(--text);
  background: rgba(232,236,248,.05);
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
  box-shadow: none;
}
.btn.primary { background: linear-gradient(135deg, var(--blue), #427BFF); color: white; border-color: transparent; box-shadow: 0 0 26px rgba(106,161,255,.28); }
.btn.ghost:hover { border-color: rgba(106,161,255,.55); color: white; }
.btn.ok { background: rgba(66,211,146,.14); border-color: rgba(66,211,146,.4); color: var(--green); }
.btn.disabled { opacity: .42; cursor: not-allowed; }
.btn.wide { width: 100%; margin-top: 18px; }

.control-card, .panel, .workflow-card, .download-strip {
  background: linear-gradient(180deg, rgba(19,27,46,.92), rgba(15,22,38,.92));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.control-card { padding: 26px; }
.control-header { display: flex; gap: 10px; align-items: center; font-weight: 900; margin-bottom: 16px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
.rule-list { margin: 0; padding-left: 20px; color: var(--text); }
.rule-list li { margin: 10px 0; }
.section { padding: 34px 0; }
.section-head { margin-bottom: 22px; }
.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.workflow-card {
  text-align: left;
  padding: 24px;
  color: var(--text);
  cursor: pointer;
  min-height: 198px;
}
.workflow-card:hover, .workflow-card.active { border-color: rgba(106,161,255,.55); transform: translateY(-2px); box-shadow: 0 0 32px rgba(106,161,255,.14); }
.tag { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.tag.danger { color: #FFD6D6; background: rgba(255,107,107,.16); }
.tag.ok { color: var(--green); background: rgba(66,211,146,.14); }
.tag.gold { color: var(--gold); background: rgba(255,209,102,.14); }
.tag.blue { color: var(--blue); background: rgba(106,161,255,.14); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.panel { padding: 24px; }
.panel-head { margin-bottom: 18px; }
.row-between { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; color: var(--gold); background: rgba(255,209,102,.13); border: 1px solid rgba(255,209,102,.25); }
.status-pill.ok { color: var(--green); background: rgba(66,211,146,.13); border-color: rgba(66,211,146,.3); }
.upload-zone {
  position: relative;
  border: 1px dashed rgba(106,161,255,.45);
  border-radius: 24px;
  background: rgba(106,161,255,.05);
  min-height: 190px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone strong { display: block; font-size: 19px; }
.upload-zone span { display: block; color: var(--muted); margin-top: 8px; }
.file-list { margin-top: 16px; display: grid; gap: 10px; }
.file-row { display: flex; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; color: var(--muted); background: rgba(232,236,248,.04); }
.viewer {
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(circle at center, rgba(106,161,255,.11), rgba(0,0,0,.12));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
}
.viewer-empty { text-align: center; max-width: 420px; padding: 24px; }
.viewer-empty strong { display: block; font-size: 24px; margin-bottom: 8px; }
.scan-line { position: absolute; inset: 0; background: linear-gradient(transparent, rgba(106,161,255,.07), transparent); animation: scan 5s infinite linear; }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(100%); } }
.field-label { display: block; margin: 14px 0 6px; color: var(--muted); font-weight: 800; }
.field {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: rgba(232,236,248,.05); color: var(--text); outline: none;
}
.field:focus { border-color: rgba(106,161,255,.65); box-shadow: 0 0 0 3px rgba(106,161,255,.12); }
.textarea { resize: vertical; }
.preview-box {
  min-height: 325px;
  background: #F7F9FC;
  color: #1E2A3A;
  border-radius: 18px;
  padding: 22px;
  overflow: auto;
}
.preview-box h3 { color: #0B3A6A; margin-top: 0; }
.preview-box p, .preview-box li { color: #334155; }
.preview-box .doc-status { color: #B42318; font-weight: 900; }
.download-strip { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 28px; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.check { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: rgba(232,236,248,.04); }
.check strong { display: block; margin-bottom: 8px; }
.check span { color: var(--muted); }
.check.ok span { color: var(--green); }
.check.warn span { color: var(--gold); }
.footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: rgba(11, 18, 32, .7);
}

@media (max-width: 980px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .workflow-grid, .check-grid { grid-template-columns: 1fr 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .download-strip, .footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
  main { padding: 0 16px 32px; }
  .workflow-grid, .check-grid { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
}
