/* donate.v153.ru — оформление.

   Палитра взята из мессенджера (client/src/styles/theme.css): приглушённый
   бетон плюс тёплый ламповый акцент. Страница поддержки должна выглядеть
   продолжением приложения, а не рекламным лендингом рядом с ним.

   Тёмная тема — основная. Светлая включается только системной настройкой:
   переключателя нет намеренно, лишняя кнопка на странице с ценами и офертой
   отвлекает от того, ради чего человек пришёл. */

:root {
  color-scheme: dark;

  --bg: #0a0c0e;
  --bg-alt: #0e1114;
  --surface: #14181c;
  --surface-2: #1a1f24;
  --border: #222830;
  --border-strong: #2f3740;

  --text: #e9ecef;
  --text-dim: #99a2aa;
  --text-faint: #6c757d;

  --accent: #d9a556;
  --accent-dim: #b8853c;
  --accent-bright: #ecbf78;
  --accent-soft: rgba(217, 165, 86, 0.13);
  --accent-line: rgba(217, 165, 86, 0.32);
  --on-accent: #17130a;
  --accent-fill: linear-gradient(180deg, #e3b166, #c9944a);
  /* Ссылки — отдельным цветом от акцента. На тёмном фоне это одно и то же,
     а на светлой бумаге акцент даёт контраст 3.3 : мало для сплошного текста,
     а тут им набраны оферта и политика, которые читают целиком. */
  --link: var(--accent);

  --online: #7cb6a1;
  --danger: #d97c6e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 3px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.42), 0 10px 28px rgba(0, 0, 0, 0.38);
  --glow: radial-gradient(ellipse at 50% 0%, rgba(217, 165, 86, 0.09), transparent 62%);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif;

  /* Зерно поверх фона: без него большие однотонные плоскости на хороших
     экранах идут полосами, а «лиминальному» настроению шум только на пользу.
     Вычисленный SVG, а не картинка, — ничего не тянется по сети. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");

  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg: #eeebe4;
    --bg-alt: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #f7f5f1;
    --border: #e1dcd2;
    --border-strong: #cdc7ba;

    --text: #17191b;
    --text-dim: #616770;
    --text-faint: #888e96;

    --accent: #a9762a;
    --accent-dim: #8d6120;
    --accent-bright: #c08c3c;
    --accent-soft: rgba(169, 118, 42, 0.12);
    --accent-line: rgba(169, 118, 42, 0.3);
    --on-accent: #fff9ee;
    --accent-fill: linear-gradient(180deg, #b8823a, #9c6b23);
    --link: #8d6120; /* контраст 4.6 на бумажном фоне — проходит AA */

    --online: #4c8f77;
    --danger: #b8544a;

    --shadow-sm: 0 1px 2px rgba(60, 50, 35, 0.08), 0 3px 10px rgba(60, 50, 35, 0.07);
    --shadow-md: 0 2px 6px rgba(60, 50, 35, 0.1), 0 10px 26px rgba(60, 50, 35, 0.12);
    --glow: radial-gradient(ellipse at 50% 0%, rgba(169, 118, 42, 0.07), transparent 62%);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--glow), var(--grain);
  background-repeat: no-repeat, repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent-soft);
}

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 calc(20px + var(--safe-left)) 0 calc(20px + var(--safe-right));
}

/* ============================================================ шапка */

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 20px 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 12px;
  height: 20px;
  border-radius: 2px;
  background: var(--accent-fill);
  box-shadow: 0 0 18px var(--accent-soft);
}

.site-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
}

.site-nav a {
  color: var(--text-dim);
}

.site-nav a[aria-current='page'] {
  color: var(--accent);
}

/* ============================================================ полоса-черновик */

.banner {
  background: rgba(217, 124, 110, 0.14);
  border-bottom: 1px solid rgba(217, 124, 110, 0.4);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 20px;
  text-align: center;
}

.banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  color: var(--accent-bright);
}

/* ============================================================ первый экран */

.hero {
  padding: 46px 0 34px;
}

.kicker {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 7vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 650;
}

.lead {
  margin: 0 0 18px;
  font-size: 18px;
  color: var(--text-dim);
  max-width: 34em;
}

.link-out {
  display: inline-block;
  font-size: 15px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 0 0 26px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.card > .dim {
  margin-top: 0;
}

.prose {
  margin: 0 0 26px;
}

.prose h2 {
  margin: 32px 0 10px;
  font-size: 21px;
  letter-spacing: -0.01em;
}

.prose p {
  margin: 0 0 14px;
  color: var(--text-dim);
}

.dim {
  color: var(--text-dim);
}

.tiny {
  font-size: 13px;
  line-height: 1.5;
}

.plain-list {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--text-dim);
}

.plain-list li {
  margin-bottom: 7px;
}

.plain-list b {
  color: var(--text);
}

/* ============================================================ статус */

.status-card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin: 18px 0 14px;
}

.stat {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.stat-value.is-up {
  color: var(--online);
  font-size: 17px;
}

.stat-value.is-down {
  color: var(--danger);
  font-size: 17px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.stat-label {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.35;
}

/* ============================================================ уровни */

.tiers {
  display: grid;
  gap: 12px;
  margin: 20px 0 22px;
}

.tier {
  display: block;
  position: relative;
  cursor: pointer;
}

.tier input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tier-body {
  display: block;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--bg-alt);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.tier:hover .tier-body {
  border-color: var(--accent-line);
}

.tier input:checked + .tier-body {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tier input:focus-visible + .tier-body {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tier-title {
  font-weight: 600;
  font-size: 17px;
}

.tier-price {
  font-size: 19px;
  font-weight: 650;
  color: var(--accent);
  white-space: nowrap;
}

.tier-term {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-faint);
}

.tier-what {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-dim);
}

.tier-what li {
  margin-bottom: 4px;
}

.amount-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.amount-field input {
  width: 130px;
  padding: 9px 12px;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.rub {
  color: var(--text-faint);
}

/* ============================================================ форма */

.code-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.code-input {
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  max-width: 320px;
  transition: border-color 0.18s ease;
}

.code-input:focus-within {
  border-color: var(--accent);
}

.code-input .at {
  color: var(--text-faint);
  font-size: 16px;
}

.code-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font-size: 16px; /* меньше 16px — и Safari на айфоне зумит страницу при фокусе */
  padding: 12px 8px;
}

.hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-faint);
  max-width: 42em;
}

.pay-button {
  display: block;
  width: 100%;
  margin: 22px 0 0;
  padding: 15px 20px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--on-accent);
  background: var(--accent-fill);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 6px 20px var(--accent-soft);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.18s ease;
}

.pay-button:hover {
  filter: brightness(1.06);
}

.pay-button:active {
  transform: translateY(1px);
}

.pay-button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.result {
  margin: 14px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-dim);
  padding: 0;
  min-height: 0;
}

.result.shown {
  padding: 13px 15px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}

.result.error {
  background: rgba(217, 124, 110, 0.12);
  border-color: rgba(217, 124, 110, 0.4);
  color: var(--text);
}

/* ============================================================ таблицы */

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th {
  text-align: left;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-dim);
}

tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: right;
  padding-right: 0;
  white-space: nowrap;
}

th.num {
  text-align: right;
}

.nick {
  color: var(--text);
  font-weight: 500;
}

.supporters .empty td {
  text-align: center;
  color: var(--text-faint);
  padding: 26px 10px;
  font-size: 14px;
}

/* ============================================================ документы */

.doc {
  padding: 34px 0 10px;
  max-width: 42em;
}

.doc h1 {
  font-size: clamp(26px, 6vw, 36px);
  margin-bottom: 8px;
}

.doc h2 {
  margin: 34px 0 12px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.doc p {
  margin: 0 0 14px;
  color: var(--text-dim);
}

.doc-meta {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 22px !important;
}

.doc b {
  color: var(--text);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 18px 0;
}

.callout p {
  margin: 0 0 10px;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-draft {
  border-left-color: var(--danger);
  background: rgba(217, 124, 110, 0.09);
}

.callout-warn {
  border-left-color: var(--danger);
}

.doc-table td,
.doc-table th {
  padding-right: 16px;
}

.tight {
  margin: 0;
  padding-left: 17px;
  font-size: 14px;
}

.tight li {
  margin-bottom: 3px;
}

.req-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 22px;
  margin: 18px 0 22px;
  font-size: 15px;
}

.req-list dt {
  color: var(--text-faint);
  font-size: 13.5px;
  padding-top: 2px;
}

.req-list dd {
  margin: 0;
  color: var(--text);
}

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

.site-foot {
  margin-top: 40px;
  padding: 30px 0 50px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 14px;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 26px;
}

.foot-title {
  margin: 0 0 10px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 600;
}

.site-foot p {
  margin: 0 0 8px;
  line-height: 1.6;
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ============================================================ телефон */

@media (max-width: 560px) {
  .card {
    padding: 20px 17px;
    border-radius: var(--radius);
  }

  .hero {
    padding: 30px 0 26px;
  }

  .lead {
    font-size: 17px;
  }

  .site-head {
    padding-top: 16px;
  }

  .site-nav {
    gap: 14px;
    font-size: 13.5px;
  }

  .req-list {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .req-list dd {
    margin-bottom: 12px;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
