:root {
  --bg: #eef3fa;
  --card: #ffffff;
  --ink: #16233a;
  --muted: #5d6b82;
  --line: #e2e9f3;
  --line-strong: #cdd8e8;
  --accent: #2b7fd4;
  --accent-soft: #e9f2fc;
  --telegram: #2aabee;
  --success: #356947;
  --success-soft: #edf7ef;
  --radius: 22px;
  --container: 920px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(43, 127, 212, .10), transparent 30rem),
    linear-gradient(180deg, #f6f9fd 0, var(--bg) 28rem);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a { color: inherit; }

.page {
  width: min(100% - clamp(24px, 5vw, 64px), var(--container));
  margin-inline: auto;
  padding-block: 28px 64px;
}

.hero {
  display: grid;
  justify-items: start;
  row-gap: 12px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0 clamp(26px, 5vw, 42px);
}

.eyebrow,
.step-kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
  letter-spacing: .01em;
}

.step-kicker::after { content: counter(step); }

.eyebrow { margin: 0; }

.step-kicker { margin: 0 0 14px; }

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -.045em;
  text-wrap: balance;
}

h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(23px, 3vw, 32px);
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lead {
  max-width: 680px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.55;
}

.device-hint {
  width: fit-content;
  max-width: 680px;
  margin: 4px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .76);
  font-size: 14px;
  line-height: 1.4;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 34px rgba(20, 35, 58, .05);
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.card:hover {
  border-color: var(--line-strong);
  background: #f4f8fd;
  box-shadow: 0 16px 40px rgba(20, 35, 58, .08);
  text-decoration: none;
  transform: translateY(-1px);
}

.device-card {
  position: relative;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
}

.card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #dde7f3;
  border-radius: 13px;
  background: #eef4fb;
  font-size: 21px;
  line-height: 1;
}

.card-copy {
  display: grid;
  gap: 5px;
}

.card-copy strong,
.card strong {
  color: var(--ink);
  font-size: 19px;
  line-height: 1.22;
}

.card-copy span,
.card span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.recommendation {
  display: none;
  width: fit-content;
  margin-top: 8px;
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--accent);
  background: rgba(43, 127, 212, .08);
  font-size: 12px;
  font-style: normal;
  font-weight: 780;
  line-height: 1;
}

.device-card.is-recommended {
  border-color: #9cc3e8;
  background: linear-gradient(180deg, #f3f8fd, #ffffff);
  box-shadow: 0 18px 46px rgba(43, 127, 212, .14);
}

.device-card.is-recommended .card-icon {
  border-color: #bcd8f2;
  background: var(--accent-soft);
}

.device-card.is-recommended .recommendation {
  display: inline-flex;
}

.steps {
  display: grid;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 12px 34px rgba(20, 35, 58, .05);
  counter-increment: step;
}

.step.copy-only { grid-template-columns: 1fr; }

.step-copy {
  display: grid;
  align-content: start;
  padding: clamp(26px, 4vw, 40px);
}

.step p,
.help p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.actions,
.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 760;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.back-link {
  width: fit-content;
  margin: 0 0 8px;
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, .72);
  font-size: 14px;
}

.button:hover,
.back-link:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.button:active,
.back-link:active { transform: translateY(0); }

.button:focus-visible,
.back-link:focus-visible,
.card:focus-visible {
  outline: 3px solid rgba(43, 127, 212, .22);
  outline-offset: 3px;
}

.button.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(43, 127, 212, .16);
}

.button.primary:hover { background: #1f5f9e; }

.button.secondary,
.back-link {
  color: var(--ink);
  border-color: var(--line);
  background: #f4f8fd;
}

.button.secondary:hover,
.back-link:hover {
  border-color: var(--line-strong);
  background: #eaf3fc;
}

.button.warning {
  color: #0d3a66;
  border-color: #2b7fd4;
  background: linear-gradient(180deg, #bcd8f2, #7fb3e6);
  box-shadow: 0 12px 24px rgba(43, 127, 212, .20);
}

.button.warning:hover {
  border-color: #1f5f9e;
  background: linear-gradient(180deg, #bcd8f2, #7fb3e6);
  box-shadow: 0 14px 28px rgba(43, 127, 212, .26);
}

.button.telegram {
  color: #fff;
  background: var(--telegram);
  box-shadow: 0 10px 22px rgba(36, 143, 195, .16);
}

.button.telegram:hover { background: #1c7ca9; }

.button.share {
  color: var(--accent);
  border-color: #c7dce1;
  background: var(--accent-soft);
  box-shadow: none;
}

.button.share:hover {
  color: #1f5f9e;
  border-color: #a9cbd4;
  background: #dff0f4;
}

.media {
  display: grid;
  min-height: 100%;
  place-items: center;
  margin: 0;
  padding: 28px;
  background: #e8eef7;
}

.media img {
  display: block;
  width: auto;
  max-width: min(100%, var(--image-max, 320px));
  height: auto;
  border-radius: var(--image-radius, 22px);
  background: #fff;
  box-shadow: 0 16px 34px rgba(20, 35, 58, .13);
}

.media.logo img {
  --image-max: 168px;
  --image-radius: 24px;
  box-shadow: none;
}

.media.wide img { --image-max: 360px; }
.media.small img { --image-max: 300px; }
.media.phone img { --image-max: 280px; }
.media.desktop img { --image-max: 420px; }

.media-stack {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 100%;
  margin: 0;
  padding: 28px;
  background: #e8eef7;
}

.media-stack .media {
  min-height: auto;
  padding: 0;
  background: transparent;
}

.media-stack .media img {
  --image-max: 320px;
}

.callout {
  margin-top: 20px;
  border: 1px solid #bbd9c3;
  border-radius: 18px;
  padding: 16px;
  color: #234d31;
  background: var(--success-soft);
  font-size: 16px;
  line-height: 1.55;
}

.callout strong {
  display: block;
  margin-bottom: 4px;
  color: var(--success);
}

.callout.warning {
  border-color: #9cc3e8;
  color: #16233a;
  background: linear-gradient(180deg, #eef4fb, #e9f2fc);
}

.callout.warning strong {
  color: #0d3a66;
  font-size: 17px;
}

.callout p,
.callout ul {
  margin: 0;
  color: inherit;
}

.callout ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.help {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 5vw, 40px);
  background: rgba(255, 255, 255, .94);
}

.help h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.help .actions {
  align-items: center;
  gap: 8px;
}

.help .button { box-shadow: none; }

.note-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

.inline-link {
  color: var(--accent);
  font-weight: 700;
}

@media (min-width: 1024px) {
  .step { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .media.phone img { --image-max: 300px; }
  .media.wide img { --image-max: 400px; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; }
  .media {
    min-height: auto;
    padding: 0 24px 28px;
    background: var(--card);
  }
  .media-stack {
    padding: 0 24px 28px;
    background: var(--card);
  }
  .media.wide img { --image-max: 560px; }
  .media.phone img { --image-max: 320px; }
  .media-stack .media img { --image-max: 100%; }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, var(--container));
    padding-block: 20px 40px;
  }

  .back-link,
  .button { width: 100%; }

  .device-hint {
    width: 100%;
    border-radius: 14px;
  }

  .hero {
    margin-bottom: 16px;
    row-gap: 10px;
    padding: 4px 0 26px;
  }

  h1 {
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.08;
  }

  .lead { font-size: 17px; }

  .device-card {
    min-height: auto;
    padding: 16px;
  }

  .step { border-radius: 20px; }
  .step-copy { padding: 24px 22px; }

  .media { padding: 0 20px 24px; }
  .media-stack { padding: 0 20px 24px; }
  .media.logo img { --image-max: 150px; }
  .media.phone img { --image-max: min(100%, 300px); }
  .media.wide img,
  .media.desktop img { --image-max: 100%; }
}

@media (max-width: 420px) {
  .page {
    width: min(100% - 16px, var(--container));
    padding-block: 12px 32px;
  }

  .help,
  .step { border-radius: 18px; }

  .help,
  .step-copy { padding: 20px; }

  .hero { padding: 4px 0 22px; }
  .steps { gap: 14px; }

  .button {
    min-height: 46px;
    padding-inline: 14px;
    font-size: 15px;
  }

  .media { padding: 0 16px 20px; }
  .media-stack { padding: 0 16px 20px; }
  .media.phone img { --image-max: min(100%, 280px); }

  .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .card-copy strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button,
  .back-link,
  .card { transition: none; }
  .button:hover,
  .back-link:hover,
  .card:hover { transform: none; }
}
