:root {
  --bg: #121218;
  --bg-elevated: #1c1c24;
  --surface: rgba(38, 38, 50, 0.72);
  --surface-solid: #262632;
  --border: rgba(139, 128, 249, 0.16);
  --border-strong: rgba(139, 128, 249, 0.42);
  --accent: #8b80f9;
  --accent-deep: #3e3a70;
  --accent-glow: rgba(139, 128, 249, 0.35);
  --cyan: #5ce1e6;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --text: #ebebf5;
  --muted: #9696a5;
  --radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient Background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.35;
}
.glow-1 {
  width: 560px; height: 560px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, #8b80f9, transparent 70%);
}
.glow-2 {
  width: 620px; height: 620px;
  bottom: -220px; right: -140px;
  background: radial-gradient(circle, #3e3a70, transparent 70%);
}
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(235, 235, 245, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(235, 235, 245, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 90%);
}

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

.muted { color: var(--muted); }
.accent { color: var(--accent); font-weight: 600; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(18, 18, 24, 0.78);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo svg { width: 38px; height: 38px; display: block; }
.brand-text { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.08em; }
.brand-ver {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(139, 128, 249, 0.14);
  border: 1px solid rgba(139, 128, 249, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: 0.2s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--text);
  background: rgba(139, 128, 249, 0.12);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.user-chip-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem;
}
.user-chip-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-chip-name { font-size: 0.86rem; font-weight: 600; }
.user-chip-sub { font-size: 0.72rem; color: var(--muted); }
.sub-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sub-dot.active { background: var(--success); box-shadow: 0 0 10px var(--success); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 13px 24px; font-size: 0.98rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #8b80f9, #6b5ce7);
  color: #fff;
  box-shadow: 0 8px 24px rgba(139, 128, 249, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 10px 30px rgba(139, 128, 249, 0.45);
  transform: translateY(-1px);
}
.btn-ghost {
  background: rgba(38, 38, 50, 0.7);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: rgba(62, 58, 112, 0.4);
}
.btn-danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.24); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Hero */
.hero { padding: 78px 0 64px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items: center;
}
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(139, 128, 249, 0.12);
  border: 1px solid rgba(139, 128, 249, 0.28);
  font-size: 0.82rem;
  font-weight: 600;
  color: #c8c2ff;
  margin-bottom: 18px;
}
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}
.hero h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.35rem);
  line-height: 1.12;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(120deg, #a99bff 0%, #8b80f9 45%, #5ce1e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 0 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }
.hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
}
.stat-val { display: block; font-size: 1.25rem; font-weight: 800; }
.stat-lbl { font-size: 0.78rem; color: var(--muted); }
.stat-sep { width: 1px; height: 32px; background: var(--border); }

/* Preview Window */
.preview-window {
  background: linear-gradient(160deg, rgba(38, 38, 50, 0.92), rgba(24, 24, 32, 0.95));
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 50px rgba(139, 128, 249, 0.16);
  overflow: hidden;
}
.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(18, 18, 24, 0.7);
  border-bottom: 1px solid var(--border);
}
.dots { display: flex; gap: 7px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(235, 235, 245, 0.18); }
.dots span:first-child { background: #f87171; }
.dots span:nth-child(2) { background: #fbbf24; }
.dots span:nth-child(3) { background: #4ade80; }
.preview-title { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.preview-status {
  font-size: 0.7rem; font-weight: 700; color: var(--success);
  padding: 2px 8px; border-radius: 6px;
  background: rgba(74, 222, 128, 0.14);
}
.preview-body {
  display: grid;
  grid-template-columns: 120px 1fr;
  min-height: 270px;
}
.preview-sidebar {
  padding: 16px 10px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.p-nav {
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.82rem;
  color: var(--muted);
}
.p-nav.active {
  background: rgba(139, 128, 249, 0.18);
  color: var(--text);
  font-weight: 600;
}
.preview-main {
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px; justify-content: space-between;
}
.p-hero-card {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 128, 249, 0.18), rgba(62, 58, 112, 0.25));
  border: 1px solid rgba(139, 128, 249, 0.3);
}
.p-tag { font-size: 0.68rem; font-weight: 700; color: var(--success); letter-spacing: 0.06em; }
.p-client-name { font-size: 1.15rem; font-weight: 800; }
.p-sub { font-size: 0.78rem; color: var(--muted); }
.p-ram-chip {
  font-size: 0.78rem; font-weight: 700;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(18, 18, 24, 0.7);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.p-slider-box {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(18, 18, 24, 0.55);
  border: 1px solid var(--border);
}
.p-slider-head {
  display: flex; justify-content: space-between;
  font-size: 0.78rem; margin-bottom: 10px;
}
.p-slider-track {
  position: relative; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.p-slider-fill {
  width: 45%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}
.p-slider-thumb {
  position: absolute; left: 45%; top: 50%;
  transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 14px var(--accent);
}
.p-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.p-btn-sec, .p-btn-pri {
  text-align: center; padding: 10px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 700;
}
.p-btn-sec { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border); }
.p-btn-pri { background: linear-gradient(135deg, #8b80f9, #6b5ce7); }

/* Sections */
.section { padding: 72px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 44px; }
.section-eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); margin: 0 0 10px; }
.section-head p { margin: 0; color: var(--muted); }

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
}
.f-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(139, 128, 249, 0.14);
  border: 1px solid rgba(139, 128, 249, 0.25);
  display: grid; place-items: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 1.08rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.plan-card:hover { transform: translateY(-5px); border-color: var(--border-strong); }
.plan-card.popular {
  background: linear-gradient(175deg, rgba(62, 58, 112, 0.45), rgba(38, 38, 50, 0.92));
  border-color: var(--accent);
  box-shadow: 0 18px 50px rgba(139, 128, 249, 0.2);
}
.plan-badge {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(139, 128, 249, 0.16);
  color: #d3ceff;
  border: 1px solid rgba(139, 128, 249, 0.32);
  margin-bottom: 14px;
}
.plan-card.popular .plan-badge {
  background: var(--accent);
  color: #121218;
  border-color: transparent;
}
.plan-duration { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; }
.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 20px;
}
.plan-price { font-size: 2.45rem; font-weight: 800; letter-spacing: -0.02em; }
.plan-old-price { font-size: 1rem; color: var(--muted); text-decoration: line-through; }
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  color: #d4d4e4;
}
.plan-features li::before {
  content: "✓";
  color: var(--accent);
  font-weight: 800;
}

/* Cabinet */
.cabinet-guest {
  padding: 48px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  max-width: 680px;
  margin: 0 auto;
}
.cabinet-guest h3 { margin: 0 0 10px; font-size: 1.4rem; }
.cabinet-guest p { margin: 0 0 24px; color: var(--muted); }
.cabinet-guest-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

.cabinet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.cab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
}
.cab-card.full { grid-column: 1 / -1; }
.cab-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 18px;
}
.cab-head h3 { margin: 0; font-size: 1.15rem; }

.profile-top {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 58px; height: 58px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  display: grid; place-items: center;
  font-size: 1.5rem; font-weight: 800;
}
.profile-meta h4 { margin: 0 0 4px; font-size: 1.25rem; }
.role-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(139, 128, 249, 0.2);
  color: #d6d1ff;
  border: 1px solid rgba(139, 128, 249, 0.35);
}

.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 14px;
  background: rgba(18, 18, 24, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.92rem;
}
.info-row code {
  font-family: 'Consolas', monospace;
  font-size: 0.84rem;
  color: #c8c2ff;
  word-break: break-all;
}

.status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.status-pill.ok { background: rgba(74, 222, 128, 0.16); color: var(--success); border: 1px solid rgba(74, 222, 128, 0.32); }
.status-pill.no { background: rgba(248, 113, 113, 0.15); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.32); }

.download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 24, 0.65);
}
.download-box.unlocked {
  border-color: rgba(139, 128, 249, 0.45);
  background: linear-gradient(135deg, rgba(139, 128, 249, 0.14), rgba(24, 24, 34, 0.85));
}
.download-box.locked {
  border-color: rgba(248, 113, 113, 0.28);
}
.download-info h4 { margin: 0 0 6px; font-size: 1.12rem; }
.download-info p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.orders-table-wrap { overflow-x: auto; }
.orders-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.orders-table th, .orders-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.orders-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

/* News */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-card {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.news-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 0.8rem;
}
.news-tag {
  padding: 3px 9px; border-radius: 6px; font-weight: 700;
  background: rgba(139, 128, 249, 0.16); color: #cfcaff;
}
.news-card h3 { margin: 0 0 8px; font-size: 1.04rem; }
.news-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: var(--text); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: min(440px, 100%);
  background: #1d1d27;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}
.modal-wide { width: min(520px, 100%); }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: transparent; border: none; color: var(--muted);
  font-size: 1.6rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text); }

.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 5px;
  background: rgba(18, 18, 24, 0.7);
  border-radius: 12px;
  margin-bottom: 20px;
}
.auth-tab {
  padding: 9px; border: none; border-radius: 9px;
  background: transparent; color: var(--muted);
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.modal-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 0.86rem; font-weight: 600; color: #d5d5e6; }
.form-group input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(18, 18, 24, 0.8);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.form-group input:focus { border-color: var(--accent); }

.form-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  font-size: 0.88rem;
}

.checkout-header h3 { margin: 0 0 6px; font-size: 1.35rem; }
.checkout-header p { margin: 0 0 18px; font-size: 0.9rem; }

.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-method {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 8px;
  border-radius: 11px;
  background: rgba(18, 18, 24, 0.75);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: center;
}
.pay-method input { display: none; }
.pay-method.active {
  border-color: var(--accent);
  background: rgba(139, 128, 249, 0.16);
}

.promo-row { display: flex; gap: 8px; }
.promo-hint { font-size: 0.78rem; }

.checkout-summary {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(18, 18, 24, 0.75);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.sum-row { display: flex; justify-content: space-between; font-size: 0.92rem; }
.sum-total {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-weight: 800;
  font-size: 1.08rem;
  color: #fff;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 13px 18px;
  border-radius: 12px;
  background: #232330;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 0.9rem;
  max-width: 360px;
}
.toast.ok { border-color: rgba(74, 222, 128, 0.5); }
.toast.err { border-color: rgba(248, 113, 113, 0.5); }

@media (max-width: 960px) {
  .hero-grid, .features-grid, .pricing-grid, .news-grid, .cabinet-grid {
    grid-template-columns: 1fr;
  }
  .nav-links { display: none; }
  .download-box { flex-direction: column; align-items: flex-start; }
  .pay-methods { grid-template-columns: 1fr; }
}
