/* Деклариум — стиль.
   Идея: спокойный светлый интерфейс с одним ярким мотивом — пульсом.
   Пульс живёт в логотипе, в шапке главной и в состояниях загрузки.
   Всё остальное намеренно тихое: цифры налога должны быть самым громким
   элементом на странице. */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #0b1020;
  --ink-2: #141a33;
  --brand: #4f5bff;
  --brand-2: #7c5cff;
  --glow: #22d3ee;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #131722;
  --muted: #5b6172;
  --line: #e4e7f0;
  --ok: #158a5e;
  --ok-bg: #e6f6ee;
  --warn: #b26a00;
  --warn-bg: #fff4e0;
  --bad: #c2362b;
  --bad-bg: #fdecea;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(19, 23, 34, .04), 0 8px 24px -12px rgba(19, 23, 34, .18);
  --shadow-lift: 0 2px 4px rgba(19, 23, 34, .05), 0 18px 40px -16px rgba(79, 91, 255, .35);
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.12; margin: 0 0 14px; font-weight: 800; }
h2 { font-size: clamp(19px, 2.4vw, 24px); margin: 40px 0 12px; font-weight: 700; }
p.lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; max-width: 62ch; }
a { color: var(--brand); }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px 22px; }
main.wrap { padding-top: 30px; padding-bottom: 72px; }

/* --- шапка ------------------------------------------------------------------ */

header.site {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 247, 251, .82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
header.site.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -16px rgba(19,23,34,.3); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
a.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 18px;
  color: var(--text); text-decoration: none; letter-spacing: -0.01em;
}
/* знак несёт подложку сам (см. tools/build_logo.py), тени и градиента здесь нет:
   логотип в шапке обязан совпадать с фавиконом и с файлами в static/brand */
a.brand .mark { width: 34px; height: 34px; border-radius: 10px; display: block;
  box-shadow: 0 6px 16px -8px var(--brand); }
a.brand .mark svg { width: 34px; height: 34px; display: block; border-radius: 10px; }
header nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
header nav a, header nav button.linklike {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
  padding: 7px 11px; border-radius: 9px; background: none; border: 0; font-family: inherit; cursor: pointer;
  box-shadow: none; transition: color .2s, background .2s;
}
header nav a:hover, header nav button.linklike:hover { color: var(--text); background: #fff; transform: none; }
header nav a.cta { color: #fff; background: var(--ink); }
header nav a.cta:hover { background: var(--brand); color: #fff; }
form.inline { display: inline; margin: 0; }
@media (max-width: 640px) {
  header.site .wrap { padding-left: 14px; padding-right: 14px; }
  header nav { gap: 0; }
  header nav a, header nav button.linklike { font-size: 14px; padding: 6px 8px; }
  header nav .hide-m { display: none; }
  .wrap { padding-left: 14px; padding-right: 14px; }
}

/* --- герой на главной ------------------------------------------------------- */

.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 500px at 20% -10%, rgba(124, 92, 255, .55), transparent 60%),
              radial-gradient(900px 400px at 90% 10%, rgba(34, 211, 238, .35), transparent 60%),
              var(--ink);
  border-radius: 24px; padding: 54px 44px 44px; margin: 6px 0 26px;
  box-shadow: 0 30px 60px -40px rgba(11, 16, 32, .8);
}
@media (max-width: 720px) { .hero { padding: 36px 24px 30px; } }
.hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 48px); max-width: 16ch; position: relative; }
.hero p.lead { color: rgba(255,255,255,.78); max-width: 52ch; position: relative; }
.hero .pulse { position: absolute; right: -40px; bottom: -10px; width: min(62%, 560px); height: auto; opacity: .9; pointer-events: none; }
.hero .pulse path.line { fill: none; stroke: url(#pulseGrad); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.6s var(--ease) .2s forwards; }
.hero .pulse circle.dot { fill: var(--glow); filter: drop-shadow(0 0 10px var(--glow)); opacity: 0;
  animation: beat 1.6s ease-in-out 2.4s infinite; }
.hero .facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 30px; position: relative; }
.hero .fact { min-width: 140px; }
.hero .fact b { display: block; font-family: var(--display); font-size: 24px; font-weight: 700; }
.hero .fact span { color: rgba(255,255,255,.7); font-size: 14px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes beat { 0%, 100% { opacity: .5; r: 5; } 50% { opacity: 1; r: 8; } }

/* --- карточки ------------------------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 28px; margin: 18px 0; box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.card.calc { border: 0; box-shadow: 0 24px 60px -30px rgba(79, 91, 255, .45); margin-top: -70px; position: relative; z-index: 2; }
@media (max-width: 720px) { .card.calc { margin-top: 0; } }
.card > h2:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* --- формы ---------------------------------------------------------------- */

label { display: block; font-weight: 700; margin: 16px 0 6px; font-size: 15px; }
label small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; margin-top: 2px; }
input[type=text], input[type=number], input[type=email], select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-s);
  font: inherit; background: #fff; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 91, 255, .15); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

/* зона загрузки поверх обычного input[type=file] */
.drop {
  position: relative; display: block; border: 2px dashed #c9cee0; border-radius: var(--radius);
  padding: 26px 20px; text-align: center; background: #fafbff; cursor: pointer; margin-top: 8px;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--brand); background: #f1f2ff; }
.drop.over { transform: scale(1.01); }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop .icon { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.drop .icon svg { width: 22px; height: 22px; }
.drop strong { display: block; font-size: 16px; }
.drop > span { color: var(--muted); font-size: 14px; }
.drop .files { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.drop .files .chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.drop.has-files { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
input[type=file]:not(.drop input) { width: 100%; padding: 10px; border: 1.5px dashed #c9cee0; border-radius: var(--radius-s); background: #fafbff; }

/* --- кнопки ---------------------------------------------------------------- */

button, .btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font: inherit; font-weight: 700;
  cursor: pointer; text-decoration: none; box-shadow: 0 10px 22px -12px var(--brand);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px -12px var(--brand); filter: saturate(1.1); }
button:active, .btn:active { transform: translateY(0); }
button:disabled { opacity: .7; cursor: progress; transform: none; }
.btn.secondary, button.secondary { background: #fff; color: var(--text); border: 1.5px solid var(--line); box-shadow: none; }
.btn.secondary:hover, button.secondary:hover { border-color: #c9cee0; box-shadow: var(--shadow); }
.btn.danger, button.danger { background: #fff; color: var(--bad); border: 1.5px solid var(--line); box-shadow: none; }
.btn.big { padding: 15px 26px; font-size: 17px; }
.actions { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* --- таблицы и цифры -------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; margin: 8px 0; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.total { font-weight: 800; font-family: var(--display); font-size: 18px; }
td.num.total { color: var(--brand); font-size: 22px; }

.muted { color: var(--muted); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.notice { border-left: 4px solid var(--warn); background: var(--warn-bg); padding: 14px 18px; border-radius: 12px; margin: 14px 0; }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }
.notice.ok { border-color: var(--ok); background: var(--ok-bg); }
.notice.info { border-color: var(--brand); background: #eef0ff; }
ul.plain { padding-left: 20px; } ul.plain li { margin: 7px 0; }
code, pre { font-family: var(--mono); font-size: 13.5px; }
pre { background: var(--ink); color: #dfe4ff; padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
details { margin: 14px 0; }
details summary { cursor: pointer; font-weight: 700; padding: 8px 0; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #eef0f6; color: var(--muted); vertical-align: middle; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.brand { background: #eef0ff; color: var(--brand); }

/* --- шаги ----------------------------------------------------------------- */

.steps { counter-reset: s; padding: 0; list-style: none; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 16px 18px 16px 62px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px;
}
.sample { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* --- появление при прокрутке ------------------------------------------------ */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; } .reveal.d3 { transition-delay: .24s; }

/* --- подвал --------------------------------------------------------------- */

footer { color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: #fff; }
footer .wrap { padding-top: 26px; padding-bottom: 30px; }
footer .small { font-size: 13px; } footer .small a { color: var(--muted); }

/* --- кошельки ------------------------------------------------------------- */

.wallet { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: start; }
@media (max-width: 640px) { .wallet { grid-template-columns: 1fr; } .wallet > div:last-child { text-align: left !important; } }
.wallet .addr { font-family: var(--mono); font-size: 13px; color: var(--muted); word-break: break-all; }
.deadline { font-weight: 700; margin-top: 4px; }

/* --- брокерские счета ------------------------------------------------------ */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* широкая таблица не должна распирать страницу — пусть едет внутри себя */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.scroll table { min-width: 720px; }

label.check {
  display: flex; align-items: center; gap: 10px; font-weight: 700;
  margin: 18px 0 4px; cursor: pointer;
}
label.check input { width: 18px; height: 18px; accent-color: var(--brand); }

pre.code { font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .hero .pulse path.line { stroke-dashoffset: 0; }
  .hero .pulse circle.dot { opacity: 1; }
}
