@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

:root {
  --bg:          #0a0a12;
  --bg2:         #0f0f1a;
  --bg3:         #141424;
  --border:      rgba(255,255,255,0.07);
  --border-hi:   rgba(255,255,255,0.14);
  --accent:      #7c3aed;
  --accent2:     #2563eb;
  --accent-glow: rgba(124,58,237,0.35);
  --text:        #e8e8f0;
  --text-dim:    #9090aa;
  --text-faint:  #4a4a5a;
  --success:     #10b981;
  --error:       #ef4444;
  --radius:      14px;
  --radius-sm:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Шапка ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255,255,255,0.07);
}

/* ── Кнопки ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-color: var(--border-hi);
}

/* ── Карточки ── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.25s;
}

.card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* ── Поля ввода ── */
textarea, input[type="text"] {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 14px 16px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  line-height: 1.6;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}

textarea::placeholder, input::placeholder {
  color: var(--text-faint);
}

/* ── Лейблы ── */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Тег-бейдж ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-purple {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.25);
}

.badge-blue {
  background: rgba(37,99,235,0.15);
  color: #60a5fa;
  border: 1px solid rgba(37,99,235,0.25);
}

.badge-green {
  background: rgba(16,185,129,0.12);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.2);
}

/* ── Уведомления ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7;
}

/* ── Спиннер ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Копировать ── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text-dim);
  transition: all 0.2s;
  font-family: inherit;
}

.copy-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-color: var(--border-hi);
}

.copy-btn.copied {
  border-color: rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.1);
  color: #34d399;
}

/* ── Контейнер ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Адаптив ── */
@media (max-width: 768px) {
  .nav { padding: 14px 20px; }
  .container { padding: 0 16px; }
  .nav-links a { padding: 6px 10px; font-size: 0.8rem; }
}

/* ── Кнопка темы ── */
#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-faint);
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 6px;
}
#theme-toggle:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

/* ── Светлая тема ── */
html.light {
  --bg:          #f4f4fb;
  --bg2:         #ffffff;
  --bg3:         #eaeaf4;
  --border:      rgba(0,0,0,0.09);
  --border-hi:   rgba(0,0,0,0.18);
  --text:        #111120;
  --text-dim:    #4a4a6a;
  --text-faint:  #8888a0;
  --accent-glow: rgba(124,58,237,0.15);
}
html.light body {
  background: var(--bg);
  color: var(--text);
}
html.light .nav {
  background: rgba(244,244,251,0.92);
}
html.light .nav-links a:hover,
html.light .nav-links a.active {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
html.light .nav-right a:hover {
  background: rgba(0,0,0,0.06) !important;
  color: var(--text) !important;
}
html.light #theme-toggle:hover {
  background: rgba(0,0,0,0.06);
}
html.light .btn-secondary {
  background: rgba(0,0,0,0.05);
  color: var(--text-dim);
  border-color: var(--border);
}
html.light .btn-secondary:hover {
  background: rgba(0,0,0,0.09);
  color: var(--text);
  border-color: var(--border-hi);
}
html.light .copy-btn {
  background: rgba(0,0,0,0.04);
  color: var(--text-dim);
  border-color: var(--border);
}
html.light .copy-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text);
}
html.light .spinner {
  border-color: rgba(0,0,0,0.12);
  border-top-color: var(--accent);
}
html.light .card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
html.light textarea:focus,
html.light input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
