:root {
  --bg: #f3f5f9;
  --paper: #ffffff;
  --ink: #101828;
  --muted: #5b6475;
  --line: #e3e7ee;
  --teal: #0f766e;
  --teal-dark: #0b5e58;
  --teal-soft: #e6f4f2;
  --amber: #b45309;
  --amber-soft: #fff4d6;
  --green: #15803d;
  --green-soft: #dff7e6;
  --red: #b42318;
  --radius: 14px;
  --maxw: 680px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 3px solid #7dd3c8; outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* Шапка */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 8px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft);
}
.top nav { white-space: nowrap; }
.top nav a { font-size: 15px; margin-left: 14px; }
@media (max-width: 400px) { .top nav a { font-size: 14px; margin-left: 10px; } }

/* Герой: сам инструмент */
.hero { padding: 24px 0 8px; }
.hero h1 {
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 800;
  margin: 0 0 14px;
}
.hero .lead { font-size: 18px; color: var(--muted); margin: 0 0 22px; max-width: 56ch; }

.tool {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}
.tool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tool-head strong { font-size: 18px; }
.tool-head span { font-size: 14px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 16px;
  padding: 16px 20px;
  background: var(--teal); color: #fff;
  border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 18px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn-ghost {
  background: transparent; color: var(--teal-dark);
  border: 1.5px solid var(--teal); width: auto; padding: 10px 16px; font-size: 15px; margin-top: 0;
}
.btn-ghost:hover { background: var(--teal-soft); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Результат: считывание */
.result { margin-top: 18px; display: none; }
.result.show { display: block; }

.readout {
  border-radius: 12px; padding: 18px 18px 16px;
  border: 1px solid var(--line);
}
.readout.is-ru { background: var(--amber-soft); border-color: #f5d58a; }
.readout.is-ok { background: var(--green-soft); border-color: #a7e3b9; }
.readout.is-err { background: #fdecec; border-color: #f3b4b4; }

.readout .label { font-size: 14px; color: var(--muted); margin: 0; }
.readout .value {
  font-size: clamp(26px, 7vw, 34px); font-weight: 800; letter-spacing: -0.02em;
  line-height: 1.1; margin: 2px 0 10px;
}
.readout.is-ru .value { color: var(--amber); }
.readout.is-ok .value { color: var(--green); }
.readout.is-err .value { color: var(--red); }

.readout .verdict { margin: 0; font-size: 17px; }
.readout .verdict strong { font-weight: 700; }

.facts {
  list-style: none; padding: 0; margin: 14px 0 0;
  border-top: 1px dashed rgba(16,24,40,0.18);
}
.facts li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px dashed rgba(16,24,40,0.18);
  font-size: 15px;
}
.facts li span:first-child { color: var(--muted); }
.facts li span:last-child { font-weight: 600; text-align: right; }

.next {
  margin-top: 16px; padding: 16px; border-radius: 12px;
  background: var(--paper); border: 1px solid var(--line);
}
.next p { margin: 0 0 12px; }
.next .btn { margin-top: 0; }
.next .fine { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

.privacy { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* Текст */
article { padding: 28px 0 8px; }
article h2 {
  font-size: 24px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 800;
  margin: 36px 0 12px;
}
article h3 { font-size: 19px; font-weight: 700; margin: 24px 0 8px; }
article p { margin: 0 0 14px; max-width: 64ch; }
article ul, article ol { padding-left: 22px; margin: 0 0 16px; max-width: 64ch; }
article li { margin-bottom: 6px; }

.note {
  border-left: 4px solid var(--teal); background: var(--teal-soft);
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 18px 0;
}
.note p { margin: 0; }

/* Список разделов: таблица запросов */
.index { list-style: none; padding: 0; margin: 8px 0 0; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: block; padding: 14px 0; text-decoration: none; color: var(--ink);
}
.index a:hover { color: var(--teal-dark); }
.index a strong { display: block; font-weight: 700; }
.index a span { display: block; font-size: 15px; color: var(--muted); margin-top: 2px; }

/* Денежный блок */
.offer {
  margin: 32px 0; padding: 22px 20px;
  background: var(--ink); color: #fff; border-radius: var(--radius);
}
.offer h2 { color: #fff; margin: 0 0 8px; font-size: 24px; }
.offer p { color: rgba(255,255,255,0.82); max-width: 60ch; }
.offer ul { list-style: none; padding: 0; margin: 14px 0 18px; display: grid; gap: 6px; }
.offer li { padding-left: 22px; position: relative; color: #fff; }
.offer li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 10px; height: 10px; border-radius: 50%; background: #2dd4bf;
}
.offer .btn { background: #2dd4bf; color: var(--ink); }
.offer .btn:hover { background: #5eead4; }
.offer .fine { color: rgba(255,255,255,0.65); font-size: 14px; margin: 10px 0 0; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; font-weight: 700; padding: 12px 0; list-style: none;
  display: flex; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; }

/* Подвал */
footer {
  margin-top: 40px; padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
footer p { margin: 0 0 6px; }

/* Липкая кнопка на мобильных */
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(243,245,249,0.92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform 0.2s ease;
}
.sticky.show { transform: translateY(0); }
.sticky .btn { margin-top: 0; padding: 13px 16px; font-size: 16px; max-width: var(--maxw); margin-inline: auto; display: flex; }
@media (min-width: 900px) { .sticky { display: none; } }
@media (prefers-reduced-motion: reduce) { .sticky { transition: none; } }
