:root {
  --bg: #090d13; --panel: #111820; --line: #1c2733;
  --text: #d3dde7; --muted: #6b7a8a; --cyan: #00f2ff; --cyan-deep: #00c8d3;
  --good: #35d47f; --danger: #ff4d5e;
}
* { box-sizing: border-box; }
/* Ensure the [hidden] attribute always wins over element display rules
   (e.g. .modal-card input{display:block} was showing the hidden Name field on Sign in). */
[hidden] { display: none !important; }
body {
  margin: 0; font-family: Inter, system-ui, sans-serif; color: var(--text);
  background: radial-gradient(1000px 500px at 80% -10%, rgba(0,242,255,.07), transparent 60%), var(--bg);
  min-height: 100vh;
}
a { color: var(--cyan); }
b { color: #fff; }
.muted { color: var(--muted); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }

.bar { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(9,13,19,.85); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand b { color: var(--cyan); }

.btn { font: inherit; font-weight: 600; padding: 12px 22px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; transition: .15s; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: #2a3a48; }
.btn.primary { background: linear-gradient(180deg, var(--cyan), var(--cyan-deep)); color: #04222a; border: none; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; margin: 8px 0; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

.hero { max-width: 820px; margin: 0 auto; padding: 90px 24px 40px; text-align: center; }
.hero h1 { font-size: 46px; line-height: 1.08; font-weight: 800; margin: 0 0 18px; }
.hero .ac { color: var(--cyan); }
.hero p { font-size: 18px; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.features { max-width: 1000px; margin: 40px auto; padding: 0 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; }
.feat h3 { margin: 0 0 8px; color: #fff; font-size: 16px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; }

.pricing { display: flex; justify-content: center; padding: 40px 24px 80px; }
.price-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; max-width: 380px; width: 100%; text-align: center; }
.price { font-size: 44px; font-weight: 800; color: #fff; }
.price span { font-size: 15px; color: var(--muted); font-weight: 400; }
.price-card label { display: block; margin: 16px 0; color: var(--muted); font-size: 14px; }
.price-card input, .row input { background: #05080d; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: #fff; font: inherit; }
.price-card small { color: var(--muted); font-size: 12px; }

.account, .endpoints { max-width: 860px; margin: 40px auto; padding: 0 24px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; }
.pill { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(0,242,255,.1); color: var(--cyan); border: 1px solid rgba(0,242,255,.3); }
.sub-info { display: flex; gap: 40px; margin: 20px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sub-info div { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.row input { flex: 1; min-width: 180px; }
.ep { display: flex; align-items: center; justify-content: space-between; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; }

.modal { position: fixed; inset: 0; background: rgba(4,8,14,.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; width: 360px; max-width: 100%; position: relative; }
.modal-card h2 { margin: 0 0 16px; }
.modal-card input { display: block; width: 100%; margin-bottom: 12px; background: #05080d; border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: #fff; font: inherit; }
.close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; }
.switch { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.err { background: rgba(255,77,94,.12); border: 1px solid rgba(255,77,94,.3); color: #ff97a2; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 40px 24px; border-top: 1px solid var(--line); margin-top: 60px; }

/* ---- shared helpers ---- */
.mono { font-family: ui-monospace, Consolas, monospace; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .25em; text-transform: uppercase; color: var(--cyan); margin-bottom: 12px; }
.c-red { color: var(--danger); } .c-green { color: var(--good); } .c-cyan { color: var(--cyan); }

/* ---- header cart ---- */
.brand { cursor: pointer; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.cart { position: relative; background: transparent; border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; }
.cart:hover { border-color: var(--cyan); color: var(--cyan); }
.cart-count { position: absolute; top: -6px; right: -6px; background: var(--cyan); color: #04222a; font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }

/* ---- animated demo ---- */
.demo { max-width: 1000px; margin: 20px auto 40px; padding: 0 24px; }
.demo-head { text-align: center; margin-bottom: 24px; }
.demo-head h2 { font-size: 28px; margin: 0 0 8px; color: #fff; }
.demo-head p { margin: 0 auto; max-width: 520px; }
.og-demo { background: linear-gradient(180deg, #070b12, #05080d); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 0 60px rgba(0,242,255,.06); }
.og-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: rgba(0,242,255,.03); flex-wrap: wrap; }
.og-title { font-weight: 700; color: #fff; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.og-live { width: 9px; height: 9px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(53,212,127,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(53,212,127,.5)} 70%{box-shadow:0 0 0 8px rgba(53,212,127,0)} 100%{box-shadow:0 0 0 0 rgba(53,212,127,0)} }
.og-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.og-stat { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
.og-stat b { color: #fff; margin-left: 4px; }
.og-stat.ok b { color: var(--good); } .og-stat.danger b { color: var(--danger); }
.og-body { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1px; background: var(--line); }
.og-panel { background: #05080d; padding: 14px 16px; }
.og-panel-h { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.og-side { display: flex; flex-direction: column; gap: 1px; background: var(--line); }
.og-conns-panel { min-height: 216px; }
.og-conn { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; margin-bottom: 6px; border-radius: 8px; background: #0a0f16; border-left: 3px solid var(--good); font-size: 13px; animation: slidein .3s ease; }
.og-conn.blocked { border-left-color: var(--danger); background: rgba(255,77,94,.06); }
.og-app { color: #fff; font-weight: 600; }
.og-host { color: var(--muted); font-size: 12px; }
.og-verdict { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--good); }
.og-conn.blocked .og-verdict { color: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.og-scan { height: 8px; background: #0a0f16; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.og-scan-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); transition: width .18s linear; }
.og-scan-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.og-log-panel { flex: 1; }
.og-log { font-size: 12px; line-height: 1.7; color: var(--muted); min-height: 120px; }
.og-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: slidein .3s ease; }
@media (max-width: 720px) { .og-body { grid-template-columns: 1fr; } }

/* ---- checkout (Stripe Elements) ---- */
#checkout { max-width: 1000px; margin: 0 auto; padding: 40px 24px 80px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 420px; gap: 40px; align-items: start; }
.checkout-info h2 { font-size: 30px; color: #fff; margin: 0 0 12px; line-height: 1.15; }
.checkout-info .lead { font-size: 16px; margin-bottom: 20px; }
.chk-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.chk-list li { position: relative; padding-left: 26px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.chk-list li b { color: #fff; }
.chk-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--cyan); font-weight: 800; }
.checkout-pay { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.order { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.order-row, .order-total { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.order-total { margin-top: 12px; font-size: 16px; color: #fff; }
.order-total b { font-size: 20px; }
.order-qty { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.order-qty input { width: 80px; background: #05080d; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: #fff; font: inherit; }
#payment-element { margin-bottom: 16px; min-height: 40px; }
.pay-loading { color: var(--muted); font-size: 13px; padding: 16px 0; }
.checkout-pay small { display: block; color: var(--muted); font-size: 12px; text-align: center; margin-top: 6px; }
.back { margin-top: 14px; width: 100%; }
@media (max-width: 820px) { .checkout-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---- dashboard header ---- */
.dash-head { max-width: 860px; margin: 40px auto 0; padding: 0 24px; }
.dash-head h1 { font-size: 32px; color: #fff; margin: 0 0 4px; }
.dash-head p { margin: 0; }

/* ---- download page ---- */
#download { max-width: 780px; margin: 0 auto; padding: 48px 24px 80px; }
.dl-wrap h1 { font-size: 34px; color: #fff; margin: 0 0 8px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dl-ver { font-size: 14px; color: var(--cyan); border: 1px solid rgba(0,242,255,.3); background: rgba(0,242,255,.08); padding: 3px 10px; border-radius: 999px; }
.dl-wrap .lead { font-size: 16px; margin-bottom: 20px; }
.dl-note { background: rgba(0,242,255,.05); border: 1px solid rgba(0,242,255,.2); border-radius: 12px; padding: 16px 18px; color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }
.dl-note b { color: #fff; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.dl-ico { width: 48px; height: 48px; border-radius: 10px; background: #05080d; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--cyan); }
.dl-meta { display: flex; flex-direction: column; gap: 2px; }
.dl-meta b { color: #fff; font-size: 16px; }
.dl-meta span { font-size: 12px; }
.dl-card .btn { width: 100%; }
.dl-steps { margin-top: 24px; font-size: 13px; }
@media (max-width: 620px) { .dl-grid { grid-template-columns: 1fr; } }

/* ---- user menu (avatar dropdown) ---- */
.user-menu { position: relative; }
.avatar-btn { width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: #05080d; cursor: pointer; overflow: hidden; transition: .15s; }
.avatar-btn:hover { border-color: var(--cyan); }
.avatar-btn img, #navAvatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.dropdown { position: absolute; right: 0; top: 52px; width: 240px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.5); z-index: 60; }
.dd-head { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.dd-head img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.dd-id { display: flex; flex-direction: column; min-width: 0; }
.dd-id b { color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-id span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); font: inherit; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.dd-item:hover { background: #0a0f16; color: #fff; }
.dd-item.danger { color: #ff97a2; }

/* ---- profile page ---- */
#profile { max-width: 860px; margin: 0 auto; }
.prof-top { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; }
.prof-avatar { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.prof-avatar img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #05080d; }
.prof-avatar-actions { display: flex; flex-direction: column; gap: 6px; }
.prof-fields { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
.fld input { background: #05080d; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: #fff; font: inherit; }
.fld input:disabled { color: var(--muted); }
.ok-msg { background: rgba(53,212,127,.1); border: 1px solid rgba(53,212,127,.3); color: var(--good); padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 14px 0 0; }
.account h3 { color: #fff; margin: 0 0 14px; }
