:root {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --ink: #0b1220;
  --muted: #5a6a82;
  --line: #d5dee9;
  --navy: #163a6b;
  --navy-deep: #0c2748;
  --orange: #ff6a00;
  --orange-hot: #ff8533;
  --emerald: #2e9e5b;
  --danger: #d64545;
  --font-display: "Space Grotesk", "Avenir Next", sans-serif;
  --font-body: "Figtree", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --shadow: 0 18px 50px rgba(12, 39, 72, 0.1);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(246, 248, 252, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy-deep);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-brand span { color: var(--orange); }
.nav-links {
  display: flex;
  gap: 1.25rem;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-links a:hover { color: var(--navy); }
.nav-cta { display: flex; gap: 0.5rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
  font-weight: 700;
  font-size: 0.92rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-hot));
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary {
  background: var(--bg-elev);
  color: var(--navy);
  border: 1px solid var(--line);
}
.btn-ghost {
  background: transparent;
  color: var(--navy);
}
.btn-danger {
  background: #fff1f1;
  color: var(--danger);
  border: 1px solid #f0c4c4;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1rem, 4vw, 2.5rem) 3rem;
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(255, 106, 0, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(22, 58, 107, 0.14), transparent 50%),
    linear-gradient(180deg, #eef3f9 0%, var(--bg) 100%);
}
.hero-inner { max-width: 720px; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin: 0 0 0.75rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--navy-deep);
  margin: 0 0 1rem;
}
.hero .lede {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.55;
  margin: 0 0 1.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-meta {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.section {
  padding: 3rem clamp(1rem, 4vw, 2.5rem);
  max-width: 1100px;
  margin: 0 auto;
}
.section h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  color: var(--navy-deep);
  margin: 0 0 0.5rem;
}
.section > .sub {
  color: var(--muted);
  margin: 0 0 1.75rem;
  max-width: 36rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.step {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.step .num {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--orange);
  font-size: 0.85rem;
}
.step h3 {
  margin: 0.4rem 0 0.35rem;
  font-size: 1.05rem;
  color: var(--navy-deep);
}
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.price-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.price-card.featured {
  border-color: var(--orange);
  box-shadow: var(--shadow);
}
.price-card h3 { margin: 0 0 0.25rem; font-family: var(--font-display); color: var(--navy-deep); }
.price-card .amount {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy-deep);
  margin: 0.5rem 0;
}
.price-card ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
}

.demo-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.drop-hit {
  width: 100%;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 2rem 1rem;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}
.drop-hit:hover { border-color: var(--orange); background: #fffaf5; }
.drop-title { display: block; font-weight: 700; color: var(--navy); }
.drop-sub { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  border: none;
  margin: 1rem 0;
  padding: 0;
}
.ticks legend { font-weight: 700; color: var(--navy); margin-bottom: 0.35rem; width: 100%; }
.tick { display: flex; align-items: center; gap: 0.4rem; color: var(--ink); font-weight: 600; }
.preview-wrap { margin-top: 1rem; }
.preview-wrap img, .result-img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.msg {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
}
.msg.error { background: #fff1f1; color: var(--danger); }
.msg.ok { background: #eefaf2; color: var(--emerald); }
.msg.info { background: #eef3f9; color: var(--navy); }

.site-footer {
  margin-top: 3rem;
  padding: 2rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}
.site-footer a { color: var(--navy); text-decoration: none; font-weight: 600; }

/* Auth */
.auth-shell {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
.auth-aside {
  background: linear-gradient(160deg, var(--navy-deep), var(--navy));
  color: #fff;
  padding: clamp(2rem, 5vw, 3.5rem);
}
.auth-aside h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}
.auth-aside p { opacity: 0.85; line-height: 1.5; }
.auth-aside ul { margin: 1.5rem 0 0; padding-left: 1.1rem; line-height: 1.7; opacity: 0.9; }
.auth-main {
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 440px;
}
.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.tabs button {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: var(--muted);
}
.tabs button.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
label.field {
  display: block;
  margin-bottom: 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy-deep);
}
label.field input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}
.hint { font-size: 0.82rem; color: var(--muted); font-weight: 500; margin-top: 0.25rem; }

/* Dashboard */
.app-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}
.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}
.app-header h1 {
  font-family: var(--font-display);
  margin: 0;
  color: var(--navy-deep);
  font-size: 1.8rem;
}
.balance-pill {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: #fff;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  min-width: 180px;
}
.balance-pill .label { font-size: 0.8rem; opacity: 0.8; }
.balance-pill .value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-family: var(--font-display);
  color: var(--navy-deep);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--line);
}
th { color: var(--muted); font-weight: 600; }
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
.keycode {
  background: #0c2748;
  color: #e8f0ff;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  word-break: break-all;
  margin: 0.75rem 0;
}
.docs-body {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem;
}
.docs-body h1 {
  font-family: var(--font-display);
  color: var(--navy-deep);
}
.docs-body h2 {
  font-family: var(--font-display);
  color: var(--navy-deep);
  margin-top: 2rem;
}
.docs-body pre {
  background: #0c2748;
  color: #e8f0ff;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.45;
}
.docs-body table { margin: 1rem 0; }
.admin-panel { margin-top: 1.25rem; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.fields-out {
  margin-top: 1rem;
  font-size: 0.9rem;
  max-height: 280px;
  overflow: auto;
  background: #f8fafc;
  border-radius: 10px;
  padding: 0.75rem;
  border: 1px solid var(--line);
}
