/* AurexScan — сайт. Дизайн-система: токены, база, компоненты.
 *
 * Оформление — как у Mini App (решение владельца 03.10.2026): Manrope,
 * тёплый фон, белые карточки, графит и приглушённый изумруд. Цвет несёт
 * балл (шкала tone), без градиентов и свечений.
 */

/* Токены те же, что у Mini App (слой «Версия 212» в webapp/index.html):
 * тёплый серый фон, белые карточки с тонкой рамкой, графитовые кнопки,
 * приглушённый изумруд. Имена --card, --brand, --track, --tint общие — общие
 * модули Mini App (Морфер, ассистент) красятся ими же. Тема по умолчанию
 * светлая, системную не спрашиваем — как в Mini App. */
:root {
  --bg: #f4f4f2;
  --bg-soft: #ecece9;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --card: #ffffff;
  --ink: #151618;
  --ink-2: #4a4c50;
  --muted: #7b7d82;
  --faint: #a4a5a8;
  --line: #e5e5e1;
  --line-strong: #d6d6d2;
  --accent: #12151a;
  --on-accent: #ffffff;
  --focus: #2f7a61;
  --good: #0d7a55;
  --mid: #ac803e;
  --bad: #ac4e4a;
  --track: #ebebe8;
  --brand: #2f7a61;
  --brand-soft: #b4d8c5;
  --tint: #e7f1ec;
  --tint-ink: #1f5c47;
  --gold-bg: #f6ebcf;
  --gold-line: #e8d4a0;
  --gold-ink: #7a5710;
  --gold: #b98a1f;
  --shadow: 0 1px 2px rgba(20, 20, 20, .04);
  --shadow-lift: 0 1px 2px rgba(20, 20, 20, .05), 0 10px 28px rgba(20, 20, 20, .08);
  --radius: 16px;
  --radius-sm: 12px;
  --max: 1160px;
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0e0e0f;
  --bg-soft: #131314;
  --surface: #171718;
  --surface-2: #1e1e20;
  --card: #171718;
  --ink: #ededeb;
  --ink-2: #b7b7b4;
  --muted: #87878a;
  --faint: #5f5f62;
  --line: #28282a;
  --line-strong: #353538;
  --accent: #e7eaee;
  --on-accent: #0e0e0f;
  --focus: #7cc2a6;
  --good: #5cb98d;
  --mid: #d0b47c;
  --bad: #d68a82;
  --track: #28282a;
  --brand: #7cc2a6;
  --brand-soft: #3a6858;
  --tint: #16241e;
  --tint-ink: #9bd3bb;
  --gold-bg: #2a2313;
  --gold-line: #4a3c1a;
  --gold-ink: #e3c27a;
  --gold: #d4a94a;
  --shadow: none;
  --shadow-lift: 0 10px 28px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ---------- база ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, canvas, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; font-weight: 700; }
h1 { font-size: clamp(32px, 5vw, 54px); letter-spacing: -0.03em; font-weight: 750; }
h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.03em; }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap-row { flex-wrap: wrap; }
.spacer { flex: 1; }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); line-height: 1.55; }

/* ---------- шапка и подвал ---------- */

.nav {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em;
  text-decoration: none; font-size: 17px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 7px; border: 2px solid var(--bg); border-radius: 50%; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 9px; }
.nav-links a:hover { background: var(--track); color: var(--ink); }
.nav-links a.active { color: var(--on-accent); background: var(--accent); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 2px; background: var(--card); }
.lang-switch button { border: 0; background: none; padding: 4px 10px; border-radius: 8px; font-size: 12.5px;
  font-weight: 650; color: var(--muted); cursor: pointer; }
.lang-switch button.on { background: var(--accent); color: var(--on-accent); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 17px; height: 17px; }

.footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* ---------- кнопки, поля ---------- */

.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: 15px; letter-spacing: -0.01em; text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--on-accent); transition: transform .08s ease, opacity .15s ease, background .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .9; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.busy { opacity: .45; pointer-events: none; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.btn.secondary:hover { background: var(--surface-2); opacity: 1; }
.btn.ghost { background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--track); opacity: 1; }
.btn.danger { background: none; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.lg { --h: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.sm { --h: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; }

.field { display: block; }
.field > span { display: block; font-size: 13.5px; font-weight: 550; margin-bottom: 6px; color: var(--ink-2); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); outline: none; font-size: 16px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.input.code { letter-spacing: .5em; text-align: center; font-size: 22px; font-weight: 600; }
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }

/* ---------- карточки ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card.soft { background: var(--tint); border-color: transparent; box-shadow: none; }
.card.soft, .card.soft .muted { color: var(--tint-ink); }
.card.lift { box-shadow: var(--shadow-lift); }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.c3, .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: minmax(0, 1fr); } }

.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 10px; border-radius: 8px; line-height: 1.3;
  background: var(--tint); color: var(--tint-ink); font-size: 12.5px; font-weight: 650; letter-spacing: .01em; }
.chip.dark { background: var(--accent); color: var(--on-accent); }
.code-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }

/* ---------- баллы ---------- */

.score { font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: -0.03em; }
.bar { height: 4px; border-radius: 999px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--ink); }
/* главный балл — крупное число, как на экране результата Mini App */
.big { --size: 168px; display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.big b { font-size: calc(var(--size) * .42); font-weight: 750; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.big b small { font-size: .34em; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; margin-left: 3px; }
.big > span { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 8px; }

/* ---------- вкладки, шаги ---------- */

.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 1px solid var(--line); background: var(--card); padding: 7px 13px; font-weight: 600; font-size: 13.5px;
  color: var(--ink-2); border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.tabs button.on .score { color: inherit !important; }
.tabs button .score { margin-left: 6px; font-size: 13.5px; }

.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 3px; border-radius: 3px; background: var(--track); }
.steps i.done { background: var(--brand); }

/* ---------- всплывающее ---------- */

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0;
  background: var(--accent); color: var(--on-accent); padding: 12px 18px; border-radius: 12px; font-size: 14.5px;
  transition: opacity .2s, transform .2s; z-index: 100; max-width: calc(100vw - 32px); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center; z-index: 90; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; padding: 28px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--brand);
  animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--bg-soft), var(--surface-2)); background-size: 200% 100%;
  animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- страницы приложения ---------- */

.page { padding-top: 40px; min-height: calc(100vh - 64px - 160px); }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(28px, 3.6vw, 40px); }
.empty { text-align: center; padding: 56px 24px; color: var(--muted); }

.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.list-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; text-decoration: none; }
.list-row + .list-row { border-top: 1px solid var(--line); }
a.list-row:hover { background: var(--surface-2); }
.list-row .score { font-size: 22px; width: 52px; }
.list-row .meta { min-width: 0; flex: 1; }
.list-row .meta b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-blocks { display: flex; gap: 14px; }
.mini-blocks span { font-size: 12.5px; color: var(--muted); }
.mini-blocks b { color: var(--ink); font-weight: 650; margin-left: 3px; }
@media (max-width: 640px) { .mini-blocks { display: none; } }

.stat b { display: block; font-size: 34px; letter-spacing: -0.03em; font-weight: 700; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }

.prose { color: var(--ink-2); }
.prose h2 { font-size: 22px; margin: 36px 0 10px; color: var(--ink); }
.prose h3 { font-size: 17px; margin: 24px 0 8px; color: var(--ink); }
.prose p, .prose li { line-height: 1.7; }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 20px; }

@media (max-width: 760px) {
  .nav-links { display: none; }
  .wrap { padding: 0 16px; }
  .card { padding: 20px; }
  .page { padding-top: 28px; }
}

/* ---------- тарифы (главная и страница тарифов) ---------- */

.plan { display: flex; flex-direction: column; gap: 10px; padding: 24px; }
.plan-hot { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan-price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.plan-price b { font-size: 40px; letter-spacing: -0.04em; font-weight: 700; }
.plan-feat { list-style: none; padding: 0; margin: 8px 0 4px; display: grid; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.plan-feat li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feat svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--brand); }
.plan-pay { margin-top: auto; padding-top: 10px; display: grid; gap: 8px; }
/* длинные подписи кнопок оплаты в узкой колонке переносятся, а не распирают страницу */
.plan-pay .btn { white-space: normal; height: auto; min-height: var(--h); padding: 10px 16px; text-align: center; line-height: 1.25; }
