:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3f9;
  --ink: #14283f;
  --muted: #64748b;
  --line: #dbe4ef;
  --navy: #0f2744;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --teal-soft: #e6f4f1;
  --amber: #b45309;
  --amber-soft: #fff4d6;
  --red: #b42318;
  --red-soft: #fef0ef;
  --green: #157347;
  --green-soft: #e8f5ee;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(15, 39, 68, 0.07);
  --shadow-soft: 0 2px 7px rgba(15, 39, 68, 0.05);
  --font: "Segoe UI", "Inter", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.88em; }
h1, h2, h3 { line-height: 1.18; color: var(--navy); margin: 0 0 10px; }
h1 { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -0.02em; }
h2 { font-size: 24px; letter-spacing: -0.01em; }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }
.container { width: min(1140px, calc(100% - 40px)); margin: 0 auto; }
.main { padding: 34px 0 60px; min-height: 68vh; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.lead { font-size: 18px; color: #43546a; max-width: 760px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── верхняя панель ───────────────────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.1) blur(10px);
}
.topbar-inner {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand:hover { color: var(--navy); }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--teal), #0a4d48);
  color: white; font-weight: 800; font-size: 22px;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text strong { font-size: 18px; letter-spacing: 0.04em; }
.brand-text small { color: var(--muted); font-size: 12px; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14.5px; font-weight: 600; }
.nav a { color: #44576e; }
.nav a:hover { color: var(--teal); }
.badge {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px;
  background: var(--surface-soft); color: #42566e; font-size: 12px; font-weight: 600;
}
.badge-demo { background: var(--amber-soft); color: #7a4b00; }
.demo-strip {
  background: #fff9e8; border-bottom: 1px solid #f3dfad; color: #6b4b08;
  font-size: 13.5px; padding: 9px 0;
}
.demo-strip code { background: rgba(255,255,255,.65); padding: 1px 5px; border-radius: 4px; }
.beta-strip {
  background: #eef6ff; border-bottom: 1px solid #cfe4fb; color: #274a6a;
  font-size: 13px; padding: 8px 0;
}
.nav-logout { margin: 0; }
.nav-button {
  border: 1px solid var(--line); background: white; color: #52657c;
  border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.nav-button:hover { border-color: var(--teal); color: var(--teal); }
.login-wrap { display: grid; place-items: center; padding: 30px 0 60px; }
.login-card { width: min(460px, 100%); padding: 34px; text-align: left; }
.login-mark {
  width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(145deg, var(--teal), #0a4d48);
  color: white; display: grid; place-items: center; font-size: 28px; font-weight: 800;
  margin-bottom: 18px; box-shadow: 0 8px 20px rgba(15,118,110,.25);
}
.login-card h1 { font-size: 32px; margin-bottom: 10px; }
.login-button { width: 100%; margin-top: 16px; }
.login-note { margin-top: 18px; }
.legal-page { max-width: 880px; margin: 0 auto; }
.legal-page h2 { margin-top: 26px; font-size: 20px; }
.legal-page ul { color: #41556d; }
.legal-page .result-actions { margin-top: 28px; }

/* ── шаги ─────────────────────────────────────────────────────────────── */
.steps {
  list-style: none; display: flex; align-items: center; gap: 10px;
  margin: 0 0 28px; padding: 0; flex-wrap: wrap;
}
.step { display: flex; align-items: center; gap: 8px; color: #8190a5; font-size: 14px; }
.step:not(:last-child)::after {
  content: ""; width: 38px; height: 1px; background: var(--line); margin-left: 8px;
}
.step-number {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: #e8edf5; color: #6c7d92; font-size: 12px; font-weight: 700;
}
.step.active { color: var(--teal); font-weight: 700; }
.step.active .step-number { background: var(--teal); color: white; }
.step.done { color: var(--green); }
.step.done .step-number { background: var(--green-soft); color: var(--green); }
.step.done::after { background: #b7d9c8; }

/* ── герой ────────────────────────────────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 34px; align-items: start;
  margin: 10px 0 30px;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; color: var(--teal);
  text-transform: uppercase; letter-spacing: 0.09em; font-size: 12px; font-weight: 800;
  margin-bottom: 12px;
}
.eyebrow .icon { flex: 0 0 auto; }
.hero-card {
  background: linear-gradient(160deg, #0f2744, #163e60);
  color: #e8f0f8; border-radius: 18px; padding: 24px 26px;
  box-shadow: 0 18px 44px rgba(15, 39, 68, 0.18);
}
.hero-card-title { display: flex; align-items: center; gap: 9px; font-weight: 700; margin-bottom: 14px; }
.hero-card .check-list li { color: #d7e4f1; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 24px; margin: 9px 0; }
.check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: #5eead4; font-weight: 800;
}
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.side-stack { display: grid; gap: 18px; }

/* ── карточки и формы ─────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-soft);
}
.form-card { padding: 28px; }
.muted-card { background: #fbfcfe; }
.field-label { display: block; font-weight: 700; font-size: 14px; margin: 0 0 8px; color: #2a405b; }
textarea, input[type=text], input[type=url], input[type=password], input[type=number], select {
  width: 100%; border: 1px solid #cbd6e3; border-radius: 10px; background: white;
  padding: 11px 13px; font: inherit; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 70px; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.13);
}
.examples { margin: 16px 0 20px; }
.examples-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.example-list { display: flex; flex-wrap: wrap; gap: 8px; }
.example-chip, .option-chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: #f8fafc; color: #3e5370; border-radius: 999px; padding: 7px 12px;
  font: inherit; font-size: 13px; cursor: pointer; transition: all .15s;
}
.example-chip:hover, .option-chip:hover { border-color: #9ccfc8; background: var(--teal-soft); }
.option-chip.chosen { border-color: var(--teal); background: var(--teal); color: white; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid transparent; padding: 10px 16px;
  font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer;
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--teal); color: white; box-shadow: 0 6px 16px rgba(15, 118, 110, 0.2); }
.btn-primary:hover { background: var(--teal-dark); color: white; }
.btn-secondary { background: var(--surface); border-color: #b9c8d9; color: var(--navy); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--navy); }
.btn-lg { padding: 13px 22px; font-size: 15.5px; border-radius: 11px; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.page-head { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 8px; }
.request-quote {
  background: #eef4fb; border: 1px solid #d9e5f4; border-left: 4px solid #6ba7d8;
  border-radius: 10px; padding: 14px 18px; margin: 0 0 22px;
}
.request-quote p { margin: 4px 0 0; color: #334963; }
.quote-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b809a; font-weight: 800; }
.notice {
  display: flex; gap: 10px; align-items: flex-start; border-radius: 10px;
  padding: 12px 14px; margin: 16px 0; font-size: 14px;
}
.notice .icon { flex: 0 0 auto; margin-top: 1px; }
.notice-info { background: #eef6ff; border: 1px solid #cfe4fb; color: #274a6a; }
.notice-error { background: var(--red-soft); border: 1px solid #f5c7c3; color: #7a271a; }
.pill {
  display: inline-block; background: #eff4fa; color: #3b5370; border-radius: 999px;
  padding: 4px 10px; font-size: 12.5px; font-weight: 600; margin: 0 5px 5px 0;
}
.connector-pills { margin: 8px 0 12px; }
.small-pills .pill { font-size: 11.5px; }
.mini-steps { list-style: none; padding: 0; margin: 12px 0; }
.mini-steps li { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; color: #3a506b; }
.mini-steps li span {
  width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 800; flex: 0 0 auto;
}
.mini-steps.compact li { margin: 7px 0; font-size: 14px; }

/* ── подключения ──────────────────────────────────────────────────────── */
.connector-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.connector-card {
  position: relative; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 18px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.connector-card:hover { border-color: #a9c7d8; box-shadow: var(--shadow-soft); }
.connector-card.selected { border-color: var(--teal); background: #f6fcfb; box-shadow: 0 0 0 3px rgba(15, 118, 110, .08); }
.connector-check { position: absolute; opacity: 0; pointer-events: none; }
.connector-main { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.connector-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--teal-soft); color: var(--teal);
  display: grid; place-items: center; flex: 0 0 auto;
}
.connector-card.selected .connector-icon { background: var(--teal); color: white; }
.connector-copy { display: flex; flex-direction: column; gap: 3px; padding-right: 18px; }
.connector-title { font-weight: 750; color: var(--navy); font-size: 16px; }
.connector-desc { color: var(--muted); font-size: 13px; line-height: 1.45; }
.connector-state {
  position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); color: transparent; display: grid; place-items: center;
}
.connector-card.selected .connector-state { background: var(--teal); border-color: var(--teal); color: white; }
.connector-badge {
  display: inline-block; margin-top: 12px; font-size: 11px; font-weight: 700;
  color: #8a5a0b; background: #fff8e6; border-radius: 999px; padding: 3px 8px;
}
.connector-badge.local { color: var(--green); background: var(--green-soft); }
.connector-extra {
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.connector-extra label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.connector-extra select { font-size: 13px; padding: 8px 10px; }
.connector-extra .small { margin: 7px 0 0; }

/* ── вопросы ──────────────────────────────────────────────────────────── */
.questions-card { padding: 8px 28px 28px; }
.question-block { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.question-block:last-of-type { border-bottom: none; }
.question-number {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: white;
  display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: 0 0 auto;
}
.question-body { flex: 1; }
.question-body h3 { font-size: 17px; margin-bottom: 4px; }
.option-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.question-body textarea { margin-top: 8px; }
.field-hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ── сборка ───────────────────────────────────────────────────────────── */
.build-status { display: flex; flex-direction: column; gap: 20px; }
.build-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.build-head h1 { margin-bottom: 8px; }
.status-pill {
  display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 750; white-space: nowrap; background: var(--surface-soft); color: #42566e;
}
.status-building { background: #e9f2ff; color: #1f5f9e; }
.status-done { background: var(--green-soft); color: var(--green); }
.status-failed { background: var(--red-soft); color: var(--red); }
.status-questions, .status-ready { background: #fff6df; color: #88570a; }
.progress-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.progress { height: 10px; background: #e8eef6; border-radius: 999px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #2bb3a5);
  transition: width .45s ease;
}
.progress-failed .progress-bar { background: linear-gradient(90deg, #b42318, #e05a4e); }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.stage-track {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.stage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #7a8a9e; font-weight: 600; }
.stage-icon {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #eef2f8; color: #8a99ac; flex: 0 0 auto;
}
.stage-done { color: var(--green); }
.stage-done .stage-icon { background: var(--green-soft); color: var(--green); }
.stage-active { color: var(--teal); }
.stage-active .stage-icon { background: var(--teal); color: white; animation: pulse 1.6s infinite; }
.stage-failed { color: var(--red); }
.stage-failed .stage-icon { background: var(--red-soft); color: var(--red); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #b4c0cf; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(15,118,110,.35); } 50% { box-shadow: 0 0 0 7px rgba(15,118,110,0); } }
.result-notice { align-items: flex-start; margin: 0; }
.result-notice p { margin: 6px 0 12px; }
.result-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.success-card {
  display: flex; gap: 18px; align-items: flex-start; padding: 24px;
  background: linear-gradient(135deg, #effaf5, #f7fcfa);
  border: 1px solid #bfe4d2; border-radius: 16px;
}
.success-icon {
  width: 54px; height: 54px; border-radius: 50%; background: var(--green); color: white;
  display: grid; place-items: center; flex: 0 0 auto;
}
.success-copy h2 { margin-bottom: 6px; }
.result-grid { margin-top: 0; }
.hash-box {
  display: flex; gap: 10px; align-items: center; background: #f7f9fc;
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px;
}
.hash-box code { overflow-wrap: anywhere; color: #2f4560; font-size: 12px; flex: 1; }
.copy-button {
  border: 1px solid var(--line); background: white; border-radius: 7px; padding: 6px 9px;
  font: inherit; font-size: 12px; cursor: pointer; color: #405776;
}
.copy-button:hover { border-color: var(--teal); color: var(--teal); }
.details-card summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.instructions {
  white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 9px; padding: 14px; font-size: 12.5px; line-height: 1.55; overflow: auto;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 7px; border-bottom: 1px solid #edf1f6; }
.table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.compact-table { font-size: 13px; }
.cost-total { text-align: right; margin: 8px 0 0; }
.event-list { list-style: none; padding: 0; margin: 6px 0 0; }
.event-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #edf1f6; }
.event-dot { width: 7px; height: 7px; border-radius: 50%; background: #9db2c8; margin-top: 7px; flex: 0 0 auto; }
.event-error .event-dot { background: var(--red); }
.event-list time { margin-left: auto; color: #96a5b8; font-size: 11px; white-space: nowrap; }
.build-hint { margin: 0; }

/* ── каталог и проекты ────────────────────────────────────────────────── */
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.catalog-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-soft); transition: transform .15s, box-shadow .15s;
}
.catalog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.catalog-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.catalog-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--teal-soft);
  color: var(--teal); display: grid; place-items: center;
}
.catalog-card h2 { font-size: 20px; margin-bottom: 8px; }
.catalog-card p { color: #4b6079; font-size: 14px; }
.catalog-request {
  background: #f8fafc; border-left: 3px solid #c9d8e8; padding: 10px 12px;
  font-size: 12.5px; color: #5b6f86; border-radius: 4px; margin: 10px 0 16px; flex: 1;
}
.catalog-card .btn { margin-top: auto; }
.project-list { display: grid; gap: 10px; }
.project-row {
  display: flex; align-items: center; gap: 18px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.project-row:hover { border-color: #a9c7d8; box-shadow: var(--shadow-soft); color: var(--ink); }
.project-main { flex: 1; min-width: 0; }
.project-title { font-weight: 750; color: var(--navy); margin-bottom: 3px; }
.project-request { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-meta { display: flex; align-items: center; gap: 12px; }
.project-arrow { color: #9aacbe; }
.empty-state { text-align: center; padding: 35px 25px; }
.empty-icon {
  width: 54px; height: 54px; border-radius: 50%; background: var(--teal-soft); color: var(--teal);
  display: grid; place-items: center; margin: 0 auto 14px;
}
.error-page { max-width: 780px; margin: 20px auto; padding: 36px; }
.error-page h1 { margin-top: 8px; }
.error-icon { background: var(--red-soft); color: var(--red); }
.technical { margin-top: 24px; }
.technical summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.technical pre {
  white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px; font-size: 12px; max-height: 300px; overflow: auto;
}

/* ── футер ───────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); background: #fbfcfe; padding: 22px 0; color: var(--muted); font-size: 12.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-note { max-width: 620px; }

/* ── адаптив ─────────────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero, .grid-2 { grid-template-columns: 1fr; }
  .connector-grid, .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-track { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; }
}
@media (max-width: 620px) {
  .container { width: calc(100% - 24px); }
  .main { padding-top: 20px; }
  .topbar-inner { min-height: 64px; }
  .brand-text small { display: none; }
  .nav { gap: 12px; font-size: 13px; }
  .connector-grid, .catalog-grid { grid-template-columns: 1fr; }
  .connector-card { padding: 15px; }
  .steps { gap: 4px; }
  .step:not(:last-child)::after { width: 10px; margin-left: 2px; }
  .step-label { display: none; }
  .question-block { gap: 12px; }
  .questions-card { padding: 4px 18px 18px; }
  .build-head { flex-direction: column; }
  .success-card { flex-direction: column; }
  .project-row { flex-wrap: wrap; }
  .project-meta { order: 3; width: 100%; }
  .hero-card { padding: 20px; }
}
