:root {
  --brand-300: #8ec5ff;
  --brand-400: #59a3ff;
  --brand-500: #3380fc;
  --brand-600: #1f60f1;
  --ink-900: #0a0e1a;
  --ink-800: #0f1424;
  --ink-700: #161c30;
  --line: rgba(255, 255, 255, 0.1);
  --text: #e9eef7;
  --muted: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-color: var(--ink-900);
  background-image:
    radial-gradient(60rem 60rem at 80% -10%, rgba(51, 128, 252, 0.18), transparent 60%),
    radial-gradient(50rem 50rem at -10% 20%, rgba(29, 58, 141, 0.22), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.narrow { max-width: 760px; }

.brand { font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.brand .a { color: #fff; }
.brand .b {
  background: linear-gradient(90deg, var(--brand-300), var(--brand-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.nav { display: flex; align-items: center; justify-content: space-between; }
.nav-links { display: flex; gap: 12px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; padding: 10px 18px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; transition: transform .08s, background .2s, opacity .2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--brand-500); color: #fff;
  box-shadow: 0 10px 25px -5px rgba(31, 96, 241, 0.4);
}
.btn-primary:hover { background: var(--brand-400); }
.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); }
.btn-danger { color: #fca5a5; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.btn-block { width: 100%; }

.card {
  border-radius: 18px; border: 1px solid var(--line);
  background: rgba(15, 20, 36, 0.7); backdrop-filter: blur(6px);
  box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6); padding: 24px;
}
.card.highlight { box-shadow: 0 0 0 2px rgba(51,128,252,0.6), 0 20px 40px -20px rgba(0,0,0,0.6); }

.hero { text-align: center; padding: 70px 0 40px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem;
  color: var(--muted); border: 1px solid var(--line);
  background: rgba(255,255,255,0.05); border-radius: 999px; padding: 5px 12px; margin-bottom: 18px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-400); animation: glow 4s ease-in-out infinite; }
.hero h1 { font-size: 3rem; line-height: 1.1; letter-spacing: -0.03em; max-width: 720px; margin: 0 auto; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--brand-300), var(--brand-500));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 540px; margin: 18px auto 0; }
.hero .cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.plan h3 { font-size: 1.25rem; }
.plan .desc { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.plan .price { font-size: 2rem; font-weight: 800; margin: 14px 0; }
.plan .price span { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan ul { list-style: none; margin: 0 0 18px; font-size: .9rem; color: #cbd5e1; }
.plan ul li { padding: 3px 0; }
.ck { color: var(--brand-300); font-weight: 700; margin-right: 6px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; color: var(--brand-300);
  background: rgba(51,128,252,0.2); border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }

.field { margin-bottom: 16px; }
.label { display: block; font-size: .85rem; color: #cbd5e1; margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(10,14,26,0.6); color: var(--text); padding: 11px 14px; font-size: .9rem; outline: none;
  transition: border .2s, box-shadow .2s;
}
.input::placeholder { color: #64748b; }
.input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(51,128,252,0.3); }

.auth-wrap { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.auth-card { width: 100%; max-width: 420px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.link { color: var(--brand-300); }
.link:hover { text-decoration: underline; }
.error { color: #fca5a5; font-size: .85rem; margin-top: 4px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; }

.quota-label { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 5px; }
.quota-track { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.quota-fill { height: 100%; border-radius: 999px; background: var(--brand-500); transition: width .3s; }
.quota-fill.warn { background: #f59e0b; } .quota-fill.crit { background: #ef4444; }

.srv-head { display: flex; justify-content: space-between; align-items: flex-start; }
.srv-specs { display: flex; gap: 12px; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.status { font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 3px 10px; }
.status.ACTIVE { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.status.PROVISIONING { background: rgba(245,158,11,0.15); color: #fcd34d; }

.spinner { width: 15px; height: 15px; border: 2px solid var(--line); border-top-color: var(--brand-400); border-radius: 50%; display: inline-block; vertical-align: middle; animation: spin .7s linear infinite; }
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.deploy-screen { text-align: center; padding: 50px 24px; }
.deploy-screen .spinner { margin-bottom: 18px; }
.prov-log { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.prov-log .done { color: #6ee7b7; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 560px) { .choices { grid-template-columns: 1fr; } }
.choice {
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.05);
  color: #cbd5e1; padding: 10px 12px; font-size: .85rem; text-align: left; cursor: pointer; transition: .15s;
}
.choice:hover { background: rgba(255,255,255,0.1); }
.choice.active { border-color: var(--brand-400); background: rgba(51,128,252,0.15); color: #fff; }

.toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.05);
  padding: 11px 14px; font-size: .9rem; cursor: pointer; margin-bottom: 10px;
}
.toggle-row.active { border-color: var(--brand-400); background: rgba(51,128,252,0.15); }
.switch { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,0.15); padding: 2px; transition: .2s; }
.switch.on { background: var(--brand-500); }
.knob { display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on .knob { transform: translateX(16px); }

.slider { width: 100%; accent-color: var(--brand-500); }
.reco { border: 1px solid rgba(51,128,252,0.3); background: rgba(51,128,252,0.1); border-radius: 12px; padding: 14px; }
.reco-title { font-weight: 600; color: var(--brand-300); }
.reco ul { font-size: .78rem; color: #cbd5e1; margin: 8px 0 0 0; list-style: none; }

.pay-toggle { display: inline-flex; border: 1px solid var(--line); background: rgba(255,255,255,0.05); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.pay-toggle button { border: none; background: none; color: var(--muted); padding: 8px 16px; border-radius: 9px; font-size: .85rem; font-weight: 500; cursor: pointer; }
.pay-toggle button.active { background: var(--brand-500); color: #fff; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 24px 0; text-align: center; color: #64748b; font-size: .85rem; }
.section-title { font-size: 1.8rem; font-weight: 700; text-align: center; margin: 30px 0; }

.feature { text-align: left; }
.feature .ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.3rem; background: rgba(51,128,252,0.15); border: 1px solid rgba(51,128,252,0.3); margin-bottom: 12px;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 4px; }
.feature p { color: var(--muted); font-size: .88rem; }

.steps { counter-reset: step; }
.step { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step .num {
  counter-increment: step; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
}
.step .num::before { content: counter(step); }
.step h3 { font-size: 1rem; }
.step p { color: var(--muted); font-size: .88rem; }

.faq-item { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.03); margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand-300); font-size: 1.3rem; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding: 0 16px 14px; color: var(--muted); font-size: .9rem; }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; text-align: center; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat .big { font-size: 1.8rem; font-weight: 800; }
.stat .big .grad { background: linear-gradient(90deg, var(--brand-300), var(--brand-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .lbl { color: var(--muted); font-size: .82rem; }

.cta-band { text-align: center; padding: 50px 24px; background: linear-gradient(135deg, rgba(51,128,252,0.15), rgba(29,58,141,0.15)); border: 1px solid rgba(51,128,252,0.25); border-radius: 22px; }

.fade-up { animation: fadeUp .4s ease-out both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.hidden { display: none !important; }

.btn { transition: transform .12s ease, background .2s, box-shadow .2s, opacity .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary:hover { box-shadow: 0 14px 30px -6px rgba(31, 96, 241, 0.55); }

.plan, .feature, .hoverable {
  transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.plan:hover, .feature:hover, .hoverable:hover {
  transform: translateY(-6px);
  border-color: rgba(89, 163, 255, 0.45);
  box-shadow: 0 26px 50px -24px rgba(51, 128, 252, 0.55);
}
.feature .ico { transition: transform .25s ease, background .25s ease; }
.feature:hover .ico { transform: scale(1.08) rotate(-3deg); background: rgba(51,128,252,0.25); }

.choice { transition: transform .12s ease, background .15s, border-color .15s; }
.choice:hover { transform: translateY(-2px); }

.stat { transition: transform .2s ease; }
.stat:hover { transform: translateY(-4px); }

.faq-item summary { transition: background .15s; }
.faq-item summary:hover { background: rgba(255,255,255,0.04); }

.brand { transition: opacity .15s; }
.brand:hover { opacity: .85; }

.step .num { transition: transform .2s ease; }
.step:hover .num { transform: scale(1.1); }

.ico svg { width: 22px; height: 22px; stroke: var(--brand-300); fill: none; stroke-width: 1.8; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang-toggle button {
  border: none; background: transparent; color: var(--muted);
  padding: 7px 11px; font-size: .78rem; font-weight: 700; cursor: pointer; transition: .15s;
}
.lang-toggle button:hover { color: var(--text); }
.lang-toggle button.active { background: var(--brand-500); color: #fff; }

html[data-theme="light"] {
  --ink-900: #f4f7fb; --ink-800: #ffffff; --ink-700: #eef2f8;
  --line: rgba(15, 23, 42, 0.1); --text: #0f172a; --muted: #64748b;
}
html[data-theme="light"] body {
  background-image:
    radial-gradient(60rem 60rem at 80% -10%, rgba(51,128,252,0.10), transparent 60%),
    radial-gradient(50rem 50rem at -10% 20%, rgba(51,128,252,0.08), transparent 55%);
}
html[data-theme="light"] .card { background: rgba(255,255,255,0.9); }
html[data-theme="light"] .input { background: #fff; }
html[data-theme="light"] .btn-ghost { background: rgba(15,23,42,0.04); }
html[data-theme="light"] .console { background: #0f1424; color: #e9eef7; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex: 0 0 244px; padding: 22px 16px; border-right: 1px solid var(--line);
  background: var(--ink-800); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  color: var(--muted); font-size: .92rem; font-weight: 500; transition: .15s;
}
.side-link:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.side-link.active { background: rgba(51,128,252,0.15); color: var(--text); }
html[data-theme="light"] .side-link:hover { background: rgba(15,23,42,0.05); }
.si { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { margin-top: auto; padding-top: 16px; }
.side-user { font-size: .78rem; color: var(--muted); margin-bottom: 10px; word-break: break-all; }
.side-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.icon-btn {
  border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 1rem; transition: .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.main { flex: 1; min-width: 0; }
.main-inner { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px; }
.page-title { font-size: 1.5rem; font-weight: 700; }
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin: 0 0 0 auto; padding: 0; display: flex; gap: 8px; align-items: center; }
  .side-user { display: none; }
}

.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 999; }
.toast {
  background: var(--ink-700); border: 1px solid var(--line); color: var(--text);
  padding: 12px 16px; border-radius: 12px; font-size: .88rem; box-shadow: 0 12px 30px -10px rgba(0,0,0,0.5);
  opacity: 0; transform: translateX(20px); transition: .25s; border-left: 3px solid var(--brand-500);
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: #ef4444; }

.console {
  background: #0a0e1a; border: 1px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .8rem;
  padding: 14px; height: 320px; overflow-y: auto; line-height: 1.6;
}
.console .ln { white-space: pre-wrap; }
.console .tm { color: #64748b; } .console .ok2 { color: #6ee7b7; } .console .warn2 { color: #fcd34d; } .console .err2 { color: #fca5a5; } .console .inf { color: #8ec5ff; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.metric .quota-label { font-size: .8rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: none; border: none; color: var(--muted); padding: 10px 14px; font-size: .9rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; transition: .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--brand-500); }

.status.RUNNING { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.status.STOPPED { background: rgba(148,163,184,0.18); color: #cbd5e1; }
.status.dotline { display: inline-flex; align-items: center; gap: 7px; }
.status .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: glow 2s ease-in-out infinite; }

.var-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.var-row .btn { padding: 8px 12px; }

select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--muted); padding: 9px 14px; border-radius: 10px; font-size: .85rem; cursor: pointer; transition: .15s; }
.seg button.active { border-color: var(--brand-400); background: rgba(51,128,252,0.15); color: var(--text); }

.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 40px 0 20px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-col h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 12px; }
.foot-col a { display: block; color: var(--text); font-size: .9rem; padding: 4px 0; opacity: .85; transition: .15s; }
.foot-col a:hover { opacity: 1; color: var(--brand-300); }
.foot-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; cursor: pointer; transition: background .15s; border: 1px solid transparent; }
.file-row:hover { background: rgba(255,255,255,0.05); border-color: var(--line); }
html[data-theme="light"] .file-row:hover { background: rgba(15,23,42,0.04); }
.file-ic { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; font-family: ui-monospace, Menlo, monospace; font-size: .72rem; font-weight: 700; background: rgba(51,128,252,0.15); color: var(--brand-300); }
.file-name { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.file-del { margin-left: auto; color: #fca5a5; opacity: 0; transition: .15s; background: none; border: none; cursor: pointer; font-size: .9rem; padding: 4px 8px; }
.file-row:hover .file-del { opacity: 1; }
.code-editor {
  width: 100%; min-height: 380px; resize: vertical;
  background: #0a0e1a; color: #e9eef7; border: 1px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .82rem; line-height: 1.6;
  padding: 14px; outline: none; tab-size: 2; white-space: pre; overflow: auto;
}
.code-editor:focus { border-color: var(--brand-400); }
.editor-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.editor-name { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; color: var(--muted); }

.row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
