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

:root {
  --bg: #0a0e1a;
  --accent: #4d81ff;
  --accent-soft: rgba(77, 129, 255, 0.15);
  --accent-orange: #ff9f43;
  --accent-orange-soft: rgba(255, 159, 67, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f2f4fb;
  --text-dim: rgba(242, 244, 251, 0.6);
  --text-dimmer: rgba(242, 244, 251, 0.4);
  --radius-lg: 28px;
  --radius-md: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

/* Any component class that sets its own `display` (buttons, flex containers,
   etc.) has the same specificity as the browser's default `[hidden]` rule,
   so author CSS silently wins and the element stays visible. Force `hidden`
   to always mean hidden, site-wide. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Outfit", "Manrope", system-ui, sans-serif;
  letter-spacing: -0.01em;
  scroll-behavior: smooth;
}

#stars {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 14, 26, 0.55);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 20px;
}

.nav-auth {
  display: flex;
  gap: 12px;
}

.nav-auth[hidden] {
  display: none;
}

.nav-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.nav-account[hidden] {
  display: none;
}

.nav-account-name {
  font-weight: 600;
  font-size: 14px;
}

.nav-account-expiry {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.nav-account-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-account-logout:hover {
  background: rgba(255, 99, 99, 0.15);
  color: #ff8080;
}

.nav-account-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.3s var(--ease);
}

.nav-account-refresh:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: rotate(90deg);
}

.nav-promo-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 320px;
  max-height: 320px;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(14, 18, 32, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.6);
}

@media (max-width: 860px) {
  .nav-account-expiry {
    display: none;
  }

  .nav-promo-popover {
    right: -60px;
  }
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.social-icon svg {
  width: 18px;
  height: 18px;
}

.social-icon:hover {
  color: var(--accent);
  border-color: rgba(77, 129, 255, 0.5);
  box-shadow: 0 0 16px -4px rgba(77, 129, 255, 0.6);
  transform: scale(1.02);
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 14px;
  color: var(--text-dim);
}

.nav-links a {
  transition: color 0.2s var(--ease);
}

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

/* ---------- buttons & badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.btn:hover {
  transform: scale(1.02);
}

.btn-primary {
  background: var(--accent);
  color: #061019;
  box-shadow: 0 0 24px -4px rgba(77, 129, 255, 0.7);
}

.btn-primary:hover {
  box-shadow: 0 0 32px -2px rgba(77, 129, 255, 0.9);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(77, 129, 255, 0.5);
  background: rgba(77, 129, 255, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-soft);
  border: 1px solid rgba(77, 129, 255, 0.3);
  color: var(--accent);
}

/* ---------- glass card ---------- */
.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 32px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.card:hover {
  transform: scale(1.015);
  border-color: rgba(77, 129, 255, 0.35);
  box-shadow: 0 0 40px -12px rgba(77, 129, 255, 0.35);
}

/* ---------- hero ---------- */
.hero {
  padding: 120px 0 100px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.08;
  margin: 28px 0 20px;
}

.hero h1 span {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(77, 129, 255, 0.5);
}

.hero p {
  max-width: 560px;
  margin: 0 auto 40px;
  color: var(--text-dim);
  font-size: 17px;
  line-height: 1.6;
}

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

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.8s var(--ease) forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- sections ---------- */
section {
  padding: 90px 0;
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 56px;
}

.section-head .badge {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  margin: 0 0 14px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- features grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.feature h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
}

.feature p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

/* ---------- pricing ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

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

.plan.featured {
  border-color: rgba(77, 129, 255, 0.45);
  box-shadow: 0 0 50px -14px rgba(77, 129, 255, 0.45);
  position: relative;
}

.plan-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.plan-price {
  font-size: 40px;
  font-weight: 800;
  margin: 14px 0 4px;
}

.plan-price small {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
}

.plan-desc {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 24px;
}

.plan-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: var(--text);
  flex: 1;
}

.plan-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

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

.plan .btn {
  width: 100%;
}

.plan .btn + .btn {
  margin-top: 12px;
}

/* ---------- lifetime plans ---------- */
.lifetime-head {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  margin: 56px 0 32px;
  font-size: 14px;
  color: var(--text-dimmer);
}

.lifetime-line {
  height: 1px;
  width: 80px;
  background: var(--border);
}

.lifetime-grid {
  grid-template-columns: repeat(2, 1fr);
  max-width: 760px;
  margin: 0 auto;
}

.lifetime .plan-price {
  margin-bottom: 20px;
}

.check-list li::before {
  content: "✓";
  width: auto;
  height: auto;
  margin-top: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.lifetime-pro .check-list li::before {
  color: var(--accent-orange);
}

.badge-pro {
  background: var(--accent-orange-soft);
  border-color: rgba(255, 159, 67, 0.35);
  color: var(--accent-orange);
}

.lifetime-pro {
  border-color: rgba(255, 159, 67, 0.35);
}

.lifetime-pro:hover {
  border-color: rgba(255, 159, 67, 0.5);
  box-shadow: 0 0 40px -12px rgba(255, 159, 67, 0.35);
}

.lifetime-ultimate {
  border-color: rgba(77, 129, 255, 0.35);
}

.btn-pro {
  background: var(--accent-orange);
  color: #1a0f04;
  box-shadow: 0 0 24px -4px rgba(255, 159, 67, 0.7);
}

.btn-pro:hover {
  box-shadow: 0 0 32px -2px rgba(255, 159, 67, 0.9);
}

@media (max-width: 860px) {
  .lifetime-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- register modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 16, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: rgba(14, 18, 32, 0.85);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal:hover {
  transform: translateY(0) scale(1);
}

.modal h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.modal-tab {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.modal-tab.active {
  background: var(--accent);
  color: #061019;
}

.modal-sub {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.field input::placeholder {
  color: var(--text-dimmer);
}

.field input:focus {
  border-color: rgba(77, 129, 255, 0.6);
  background: rgba(77, 129, 255, 0.06);
}

.field input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 99, 99, 0.5);
}

.form-message {
  min-height: 18px;
  font-size: 13px;
  margin: 4px 0 16px;
}

.form-message.error {
  color: #ff8080;
}

.form-message.success {
  color: #7ee1a8;
}

/* ---------- account summary (post-login, non-admin) ---------- */
.account-summary {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.account-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.account-summary-name {
  font-size: 18px;
  font-weight: 700;
}

.account-summary-balance {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.account-summary-balance b {
  color: var(--text);
  font-weight: 700;
}

/* ---------- admin panel ---------- */
.admin-modal {
  max-width: 920px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tab {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.admin-tab.active {
  background: var(--accent);
  color: #061019;
  border-color: transparent;
}

.admin-toast {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  font-size: 13px;
  border-radius: 12px;
  text-align: center;
  transition: max-height 0.25s var(--ease), padding 0.25s var(--ease), margin 0.25s var(--ease);
  margin: 0;
}

.admin-toast.show {
  max-height: 60px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.admin-toast.success { color: #7ee1a8; }
.admin-toast.error { color: #ff8080; }

.admin-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.admin-pane[hidden] {
  display: none;
}

.admin-scroll {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.admin-create-form input,
.admin-create-form select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.admin-create-form input:focus,
.admin-create-form select:focus {
  border-color: rgba(77, 129, 255, 0.6);
}

.admin-create-form button {
  grid-column: 1 / -1;
}

.admin-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.02);
}

.admin-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 8px;
}

.admin-item-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.admin-log-meta {
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  opacity: 0.7;
}

.admin-referral-row {
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-left: 2px;
}

.admin-item-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-mini-input,
.admin-mini-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.admin-mini-input {
  width: 100px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.admin-code {
  font-family: monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.admin-search {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.admin-search::placeholder {
  color: var(--text-dimmer);
}

.admin-search:focus {
  border-color: rgba(77, 129, 255, 0.6);
  background: rgba(77, 129, 255, 0.06);
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-dimmer);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
}

.admin-table td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--text);
}

.admin-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 24px !important;
}

.tier-tag {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tier-FREE { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.tier-PRO { background: var(--accent-orange-soft); color: var(--accent-orange); }
.tier-ULTIMATE { background: var(--accent-soft); color: var(--accent); }
.tier-ADMIN { background: rgba(255, 77, 109, 0.15); color: #ff6b86; }
.tier-SUPPORT { background: rgba(126, 225, 168, 0.15); color: #7ee1a8; }
.tier-MEDIA { background: rgba(186, 143, 255, 0.15); color: #ba8fff; }

.status-tag {
  font-size: 12px;
}

.status-blocked { color: #ff8080; }
.status-active { color: #7ee1a8; }

@media (max-width: 640px) {
  .admin-modal {
    max-height: 90vh;
  }
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: var(--text-dim);
}

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

.footer-note {
  font-size: 13px;
  color: var(--text-dimmer);
}

@media (max-width: 860px) {
  .features-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}
