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

:root {
  --bg: #09090b;
  --bg-card: #111113;
  --bg-elevated: #18181b;
  --border: #27272a;
  --border-strong: #3f3f46;
  --text: #fafafa;
  --text-soft: #a1a1aa;
  --muted: #71717a;
  --accent: #356eff;
  --accent-hover: #2557e0;
  --green: #05df72;
  --green-deep: #00bb7f;
  --amber: #fcbb00;
  --red: #ff2357;
  --radius-card: 12px;
  --radius-ctrl: 8px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 65% 42% at 20% -5%, rgba(53, 110, 255, 0.22), transparent 62%),
    radial-gradient(ellipse 55% 38% at 85% 15%, rgba(5, 223, 114, 0.14), transparent 60%),
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display-font {
  font-family: 'Montserrat', 'Inter', sans-serif;
  letter-spacing: -0.025em;
}

code, .mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.tnum { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Topbar (Landing) ──────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(9, 9, 11, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 16px;
}
.brand-badge {
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--radius-ctrl);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* ── App Shell (Dashboard & Admin) ─────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0b0b0e;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-ctrl);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.tab-btn svg { flex-shrink: 0; opacity: 0.8; }
.tab-btn:hover { background: var(--bg-elevated); color: #fff; }
.tab-btn.active {
  background: rgba(53, 110, 255, 0.14);
  border-color: rgba(53, 110, 255, 0.45);
  color: #fff;
}
.tab-btn.active svg { color: var(--green); opacity: 1; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.main-area { display: flex; flex-direction: column; min-width: 0; }

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.main-content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
  padding: 40px 0 48px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}
.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 12px 0 16px;
}

.hero-app-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: 0 0 28px rgba(53, 110, 255, 0.25), 0 8px 20px rgba(0, 0, 0, 0.55);
}

.hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.12;
  margin: 0;
  color: var(--text);
}
.hero h1 .accent-word { color: var(--green); }

.hero-preview {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1100px;
  padding: 16px 0;
}

.hero-preview-glow {
  position: absolute;
  inset: -12px;
  background:
    radial-gradient(circle at 65% 28%, rgba(53, 110, 255, 0.32), transparent 55%),
    radial-gradient(circle at 35% 75%, rgba(5, 223, 114, 0.22), transparent 55%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
}

.hero-mockup-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 375px;
  transform-style: preserve-3d;
  transform: rotateY(-12deg) rotateX(4deg) rotate(2.5deg);
  transition: transform 0.3s ease;
}

.hero-mockup-stage:hover {
  transform: rotateY(-6deg) rotateX(2deg) rotate(1.2deg) translateY(-4px);
}

.hero-mockup-frame {
  padding: 6px;
  border-radius: 20px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(53, 110, 255, 0.16) 45%, rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 28px 68px rgba(0, 0, 0, 0.82),
    0 0 42px rgba(53, 110, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-preview-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-float-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  background: rgba(14, 16, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
  z-index: 2;
}

.hero-float-badge--top {
  top: 18px;
  right: -18px;
  border-color: rgba(53, 110, 255, 0.45);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 20px rgba(53, 110, 255, 0.22);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.hero-mockup-stage:hover .hero-float-badge--top {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Cards & Grids ─────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 22px;
}

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}
.stat-label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: 800; margin-top: 6px; color: #fff; font-variant-numeric: tabular-nums; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-ctrl);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.1s ease;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-strong); background: #222226; }
.btn-danger { background: rgba(255, 35, 87, 0.12); color: #fda4af; border-color: rgba(255, 35, 87, 0.35); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 35, 87, 0.22); }
.btn-success { background: #059669; color: #ffffff; font-weight: 700; }
.btn-success:hover:not(:disabled) { background: #047857; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-lg { padding: 14px 24px; font-size: 15px; font-weight: 700; }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.input, .select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--border);
  background: #09090b;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.14s ease;
}
.input:focus, .select:focus { border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field label { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* ── Searchable Select Dropdown ────────────────────────────────────────── */
.ss-wrap { position: relative; width: 100%; }
.ss-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ss-trigger {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--border);
  background: #09090b;
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.14s ease;
}
.ss-trigger:hover:not(:disabled),
.ss-wrap.is-open .ss-trigger { border-color: var(--accent); }
.ss-trigger:disabled { opacity: 0.55; cursor: not-allowed; }
.ss-trigger-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-trigger-text.is-placeholder { color: var(--muted); }
.ss-panel {
  margin-top: 6px;
  background: #0e1015;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-ctrl);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72);
  overflow: hidden;
}
.ss-panel[hidden] { display: none; }
.ss-search-wrap {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: #09090b;
}
.ss-search {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #131317;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.ss-search:focus { border-color: var(--accent); }
.ss-list { max-height: 200px; overflow-y: auto; padding: 4px; }
.ss-group {
  padding: 6px 8px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.ss-option {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  display: block;
}
.ss-option:hover { background: rgba(53, 110, 255, 0.16); color: #ffffff; }
.ss-option.is-selected { background: rgba(5, 223, 114, 0.14); color: var(--green); font-weight: 600; }
.ss-empty { padding: 12px 10px; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-free { background: #18181b; color: #d4d4d8; border: 1px solid #3f3f46; }
.badge-plus { background: rgba(53, 110, 255, 0.16); color: #93c5fd; border: 1px solid rgba(53, 110, 255, 0.4); }
.badge-pro { background: rgba(5, 223, 114, 0.14); color: #6ee7b7; border: 1px solid rgba(5, 223, 114, 0.4); }
.badge-warn { background: rgba(252, 187, 0, 0.14); color: #fcd34d; border: 1px solid rgba(252, 187, 0, 0.4); }
.badge-err { background: rgba(255, 35, 87, 0.14); color: #fda4af; border: 1px solid rgba(255, 35, 87, 0.4); }

/* ── Tables ────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #09090b;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #1c1c20; }
th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-card);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(53, 110, 255, 0.06); }

/* ── Progress & Alerts ─────────────────────────────────────────────────── */
.progress-track {
  width: 100%;
  height: 6px;
  background: #18181b;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--radius-pill);
  transition: width 0.25s ease;
}

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-ctrl);
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid rgba(53, 110, 255, 0.4);
  background: rgba(53, 110, 255, 0.1);
  color: #dbeafe;
}
.alert-err {
  border-color: rgba(255, 35, 87, 0.45);
  background: rgba(255, 35, 87, 0.12);
  color: #fecdd3;
}

/* ── Pricing Cards ─────────────────────────────────────────────────────── */
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.18s ease;
}
.price-card:hover { border-color: var(--accent); }
.price-card--pro {
  border-color: rgba(5, 223, 114, 0.5);
  background: linear-gradient(180deg, rgba(5, 223, 114, 0.07) 0%, #111113 42%);
}
.price-tag {
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 800;
  margin: 12px 0 4px;
  font-variant-numeric: tabular-nums;
}
.price-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; font-family: 'Inter', sans-serif; }
.feature-list { list-style: none; padding: 0; margin: 14px 0 22px; display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: #d4d4d8; }
.feature-list li { display: flex; align-items: flex-start; gap: 8px; }
.feature-list li svg { flex-shrink: 0; margin-top: 3px; color: var(--green); }

/* ── Modals (Login & Register/Pricing Flow) ────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop.is-open { opacity: 1; }

.modal-box {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
  position: relative;
  opacity: 0;
  transform: translateY(18px) scale(0.95);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}
.modal-backdrop.is-open .modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.modal-box--wide { max-width: 960px; }

.enco-swal-popup {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85) !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-ctrl);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: #fff; border-color: var(--border-strong); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 20px 0 28px; }
  .hero-mockup-stage { max-width: 320px; transform: rotateY(-6deg) rotate(1.5deg); }
  .hero-float-badge--top { right: -6px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .tab-btn { width: auto; }
  .main-content, .main-header { padding: 16px; }
}
