/* vtekst — стили интерактивных компонентов и доп-блоков. */

/* ───── Иконки (SVG-спрайт /assets/icons.svg) ───── */
.icon {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
  fill: none; stroke: currentColor;
}
.icon--lg    { width: 1.4em; height: 1.4em; }
.icon--xl    { width: 2em;   height: 2em;   }
.icon--brand { color: var(--brand); }
.icon--success { color: var(--success); }
.icon--muted { color: var(--fg-mute); }
.icon--danger { color: #dc2626; }
.icon--warn  { color: #d97706; }

/* ───── Use cases / сегменты ───── */
.segments {
  display: grid; gap: 24px; grid-template-columns: 1fr;
}
@media (min-width: 720px) { .segments { grid-template-columns: repeat(2, 1fr); } }
.segment {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; color: inherit; text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.segment:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand); text-decoration: none; }
.segment__icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 1.4rem; margin-bottom: 16px;
}
.segment__icon .icon { width: 22px; height: 22px; }
.segment h3  { margin-bottom: 4px; }
.segment__sub { color: var(--fg-mute); font-size: 0.88rem; margin-bottom: 12px; }
.segment p   { font-size: 0.95rem; margin: 0 0 16px; flex-grow: 1; }
.segment__link {
  color: var(--brand); font-weight: 600; font-size: 0.9rem;
}

/* ───── Было / стало ───── */
.compare-pair {
  display: grid; gap: 20px; grid-template-columns: 1fr;
  max-width: 960px; margin: 0 auto;
}
@media (min-width: 760px) { .compare-pair { grid-template-columns: 1fr 1fr; } }
.compare-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px;
  font-size: 0.9rem; line-height: 1.55;
  display: flex; flex-direction: column;
}
.compare-card--before { background: var(--bg-soft); }
.compare-card--after  { border: 2px solid var(--brand); }
.compare-card h4 {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-mute); margin: 0 0 16px;
}
.compare-card--before h4 { color: var(--fg-mute); }
.compare-card--after  h4 { color: var(--brand); }
.compare-card pre {
  font-family: inherit; white-space: pre-wrap; color: var(--fg-dim); margin: 0;
}
.compare-raw {
  font-family: inherit; color: var(--fg-dim); margin: 0;
  font-size: 0.95rem; line-height: 1.6;
}
.compare-noise { color: #cbd5e1; }
.compare-card__foot {
  margin-top: auto; padding-top: 20px;
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--fg-mute);
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}
.compare-card__foot .icon { width: 16px; height: 16px; flex-shrink: 0; }
.compare-card__foot strong { color: var(--fg); font-weight: 700; }
.compare-card__foot--brand { border-top-color: rgba(37, 99, 235, 0.18); }
.compare-card__foot--brand .icon { color: var(--brand); }
.compare-card__foot--brand strong { color: var(--brand); }
.compare-card__struct { color: var(--fg); }
.compare-card__struct strong { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; }
.compare-card__struct ul { list-style: none; padding: 0; margin: 4px 0 0; }
.compare-card__struct li { padding: 2px 0; color: var(--fg); }

.compare-struct { margin: 0; display: grid; gap: 12px; }
.compare-struct__row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}
.compare-struct__row:first-child { border-top: 0; padding-top: 0; }
.compare-struct dt {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--brand);
  margin: 0;
}
.compare-struct dt .icon { width: 14px; height: 14px; flex-shrink: 0; }
.compare-struct dd {
  margin: 0; font-size: 0.95rem; color: var(--fg); line-height: 1.5;
}
@media (max-width: 520px) {
  .compare-struct__row { grid-template-columns: 1fr; gap: 4px; }
}

/* ───── Калькулятор минут ───── */
.calculator {
  max-width: 720px; margin: 0 auto;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow-sm);
}
.calculator h3 { margin-bottom: 8px; }
.calculator__hint { color: var(--fg-mute); font-size: 0.9rem; margin-bottom: 20px; }
.calc__row {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.calc__row label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.92rem; color: var(--fg-dim);
}
.calc__row label output { color: var(--fg); font-weight: 600; }
.calc__row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; background: var(--border); border-radius: 100px;
  outline: none;
}
.calc__row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3); cursor: pointer;
}
.calc__row input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--brand); border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3); cursor: pointer;
}
.calc__result {
  margin-top: 20px; padding: 20px; border-radius: 12px;
  background: var(--brand-soft); text-align: center;
}
.calc__minutes {
  font-size: 1.1rem; color: var(--fg-dim); margin-bottom: 4px;
}
.calc__minutes strong { font-size: 1.8rem; color: var(--fg); font-weight: 700; }
.calc__tier {
  font-size: 1rem; margin-bottom: 8px;
}
.calc__tier strong { color: var(--brand); }
.calc__savings {
  font-size: 0.85rem; color: var(--success); margin-bottom: 16px;
  min-height: 1.2em;
}

/* ───── Сравнительная таблица ───── */
.comparison {
  max-width: 960px; margin: 0 auto;
  overflow-x: auto;
}
.comparison table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.comparison th,
.comparison td {
  padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border);
}
.comparison th {
  background: var(--bg-soft); font-weight: 600; white-space: nowrap;
}
.comparison tr:last-child td { border-bottom: 0; }
.comparison th.is-sortable { cursor: pointer; user-select: none; }
.comparison th.is-sortable:hover { background: var(--brand-soft); color: var(--brand); }
.comparison th.is-sorted-asc::after  { content: ' ▲'; color: var(--brand); }
.comparison th.is-sorted-desc::after { content: ' ▼'; color: var(--brand); }
.comparison td:nth-child(2) { font-weight: 600; color: var(--brand); }

/* ───── Checklist (interactive) ───── */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding: 12px 12px 12px 44px;
  margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; user-select: none;
  transition: background 0.12s, border-color 0.12s;
  background: #fff;
}
.checklist li:hover { border-color: var(--brand); background: var(--brand-soft); }
.checklist li::before {
  content: ''; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: #fff;
  transition: background 0.12s, border-color 0.12s;
}
.checklist li.is-checked {
  background: var(--bg-soft); color: var(--fg-mute);
  text-decoration: line-through;
}
.checklist li.is-checked::before {
  content: '✓'; background: var(--success); border-color: var(--success); color: #fff;
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.checklist li:focus { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ───── Article checklist (label-based, form-style) ───── */
.article-checklist {
  display: block;
  padding: 20px 22px; margin: 24px 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-soft);
}
.article-checklist h4 {
  margin: 0 0 14px; font-size: 1rem; font-weight: 600; color: var(--fg);
}
.article-checklist .checklist-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  font-size: 0.95rem; line-height: 1.45;
}
.article-checklist .checklist-item:last-child { margin-bottom: 0; }
.article-checklist .checklist-item:hover {
  border-color: var(--brand); background: var(--brand-soft);
}
.article-checklist .checklist-item input[type="checkbox"] {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.article-checklist .checkmark {
  flex-shrink: 0; display: inline-block;
  width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--border); border-radius: 5px;
  background: #fff; position: relative;
  transition: background 0.12s, border-color 0.12s;
}
.article-checklist input[type="checkbox"]:checked + .checkmark {
  background: var(--brand); border-color: var(--brand);
}
.article-checklist input[type="checkbox"]:checked + .checkmark::after {
  content: ''; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.article-checklist input[type="checkbox"]:focus-visible + .checkmark {
  outline: 2px solid var(--brand); outline-offset: 2px;
}
.article-checklist .checklist-item .text { flex: 1; color: var(--fg); }
.article-checklist input[type="checkbox"]:checked ~ .text {
  color: var(--fg-mute); text-decoration: line-through;
}

/* ───── Before/After slider ───── */
.ba-slider {
  position: relative;
  max-width: 900px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  min-height: 280px;
  user-select: none; touch-action: none;
}
.ba-slider__before,
.ba-slider__after {
  padding: 24px; min-height: 280px;
}
.ba-slider__after {
  position: absolute; inset: 0;
  background: #fff; border-left: 2px solid var(--brand);
  clip-path: inset(0 0 0 50%);
}
.ba-slider__handle {
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--brand);
  transform: translateX(-50%); cursor: ew-resize;
  display: flex; align-items: center; justify-content: center;
}
.ba-slider__handle::after {
  content: '↔'; width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 18px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}
.ba-slider__handle:focus { outline: none; }
.ba-slider__handle:focus::after { outline: 3px solid rgba(37,99,235,0.3); outline-offset: 2px; }

/* ───── Copy button ───── */
.copy-code, .copy-code-block {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--bg-soft); padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.copy-code:hover, .copy-code-block:hover { background: var(--brand-soft); border-color: var(--brand); }
.copy-code.is-copied, .copy-code-block.is-copied { background: #ecfdf5; border-color: var(--success); color: var(--success); }

/* ───── Toggle ───── */
.pricing-toggle {
  display: inline-flex; background: var(--bg-soft); border-radius: 100px;
  padding: 4px; margin: 0 auto 32px; gap: 4px;
  border: 1px solid var(--border);
}
.pricing-toggle button {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 100px;
  font-size: 0.92rem; font-weight: 500; color: var(--fg-dim);
  transition: background 0.12s, color 0.12s;
}
.pricing-toggle button.is-active {
  background: #fff; color: var(--fg);
  box-shadow: var(--shadow-sm);
}
.pricing-toggle__hint {
  font-size: 0.78em; color: var(--brand); font-weight: 600; margin-left: 4px;
}

/* ───── KINDS / распознавание типов ───── */
.kinds {
  display: grid; gap: 56px;
  max-width: 1040px; margin: 0 auto;
}
.kind {
  display: grid; gap: 32px;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) {
  .kind { grid-template-columns: 1fr 1fr; gap: 48px; }
  .kind--right .kind__intro { order: 2; }
  .kind--right .kind__mock  { order: 1; }
}

.kind__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: #fff; border: 1px solid var(--border);
  color: var(--brand); font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.kind__chip .icon { width: 14px; height: 14px; }

.kind__intro h3 {
  font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.35;
  font-weight: 600; color: var(--fg); margin: 0 0 18px;
}

.kind__who, .kind__struct {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; margin-top: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.88rem;
}
.kind__who-label, .kind__struct-label {
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--fg-mute);
}
.kind__who span:last-child { color: var(--fg); }
.kind__struct code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem; color: var(--brand);
  background: transparent; padding: 0;
}

/* Telegram-style mockup */
.tg-card {
  background: var(--brand-soft);
  border: 1px solid #dbeafe; border-radius: 14px;
  padding: 18px 20px;
  font-size: 0.9rem; line-height: 1.5;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.08);
}
.tg-card__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  color: var(--brand); font-size: 0.86rem;
  margin-bottom: 10px;
}
.tg-card__head strong { font-weight: 600; }
.tg-card__head .icon { width: 14px; height: 14px; }
.tg-card__sep { color: var(--fg-mute); }
.tg-card__kind {
  color: var(--fg-mute); font-style: normal;
}
.tg-card__head > span:not(.tg-card__sep):not(.tg-card__kind) {
  color: var(--fg-dim); font-weight: 500;
}

.tg-card__tldr {
  margin: 0 0 12px; color: var(--fg);
  font-size: 0.95rem; line-height: 1.5;
}
.tg-card__tldr strong { color: var(--fg); font-weight: 700; }

.tg-block { margin-top: 12px; }
.tg-block__title {
  font-size: 0.78rem; font-weight: 700; color: var(--fg);
  margin-bottom: 6px;
}

.tg-todo, .tg-line {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 10px; margin-bottom: 4px;
  background: #fff; border-radius: 8px;
  color: var(--fg); font-size: 0.88rem; line-height: 1.45;
}
.tg-todo:last-child, .tg-line:last-child { margin-bottom: 0; }
.tg-todo strong { color: var(--fg); font-weight: 700; }
.tg-todo em { color: var(--fg-mute); font-style: normal; font-weight: 500; }
.tg-todo .icon, .tg-line .icon {
  width: 14px; height: 14px; flex-shrink: 0; margin-top: 3px;
  color: var(--brand);
}
.tg-line .icon--success { color: var(--success); }
.tg-line .icon--warn    { color: #d97706; }

.tg-bullets {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: grid; gap: 4px;
}
.tg-bullets li {
  padding: 7px 10px; background: #fff; border-radius: 8px;
  color: var(--fg); font-size: 0.88rem; line-height: 1.45;
  position: relative; padding-left: 24px;
}
.tg-bullets li::before {
  content: '•'; position: absolute; left: 11px; top: 7px;
  color: var(--brand); font-weight: 700;
}

/* extras plate */
.kinds-extras {
  margin-top: 64px; padding-top: 40px;
  border-top: 1px dashed var(--border);
  max-width: 1040px; margin-left: auto; margin-right: auto;
}
.kinds-extras__head {
  text-align: center; max-width: 600px; margin: 0 auto 28px;
}
.kinds-extras__head h3 {
  font-size: 1.15rem; margin-bottom: 6px;
}
.kinds-extras__head p { margin: 0; font-size: 0.95rem; color: var(--fg-dim); }
.kinds-extras__grid {
  display: grid; gap: 14px; grid-template-columns: 1fr;
}
@media (min-width: 720px)  { .kinds-extras__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .kinds-extras__grid { grid-template-columns: repeat(4, 1fr); } }
.kind-mini {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
}
.kind-mini__icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}
.kind-mini__icon .icon { width: 16px; height: 16px; }
.kind-mini__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kind-mini__body strong { font-size: 0.92rem; color: var(--fg); }
.kind-mini__body span   { font-size: 0.85rem; color: var(--fg-dim); line-height: 1.4; }

/* ───── Hidden state (toggleable) ───── */
.is-hidden { display: none !important; }

/* ───── Reduced motion ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
