:root {
  --bg: #121214;
  --bg-card: #1a1b20;
  --bg-elevated: #22242b;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #e9edf4;
  --text-muted: #94a0b4;
  --accent: #2787f5;
  --accent-bright: #4d9eff;
  --danger: #e5484d;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Фон в стиле VK ID: тонкие дуги-окружности на тёмном */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1920 1280' preserveAspectRatio='xMidYMid slice'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.07' stroke-width='1.5'%3E%3Ccircle cx='340' cy='1580' r='1100'/%3E%3Ccircle cx='2050' cy='320' r='1150'/%3E%3Ccircle cx='960' cy='-780' r='1060'/%3E%3Ccircle cx='1650' cy='1500' r='760'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
}

.page {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--accent-bright); }

.muted { color: var(--text-muted); }

[hidden] { display: none !important; }

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 16px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  gap: 5px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 13px;
}

.hero h1 {
  font-size: clamp(26px, 4.4vw, 42px);
  line-height: 1.2;
  max-width: 780px;
  margin: 24px auto 14px;
}

.hero .subtitle {
  color: var(--text-muted);
  font-size: 16.5px;
  max-width: 640px;
  margin: 0 auto 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}

.stat-pill {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 14px;
}

.stat-pill b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-bright); }

.btn-primary:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: default;
}

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

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

.btn-small {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 10px;
}

/* ---------- Cards grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
  margin: 32px 0 8px;
}

.card {
  --card-pad: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--card-pad);
}

.public-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .2s ease, transform .2s ease;
}

.public-card:hover {
  border-color: rgba(77, 158, 255, 0.35);
  transform: translateY(-2px);
}

.card-cover {
  position: relative;
  margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) 0;
  height: 170px;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
  background: var(--bg-elevated);
}

.card-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 44px;
  font-weight: 600;
  color: var(--accent-bright);
  background: linear-gradient(135deg, rgba(39, 135, 245, 0.18), rgba(39, 135, 245, 0.04));
}

.chip.cover-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-bright);
  background: rgba(39, 135, 245, 0.12);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 14px;
}

.avatar-fetch {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 16px;
}

.avatar-fetch .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.public-name {
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

a.public-name:hover { color: var(--accent-bright); }

.chip {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-bright);
  background: rgba(39, 135, 245, 0.12);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 2px;
}

.card-stats {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
}

.stat-right {
  text-align: right;
  min-width: 0;
}

.stat-right .stat-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.price-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
}

.price-format { color: var(--text-muted); }

.dots {
  flex: 1;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.16);
  transform: translateY(-4px);
}

.price-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-note {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.card-cta { margin-top: auto; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Promos ---------- */

.promos {
  display: flex;
  flex-direction: column;
}

.promo-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.promo-item {
  padding: 18px 22px;
  transition: border-color .2s ease;
}

.promo-item:hover {
  border-color: rgba(77, 158, 255, 0.3);
}

.promo-item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.promo-item-title {
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.45;
}

.promo-price {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent-bright);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.promo-item-text {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.65;
}

.promo-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 28px;
}

.promo-list li {
  display: flex;
  gap: 10px;
  color: var(--text-muted);
  font-size: 15px;
}

.promo-list li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
}

.promo-extra {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text);
}

.promo-extra::before {
  content: '+ ';
  color: var(--accent-bright);
  font-weight: 700;
}

.promo-edit {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.promo-edit-head {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.promo-edit-head input { flex: 1; }

/* ---------- Conditions ---------- */

.section-title {
  font-size: 22px;
  margin: 48px 0 18px;
}

.conditions ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conditions li {
  display: flex;
  gap: 12px;
  color: var(--text-muted);
}

.conditions li::before {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
}

/* ---------- Footer ---------- */

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 56px 0 40px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
}

.footer-legal a,
.legal-link {
  padding: 0;
  background: none;
  border: none;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  transition: color .15s ease;
}

.footer-legal a:hover,
.legal-link:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

.legal-dot {
  color: rgba(255, 255, 255, 0.25);
}

/* ---------- Реквизиты ---------- */

.requisites-modal {
  max-width: 420px;
}

.req-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.req-head h2 {
  font-size: 19px;
  margin: 0;
}

.req-name {
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  padding: 16px 0 14px;
}

.req-row {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

#req-content > .req-row:first-child {
  border-top: none;
  padding-top: 16px;
}

.req-label {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.req-value {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-decoration: none;
  cursor: copy;
  transition: color .15s ease;
}

.req-value:hover {
  color: var(--accent-bright);
}

a.req-value {
  cursor: pointer;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent-bright); }

/* ---------- Admin ---------- */

.admin .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  margin-bottom: 28px;
  background: rgba(18, 18, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-family: 'Unbounded', 'Inter', sans-serif;
  font-size: 16px;
}

.flex-spacer { flex: 1; }

.admin-section { margin-bottom: 20px; }

.admin-section h2 {
  font-size: 19px;
  margin: 0 0 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head h2 { margin: 0; }

.section-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label,
.field-label-row {
  font-size: 13px;
  color: var(--text-muted);
}

.field-label-row {
  display: block;
  margin: 4px 0 10px;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  transition: border-color .15s ease;
}

input:focus, textarea:focus, select:focus { border-color: var(--accent); }

textarea { resize: vertical; }

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pub-row-info {
  flex: 1;
  min-width: 0;
}

.pub-row-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pub-row-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.icon-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.icon-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  background: rgba(5, 8, 12, 0.72);
}

.modal-backdrop.centered {
  align-items: center;
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal-backdrop:not([hidden]) {
  animation: backdrop-in .2s ease both;
}

.modal-backdrop:not([hidden]) .modal {
  animation: modal-in .3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop:not([hidden]),
  .modal-backdrop:not([hidden]) .modal {
    animation: none;
  }
}

.modal {
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 26px;
}

.modal h2 {
  font-size: 19px;
  margin: 0 0 20px;
}

.price-edit-row {
  display: grid;
  grid-template-columns: 1fr 140px 36px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ---------- Login / toast ---------- */

.login-screen {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card h2 {
  font-size: 20px;
  margin: 0 0 8px;
}

.login-card .muted {
  font-size: 14px;
  margin: 0 0 18px;
}

.login-card .btn { width: 100%; }

.error {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
  margin-bottom: 8px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 100;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .row-2 { grid-template-columns: 1fr; gap: 0; }
  .card { --card-pad: 18px; }
  .card-stats { gap: 20px; }
  footer { flex-direction: column; align-items: flex-start; }
  .pub-row { flex-wrap: wrap; }
  .price-edit-row { grid-template-columns: 1fr 110px 36px; }
}
