/* ---------- Шрифты (свои файлы, без внешних сервисов) ---------- */
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/unbounded-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/unbounded-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/onest-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/onest-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/onest-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/onest-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/onest-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/onest-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }

/* ---------- Токены ---------- */
:root {
  --paper: #EDEFF4;
  --panel: #FFFFFF;
  --ink: #151A30;
  --muted: #5A6078;
  --line: #D4D8E4;
  --accent: #3346D3;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDE2FF;
  --deep: #151A30;
  --deep-digit: #3A4270;
  --deep-lit: #AEB8FF;
  --ok: #1D7A55;
  --ok-soft: #DCEFE6;
  --bad: #B2342A;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1322;
    --panel: #171C30;
    --ink: #E7EAF5;
    --muted: #9AA1BA;
    --line: #2A3150;
    --accent: #8A98FF;
    --accent-ink: #0F1322;
    --accent-soft: #252D57;
    --deep: #080B16;
    --deep-digit: #262D52;
    --ok: #5CC99A;
    --ok-soft: #173327;
    --bad: #F08A80;
  }
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--body);
       -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 560px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(32px, 5.4vw, 58px); line-height: 1.08; }
h2 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.15; }
h3 { font-size: 17px; line-height: 1.3; }
p { margin: 0 0 16px; max-width: 62ch; }
.lead { font-size: 19px; color: var(--muted); }
.muted { color: var(--muted); }

/* ---------- Шапка ---------- */
.site-header { padding: 20px 0; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wordmark { font-family: var(--display); font-weight: 600; font-size: 22px; text-decoration: none;
            letter-spacing: -0.01em; display: inline-flex; align-items: baseline; gap: 1px; }
.wordmark b { color: var(--accent); font-weight: 600; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav .nav-links { display: flex; gap: 28px; }
@media (max-width: 720px) { .nav .nav-links { display: none; } }
.nav form { margin: 0; }
.link-button { font: inherit; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.link-button:hover { color: var(--ink); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       font: 500 16px/1 var(--body); text-decoration: none; cursor: pointer;
       background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
       border-radius: var(--radius); padding: 14px 22px; transition: filter .15s; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); filter: none; }
.btn.small { padding: 10px 16px; font-size: 15px; }
.btn.block { width: 100%; }

/* ---------- Герой ---------- */
.hero { padding: 48px 0 88px; }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .hero .container { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 24px; } }
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 32px; padding: 0; list-style: none;
              color: var(--muted); font-size: 15px; }
.hero-facts li::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
                         background: var(--ok); margin-right: 8px; vertical-align: 2px; }

/* Шифр-панель: главный визуальный элемент */
.cipher { background: var(--deep); border-radius: 18px; padding: 28px; color: var(--deep-digit);
          font-family: var(--display); font-weight: 600; position: relative; overflow: hidden; }
.cipher-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; font-size: clamp(20px, 3vw, 34px);
               line-height: 1.35; text-align: center; font-variant-numeric: tabular-nums; user-select: none; }
.cipher-grid span { transition: color .4s ease; }
.cipher-grid span.lit { color: var(--deep-lit); }
.cipher-status { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(174,184,255,.18);
                 display: flex; justify-content: space-between; gap: 12px; font: 500 14px/1.4 var(--body);
                 color: #C9CFF0; }
.cipher-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5CC99A;
                      margin-right: 8px; box-shadow: 0 0 0 4px rgba(92,201,154,.18); }

/* ---------- Секции ---------- */
.section { padding: 80px 0; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.section-head p { margin: 0; color: var(--muted); max-width: 44ch; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; gap: 28px; } }
.feature h3 { margin-bottom: 10px; }
.feature p { color: var(--muted); margin: 0; }
.feature .big { font-family: var(--display); font-weight: 600; font-size: 44px; line-height: 1; color: var(--accent);
                margin-bottom: 16px; display: block; }

/* Тарифы */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px;
        display: flex; flex-direction: column; gap: 6px; position: relative; }
.plan.best { border: 2px solid var(--accent); padding: 23px; }
.plan .tag { position: absolute; top: -12px; left: 22px; background: var(--accent); color: var(--accent-ink);
             font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 999px; }
.plan .name { font-weight: 500; color: var(--muted); }
.plan .price { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: -0.02em; margin: 6px 0 0; }
.plan .price small { font-family: var(--body); font-size: 18px; font-weight: 500; }
.plan .per { color: var(--muted); font-size: 15px; }
.plan .save { color: var(--ok); font-size: 15px; font-weight: 500; min-height: 24px; }
.plan .btn { margin-top: 16px; }
.plans-note { margin-top: 20px; color: var(--muted); font-size: 15px; }

/* Шаги подключения: это последовательность, поэтому с номерами */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; gap: 28px; } }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: flex; align-items: center; justify-content: center;
                    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink);
                    font: 600 16px/1 var(--display); margin-bottom: 16px; }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--muted); margin: 0; }

/* Вопросы */
.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 500; font-size: 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 28px/1 var(--body); color: var(--muted); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 12px; }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 15px; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: var(--muted); }

/* ---------- Формы и страницы входа ---------- */
.auth { padding: 40px 0 96px; }
.auth h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 12px; }
.auth .lead { font-size: 17px; margin-bottom: 28px; }
.form label { display: block; font-weight: 500; margin-bottom: 8px; }
.input { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
         border-radius: var(--radius); padding: 14px 16px; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.code-input { font: 600 34px/1 var(--display); letter-spacing: .32em; text-align: center; padding: 18px 10px 18px 22px; }
.form .btn { margin-top: 16px; }
.error { color: var(--bad); margin: 12px 0 0; }
.aside-links { margin-top: 20px; display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; }
.aside-links a, .aside-links .link-button { color: var(--muted); }

/* ---------- Кабинет ---------- */
.cab { padding: 24px 0 96px; }
.cab-email { color: var(--muted); margin-bottom: 8px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px;
          padding: 6px 12px; border-radius: 999px; margin-bottom: 16px; }
.status.on { background: var(--ok-soft); color: var(--ok); }
.status.off { background: #F6DEDB; color: var(--bad); }
@media (prefers-color-scheme: dark) { .status.off { background: #3A1E1C; } }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cab h1 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 10px; }
.cab-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-top: 36px; }
@media (max-width: 820px) { .cab-grid { grid-template-columns: 1fr; } }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.box h2 { font-size: 20px; margin-bottom: 14px; }
.link-field { font: 400 14px/1.4 ui-monospace, "SF Mono", Consolas, monospace; }
.qr { background: #fff; border-radius: 10px; padding: 10px; max-width: 240px; margin: 0 auto; }
.qr svg { width: 100%; height: auto; display: block; }
.box .steps { grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 820px) { .box .steps { grid-template-columns: 1fr; gap: 18px; } }
.box .steps li::before { width: 32px; height: 32px; font-size: 14px; margin-bottom: 8px; }
.empty { margin-top: 32px; }

/* Два тарифа */
.plans.two { grid-template-columns: repeat(2, minmax(0, 360px)); }
@media (max-width: 620px) { .plans.two { grid-template-columns: 1fr; } }
.plan .devices { margin: 4px 0 2px; font-size: 17px; }
.plan .devices b { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--accent); margin-right: 2px; }

/* ================= Кабинет v2 ================= */
.nav-email { color: var(--muted); font-size: 15px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) { .nav-email { display: none; } }
.notice { border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-weight: 500; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }

.status-panel { position: relative; overflow: hidden; background: var(--deep); color: #E7EAF5; border-radius: 22px;
                padding: 40px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: end; }
@media (max-width: 820px) { .status-panel { grid-template-columns: 1fr; padding: 28px 24px; gap: 28px; } }
.status-bg { position: absolute; right: -10px; top: -20px; font: 600 110px/1.05 var(--display); color: #1B2140;
             letter-spacing: .06em; pointer-events: none; user-select: none; text-align: right; }
@media (max-width: 820px) { .status-bg { font-size: 72px; opacity: .6; } }
.status-panel.expired .status-bg { color: #22192A; }
.status-main, .status-side { position: relative; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; padding: 6px 12px;
        border-radius: 999px; background: rgba(174,184,255,.14); color: #C9CFF0; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.on { background: rgba(92,201,154,.16); color: #6FD6A6; }
.pill.off { background: rgba(240,138,128,.16); color: #F29A90; }
.days { display: flex; align-items: flex-end; gap: 14px; margin: 18px 0 20px; }
.days-num { font: 600 clamp(72px, 12vw, 132px)/.85 var(--display); letter-spacing: -.04em; color: #FFFFFF; }
.days-word { font: 500 18px/1.25 var(--body); color: #AEB8FF; padding-bottom: 6px; }
.meter { height: 6px; border-radius: 999px; background: rgba(174,184,255,.16); overflow: hidden; max-width: 420px; }
.meter span { display: block; height: 100%; background: #AEB8FF; border-radius: inherit; }
.status-sub { color: #C9CFF0; margin: 14px 0 0; }
.status-title { font-size: clamp(28px, 4vw, 44px); color: #FFFFFF; margin: 18px 0 4px; }
.facts { margin: 0 0 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.facts div { border-top: 1px solid rgba(174,184,255,.2); padding-top: 10px; }
.facts dt { font-size: 13px; color: #8E97C4; margin-bottom: 2px; }
.facts dd { margin: 0; font-weight: 500; color: #FFFFFF; }
.btn.light { background: #FFFFFF; color: var(--deep); border-color: #FFFFFF; }
.btn.light:hover { filter: none; background: #DDE2FF; }
.btn.on-dark { background: transparent; color: #E7EAF5; border-color: rgba(174,184,255,.35); margin-top: 10px; }
.btn.on-dark:hover { border-color: #E7EAF5; filter: none; }
.status-side form { margin: 0; }

.connect { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 820px) { .connect { grid-template-columns: 1fr; } }
.connect .box { padding: 28px; }
.connect h2 { font-size: 20px; margin-bottom: 6px; }
.small { font-size: 15px; }
.copy-row { display: flex; gap: 8px; margin: 14px 0 28px; }
.copy-row .input { flex: 1; min-width: 0; }
.copy-row .btn { flex: none; }
@media (max-width: 480px) { .copy-row { flex-direction: column; } }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--paper); border-radius: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { font: 500 15px/1 var(--body); color: var(--muted); background: transparent; border: 0;
               padding: 10px 14px; border-radius: 7px; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(21,26,48,.08); }
.howto { margin: 0 0 20px; padding: 0; list-style: none; counter-reset: h; }
.howto li { counter-increment: h; position: relative; padding: 0 0 14px 44px; }
.howto li::before { content: counter(h); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
                    border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
                    font: 600 13px/1 var(--display); color: var(--accent); }
.connect-qr { text-align: center; display: flex; flex-direction: column; align-items: center; }
.connect-qr .qr { width: 100%; max-width: 230px; margin: 14px 0 16px; }

.renew { margin-top: 72px; }
.renew h2 { margin-bottom: 8px; }
.renew > p { margin-bottom: 28px; }
.renew .plan form { margin: 0; }

.history { margin-top: 72px; }
.history h2 { font-size: 22px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.history table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 480px; }
.history th, .history td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.history th { color: var(--muted); font-weight: 500; font-size: 14px; }
.history tr:last-child td { border-bottom: 0; }
.history td:last-child, .history th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.wordmark .wm-suffix { color: var(--muted); font-weight: 600; }
