/* Общие стили marflow: цвета, шрифт, контейнер, кнопки, поля, карточки.
   Подключаются на всех страницах сайта (лендинг, панель), чтобы сетка и вид совпадали. */

:root {
  --bg: #0b0b0e;
  --surface: #141418;
  --surface-2: #1b1b21;
  --border: #25252d;
  --border-strong: #3a3a45;
  --text: #ededf2;
  --muted: #8b8b98;
  --accent: #c6ff3d;
  --accent-ink: #0b0b0e;
  --danger: #ff5a5f;
  --warn: #ffb547;
  --radius: 14px;
  --container: 1200px;
  --gutter: 28px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* иначе display у .btn и т.п. перебивает hidden */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter Tight", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* Единый контейнер для всех страниц */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (max-width: 900px) {
  :root { --gutter: 16px; }
}

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

.topbar { border-bottom: 1px solid var(--border); }
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-logo { width: 26px; height: 26px; }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, filter .15s;
}
.btn:hover { border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-wide { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
.btn-icon { padding: 9px; width: 40px; }
.btn-icon svg { width: 18px; height: 18px; }

/* ---------- карточки и поля ---------- */

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

.section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; flex: 1; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); }
.field-row { display: flex; gap: 10px; }

input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus { border-color: var(--accent); }

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

/* переключатель */
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 14px; user-select: none; }
.switch input { display: none; }
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: background .15s;
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent-ink); }

/* ---------- уведомление ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: var(--danger); color: #ffd5d6; }
.toast.ok { border-color: var(--accent); }
