:root {
  --bg: #07080f;
  --panel: rgba(20, 23, 38, 0.72);
  --panel-solid: #11131f;
  --border: rgba(255, 255, 255, 0.08);
  --text: #eef0f7;
  --muted: #8b90a8;
  --accent: #7c5cff;
  --accent2: #19d3c5;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0 0; }
small { color: var(--muted); font-weight: 400; }

/* ── Animated aurora background ─────────────────────────────── */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; filter: blur(70px); }
.aurora span {
  position: absolute; width: 45vw; height: 45vw; border-radius: 50%;
  opacity: 0.5; mix-blend-mode: screen;
}
.aurora span:nth-child(1) { background: #7c5cff; top: -10%; left: -5%; animation: drift1 18s ease-in-out infinite; }
.aurora span:nth-child(2) { background: #19d3c5; bottom: -15%; right: -5%; animation: drift2 22s ease-in-out infinite; }
.aurora span:nth-child(3) { background: #ff6fae; top: 30%; left: 40%; animation: drift3 26s ease-in-out infinite; }
@keyframes drift1 { 50% { transform: translate(20vw, 18vh) scale(1.2); } }
@keyframes drift2 { 50% { transform: translate(-18vw, -12vh) scale(1.15); } }
@keyframes drift3 { 50% { transform: translate(-22vw, 14vh) scale(0.85); } }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text);
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
  transition: transform .15s ease, box-shadow .25s ease, background .2s ease, opacity .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), #5b8cff);
  border-color: transparent;
  box-shadow: 0 8px 24px -8px var(--accent);
}
.btn.primary:hover { box-shadow: 0 14px 34px -8px var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(251,113,133,.3); }
.btn.danger:hover { background: rgba(251,113,133,.12); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn .arrow, .btn .plus { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover .plus { transform: rotate(90deg); }

/* ── Logo ────────────────────────────────────────────────────── */
.logo-mark {
  position: relative; font-size: 30px; color: var(--accent2);
  display: inline-grid; place-items: center;
  filter: drop-shadow(0 0 12px var(--accent2));
  animation: pulse-glow 3s ease-in-out infinite;
}
.logo-mark.sm { font-size: 20px; }
@keyframes pulse-glow { 50% { filter: drop-shadow(0 0 22px var(--accent2)); transform: scale(1.08); } }

/* ── Login gate ─────────────────────────────────────────────── */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  width: 360px; max-width: 100%; padding: 38px 30px; text-align: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 24px;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  animation: rise .6s cubic-bezier(.2,.8,.2,1) both;
}
.gate-card h1 { margin: 14px 0 2px; font-size: 30px; letter-spacing: -.5px; }
.gate-card input {
  width: 100%; margin: 18px 0 14px; padding: 13px 16px;
  background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font: inherit; transition: border .2s, box-shadow .2s;
}
.gate-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.18); }
.gate-card .btn { width: 100%; justify-content: center; }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.96); } }

/* ── Shell / topbar ─────────────────────────────────────────── */
.shell { animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; } }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; backdrop-filter: blur(14px);
  background: rgba(7,8,15,.6); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.topbar-actions { display: flex; gap: 10px; }
.container { max-width: 1140px; margin: 0 auto; padding: 32px 28px 80px; }

/* ── Stats ───────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 16px; margin-bottom: 28px; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; backdrop-filter: blur(12px); animation: rise .5s ease both;
}
.stat .n { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat .n.accent { color: var(--accent2); }

/* ── App cards ──────────────────────────────────────────────── */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 18px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; backdrop-filter: blur(12px); cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform .2s ease, border-color .2s, box-shadow .3s;
  animation: rise .5s ease both;
}
.card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,0%), rgba(124,92,255,.14), transparent 40%);
  transition: opacity .3s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(124,92,255,.4); box-shadow: 0 20px 50px -24px rgba(124,92,255,.6); }
.card:hover::before { opacity: 1; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-head h3 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.card-repo { color: var(--muted); font-size: 13px; margin: 8px 0 14px; word-break: break-all; }
.card-url { font-size: 13px; color: var(--accent2); text-decoration: none; }
.card-url:hover { text-decoration: underline; }
.card-meta { display: flex; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 12px; }

/* ── Status pill ────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; background: rgba(255,255,255,.05); text-transform: capitalize; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill.running .dot { background: var(--green); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: ping 1.8s infinite; }
.pill.running { color: var(--green); }
.pill.building .dot, .pill.deploying .dot { background: var(--amber); animation: spin-dot 1s linear infinite; }
.pill.building, .pill.deploying { color: var(--amber); }
.pill.failed .dot { background: var(--red); }
.pill.failed { color: var(--red); }
.pill.stopped .dot, .pill.created .dot { background: var(--muted); }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.5);} 70% { box-shadow: 0 0 0 7px rgba(52,211,153,0);} }
@keyframes spin-dot { 0%{transform:scale(.6);opacity:.5} 50%{transform:scale(1);opacity:1} 100%{transform:scale(.6);opacity:.5} }

/* ── Empty state ────────────────────────────────────────────── */
.empty { text-align: center; padding: 70px 20px; animation: rise .5s ease both; }
.empty-orb {
  width: 90px; height: 90px; margin: 0 auto 22px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent2));
  box-shadow: 0 0 50px -6px var(--accent); animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px); } }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(3,4,10,.66); backdrop-filter: blur(6px); animation: fade .25s ease;
}
.modal {
  width: 460px; max-width: 94vw; padding: 28px; border-radius: 22px;
  background: var(--panel-solid); border: 1px solid var(--border);
  box-shadow: 0 40px 100px -30px #000; animation: pop .35s cubic-bezier(.2,.9,.2,1) both;
}
.modal h2 { margin: 0 0 18px; }
.modal label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.modal input {
  width: 100%; margin-top: 7px; padding: 11px 13px; font: inherit;
  background: rgba(0,0,0,.32); border: 1px solid var(--border); border-radius: 11px; color: var(--text);
  transition: border .2s, box-shadow .2s;
}
.modal input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.16); }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(14px); } }

/* ── Drawer ─────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer::before { content:''; position:absolute; inset:0; background: rgba(3,4,10,.6); backdrop-filter: blur(4px); animation: fade .3s ease; }
.drawer-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: 620px; max-width: 96vw;
  background: var(--panel-solid); border-left: 1px solid var(--border);
  padding: 26px 28px; overflow-y: auto; animation: slide-in .35s cubic-bezier(.2,.85,.25,1) both;
}
@keyframes slide-in { from { transform: translateX(100%); } }
.drawer-close { position: absolute; top: 18px; right: 20px; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; transition: color .2s, transform .2s; }
.drawer-close:hover { color: var(--text); transform: rotate(90deg); }
.drawer h2 { margin: 0 0 4px; }
.section { margin-top: 26px; }
.section h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Live terminal ──────────────────────────────────────────── */
.terminal {
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.6;
  background: #05060c; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; height: 280px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
}
.terminal .ln { animation: type-in .2s ease both; }
.terminal .ok { color: var(--green); }
.terminal .err { color: var(--red); }
.terminal .arrow { color: var(--accent2); }
@keyframes type-in { from { opacity: 0; transform: translateX(-6px); } }

/* ── Secrets / key-value rows ───────────────────────────────── */
.kv { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kv code { background: rgba(255,255,255,.05); padding: 6px 10px; border-radius: 8px; flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.kv .lock { color: var(--accent2); }
.field { display: flex; gap: 8px; margin-top: 6px; }
.field input { flex: 1; padding: 9px 12px; background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font: inherit; font-size: 13px; }
.field input:focus { outline: none; border-color: var(--accent); }

.copy { cursor: pointer; color: var(--muted); transition: color .2s; }
.copy:hover { color: var(--accent2); }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--panel-solid); border: 1px solid var(--border); padding: 12px 20px; border-radius: 12px;
  opacity: 0; transition: all .3s ease; z-index: 100; box-shadow: 0 20px 50px -20px #000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Get Started wizard ─────────────────────────────────────── */
.wizard {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 24px; background: rgba(4,5,12,.74); backdrop-filter: blur(10px);
  animation: fade .3s ease;
}
.wiz-card {
  width: 620px; max-width: 96vw; max-height: 92vh; overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: 0 50px 120px -30px #000; display: flex; flex-direction: column;
  animation: pop .4s cubic-bezier(.2,.9,.2,1) both;
}
.wiz-head { padding: 22px 28px 0; }
.wiz-progress { display: flex; gap: 8px; margin-bottom: 18px; }
.wiz-progress .seg {
  flex: 1; height: 5px; border-radius: 999px; background: rgba(255,255,255,.08);
  overflow: hidden; position: relative;
}
.wiz-progress .seg.done { background: var(--accent2); }
.wiz-progress .seg.active::after {
  content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: fillbar .5s ease both;
}
@keyframes fillbar { from { transform: translateX(-100%); } }
.wiz-step-no { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; }

.wiz-body { padding: 8px 28px 26px; overflow-y: auto; }
.wiz-body.enter { animation: step-slide .4s cubic-bezier(.2,.85,.25,1) both; }
@keyframes step-slide { from { opacity: 0; transform: translateX(26px); } }
.wiz-body h2 { margin: 6px 0 6px; font-size: 25px; letter-spacing: -.5px; }
.wiz-body p { color: #c2c6db; line-height: 1.6; font-size: 14.5px; }
.wiz-icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(135deg, rgba(124,92,255,.25), rgba(25,211,197,.2));
  border: 1px solid var(--border); margin-bottom: 14px; animation: float 4s ease-in-out infinite;
}
.wiz-steps-list { list-style: none; padding: 0; margin: 14px 0; }
.wiz-steps-list li { padding: 9px 0 9px 30px; position: relative; color: #c2c6db; font-size: 14px; animation: rise .5s ease both; }
.wiz-steps-list li::before {
  content: '✦'; position: absolute; left: 4px; color: var(--accent2);
}
.wiz-code {
  font-family: 'JetBrains Mono', monospace; font-size: 13px; background: #05060c;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 12px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #eef0f7;
}
.wiz-code b { color: var(--accent2); }
.wiz-input {
  width: 100%; margin: 12px 0 6px; padding: 12px 14px; font: inherit; color: var(--text);
  background: rgba(0,0,0,.32); border: 1px solid var(--border); border-radius: 12px;
  transition: border .2s, box-shadow .2s;
}
.wiz-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124,92,255,.16); }
.wiz-hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.wiz-link { color: var(--accent2); text-decoration: none; font-weight: 600; }
.wiz-link:hover { text-decoration: underline; }

.dns-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.dns-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.dns-table td { padding: 9px 10px; border-top: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; }
.dns-table tr td:first-child { color: var(--accent2); }

.connected-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; font-size: 14px; margin: 10px 0; }
.check-ring {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--green);
  display: grid; place-items: center; animation: pop-check .4s cubic-bezier(.2,1.4,.4,1) both;
}
.check-ring::after { content: '✓'; font-size: 12px; }
@keyframes pop-check { from { transform: scale(0); } }

.wiz-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 28px; border-top: 1px solid var(--border); background: rgba(255,255,255,.015);
}
.wiz-foot .left { display: flex; gap: 8px; }
.wiz-skip { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 13.5px; transition: color .2s; }
.wiz-skip:hover { color: var(--text); }

/* confetti for the final step */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 90; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 9px; opacity: .9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(102vh) rotate(640deg); opacity: 0; }
}

/* ── Settings / Activity panels ─────────────────────────────── */
.panel { width: 560px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
  padding: 28px; border-radius: 22px; background: var(--panel-solid); border: 1px solid var(--border);
  box-shadow: 0 40px 100px -30px #000; animation: pop .35s cubic-bezier(.2,.9,.2,1) both; }
.panel h2 { margin: 0 0 4px; }
.panel .sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.panel label { display: block; font-size: 13px; font-weight: 600; margin: 16px 0 0; }
.panel label small { display: block; font-weight: 400; margin-top: 2px; }
.panel input { width: 100%; margin-top: 8px; padding: 11px 13px; font: inherit; color: var(--text);
  background: rgba(0,0,0,.32); border: 1px solid var(--border); border-radius: 11px; }
.panel input:focus { outline: none; border-color: var(--accent); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 4px; }
.info-grid .cell { background: #05060c; border: 1px solid var(--border); border-radius: 11px; padding: 12px 14px; }
.info-grid .cell .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.info-grid .cell .v { font-family: 'JetBrains Mono', monospace; font-size: 13px; margin-top: 4px; word-break: break-all; }
.act-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
  padding: 12px 4px; border-top: 1px solid var(--border); animation: rise .4s ease both; }
.act-row .app { font-weight: 600; }
.act-row .meta { color: var(--muted); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
