:root {
  --bg: #0b0d17;
  --bg-soft: #11142100;
  --panel: #161a2b;
  --panel-2: #1d2236;
  --border: #262c44;
  --text: #e7e9f3;
  --muted: #9aa0bd;
  --brand: #6c8cff;
  --brand-2: #a855f7;
  --accent: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 16px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code {
  background: var(--panel-2);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s;
  color: var(--text);
  background: var(--panel-2);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--brand);
}
.btn.primary:hover { box-shadow: 0 12px 30px -8px var(--brand); }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.lg { padding: 14px 26px; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; border-color: #4b2030; color: var(--err); }
.btn.danger:hover { background: #2a1420; }
.btn.sm { padding: 7px 13px; font-size: 0.88rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 16px 32px;
  background: rgba(11, 13, 23, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.brand-mark { color: var(--brand); }
.nav-links { display: flex; gap: 24px; margin-left: 12px; color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: 10px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 110px 24px 90px; text-align: center; }
.hero-glow {
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(circle at center, rgba(108, 140, 255, 0.28), transparent 60%),
              radial-gradient(circle at 70% 40%, rgba(168, 85, 247, 0.22), transparent 55%);
  filter: blur(20px); pointer-events: none;
}
.hero-inner { position: relative; max-width: 860px; margin: 0 auto; }
.pill {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--muted); margin-bottom: 26px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
.grad { background: linear-gradient(120deg, var(--brand), var(--accent), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.18rem; max-width: 660px; margin: 24px auto 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-sub { margin-top: 22px; color: var(--muted); font-size: 0.92rem; }

/* ---------- Sections ---------- */
.section { padding: 80px 24px; max-width: 1120px; margin: 0 auto; }
.section.alt { background: linear-gradient(180deg, transparent, rgba(29, 34, 54, 0.4), transparent); max-width: none; }
.section-title { text-align: center; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 48px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; transition: transform 0.18s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); }
.card-ico { font-size: 2rem; margin-bottom: 14px; }
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 0.96rem; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; position: relative; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; font-weight: 700; font-size: 1.1rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; margin-bottom: 16px;
}
.step h3 { margin-bottom: 6px; }
.step p { color: var(--muted); }

/* ---------- Pricing ---------- */
.price-card {
  max-width: 420px; margin: 0 auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 20px; padding: 36px; text-align: center;
  box-shadow: var(--shadow);
}
.price-head { font-weight: 700; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; }
.price-amount { font-size: 3rem; font-weight: 800; margin: 12px 0 6px; }
.price-amount span { font-size: 1rem; color: var(--muted); font-weight: 500; }
.price-list { list-style: none; text-align: left; margin: 24px 0; display: grid; gap: 10px; }
.price-list li { color: var(--text); }
.price-note { margin-top: 16px; color: var(--muted); font-size: 0.85rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 32px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.muted { color: var(--muted); }

/* ---------- Dashboard ---------- */
#dashboard { max-width: 1120px; margin: 0 auto; padding: 48px 24px 80px; min-height: 70vh; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.dash-head h1 { font-size: 2rem; letter-spacing: -0.02em; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.app-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.app-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-slug { font-weight: 700; font-size: 1.15rem; }
.app-url { color: var(--accent); font-size: 0.9rem; word-break: break-all; display: inline-block; margin: 6px 0 16px; }
.app-url:hover { text-decoration: underline; }
.badge { font-size: 0.78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.badge.running { color: var(--ok); border-color: #1f4d3a; background: #0e2a20; }
.badge.stopped { color: var(--muted); }
.badge.provisioning { color: var(--warn); border-color: #4d3f1f; background: #2a230e; }
.badge.error { color: var(--err); border-color: #4d2020; background: #2a0e0e; }
.badge.missing { color: var(--muted); }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-err { color: var(--err); font-size: 0.82rem; margin-top: 10px; word-break: break-word; }

.empty { text-align: center; padding: 80px 20px; }
.empty-ico { font-size: 3rem; margin-bottom: 12px; }
.empty h3 { margin-bottom: 6px; }
.empty p { margin-bottom: 22px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 7, 14, 0.7); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
/* `display:flex` above would otherwise override the [hidden] attribute, leaving
   modals permanently visible — this restores hide-on-hidden. */
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative; width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow);
}
.modal h2 { margin-bottom: 20px; }
.modal-x { position: absolute; top: 16px; right: 18px; background: none; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 6px; background: var(--bg); border-radius: 12px; padding: 5px; margin-bottom: 22px; }
.tab { flex: 1; padding: 9px; border: none; background: none; color: var(--muted); font: inherit; font-weight: 600; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--panel-2); color: var(--text); }
.modal-form { display: grid; gap: 16px; }
.modal-form label { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 500; color: var(--muted); }
.modal-form input {
  font: inherit; padding: 12px 14px; border-radius: 11px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
}
.modal-form input:focus { outline: none; border-color: var(--brand); }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: -6px; }
.form-err { color: var(--err); font-size: 0.88rem; background: #2a0e0e; border: 1px solid #4d2020; padding: 9px 12px; border-radius: 9px; }
.slug-input { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.slug-input input { border: none; background: none; flex: 1; }
.slug-input input:focus { outline: none; }
.slug-suffix { color: var(--muted); padding-right: 14px; font-size: 0.92rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 13px 22px; border-radius: 12px; box-shadow: var(--shadow); z-index: 200; font-weight: 500;
}
.toast.err { border-color: #4d2020; color: var(--err); }
.toast.ok { border-color: #1f4d3a; color: var(--ok); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav { padding: 14px 18px; }
}
