/* Палитра бренда Nizya: основной фиолетовый, дополнительный лайм,
   глубокий чёрный фон (см. CLAUDE.md). Светлая тема — тот же набор на
   светлом фоне, чтобы страница не слепила в системной светлой схеме. */
:root {
  --brand: #7b4fc9;
  --brand-alt: #9cc94f;
  --bg: #0a0a0c;
  --card: #15151a;
  --text: #f2f2f5;
  --muted: #9a9aa6;
  --line: #26262e;
  --error: #ff6b6b;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #f7f7fa;
    --card: #ffffff;
    --text: #15151a;
    --muted: #61616e;
    --line: #e3e3ea;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.2px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wrap {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}

h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 20px 0 8px; }

.muted { color: var(--muted); }

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0;
}

.form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.form-inline { margin-top: 12px; }

label { color: var(--muted); font-size: 14px; }

input[type='email'],
input[type='text'] {
  padding: 12px;
  font-size: 16px; /* меньше 16px — и мобильный Safari зумит страницу на фокусе */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

input:focus-visible,
button:focus-visible { outline: 2px solid var(--brand-alt); outline-offset: 2px; }

button {
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button.link {
  padding: 0;
  color: var(--brand-alt);
  background: none;
  font-weight: 500;
  text-decoration: underline;
}

.consent { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 4px 0; }
.consent legend { color: var(--muted); font-size: 13px; padding: 0 4px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }

.error {
  margin: 0 0 16px;
  padding: 12px;
  color: var(--error);
  background: rgb(255 107 107 / 10%);
  border: 1px solid var(--error);
  border-radius: 10px;
}

.foot { padding: 16px; border-top: 1px solid var(--line); text-align: center; }
.foot a, a { color: var(--brand-alt); }

/* ─── каталог тарифов ─── */

.card + .card { margin-top: 12px; }

.tariff-top { border-color: var(--brand); }

.tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-alt);
  border: 1px solid var(--brand-alt);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
}

.specs { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }

.periods { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.period {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.period:hover { border-color: var(--brand); }
.period-top { border-color: var(--brand-alt); }
.period-price { font-weight: 600; white-space: nowrap; }
.period-price s { margin-left: 6px; font-weight: 400; font-size: 13px; }

.note { margin-top: 12px; font-size: 14px; }

/* ─── разделы кабинета ─── */

.sections { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 8px 0 4px; }

input[type='text'][readonly] {
  width: 100%;
  margin-bottom: 8px;
  color: var(--muted);
}

/* Документы приходят готовой разметкой: ограничиваем только то, что ломает вид. */
.document { margin: 8px 0; overflow-wrap: anywhere; }
.document img { max-width: 100%; height: auto; }
.document table { width: 100%; border-collapse: collapse; }
.document h1, .document h2, .document h3 { font-size: 17px; margin: 16px 0 6px; }

.period input[type='radio'] { accent-color: var(--brand); }

.button-link {
  display: inline-block;
  padding: 12px 16px;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border-radius: 10px;
  text-decoration: none;
}

.button-link:hover { filter: brightness(1.08); }
