/* Общие стили: тёмная тема, градиенты, кнопки, формы. */

:root {
  --bg-0: #0f172a;
  --bg-1: #1e293b;
  --bg-2: #253449;
  --text-0: #f1f5f9;
  --text-1: #cbd5e1;
  --text-2: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --accent-1: #38bdf8;
  --accent-2: #a78bfa;
  --accent-3: #f472b6;
  --gradient: linear-gradient(135deg, #38bdf8 0%, #a78bfa 55%, #f472b6 100%);
  --gradient-soft: linear-gradient(135deg, rgba(56,189,248,.18), rgba(167,139,250,.18), rgba(244,114,182,.18));
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: var(--text-0);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.55;
}

a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Карточки ---- */
.card {
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* ---- Кнопки ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--gradient);
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(167, 139, 250, 0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--text-0);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(148, 163, 184, 0.08); }

/* ---- Формы ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text-0);
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* ---- Текст ---- */
.muted { color: var(--text-2); font-size: 14px; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---- Spinner ---- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Progress ---- */
.progress {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  overflow: hidden;
}
.progress > .bar {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  border-radius: 999px;
  transition: width .4s ease;
}

/* ---- Уведомления ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--text-0);
  font-size: 14px;
  max-width: 360px;
  z-index: 9999;
  animation: toastIn .25s ease;
}
.toast.error { border-color: rgba(244, 114, 182, 0.6); }
.toast.ok    { border-color: rgba(56, 189, 248, 0.6); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Хедер страниц (внутренних) ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}
.topbar .logo {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.3px;
}
.topbar .logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar .nav { display: flex; gap: 16px; align-items: center; font-size: 14px; }