/*
 * Публичная часть: лендинг, вход, админка, юридические тексты, 404.
 * Цвета берутся из tokens.css — те же, что в приложении, поэтому переход из
 * лендинга в кабинет не выглядит сменой продукта.
 */

* { box-sizing: border-box }

/* Атрибут hidden скрывает элемент через display: none в стилях браузера, и
   любое наше правило с display его молча перебивает. */
[hidden] { display: none !important }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, -apple-system, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 24px }
.narrow { max-width: 760px }

/* ---------------------------------------------------------------- шапка */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  font: 600 17px Unbounded, sans-serif;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(140deg, #4a72f5, #2450dc);
  display: grid;
  place-items: center;
  font: 700 17px Unbounded;
  box-shadow: var(--accent-glow);
}

.brand-light { font-weight: 400; color: var(--faint) }

.site-nav { display: flex; gap: 4px; margin-left: 12px }

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  transition: background .13s, color .13s;
}

.site-nav a:hover { background: var(--surface-2); color: var(--ink) }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px }

/* ---------------------------------------------------------------- кнопки */

.button {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font: 700 13px Manrope;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .1s, background .15s, border-color .15s, color .15s;
}

.button:active { transform: translateY(1px) }
.button.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--accent-glow) }
.button.primary:hover { background: var(--accent-hover) }
.button.secondary { background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft) }
.button.secondary:hover { border-color: var(--line-strong); color: var(--ink) }
.button.ghost { background: transparent; color: var(--ink-soft); padding: 10px 12px }
.button.ghost:hover { color: var(--accent-text) }
.button.big { padding: 15px 26px; font-size: 14px }
.button:disabled { opacity: .55; cursor: progress }

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  font-size: 15px;
  cursor: pointer;
  flex: none;
}

.theme-toggle:hover { border-color: var(--accent-line); color: var(--accent-text) }

/* ---------------------------------------------------------------- типографика */

h1 { font: 600 clamp(30px, 5vw, 52px) / 1.1 Unbounded, sans-serif; letter-spacing: -2px; margin: 0 }
h2 { font: 600 clamp(22px, 3vw, 32px) / 1.2 Unbounded, sans-serif; letter-spacing: -1px; margin: 0 }
h3 { font: 700 18px Manrope; margin: 0 }
.eyebrow {
  font: 700 11px Manrope;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 14px;
}

.lead { font-size: 17px; color: var(--ink-soft); margin: 20px 0 0 }
.muted { color: var(--muted) }
.section { padding: 84px 0 }
.section-head { max-width: 720px; margin-bottom: 44px }
.section-head p { color: var(--muted); margin: 14px 0 0 }

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

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

.grid { display: grid; gap: 16px }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) }

/* ---------------------------------------------------------------- формы */

.field { display: grid; gap: 6px; margin-bottom: 16px }
.field > span { font: 700 11px Manrope; letter-spacing: .4px; text-transform: uppercase; color: var(--muted) }

.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px 13px;
  font: 500 14px Manrope;
  width: 100%;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.field small { color: var(--faint); font-size: 12px }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
  cursor: pointer;
}

.check input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 1px; flex: none }

.notice {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.55;
}

.notice-error { background: var(--bad-soft); border-color: var(--bad); color: var(--bad) }
.notice-ok { background: var(--good-soft); border-color: var(--good); color: var(--good) }
.notice-info { background: var(--info-soft); border-color: var(--accent-line); color: var(--info-ink) }
.notice code { word-break: break-all; font-size: 12px }

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 44px 0 34px;
  margin-top: 40px;
  color: var(--muted);
  font-size: 13px;
}

.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px }
.footer-grid h4 { font: 700 12px Manrope; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-soft); margin: 0 0 12px }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px }
.footer-grid a { color: var(--muted); text-decoration: none }
.footer-grid a:hover { color: var(--accent-text) }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--faint) }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr }
  .site-nav { display: none }
  .section { padding: 56px 0 }
}
