/*
 * Оформление страниц id.claos.ru — как в приложении claos (claos/src/design: themes.ts, tokens.ts):
 * тёплый фон со свечением, белые карточки со скруглением 22, кнопки с оранжевым градиентом.
 * Шрифт системный: своих и чужих файлов шрифтов нет. Тёмная тема — по настройке системы.
 * Встроенных стилей на страницах нет (CSP), всё оформление — здесь.
 */

:root {
  color-scheme: light;
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-muted: #f2eee7;
  --surface-sunken: #f7f4ef;
  --input: #ffffff;
  --text: #18130e;
  --text-2: #4b443b;
  --muted: #6f665b;
  --faint: #8a8176;
  --border: rgba(24, 19, 14, 0.06);
  --border-strong: rgba(24, 19, 14, 0.1);
  --divider: rgba(24, 19, 14, 0.07);
  --accent: #f97316;
  --accent-deep: #c2410c;
  --accent-soft: #fff1e2;
  --on-gradient: #2a1504;
  --danger: #b4232a;
  --danger-border: rgba(180, 35, 42, 0.18);
  --success: #12a15a;
  --gradient: linear-gradient(135deg, #ffbc57 0%, #fb8a24 52%, #f26a12 100%);
  --shadow-card: 0 1px 2px rgba(24, 19, 14, 0.05), 0 12px 28px -20px rgba(24, 19, 14, 0.32);
  --shadow-brand: 0 10px 22px -12px rgba(242, 106, 18, 0.7);
  --glow-1: rgba(249, 115, 22, 0.16);
  --glow-2: rgba(124, 92, 252, 0.1);
  --glow-3: rgba(47, 128, 237, 0.08);

  --tone-accent-bg: #fff1e2;
  --tone-accent-fg: #c2410c;
  --tone-blue-bg: #e8f2ff;
  --tone-blue-fg: #1c5fc0;
  --tone-green-bg: #e4f7ed;
  --tone-green-fg: #0b7a43;
  --tone-red-bg: #ffecec;
  --tone-red-fg: #b4232a;
  --tone-amber-bg: #fff4dc;
  --tone-amber-fg: #8a5a06;
  --tone-slate-bg: #eef1f5;
  --tone-slate-fg: #475569;

  --r-tile: 13px;
  --r-button: 13px;
  --r-button-large: 15px;
  --r-row: 16px;
  --r-card: 22px;
  --r-pill: 999px;

  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #120e0a;
    --surface: #221b15;
    --surface-muted: rgba(255, 240, 225, 0.08);
    --surface-sunken: rgba(255, 240, 225, 0.07);
    --input: #1c1611;
    --text: #f6efe7;
    --text-2: #d9cec2;
    --muted: #b9ada0;
    --faint: #8f8478;
    --border: rgba(255, 240, 225, 0.08);
    --border-strong: rgba(255, 240, 225, 0.14);
    --divider: rgba(255, 240, 225, 0.08);
    --accent-deep: #ffb27a;
    --accent-soft: rgba(249, 115, 22, 0.18);
    --danger: #ff9a9d;
    --danger-border: rgba(255, 154, 157, 0.24);
    --success: #3ddc84;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 32px -22px rgba(0, 0, 0, 0.7);
    --glow-1: rgba(249, 115, 22, 0.14);
    --glow-2: rgba(124, 92, 252, 0.12);
    --glow-3: rgba(47, 128, 237, 0.08);

    --tone-accent-bg: rgba(249, 115, 22, 0.18);
    --tone-accent-fg: #ffb27a;
    --tone-blue-bg: rgba(47, 128, 237, 0.18);
    --tone-blue-fg: #8dbaff;
    --tone-green-bg: rgba(18, 161, 90, 0.18);
    --tone-green-fg: #6fd7a0;
    --tone-red-bg: rgba(207, 47, 54, 0.2);
    --tone-red-fg: #ff9a9d;
    --tone-amber-bg: rgba(245, 166, 35, 0.18);
    --tone-amber-fg: #f5c46b;
    --tone-slate-bg: rgba(148, 163, 184, 0.16);
    --tone-slate-fg: #cbd5e1;
  }
}

/* ── Основа ──────────────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(420px 320px at -10% -6%, var(--glow-1), transparent 70%),
    radial-gradient(360px 300px at 110% 8%, var(--glow-2), transparent 70%),
    radial-gradient(440px 340px at 50% 112%, var(--glow-3), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: var(--accent-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

h1 {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
}

h2 {
  margin: 24px 0 10px;
  font-size: 18px;
  font-weight: 700;
}

p {
  margin: 0 0 12px;
}

code,
.code {
  font-family: var(--mono);
  font-size: 0.92em;
}

/* ── Шапка и подвал ─────────────────────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.brand b {
  color: var(--accent);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--gradient);
  box-shadow: var(--shadow-brand);
  color: var(--on-gradient);
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}

.top-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 15px;
}

.top-links a {
  color: var(--text-2);
  text-decoration: none;
  font-weight: 600;
}

.top-links a:hover {
  color: var(--accent-deep);
}

.top-links form {
  margin: 0;
}

.bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  padding: 24px 20px 32px;
  font-size: 13px;
  color: var(--faint);
}

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

/* ── Страница и карточка ────────────────────────────────────────────────────────────── */

.page {
  flex: 1;
  width: 100%;
  margin: 0 auto;
  padding: 12px 20px 24px;
}

.page-narrow {
  max-width: 480px;
}

.page-wide {
  max-width: 800px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 28px;
}

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

.lead {
  color: var(--muted);
  margin-bottom: 20px;
}

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

.stack > * + * {
  margin-top: 12px;
}

.divider {
  height: 1px;
  background: var(--divider);
  border: 0;
  margin: 20px 0;
}

/* ── Формы ──────────────────────────────────────────────────────────────────────────── */

.form {
  margin: 0;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.field input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-button);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field input::placeholder {
  color: var(--faint);
}

.hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.field-invalid input {
  border-color: var(--danger);
}

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-2);
}

.check input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.check .field-error {
  grid-column: 2;
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.form .actions {
  margin-top: 8px;
}

.form-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
}

/* ── Кнопки ─────────────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  border-radius: var(--r-button-large);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s, filter 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: var(--on-gradient);
  background: var(--gradient);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.form .btn-primary {
  width: 100%;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--surface-sunken);
}

.btn-link {
  min-height: auto;
  padding: 0;
  background: none;
  color: var(--accent-deep);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Сообщения и метки ──────────────────────────────────────────────────────────────── */

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--r-tile);
  font-size: 14px;
  border: 1px solid transparent;
}

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

.notice-error {
  background: var(--tone-red-bg);
  color: var(--tone-red-fg);
  border-color: var(--danger-border);
}

.notice-warning {
  background: var(--tone-amber-bg);
  color: var(--tone-amber-fg);
}

.notice-success {
  background: var(--tone-green-bg);
  color: var(--tone-green-fg);
}

.notice-info {
  background: var(--tone-slate-bg);
  color: var(--tone-slate-fg);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-accent {
  background: var(--tone-accent-bg);
  color: var(--tone-accent-fg);
}

.tag-amber {
  background: var(--tone-amber-bg);
  color: var(--tone-amber-fg);
}

.tag-green {
  background: var(--tone-green-bg);
  color: var(--tone-green-fg);
}

.tag-slate {
  background: var(--tone-slate-bg);
  color: var(--tone-slate-fg);
}

.tag.code {
  font-family: var(--mono);
  letter-spacing: 0.12em;
}

/* ── Списки ─────────────────────────────────────────────────────────────────────────── */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list li + li {
  margin-top: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-row);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

a.row:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.row-main > * {
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-main .muted {
  font-size: 13px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 16px;
  font-size: 14px;
}

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

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

pre.letter {
  margin: 0;
  padding: 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-row);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Текст юридических документов. */
.prose {
  font-size: 15px;
  color: var(--text-2);
}

.prose h2 {
  color: var(--text);
}

/* ── Телефон ────────────────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .top {
    padding: 12px 16px;
  }

  .page {
    padding: 8px 12px 20px;
  }

  .card {
    padding: 22px 18px;
  }

  h1 {
    font-size: 23px;
  }

  .top-links {
    gap: 12px;
    font-size: 14px;
  }
}
