/* SnipForge — shared styles
   Design tokens are declared once here and reused across pages. */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #161616;
  --border: #222;
  --border-strong: #2a2a2a;
  --accent: #7C3AED;
  --accent-hover: #8b4cf0;
  --accent-press: #6b2cd9;
  --text: #FAFAFA;
  --text-muted: #888;
  --text-dim: #555;
  --code-bg: #1a1a2e;
  --danger: #f87171;
  --ok: #4ade80;
  --warn: #fbbf24;

  --radius: 8px;
  --radius-sm: 4px;

  --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, ui-monospace, monospace;

  --maxw: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

/* -------- Layout primitives -------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type { border-bottom: none; }

.section-narrow { padding: 64px 0; }

/* -------- Header / nav -------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.brand .bolt {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.nav-user {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  white-space: nowrap;
}

.btn:hover { background: #1a1a1a; }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn-primary[disabled],
.btn-primary[aria-disabled="true"] {
  background: #2a1f3d;
  border-color: #2a1f3d;
  color: #9b8bc4;
  cursor: not-allowed;
}

.btn-secondary {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface);
}
.btn-secondary:hover { background: #1a1a1a; border-color: #333; }

.btn-ghost {
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: #1a1a1a; }

.btn-lg {
  padding: 14px 22px;
  font-size: 15px;
}

.btn-block { width: 100%; }

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

.eyebrow {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  font-weight: 600;
}

.hero p.subhead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
}

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

/* -------- Before/After demo -------- */
.demo {
  margin-top: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.demo-pane {
  padding: 20px;
  text-align: left;
}

.demo-pane + .demo-pane {
  border-left: 1px solid var(--border);
}

.demo-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.demo-label .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  margin-right: 6px;
}

.demo-label.right .dot { background: var(--accent); }

.demo pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #d4d4d4;
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  border: 1px solid #20203a;
}

.demo .notes {
  color: #b8b8b8;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: #141414;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  white-space: pre-wrap;
}

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

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

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

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

.feature .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: #1a1430;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 16px;
}

/* -------- Section heads -------- */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 600;
}

.section-head p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-muted);
}

/* -------- Trust bar -------- */
.trust {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.trust-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.trust-langs {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
}

/* -------- Pricing -------- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.plan.featured {
  border-color: #3a2a5e;
  background: linear-gradient(180deg, #15102a 0%, var(--surface) 70%);
}

.plan h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.plan .price {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 4px;
}
.plan .price .per {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.plan ul li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.plan ul li:last-child { border-bottom: none; }

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

/* -------- Footer -------- */
.site-footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }
.site-footer .dot { margin: 0 8px; color: var(--text-dim); }

/* -------- Auth card -------- */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-card .subtitle {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.form-group { margin-bottom: 16px; }

label.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="email"],
input[type="text"],
select,
textarea {
  width: 100%;
  background: #0d0d0d;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}

textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
}

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

.debug-note {
  margin-top: 24px;
  padding: 12px;
  background: #0f0f0f;
  border: 1px dashed #2a2a2a;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
}

.debug-note .tag {
  display: inline-block;
  padding: 1px 6px;
  background: #2a1f3d;
  color: #b9a3e8;
  border-radius: 3px;
  font-size: 10px;
  margin-right: 6px;
  letter-spacing: 0.04em;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin: 12px 0;
  line-height: 1.5;
}

.alert-ok {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #a7f3c8;
}

.alert-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
}

.alert-warn {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fcd58a;
}

.alert-info {
  background: #141414;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

/* -------- App editor -------- */
.app-shell {
  padding: 32px 0 64px;
}

.app-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.app-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.app-head .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.quota-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.quota-pill .bar {
  width: 60px; height: 4px;
  background: #1a1a1a;
  border-radius: 2px;
  overflow: hidden;
}
.quota-pill .bar > i {
  display: block; height: 100%;
  background: var(--accent);
  width: 0%;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

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

.panel-title {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.editor-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.editor-controls select {
  width: auto;
  min-width: 140px;
}

.generate-row {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quota-line {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.output-code {
  flex: 1;
  background: var(--code-bg);
  border: 1px solid #20203a;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #d4d4d4;
  min-height: 240px;
  white-space: pre-wrap;
  overflow: auto;
}

.output-empty {
  color: var(--text-dim);
  font-style: italic;
}

.output-actions {
  display: flex;
  gap: 8px;
}

/* spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #ffffff33;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

/* blocked banner */
.blocked-banner {
  background: #141022;
  border: 1px solid #2a1f3d;
  color: #c8b8e8;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

.blocked-banner .lock { color: var(--accent); }

/* -------- History -------- */
.history-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 24px;
}

.snippet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.snippet-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.lang-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #1a1430;
  color: #c8b8e8;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.snippet-time {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.snippet-preview {
  background: var(--code-bg);
  border: 1px solid #20203a;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #c8c8c8;
  white-space: pre;
  overflow: hidden;
  max-height: 76px;
}

.snippet-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* skeleton */
.skel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.skel-bar {
  height: 10px;
  background: linear-gradient(90deg, #1a1a1a 0%, #232323 50%, #1a1a1a 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: pulse 1.4s linear infinite;
}
.skel-bar + .skel-bar { margin-top: 10px; }
.skel-bar.w-30 { width: 30%; }
.skel-bar.w-60 { width: 60%; }
.skel-bar.w-90 { width: 90%; }
@keyframes pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* small inline link */
.inline-link {
  color: var(--accent);
  font-weight: 500;
}
.inline-link:hover { color: var(--accent-hover); }

/* copy-feedback floating */
.copy-flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #161616;
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.copy-flash.show { opacity: 1; }

/* -------- Responsive -------- */
@media (max-width: 820px) {
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid  { grid-template-columns: 1fr; }
  .demo-grid     { grid-template-columns: 1fr; }
  .demo-pane + .demo-pane { border-left: none; border-top: 1px solid var(--border); }
  .editor-grid   { grid-template-columns: 1fr; }
  .section       { padding: 64px 0; }
  .hero          { padding: 72px 0 48px; }
  .nav-links     { gap: 16px; }
  .nav-links a   { font-size: 13px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .nav { height: 56px; }
  .auth-card { padding: 24px; }
}
