:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --line: #1d2130;
  --text: #e7e9ee;
  --muted: #9aa3b2;
  --brand: #6ea8fe;
  --brand-2: #8bd3ff;
  --accent: #a78bfa;
  --ok: #36d399;
  --bad: #f87272;
}

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

html {
  scroll-behavior: smooth;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 12, 16, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(110, 168, 254, 0.1);
  transition: all 0.3s ease;
}

.nav.scrolled {
  background: rgba(11, 12, 16, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.menu {
  margin-left: auto;
  display: flex;
  gap: 24px;
  align-items: center;
}

.menu a {
  color: var(--muted);
  transition: color 0.2s ease;
  font-weight: 500;
}

.menu a:hover {
  color: var(--text);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid #293045;
  transition: all 0.25s ease;
  background: transparent;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0b0c10;
  border-color: transparent;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(110, 168, 254, 0.4);
}

.btn-ghost {
  color: var(--text);
  background: transparent;
  border-color: #293045;
}

.btn-ghost:hover {
  background: rgba(110, 168, 254, 0.08);
  border-color: var(--brand);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1.05rem;
}

/* ===== HERO SECTION ===== */
.hero {
  background: 
    radial-gradient(1000px 400px at 10% -10%, rgba(110, 168, 254, 0.20), transparent 60%),
    radial-gradient(1000px 400px at 90% -20%, rgba(139, 211, 255, 0.12), transparent 60%);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 42px;
}

.hero-inner {
  text-align: center;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.2;
  margin-bottom: 24px;
  padding: 8px 0;
  font-weight: 800;
  overflow: visible;
  
  /* Анимированный градиент */
  background: linear-gradient(90deg, #5B9BFF, #8BD3FF, #A78BFA, #C084FC, #A78BFA, #8BD3FF, #5B9BFF);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease-in-out infinite;
}

.hero-subtitle {
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 680px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* ===== CATALOG SECTION ===== */
.catalog-section {
  padding: 48px 0 64px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  margin: 0;
}

.section-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ===== CARDS GRID ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(110, 168, 254, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.card:hover::before {
  opacity: 1;
}

.card .title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 4px;
}

.card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid;
}

.chip.ok {
  background: rgba(54, 211, 153, 0.12);
  border-color: rgba(54, 211, 153, 0.3);
  color: #36d399;
}

.chip.bad {
  background: rgba(248, 114, 114, 0.12);
  border-color: rgba(248, 114, 114, 0.3);
  color: #f87272;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-2);
}

.card .actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.card .actions .btn {
  flex: 1;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
}

.empty-state svg {
  width: 120px;
  height: 120px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 1.05rem;
  margin-bottom: 28px;
}

/* ===== AUTH SLOT ===== */
.auth-slot {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}

.pill {
  background: rgba(110, 168, 254, 0.12);
  color: var(--brand-2);
  border: 1px solid rgba(110, 168, 254, 0.25);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* ===== TOAST ===== */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: #0f121a;
  border: 1px solid var(--line);
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  min-width: 280px;
  pointer-events: all;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.err {
  border-color: rgba(248, 114, 114, 0.3);
  background: rgba(248, 114, 114, 0.1);
}

/* ===== LOADING STATE ===== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid rgba(110, 168, 254, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== AUTH DIALOG STYLES ===== */
dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  max-width: 440px;
  width: 92%;
  background: var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.dlg-head {
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0b0c10;
  font-weight: 700;
  font-size: 1.1rem;
}

.dlg-body {
  padding: 24px;
}

.auth-email,
.auth-pass {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1rem;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.auth-email:focus,
.auth-pass:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(110, 168, 254, 0.08);
}

.dlg-actions {
  display: flex;
  gap: 10px;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--line);
}

.dlg-actions .btn {
  flex: 1;
}

/* ===== ANIMATIONS ===== */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: 1fr;
  }
  
  .menu {
    display: none;
  }
  
  .hero {
    padding: 32px 0 28px;
  }
  
  .catalog-section {
    padding: 32px 0 48px;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 600px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-actions .btn {
    width: 100%;
  }
  
  .card .actions {
    flex-direction: column;
  }
  
  .dlg-actions {
    flex-direction: column;
  }
}

/* ===== СТИЛИ ДЛЯ КНОПОК АВТОРИЗАЦИИ ===== */
/* Кнопка "Войти" в каталоге - точно как на главной */
.auth-slot .btn-primary {
  background: linear-gradient(90deg, #4A8EFF 0%, #7B85FA 50%, #8B7BFA 100%) !important;
  background-size: 200% 100% !important;
  background-position: 100% 0 !important;
  color: #fff !important;
  box-shadow: 0 8px 25px rgba(74, 142, 255, 0.3) !important;
  font-weight: 700 !important;
  padding: 11px 18px !important;
  border-radius: 12px !important;
  border-color: transparent !important;
  position: relative !important;
  vertical-align: middle !important;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.auth-slot .btn-primary:hover {
  background-position: 0% 0 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 35px rgba(91, 155, 255, 0.4) !important;
}

/* Кнопка "Выйти" в каталоге - как на главной */
.auth-slot .btn-secondary {
  background: rgba(110, 168, 254, 0.1) !important;
  border: 1px solid rgba(110, 168, 254, 0.2) !important;
  color: var(--text) !important;
  padding: 11px 18px !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(110, 168, 254, 0.15) !important;
  vertical-align: middle !important;
  transition: all 0.3s ease !important;
}

.auth-slot .btn-secondary:hover {
  background: rgba(110, 168, 254, 0.15) !important;
  border-color: var(--brand) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(110, 168, 254, 0.25) !important;
}
