/* ==========================================================================
   Базовая тема: тёмная, мобильная, без внешних шрифтов и CDN.
   ========================================================================== */

:root {
  --bg: #0a0d14;
  --bg-soft: #0f1420;
  --surface: #131a27;
  --surface-2: #1a2334;
  --border: #26314a;
  --border-strong: #3a4767;
  --text: #e9eefb;
  --muted: #98a5c0;
  --dim: #6e7c99;
  --accent: #6c8cff;
  --accent-2: #22d3a7;
  --accent-soft: rgba(108, 140, 255, 0.14);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.12);
  --warning: #ffc857;
  --success: #3ddc97;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --maxw: 1080px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -240px, rgba(108, 140, 255, 0.18), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 12px;
  font-weight: 700;
}

h1 {
  font-size: clamp(28px, 7vw, 44px);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(21px, 4.6vw, 28px);
}

h3 {
  font-size: 18px;
}

p {
  margin: 0 0 12px;
}

img,
svg {
  max-width: 100%;
}

/* ---------- Каркас ---------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding: 28px 0;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 8px 16px;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-badge {
  display: block;
  flex: none;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.nav a:hover,
.nav a.is-active {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

/* На телефонах в шапке остаётся только основное действие — «Регистрация» */
@media (max-width: 719px) {
  .nav a.nav-hide-mobile {
    display: none;
  }
}

.footer {
  margin-top: 32px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 13px;
}

/* ---------- Карточки и сетки ---------- */

.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.card-muted {
  background: var(--surface);
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.dim {
  color: var(--dim);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 16px 0;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #202b40;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(140deg, var(--accent), #8f7bff);
  color: #0a0d14;
  box-shadow: 0 10px 24px rgba(108, 140, 255, 0.32);
}

.btn-primary:hover {
  background: linear-gradient(140deg, #7f9bff, #9c88ff);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--danger);
}

.btn-sm {
  min-height: 38px;
  padding: 7px 13px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

/* ---------- Поля ввода ---------- */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label,
.label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.field .hint {
  font-size: 12.5px;
  color: var(--dim);
}

input[type="text"],
input[type="url"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0c111b;
  color: var(--text);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #56617c;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
}

.checkbox input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

/* ---------- Мелочи ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(108, 140, 255, 0.32);
  color: #b9c8ff;
  font-size: 12.5px;
  font-weight: 600;
}

.badge-success {
  background: rgba(61, 220, 151, 0.12);
  border-color: rgba(61, 220, 151, 0.35);
  color: #8ff0c4;
}

.badge-warning {
  background: rgba(255, 200, 87, 0.12);
  border-color: rgba(255, 200, 87, 0.35);
  color: var(--warning);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: #cdd8ff;
}

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  font-size: 14.5px;
}

.alert-error {
  border-color: rgba(255, 107, 107, 0.42);
  background: var(--danger-soft);
  color: #ffc9c9;
}

.alert-success {
  border-color: rgba(61, 220, 151, 0.4);
  background: rgba(61, 220, 151, 0.1);
  color: #a9f3d3;
}

.alert-warning {
  border-color: rgba(255, 200, 87, 0.4);
  background: rgba(255, 200, 87, 0.1);
  color: #ffe0a3;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 20px);
  z-index: 60;
  max-width: min(460px, 92vw);
  padding: 13px 16px;
  border-radius: 12px;
  background: #182032;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 14.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 720px) {
  .container {
    padding: 0 24px;
  }

  .section {
    padding: 40px 0;
  }

  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
