:root {
  --bg: #F7F5F0;
  --panel: #FFFFFF;
  --ink: #1C1B19;
  --ink-soft: #55524A;
  --line: #E4DFD3;
  --accent: #8A6E3A;
  --accent-ink: #5F4B26;
  --danger: #9C4B3E;
}

:root[data-theme="dark"] {
  --bg: #17140F; --panel: #1F1C16; --ink: #F1ECE0; --ink-soft: #C8C1B2;
  --line: #332E24; --accent: #D2A85C; --accent-ink: #F0D9A6; --danger: #D08974;
}
:root[data-theme="light"] {
  --bg: #F7F5F0; --panel: #FFFFFF; --ink: #1C1B19; --ink-soft: #55524A;
  --line: #E4DFD3; --accent: #8A6E3A; --accent-ink: #5F4B26; --danger: #9C4B3E;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.5;
}
h1 { font-size: 22px; margin: 0; }
h1 .accent, .brand .accent { color: var(--accent); }
a { color: var(--accent); }

/* --- Карточка гостевой ссылки (share.html) — та же структура, что
   .auth-card в app/css/app.css, но этот файл её не наследует напрямую. --- */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 32px; width: 360px; max-width: calc(100vw - 32px);
}
.tagline { color: var(--ink-soft); font-size: 14px; margin: 6px 0 20px; }
.auth-card .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.auth-card .field-label { font-size: 12px; color: var(--ink-soft); }
.auth-card .field-value { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.auth-card .field-value input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--ink); font: inherit;
}

button, .btn {
  font: inherit; line-height: 1.2; cursor: pointer; padding: 9px 16px; border-radius: 4px;
  border: 1px solid var(--accent); background: var(--accent); color: white;
  text-decoration: none; display: inline-block; vertical-align: middle; margin: 0;
}
button.ghost, .btn.ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
button.small, .btn.small { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 16px; }

/* Лендинг */
.landing-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; border-bottom: 1px solid var(--line);
}
.brand { font-size: 20px; font-weight: 600; color: var(--ink); text-decoration: none; }
.landing-nav { display: flex; align-items: center; gap: 12px; }
.nav-link { color: var(--ink-soft); text-decoration: none; font-size: 14px; line-height: 1.2; }
.nav-link:hover { color: var(--ink); text-decoration: underline; }

.landing { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.hero { text-align: center; padding: 64px 0 48px; }
.hero h1 { font-size: 40px; line-height: 1.2; max-width: 720px; margin: 0 auto 16px; }
.lead { font-size: 18px; color: var(--ink-soft); max-width: 640px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ZK схема */
.zk { text-align: center; padding: 32px 0; }
.zk h2 { font-size: 24px; margin-bottom: 8px; }
.zk-sub { color: var(--ink-soft); max-width: 640px; margin: 0 auto 24px; }
.zk-diagram {
  width: 100%; max-width: 900px; height: auto;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.zk-note { font-size: 13px; color: var(--ink-soft); max-width: 640px; margin: 16px auto 0; }

/* Почему доверять */
.trust { padding: 32px 0; }
.trust h2 { font-size: 24px; text-align: center; margin-bottom: 20px; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.trust-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.trust-icon { font-size: 28px; margin-bottom: 8px; }
.trust-item h3 { margin: 0 0 6px; font-size: 16px; }
.trust-item p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Персональные данные / ФЗ */
.pd { padding: 32px 0; }
.pd h2 { font-size: 24px; text-align: center; margin-bottom: 20px; }
.pd-card { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 24px; }
.pd-card ul { margin: 12px 0; padding-left: 20px; }
.pd-card li { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.pd-card strong { color: var(--ink); }
.pd-foot { font-size: 12px; color: var(--ink-soft); font-style: italic; margin: 12px 0 0; }

/* FAQ */
.faq { padding: 32px 0; }
.faq h2 { font-size: 24px; text-align: center; margin-bottom: 20px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 0 16px; margin-bottom: 12px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { font-size: 14px; color: var(--ink-soft); padding: 12px 0; margin: 0; }

.how { padding: 32px 0; text-align: center; }
.how h2 { font-size: 24px; margin-bottom: 20px; }
.steps { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 220px; max-width: 280px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px;
  text-align: left;
}
.step-num {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white; align-items: center; justify-content: center;
  font-weight: 600; margin-bottom: 8px;
}
.step p { margin: 0; font-size: 14px; color: var(--ink-soft); }

.cta { text-align: center; padding: 48px 0; }
.cta h2 { font-size: 24px; margin-bottom: 20px; }

.landing-footer {
  border-top: 1px solid var(--line); padding: 24px; text-align: center;
  font-size: 13px; color: var(--ink-soft);
}
.landing-footer-links { margin: 8px 0 0; }
.landing-footer-links a { color: var(--ink-soft); }
.landing-footer-links a:hover { color: var(--accent); }

/* Тарифные карточки (pricing.html) */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.pricing-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 24px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.pricing-badge {
  align-self: flex-start; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--ink-soft); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.pricing-badge-live { color: var(--accent-ink); border-color: var(--accent); }
.pricing-card h3 { font-size: 20px; margin: 4px 0 0; }
.pricing-price { font-size: 28px; font-weight: 700; }
.pricing-desc { color: var(--ink-soft); font-size: 14px; margin: 0; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 8px; }
.pricing-features li { font-size: 13px; color: var(--ink-soft); padding-left: 20px; position: relative; }
.pricing-features li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pricing-card .btn { margin-top: auto; text-align: center; }
.pricing-card .btn:disabled { cursor: not-allowed; opacity: 0.6; }

/* Юридические страницы (privacy.html, terms.html) */
.legal-hero { padding: 48px 0 24px; }
.legal .pd-card { text-align: left; }
.legal .pd-card h2 { font-size: 18px; margin: 24px 0 8px; }
.legal .pd-card h2:first-child { margin-top: 0; }
.legal .pd-card p { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.6; }
.legal .pd-card code { background: var(--bg); border-radius: 3px; padding: 1px 5px; font-size: 13px; }
.legal .pd-card ul { font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

/* Таблица крипто-примитивов (security.html) */
.crypto-table-wrap { overflow-x: auto; margin: 0 0 16px; }
.crypto-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crypto-table th, .crypto-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.crypto-table th { color: var(--ink-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; }
.crypto-table td { color: var(--ink); }
.crypto-table code { background: var(--bg); border-radius: 3px; padding: 1px 5px; font-size: 12px; }

@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .landing-header { flex-direction: column; gap: 10px; padding: 12px 16px; }
  .landing-nav { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .landing-nav .btn, .landing-nav .nav-link, .landing-nav button { white-space: nowrap; }
  .zk-diagram { border-radius: 0; }
  .trust-grid { grid-template-columns: 1fr; }
  .pd-card { padding: 16px; }
}
