/* =========================================================
   Chiroy — публичные страницы платформы: главная, вход, регистрация
   ========================================================= */
:root {
  --porcelain: #F4F6FA;
  --surface: #FFFFFF;
  --sunk: #EDF0F6;
  --ink: #18213A;
  --ink-2: #444E69;
  --muted: #6B7590;
  --line: #E1E6EF;
  --cobalt: #2643A6;
  --cobalt-ink: #1A2F7C;
  --cobalt-tint: #E7ECFA;
  --turq: #12807B;
  --turq-tint: #DFF2F0;
  --saffron: #E39A2D;
  --pom: #B32B44;
  --pom-tint: #FBE5E9;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Unbounded', 'Onest', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--porcelain); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--cobalt); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 6px; }
.i { width: 22px; height: 22px; flex: none; }
.i-sm { width: 18px; height: 18px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.ikat-ribbon { height: 8px; background: url('../img/ikat.svg') repeat-x left center / auto 100%; }

/* Шапка */
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 14px 16px; }
@media (min-width: 720px) { .pub-head { padding: 18px 28px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: url('../img/favicon.svg') center / cover; }
.brand-word { font-family: var(--display); font-weight: 600; font-size: 21px; letter-spacing: -0.02em; }
.pub-nav { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sunk); }
.lang-switch a { padding: 5px 9px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.lang-switch a.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(24,33,58,.12); }

/* Кнопки, поля */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border-radius: 13px; border: 1px solid transparent; font: 600 15px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btn-lg { min-height: 54px; padding: 0 24px; font-size: 16px; border-radius: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-ink); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #C5CDDD; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #EEF1F8; }

.field { display: grid; gap: 6px; }
.field > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 400 16px/1.4 var(--font);
}
.input-lg { min-height: 56px; font-size: 18px; font-weight: 500; }
.input:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(38, 67, 166, .14); }
.hint { font-size: 13.5px; color: var(--muted); }
.hint.is-ok { color: var(--turq); }
.hint.is-bad { color: var(--pom); }
.hint.fine { text-align: center; margin-top: 4px; }
.err { color: var(--pom); font-size: 13.5px; }
.toast { padding: 12px 14px; border-radius: 12px; font-weight: 500; margin: 12px 0; }
.toast-success { background: var(--turq-tint); color: #0B5F5B; }
.toast-error { background: var(--pom-tint); color: var(--pom); }

.slug-input { display: flex; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); overflow: hidden; }
.slug-input:focus-within { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(38, 67, 166, .14); }
.slug-input span { display: flex; align-items: center; padding-left: 14px; color: var(--muted); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.slug-input .input { border: 0; box-shadow: none; padding-left: 2px; min-width: 0; }

/* ---------- Вход и регистрация ---------- */
.page-auth main { padding: 8px 0 48px; }
.auth { max-width: 560px; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 22px 18px; display: grid; gap: 18px; }
@media (min-width: 600px) { .auth-card { padding: 32px; } }
.auth-card h1 { font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; }
.lead { color: var(--ink-2); }
.auth-alt { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-alt a { font-weight: 600; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 18px; }
.step legend { padding: 0; float: left; width: 100%; }
.step legend + * { clear: both; }
.step-nav { display: flex; gap: 10px; margin-top: 4px; }
.step-nav .btn { flex: 1; }
.step-nav .btn-ghost { flex: 0 0 auto; }
.reg:not(.is-stepped) .step-nav [data-next], .reg:not(.is-stepped) .step-nav [data-prev] { display: none; }
.reg:not(.is-stepped) .step + .step { border-top: 1px solid var(--line); padding-top: 22px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; counter-reset: s; }
.steps li { counter-increment: s; font-size: 12.5px; color: var(--muted); font-weight: 500; padding-top: 10px; position: relative; }
.steps li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--sunk); }
.steps li.is-on, .steps li.is-done { color: var(--ink); }
.steps li.is-on::before { background: var(--cobalt); }
.steps li.is-done::before { background: var(--turq); }
.reg:not(.is-stepped) .steps { display: none; }

.sphere-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sphere { position: relative; display: block; }
.sphere input { position: absolute; opacity: 0; }
.sphere-face {
  display: grid; gap: 4px; align-content: start; height: 100%; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.sphere-face b { font-size: 15px; line-height: 1.25; }
.sphere-face small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.sphere-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--cobalt-tint); color: var(--cobalt); margin-bottom: 6px; }
.sphere input:checked + .sphere-face { border-color: var(--cobalt); background: #F6F8FE; }
.sphere input:checked + .sphere-face .sphere-ic { background: var(--cobalt); color: #fff; }
.sphere input:focus-visible + .sphere-face { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.sphere-face:hover { border-color: #C5CDDD; }

.link-preview { padding: 16px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; gap: 4px; position: relative; overflow: hidden; }
.link-preview::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 10px; background: url('../img/ikat.svg') repeat-y center top / 100% auto; opacity: .9; }
.link-preview-label { font-size: 13px; color: rgba(255,255,255,.7); }
.link-preview b { font-weight: 600; font-size: 17px; word-break: break-all; padding-right: 14px; }
.link-preview b span { color: #F2C27A; }

/* ---------- Главная ---------- */
.page-home h2 { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
@media (min-width: 900px) { .page-home h2 { font-size: 34px; } }
.section-lead { color: var(--ink-2); margin-top: 10px; max-width: 60ch; }

.hero { display: grid; gap: 34px; padding-top: 18px; padding-bottom: 48px; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: 31px; letter-spacing: -0.03em; line-height: 1.12; max-width: 17ch; }
.hero-sub { font-size: 17px; color: var(--ink-2); margin-top: 16px; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-note { font-size: 14px; color: var(--muted); margin-top: 14px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.1fr .9fr; align-items: center; padding-top: 40px; padding-bottom: 72px; }
  .hero h1 { font-size: 50px; }
  .hero-sub { font-size: 19px; }
}
.hero-demo { display: grid; justify-items: center; gap: 14px; }
.phone {
  width: min(330px, 86vw); height: min(640px, 168vw); border-radius: 46px; padding: 12px; background: #121726;
  box-shadow: 0 40px 80px -40px rgba(24,33,58,.7), inset 0 0 0 1.5px #2C3350; display: flex; flex-direction: column;
}
.phone-bar { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; color: #C9D0E3; font-size: 12.5px; flex: none; }
.phone-bar b { color: #fff; font-weight: 600; }
.phone-lock { width: 9px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; position: relative; top: 1px; }
.phone-lock::before { content: ''; position: absolute; left: 1px; right: 1px; top: -6px; height: 6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.phone iframe { flex: 1; width: 100%; border: 0; border-radius: 32px; background: #fff; }
.demo-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.demo-chip { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); font: 500 14px var(--font); color: var(--ink-2); cursor: pointer; }
.demo-chip i { width: 10px; height: 10px; border-radius: 50%; }
.demo-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.link-band { background: var(--cobalt); color: #fff; padding: 46px 0 50px; position: relative; }
.link-band::before, .link-band::after { content: ''; position: absolute; left: 0; right: 0; height: 8px; background: url('../img/ikat.svg') repeat-x left center / auto 100%; }
.link-band::before { top: 0; }
.link-band::after { bottom: 0; }
.link-band-lead { font-size: 15px; color: rgba(255,255,255,.78); }
.link-big { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 7.4vw, 72px); letter-spacing: -0.03em; line-height: 1.05; margin: 12px 0 18px; word-break: break-all; }
.link-big span { color: rgba(255,255,255,.55); }
.link-big b { font-weight: 600; color: #F6C77E; }
.link-band-text { max-width: 58ch; color: rgba(255,255,255,.88); font-size: 17px; }

.how { padding-top: 56px; padding-bottom: 56px; }
.how-steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 22px; counter-reset: how; }
@media (min-width: 900px) { .how-steps { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.how-steps li { counter-increment: how; display: grid; gap: 6px; padding-top: 18px; border-top: 2px solid var(--ink); }
.how-steps li::before { content: counter(how); font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--cobalt); }
.how-steps b { font-size: 19px; line-height: 1.3; }
.how-steps span { color: var(--ink-2); }

.themes-band { padding: 8px 0 56px; }
.theme-strip { display: flex; gap: 12px; overflow-x: auto; padding: 24px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.theme-strip::-webkit-scrollbar { display: none; }
@media (min-width: 1120px) { .theme-strip { max-width: 1120px; margin: 0 auto; padding-left: 28px; padding-right: 28px; } }
.theme-tile {
  flex: 0 0 210px; scroll-snap-align: start; display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 22px;
  background: var(--bg); color: var(--ink); border: 1px solid rgba(24,33,58,.08); min-height: 300px;
}
.theme-tile .tt-name { color: var(--acc); font-size: 25px; line-height: 1.05; min-height: 54px; }
.tt-lines { display: grid; gap: 7px; margin-top: 6px; }
.tt-lines i { height: 10px; border-radius: 5px; background: var(--tint); }
.tt-lines i:nth-child(2) { width: 80%; }
.tt-lines i:nth-child(3) { width: 62%; }
.tt-btn { justify-self: start; padding: 9px 14px; border-radius: 12px; background: var(--acc); color: var(--bg); font-weight: 600; font-size: 13px; margin-top: 6px; }
.tt-meta { margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--ink); opacity: .85; line-height: 1.4; }
.tt-meta b { display: block; font-size: 15px; opacity: 1; }
.theme-tile[style*="#1E1A17"] .tt-meta { color: #EDE6DC; }

.crm-band { display: grid; gap: 28px; padding-top: 24px; padding-bottom: 64px; }
@media (min-width: 900px) { .crm-band { grid-template-columns: .9fr 1.1fr; gap: 56px; } }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feature-list li { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.feature-list li:last-child { border-bottom: 0; }
.feature-list .i { color: var(--cobalt); margin-top: 2px; }
.feature-list b { display: block; font-size: 17px; }
.feature-list span { color: var(--ink-2); }

.faq { padding-bottom: 64px; max-width: 820px; }
.faq h2 { margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; font-weight: 600; font-size: 17px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 64ch; }

.final-cta { background: var(--ink); color: #fff; padding: 56px 0; position: relative; }
.final-cta::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: url('../img/ikat.svg') repeat-x left center / auto 100%; }
.final-cta h2 { color: #fff; }
.final-cta p { color: rgba(255,255,255,.8); margin: 12px 0 24px; max-width: 52ch; font-size: 17px; }

.pub-foot { padding: 22px 0 28px; color: var(--muted); font-size: 14px; }
.page-home .pub-foot { background: var(--ink); color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.08); }
.pub-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* Ошибки */
.error-page { text-align: center; padding: 60px 16px 80px; max-width: 520px; display: grid; justify-items: center; gap: 14px; }
.error-art { width: 120px; height: 60px; border-radius: 10px; background: url('../img/ikat.svg') center / auto 100%; }
.error-page h1 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.error-page p { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
