/* Crafix Scan — публичный сайт. Дизайн-система перенесена из marketing/presentation.html:
   палитра purple/magenta/teal, тонколинейные SVG-иконки (stroke 1.75), clamp()-типографика. */

:root {
  --purple: #4c3c90;
  --purple-d: #3a2c70;
  --magenta: #b82585;
  --teal: #0aacaf;
  --teal-l: #4eeaaa;
  --teal-d: #088a8d;
  --dark: #1a1428;
  --g-100: #f7f5fa;
  --g-200: #ede9f3;
  --g-500: #8a7fa6;
  --g-700: #4a4260;

  --ok: #1fae66;
  --err: #d94a45;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --fs-hero: clamp(30px, 4.6vw, 56px);
  --fs-h2: clamp(24px, 3.1vw, 40px);
  --fs-h3: clamp(15px, 1.55vw, 18px);
  --fs-lead: clamp(16px, 1.7vw, 21px);
  --fs-body: clamp(14px, 1.45vw, 17px);
  --fs-small: clamp(12px, 1.2vw, 14px);

  --header-h: 64px;
}

* { box-sizing: border-box; }
/* Классы с display (например .card { display:flex }) не должны перебивать hidden */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--g-100);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}

.icon {
  width: 24px; height: 24px;
  stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

/* ---------- секции: светлая / затемнённая / тёмная / брендовая ---------- */
.section { padding: clamp(48px, 8vh, 96px) 0; background: var(--g-100);
  --ink: var(--dark); --ink-2: var(--g-700); --ink-3: var(--g-500);
  --line: #d9d2e6; --card: #ffffff;
  color: var(--ink);
}
.section--tint { background: var(--g-200); --line: #cec5e0; }
.section--dark {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(76, 60, 144, .55), transparent 65%),
    radial-gradient(800px 500px at -10% 110%, rgba(8, 138, 141, .25), transparent 60%),
    var(--dark);
  --ink: var(--g-100); --ink-2: #d8d2e8; --ink-3: #a094c0;
  --line: rgba(247, 245, 250, .16); --card: rgba(247, 245, 250, .06);
  color: var(--ink);
}
.section--brand {
  background:
    radial-gradient(1000px 600px at 110% 0%, rgba(184, 37, 133, .28), transparent 60%),
    linear-gradient(150deg, var(--purple-d), var(--dark) 78%);
  --ink: var(--g-100); --ink-2: #d8d2e8; --ink-3: #a094c0;
  --line: rgba(247, 245, 250, .16); --card: rgba(247, 245, 250, .06);
  color: var(--ink);
}

.wrap {
  max-width: 1120px; margin: 0 auto;
  padding: 0 clamp(20px, 4.5vw, 56px);
  display: flex; flex-direction: column; gap: clamp(18px, 2.6vh, 30px);
}
.wrap--narrow { max-width: 640px; }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-small); font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--teal-d);
}
.section--dark .eyebrow, .section--brand .eyebrow { color: var(--teal-l); }
.eyebrow::after {
  content: ""; height: 1px; width: 56px;
  background: linear-gradient(90deg, currentColor, transparent);
}
.eyebrow .icon { width: 20px; height: 20px; }

h1, .h1 { margin: 0; font-size: var(--fs-hero); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
h2, .h2 { margin: 0; font-size: var(--fs-h2); font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.accent { color: var(--teal-d); }
.section--dark .accent, .section--brand .accent { color: var(--teal-l); }

.lead { margin: 0; font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 62ch; }
p { margin: 0; font-size: var(--fs-body); line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--ink-3); }
a { color: var(--teal-d); }
.section--dark a, .section--brand a { color: var(--teal-l); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1.5px solid transparent;
  padding: 10px 20px;
  font-size: var(--fs-body); font-weight: 600; font-family: var(--sans);
  text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--magenta); color: #fff; }
.btn--primary:hover { background: #a02074; }
.btn--ghost { background: transparent; color: inherit; border-color: var(--line); }
.btn--ghost:hover { border-color: var(--teal); color: var(--teal-d); }
.section--dark .btn--ghost:hover, .section--brand .btn--ghost:hover { color: var(--teal-l); }
.btn--lg { padding: 13px 28px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: default; pointer-events: none; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(26, 20, 40, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(247, 245, 250, .1);
  color: var(--g-100);
  --line: rgba(247, 245, 250, .2);
}
.site-header__inner {
  max-width: 1120px; margin: 0 auto; height: 100%;
  padding: 0 clamp(20px, 4.5vw, 56px);
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand__logo { display: block; border-radius: 50%; }
.brand__name { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.site-nav { display: flex; gap: clamp(12px, 2vw, 28px); margin-left: auto; }
.site-nav a {
  color: #d8d2e8; text-decoration: none; font-size: var(--fs-small); font-weight: 600;
  transition: color .2s;
}
.site-nav a:hover { color: var(--teal-l); }
.site-header__actions { display: flex; gap: 10px; }
.site-header__actions .btn { padding: 8px 16px; font-size: var(--fs-small); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(76, 60, 144, .55), transparent 65%),
    radial-gradient(800px 500px at -10% 110%, rgba(8, 138, 141, .25), transparent 60%),
    var(--dark);
  --ink: var(--g-100); --ink-2: #d8d2e8; --ink-3: #a094c0;
  --line: rgba(247, 245, 250, .16); --card: rgba(247, 245, 250, .06);
  color: var(--ink);
  padding: clamp(56px, 10vh, 120px) 0;
}
.hero__inner { flex-direction: row; align-items: center; gap: clamp(24px, 4vw, 64px); }
.hero__text { display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 26px); flex: 1.2; }
.hero__visual { flex: .8; display: flex; justify-content: center; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- карточки / фичи ---------- */
.cards { display: grid; gap: clamp(12px, 1.6vw, 20px); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(14px, 1.8vw, 22px);
  display: flex; flex-direction: column; gap: 10px;
}
.card .icon { width: 28px; height: 28px; color: var(--teal-d); }
.section--dark .card .icon, .section--brand .card .icon { color: var(--teal-l); }
.card h3 { margin: 0; font-size: var(--fs-h3); font-weight: 700; line-height: 1.25; color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: var(--fs-small); font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  background: var(--card);
  white-space: nowrap;
}

.list { display: flex; flex-direction: column; gap: clamp(10px, 1.6vh, 16px); margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 14px; align-items: flex-start; font-size: var(--fs-body); line-height: 1.55; color: var(--ink-2); }
.list .icon { width: 22px; height: 22px; margin-top: 2px; color: var(--teal-d); }
.section--dark .list .icon, .section--brand .list .icon { color: var(--teal-l); }
.list b { color: var(--ink); font-weight: 700; }

.cols { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(20px, 3.5vw, 48px); align-items: center; }

/* ---------- процесс (flow) ---------- */
.flow { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.flow .node {
  flex: 1 1 140px; min-width: 130px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.flow .node .icon { width: 24px; height: 24px; color: var(--teal-d); }
.section--dark .flow .node .icon, .section--brand .flow .node .icon { color: var(--teal-l); }
.flow .node b { font-size: var(--fs-small); font-weight: 700; color: var(--ink); line-height: 1.3; }
.flow .node span { font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.flow .arr { align-self: center; color: var(--ink-3); flex: none; }
.flow .fork { flex: 1.2 1 170px; min-width: 150px; display: flex; flex-direction: column; gap: 8px; }
.outcome {
  border-radius: 12px; padding: 10px 12px;
  display: flex; gap: 10px; align-items: center;
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  border: 1.5px solid;
}
.outcome .icon { width: 18px; height: 18px; }
.outcome--ok  { color: var(--ok);  border-color: var(--ok);  background: rgba(31, 174, 102, .08); }
.outcome--err { color: var(--err); border-color: var(--err); background: rgba(217, 74, 69, .08); }
.outcome small { display: block; font-weight: 400; color: var(--ink-3); }

/* ---------- телефоны ---------- */
.phone {
  position: relative;
  width: clamp(150px, 15vw, 200px);
  aspect-ratio: 9 / 18.5;
  border: 2px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  padding: 7px;
  display: flex; flex-direction: column;
  flex: none;
}
.phone::before, .phone::after {
  content: ""; position: absolute; right: -4.5px; width: 2.5px;
  border-radius: 2px; background: var(--line);
}
.phone::before { top: 16%; height: 8%; }
.phone::after  { top: 26.5%; height: 5%; }
.phone__screen {
  position: relative; overflow: hidden;
  flex: 1; border-radius: 19px;
  display: flex; flex-direction: column;
  padding: 24px 10px 16px;
  border: 1px solid var(--line);
}
.phone__cam {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-3); opacity: .75;
}
.phone__status {
  position: absolute; top: 5px; left: 11px; right: 11px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 8.5px; font-weight: 600; color: var(--ink-3);
  font-variant-numeric: tabular-nums; letter-spacing: .03em;
  pointer-events: none;
}
.phone__sys { display: flex; align-items: flex-end; gap: 2.5px; }
.phone__sys i { display: block; width: 2px; border-radius: 1px; background: currentColor; }
.phone__sys i:nth-child(1) { height: 3.5px; }
.phone__sys i:nth-child(2) { height: 5.5px; }
.phone__sys i:nth-child(3) { height: 7.5px; }
.phone__sys b {
  display: block; width: 11px; height: 5.5px; margin-left: 3px;
  border: 1px solid currentColor; border-radius: 1.5px; position: relative;
}
.phone__sys b::before { content: ""; position: absolute; top: 1px; bottom: 1px; left: 1px; width: 4.5px; background: currentColor; border-radius: .5px; }
.phone__sys b::after { content: ""; position: absolute; right: -2.5px; top: 50%; transform: translateY(-50%); width: 1.5px; height: 2.5px; background: currentColor; border-radius: 1px; }
.phone__screen::after {
  content: ""; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 34%; height: 3px; border-radius: 2px;
  background: var(--ink-3); opacity: .55;
}
.phone__content {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center;
}
.phone__content .icon { width: 34px; height: 34px; }
.phone__title { font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.phone__sub { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.phone--ok .phone__screen { background: rgba(31, 174, 102, .12); border-color: var(--ok); }
.phone--ok .phone__content .icon, .phone--ok .phone__title { color: var(--ok); }
.phone--err .phone__screen { background: rgba(217, 74, 69, .12); border-color: var(--err); }
.phone--err .phone__content .icon, .phone--err .phone__title { color: var(--err); }
.phone--scan .phone__content .icon { color: var(--teal-d); }

.phones-row { display: flex; gap: clamp(10px, 1.4vw, 16px); justify-content: center; flex-wrap: wrap; }
.phones-row .phone { width: clamp(108px, 12vw, 156px); padding: 5px; border-radius: 20px; }
.phones-row .phone__screen { padding: 21px 8px 14px; border-radius: 15px; }
.phones-row .phone__content { gap: 7px; }
.phones-row .phone__content .icon { width: 26px; height: 26px; }
.phones-row .phone__title { font-size: 11.5px; }
.phones-row .phone__sub { font-size: 9.5px; }
.phones-row .phone__status { top: 4px; left: 9px; right: 9px; font-size: 7.5px; }
.phones-row .phone__cam { top: 7px; width: 5px; height: 5px; }

/* ---------- таймлайн ---------- */
.timeline { display: flex; align-items: flex-start; gap: 0; }
.timeline .tpoint { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.timeline .tdot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--teal-l); background: transparent;
  box-shadow: 0 0 0 5px rgba(78, 234, 170, .12);
}
.timeline .tline {
  flex: 1.2; height: 2px; margin-top: 6px;
  background: repeating-linear-gradient(90deg, var(--teal-l) 0 8px, transparent 8px 15px);
  opacity: .7;
}
.timeline .ttime { font-size: var(--fs-small); font-weight: 700; letter-spacing: .1em; color: var(--teal-l); font-variant-numeric: tabular-nums; }
.timeline .tlabel { font-size: var(--fs-body); color: var(--ink-2); line-height: 1.5; max-width: 34ch; }
.timeline .tlabel b { color: var(--ink); }

/* ---------- скриншоты ---------- */
.screens { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.5vw, 32px); }
.screen { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.screen img {
  width: 100%; height: auto; display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px -18px rgba(26, 20, 40, .35);
  background: var(--dark);
}
.screen figcaption { font-size: var(--fs-small); line-height: 1.5; color: var(--ink-3); }
.screen figcaption b { color: var(--ink); }

/* ---------- тарифы ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 24px); align-items: stretch; }
.pricing__loading { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 40px 0; font-size: var(--fs-body); }
.plan {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: clamp(20px, 2.4vw, 30px);
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.plan--featured { border-color: var(--magenta); box-shadow: 0 18px 44px -22px rgba(184, 37, 133, .45); }
.plan__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--magenta); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border-radius: 999px; padding: 4px 14px; white-space: nowrap;
}
.plan__name { font-size: clamp(17px, 1.8vw, 21px); font-weight: 800; color: var(--dark); }
.plan__desc { font-size: var(--fs-small); color: var(--g-500); line-height: 1.5; min-height: 2.6em; }
.plan__price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.plan__price .v { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.02em; color: var(--dark); font-variant-numeric: tabular-nums; }
.plan__price .u { font-size: var(--fs-small); color: var(--g-500); }
.plan__total { font-size: var(--fs-small); color: var(--g-700); font-variant-numeric: tabular-nums; }
.plan__total b { color: var(--dark); }
.plan__features { display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; flex: 1; }
.plan__features li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); line-height: 1.45; color: var(--g-700); }
.plan__features .icon { width: 17px; height: 17px; margin-top: 1px; color: var(--teal-d); }
.plan__calc { display: flex; flex-direction: column; gap: 6px; }
.plan__calc label { font-size: var(--fs-small); font-weight: 600; color: var(--g-700); }
.plan__calc input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: var(--fs-body); font-family: var(--sans);
  font-variant-numeric: tabular-nums; color: var(--dark); background: #fff;
}
.plan__calc input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.plan .btn { margin-top: 4px; }

/* ---------- CTA / штрих-код ---------- */
.barcode { display: flex; align-items: stretch; gap: 4px; height: 44px; opacity: .5; }
.barcode i { display: block; background: var(--g-500); border-radius: 1px; }
.barcode i:nth-child(3n) { background: var(--teal); }
.section--cta .wrap { align-items: flex-start; }

/* ---------- формы ---------- */
.section--form { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; padding: clamp(40px, 6vh, 72px) 0; }
.section--form .wrap { width: 100%; }
.form { max-width: 520px; }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form__field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.form__field input, .form__field select {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-size: var(--fs-body); font-family: var(--sans);
  background: rgba(247, 245, 250, .04); color: var(--ink);
}
.form__field input::placeholder { color: var(--ink-3); }
.form__field input:focus, .form__field select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.form__field small { font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.form__field select option { color: #000; }
.form__row { display: flex; gap: 12px; }
.form__row .form__field { flex: 1; min-width: 0; }
.form__total {
  font-size: var(--fs-small); color: var(--g-700); font-variant-numeric: tabular-nums;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px;
}
.form__total b { color: var(--ink); }
.form__error {
  border: 1.5px solid var(--err); border-radius: 10px;
  background: rgba(217, 74, 69, .1); color: var(--err);
  font-size: var(--fs-small); font-weight: 600; line-height: 1.4;
  padding: 10px 14px;
}
.form__hint { font-size: var(--fs-small); color: var(--ink-3); text-align: center; }
.form__big-icon { width: 40px; height: 40px; color: var(--teal-l); }
.form--success h3, .form h3 { margin: 0; font-size: clamp(18px, 2vw, 24px); font-weight: 800; color: var(--ink); }
.icon--ok { color: var(--ok) !important; }
.icon--err { color: var(--err) !important; }

/* ---------- подвал ---------- */
.site-footer {
  background: var(--dark); color: #d8d2e8;
  border-top: 1px solid rgba(247, 245, 250, .1);
  padding: clamp(36px, 6vh, 64px) 0;
}
.site-footer__inner {
  max-width: 1120px; margin: 0 auto;
  padding: 0 clamp(20px, 4.5vw, 56px);
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(24px, 4vw, 56px);
}
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer__tagline { font-size: var(--fs-small); color: #a094c0; line-height: 1.6; max-width: 34ch; }
.site-footer__title { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #a094c0; }
.site-footer__link {
  display: inline-flex; align-items: center; gap: 8px;
  color: #d8d2e8; text-decoration: none; font-size: var(--fs-small);
  transition: color .2s;
}
.site-footer__link:hover { color: var(--teal-l); }
.site-footer__link .icon { width: 16px; height: 16px; color: var(--teal-l); }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .pricing { grid-template-columns: 1fr; max-width: 460px; }
  .cols { grid-template-columns: 1fr; }
  .screens { grid-template-columns: 1fr; }
  .hero__inner { flex-direction: column; align-items: flex-start; }
  .hero__visual { display: none; }
  .site-nav { display: none; }
}
@media (max-width: 700px) {
  .flow { flex-direction: column; align-items: stretch; gap: 6px; }
  .flow .node {
    min-width: 0; flex: none;
    display: grid; grid-template-columns: auto 1fr;
    column-gap: 14px; row-gap: 3px; align-items: center;
    padding: 12px 14px;
  }
  .flow .node .icon { grid-row: 1 / 3; }
  .flow .arr { align-self: center; transform: rotate(90deg); width: 20px; height: 20px; margin: -2px 0; }
  .flow .fork { min-width: 0; flex: none; }
  .timeline { flex-direction: column; gap: 14px; }
  .timeline .tline { width: 2px; height: 28px; flex: none; margin: 0 0 0 6px;
    background: repeating-linear-gradient(180deg, var(--teal-l) 0 8px, transparent 8px 15px); }
}
@media (max-width: 560px) {
  .cards--4 { grid-template-columns: 1fr; }
  .site-header__actions .btn--ghost { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
