/* Kryon — design system.
   One stylesheet for the marketing site, the customer dashboard and the admin
   panel, so a button looks the same wherever a customer meets it. */

:root {
  /* Surfaces, darkest to lightest. */
  --bg: #090c11;
  --bg-1: #0e131a;
  --bg-2: #141b25;
  --bg-3: #1b2530;
  --line: #202b38;
  --line-2: #2c3a4b;

  --ink: #e6edf6;
  --ink-2: #9fb0c4;
  --ink-3: #6b7e94;

  --brand: #6c8cff;
  --brand-2: #8b6cff;
  --brand-ink: #0a0e14;
  --glow: rgba(108, 140, 255, .35);

  --ok: #3ddc97;
  --warn: #ffb454;
  --bad: #ff5f6d;
  --info: #4cc4ff;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .8);
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 68px;
  --shell-w: 250px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Respect people who get motion sick — every animation below is optional. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: #93a9ff; }

h1, h2, h3, h4 { margin: 0 0 .55rem; line-height: 1.2; font-weight: 680; letter-spacing: -.025em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.35rem); }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.15rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
small { font-size: .84rem; }
code, pre, .mono { font-family: var(--mono); font-size: .87em; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

::selection { background: var(--brand); color: var(--brand-ink); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================ primitives */

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 780px; }
.container-wide { max-width: 1360px; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.tiny { font-size: .8rem; }
.small { font-size: .875rem; }
.big { font-size: 1.08rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .5rem; } .mb-1 { margin-bottom: .5rem; }
.mt-2 { margin-top: 1rem; } .mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.75rem; } .mb-3 { margin-bottom: 1.75rem; }
.mt-4 { margin-top: 2.75rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-center { display: flex; align-items: center; gap: .55rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-fixed-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .grid-fixed-2 { grid-template-columns: 1fr; } }

.gradient-text {
  background: linear-gradient(100deg, var(--ink) 10%, var(--brand) 55%, var(--brand-2) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ================================================================ buttons */

.btn {
  --btn-bg: var(--bg-3);
  --btn-fg: var(--ink);
  --btn-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .68rem 1.15rem;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 .92rem/1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, filter .16s ease, background .16s ease, border-color .16s ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.14); color: var(--btn-fg); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  --btn-bg: linear-gradient(120deg, var(--brand), var(--brand-2));
  --btn-fg: var(--brand-ink);
  --btn-line: transparent;
  box-shadow: 0 8px 26px -10px var(--glow);
}
.btn-ghost { --btn-bg: transparent; }
.btn-ok { --btn-bg: transparent; --btn-fg: var(--ok); --btn-line: rgba(61, 220, 151, .45); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--bad); --btn-line: rgba(255, 95, 109, .45); }
.btn-warn { --btn-bg: transparent; --btn-fg: var(--warn); --btn-line: rgba(255, 180, 84, .45); }
.btn-lg { padding: .92rem 1.7rem; font-size: 1rem; border-radius: var(--r); }
.btn-sm { padding: .42rem .75rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* Spinner shown while a form is submitting. */
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 15px; height: 15px;
  border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%;
  animation: spin .6s linear infinite;
  color: var(--ink);
}
.btn-primary.is-loading::after { color: var(--brand-ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================== cards */

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.35rem;
}
.card-pad-lg { padding: 1.9rem; }
.card-tight { padding: .95rem 1.1rem; }
.card-flush { padding: 0; overflow: hidden; }
.card > :last-child { margin-bottom: 0; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.35rem; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 1.35rem; }
.card-hover { transition: border-color .18s, transform .18s; }
.card-hover:hover { border-color: var(--line-2); transform: translateY(-2px); }

.panel {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.6rem;
}

/* ================================================================= badges */

.badge {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .2rem .6rem; border-radius: 100px;
  background: var(--bg-3); border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: .74rem; font-weight: 650; letter-spacing: .015em; white-space: nowrap;
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok      { color: var(--ok);    border-color: rgba(61,220,151,.4);  background: rgba(61,220,151,.11); }
.badge-warn    { color: var(--warn);  border-color: rgba(255,180,84,.4);  background: rgba(255,180,84,.11); }
.badge-bad     { color: var(--bad);   border-color: rgba(255,95,109,.4);  background: rgba(255,95,109,.11); }
.badge-info    { color: var(--info);  border-color: rgba(76,196,255,.4);  background: rgba(76,196,255,.11); }
.badge-brand   { color: var(--brand); border-color: rgba(108,140,255,.45);background: rgba(108,140,255,.13); }

/* Server/order status words map onto the palette above. */
.badge-running, .badge-active, .badge-paid, .badge-completed, .badge-online, .badge-ready
  { color: var(--ok); border-color: rgba(61,220,151,.4); background: rgba(61,220,151,.11); }
.badge-starting, .badge-stopping, .badge-installing, .badge-provisioning, .badge-pending,
.badge-pending_payment, .badge-unpaid, .badge-processing, .badge-maintenance
  { color: var(--warn); border-color: rgba(255,180,84,.4); background: rgba(255,180,84,.11); }
.badge-crashed, .badge-failed, .badge-install_failed, .badge-suspended, .badge-overdue,
.badge-error, .badge-cancelled, .badge-refunded
  { color: var(--bad); border-color: rgba(255,95,109,.4); background: rgba(255,95,109,.11); }
.badge-offline, .badge-draft, .badge-closed { color: var(--ink-3); }

/* ================================================================== forms */

label { display: block; margin-bottom: .35rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%;
  padding: .68rem .85rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font: inherit; font-size: .93rem;
  transition: border-color .15s, box-shadow .15s;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #3a4b60; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(108,140,255,.16);
}
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { min-height: 110px; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7e94' d='M6 8.5 1.5 4h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; padding-right: 2.1rem;
}

.field { margin-bottom: 1.05rem; }
.field .hint { margin-top: .32rem; font-size: .81rem; color: var(--ink-3); }
.field .error { margin-top: .32rem; font-size: .81rem; color: var(--bad); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.required { color: var(--bad); }

.check { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: .55rem; }
.check input[type=checkbox], .check input[type=radio] {
  width: 17px; height: 17px; margin: .15rem 0 0; accent-color: var(--brand); flex: none; cursor: pointer;
}
.check label { margin: 0; font-weight: 500; color: var(--ink); cursor: pointer; }
.check .hint { margin: 0; }

.form-actions {
  display: flex; gap: .7rem; flex-wrap: wrap; align-items: center;
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}
.inline-form { display: inline-block; }

/* Selectable tiles used by the order configurator. */
.option-grid { display: grid; gap: .8rem; }
.option {
  position: relative; display: block; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-1); padding: 1rem 1.15rem;
  transition: border-color .15s, background .15s, transform .12s;
}
.option:hover { border-color: #40536c; transform: translateY(-1px); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option-title { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-weight: 640; }
.option-sub { color: var(--ink-2); font-size: .86rem; margin-top: .2rem; }
.option:has(input:checked) {
  border-color: var(--brand);
  background: linear-gradient(180deg, rgba(108,140,255,.11), transparent);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.option:has(input:disabled) { opacity: .45; cursor: not-allowed; }

/* Password strength meter. */
.meter-bar { height: 5px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin-top: .45rem; }
.meter-bar > span { display: block; height: 100%; width: 0; background: var(--bad); transition: width .3s, background .3s; }
.meter-bar[data-score="3"] > span, .meter-bar[data-score="4"] > span { background: var(--warn); }
.meter-bar[data-score="5"] > span, .meter-bar[data-score="6"] > span { background: var(--ok); }

/* ================================================================= tables */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .78rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3); background: var(--bg-2); white-space: nowrap;
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: rgba(255, 255, 255, .022); }
tbody tr:last-child td { border-bottom: 0; }
td.right, th.right { text-align: right; }
.empty-state { padding: 3rem 1.5rem; text-align: center; color: var(--ink-3); }
.empty-state .icon { font-size: 2.2rem; margin-bottom: .6rem; opacity: .55; }

/* ================================================================ alerts */

.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1.05rem; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--bg-2);
  margin-bottom: 1rem; font-size: .93rem;
}
.alert-success { border-color: rgba(61,220,151,.4);  background: rgba(61,220,151,.09);  color: #9df0c8; }
.alert-error   { border-color: rgba(255,95,109,.4);  background: rgba(255,95,109,.09);  color: #ffb3b8; }
.alert-warning { border-color: rgba(255,180,84,.4);  background: rgba(255,180,84,.09);  color: #ffd6a0; }
.alert-info    { border-color: rgba(76,196,255,.4);  background: rgba(76,196,255,.09);  color: #a9e2ff; }

/* Toasts, spawned by app.js. */
.toast-stack {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: .6rem; max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex; gap: .65rem; align-items: flex-start;
  padding: .85rem 1rem; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: .9rem;
  animation: toast-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.is-leaving { animation: toast-out .2s ease forwards; }
.toast-success { border-left: 3px solid var(--ok); }
.toast-error { border-left: 3px solid var(--bad); }
.toast-info { border-left: 3px solid var(--info); }
.toast-close { margin-left: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ================================================================ dialogs */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 7, 11, .72); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 1rem;
  animation: fade-in .16s ease;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--bg-1); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: 1.6rem; box-shadow: var(--shadow);
  animation: modal-in .22s cubic-bezier(.2, .9, .3, 1.1);
}
.modal h3 { margin-bottom: .5rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* =============================================================== skeleton */

.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
  color: transparent !important;
}
.skeleton-line { height: 12px; margin-bottom: .55rem; }
.skeleton-line:last-child { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================================================================= meters */

.meter { height: 7px; border-radius: 4px; background: var(--bg-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; transition: width .4s ease; }
.meter.hot > span { background: var(--warn); }
.meter.crit > span { background: var(--bad); }

.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-2); font-size: .89rem; }
.kv .v { font-family: var(--mono); font-size: .85rem; text-align: right; word-break: break-word; }

.stat { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.25rem; }
.stat .n { font-size: 1.85rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat .l { color: var(--ink-3); font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; margin-top: .25rem; }
.stat .delta { font-size: .8rem; margin-top: .4rem; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--bad); }

/* ============================================================ public nav */

.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: rgba(9, 12, 17, .78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.nav.is-stuck { border-bottom-color: var(--line); background: rgba(9, 12, 17, .93); }
.nav .container { display: flex; align-items: center; gap: 1.5rem; height: 100%; }

.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; font-weight: 750; color: var(--ink); letter-spacing: -.03em; }
.logo:hover { color: var(--ink); text-decoration: none; }
.logo .mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  color: var(--brand-ink); font-size: .95rem; box-shadow: 0 6px 18px -8px var(--glow);
}

.nav-links { display: flex; align-items: center; gap: .3rem; margin-left: auto; }
.nav-links a {
  padding: .5rem .8rem; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: .92rem; font-weight: 550;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-2); text-decoration: none; }
.nav-links a.active { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: .6rem; margin-left: .6rem; }

.nav-toggle { display: none; background: none; border: 0; color: var(--ink); font-size: 1.5rem; cursor: pointer; padding: .2rem .4rem; }

@media (max-width: 900px) {
  .nav-toggle { display: block; margin-left: auto; }
  .nav-links {
    position: fixed; inset: var(--nav-h) 0 auto; margin: 0;
    flex-direction: column; align-items: stretch; gap: .15rem;
    background: var(--bg-1); border-bottom: 1px solid var(--line);
    padding: .8rem 20px 1.2rem;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .18s, transform .18s;
  }
  .nav-links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: .75rem .8rem; }
  .nav-cta { margin: .6rem 0 0; flex-direction: column; align-items: stretch; }
  .nav-cta .btn { width: 100%; }
}

/* ================================================================== hero */

.hero { position: relative; padding: clamp(4rem, 11vh, 8rem) 0 clamp(3.5rem, 8vh, 6rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% 0 auto 50%;
  width: 1000px; height: 700px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(108,140,255,.2), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: .5; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-inner { max-width: 780px; margin: 0 auto; text-align: center; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lead { font-size: clamp(1.02rem, 1.9vw, 1.22rem); color: var(--ink-2); max-width: 620px; margin: 0 auto 2rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .34rem .85rem; margin-bottom: 1.4rem;
  border: 1px solid var(--line-2); border-radius: 100px;
  background: var(--bg-2); color: var(--ink-2);
  font-size: .82rem; font-weight: 600;
}
.eyebrow .pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61,220,151,.6); animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(61,220,151,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); }
}

.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.trust-row {
  display: flex; gap: 1.6rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.6rem; color: var(--ink-3); font-size: .87rem;
}
.trust-row span { display: flex; align-items: center; gap: .4rem; }

/* ============================================================== sections */

.section { padding: clamp(3.2rem, 8vh, 5.5rem) 0; }
.section-alt { background: linear-gradient(180deg, transparent, var(--bg-1) 18%, var(--bg-1) 82%, transparent); }
.section-head { max-width: 640px; margin: 0 auto 2.6rem; text-align: center; }
.section-head p { color: var(--ink-2); margin-bottom: 0; }
.section-label {
  display: block; margin-bottom: .55rem;
  color: var(--brand); font-size: .78rem; font-weight: 750;
  letter-spacing: .13em; text-transform: uppercase;
}

/* Reveal-on-scroll, driven by app.js. */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============================================================= game cards */

.game-card {
  position: relative; display: block; overflow: hidden;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.5rem; color: var(--ink);
  transition: transform .2s, border-color .2s;
}
.game-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--accent, var(--brand)), transparent);
  opacity: .85;
}
.game-card:hover { transform: translateY(-4px); border-color: var(--line-2); color: var(--ink); text-decoration: none; }
.game-card .icon { font-size: 2.1rem; margin-bottom: .7rem; }
.game-card h3 { margin-bottom: .25rem; }
.game-card .tagline { color: var(--ink-2); font-size: .89rem; margin-bottom: 1.1rem; }
.game-card .foot { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.game-card .price { font-size: 1.15rem; font-weight: 700; }
.game-card .price small { color: var(--ink-3); font-weight: 500; font-size: .78rem; }

/* =============================================================== pricing */

.plan {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.6rem; transition: transform .2s, border-color .2s;
}
.plan:hover { transform: translateY(-3px); border-color: var(--line-2); }
.plan.is-featured {
  border-color: rgba(108,140,255,.55);
  background: linear-gradient(180deg, rgba(108,140,255,.09), var(--bg-1) 45%);
  box-shadow: 0 24px 60px -34px var(--glow);
}
.plan-flag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  padding: .22rem .75rem; border-radius: 100px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2)); color: var(--brand-ink);
  font-size: .7rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase;
}
.plan h3 { margin-bottom: .15rem; }
.plan .plan-tagline { color: var(--ink-2); font-size: .87rem; min-height: 2.6em; margin-bottom: 1rem; }
.plan .plan-price { display: flex; align-items: baseline; gap: .3rem; margin-bottom: 1.2rem; }
.plan .plan-price .amount { font-size: 2.15rem; font-weight: 760; letter-spacing: -.035em; }
.plan .plan-price .period { color: var(--ink-3); font-size: .9rem; }
.plan ul { list-style: none; margin: 0 0 1.4rem; padding: 0; display: grid; gap: .55rem; }
.plan li { display: flex; gap: .55rem; align-items: flex-start; font-size: .9rem; color: var(--ink-2); }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 700; flex: none; }
.plan .btn { margin-top: auto; }

.spec-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.spec {
  display: flex; flex-direction: column; gap: .1rem;
  padding: .5rem .7rem; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: .78rem; color: var(--ink-3); min-width: 74px;
}
.spec b { color: var(--ink); font-size: .95rem; font-weight: 650; }

/* ============================================================== features */

.feature { display: flex; gap: 1rem; align-items: flex-start; }
.feature .fi {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line);
  font-size: 1.2rem;
}
.feature h3 { font-size: 1.02rem; margin-bottom: .25rem; }
.feature p { color: var(--ink-2); font-size: .91rem; margin: 0; }

/* =================================================================== FAQ */

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 0; cursor: pointer; font-weight: 620; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; color: var(--brand); font-size: 1.3rem; font-weight: 400;
  transition: transform .2s; flex: none;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .answer { padding: 0 2rem 1.25rem 0; color: var(--ink-2); font-size: .93rem; }

/* ================================================================ footer */

.footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; margin-top: 3rem; background: var(--bg-1); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2rem; margin-bottom: 2.4rem; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); margin-bottom: .8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer a { color: var(--ink-2); font-size: .9rem; }
.footer a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .85rem;
}

/* ============================================================ app shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 90;
  width: var(--shell-w); flex: none;
  background: var(--bg-1); border-right: 1px solid var(--line);
  padding: 1rem .75rem; display: flex; flex-direction: column; gap: .12rem;
  overflow-y: auto;
}
.sidebar .logo { padding: .4rem .55rem 1.2rem; }
.side-label {
  padding: 1.1rem .6rem .35rem; font-size: .68rem; font-weight: 750;
  letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3);
}
.side-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: .92rem; font-weight: 550;
  transition: background .14s, color .14s;
}
.side-link:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
.side-link.active { background: var(--bg-3); color: var(--ink); box-shadow: inset 2px 0 0 var(--brand); }
.side-link .ico { width: 18px; text-align: center; flex: none; opacity: .9; }
.side-link .count {
  margin-left: auto; padding: .05rem .4rem; border-radius: 100px;
  background: var(--brand); color: var(--brand-ink); font-size: .7rem; font-weight: 700;
}
.side-foot { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; margin-left: var(--shell-w); display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1.5rem;
  background: rgba(14, 19, 26, .9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.05rem; margin: 0; letter-spacing: -.015em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .6rem; }

.content { padding: 1.6rem 1.5rem 3rem; width: 100%; max-width: 1320px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; margin-bottom: .2rem; }
.page-head .sub { color: var(--ink-2); font-size: .92rem; margin: 0; }

.sidebar-scrim { display: none; }

@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex !important; }
  .sidebar-scrim.is-open {
    display: block; position: fixed; inset: 0; z-index: 85;
    background: rgba(4, 7, 11, .6); backdrop-filter: blur(2px);
  }
  .content { padding: 1.2rem 1rem 2.5rem; }
}
.menu-btn { display: none; background: none; border: 0; color: var(--ink); font-size: 1.35rem; cursor: pointer; padding: 0 .2rem; }

/* =================================================================== tabs */

.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs a {
  padding: .65rem .95rem; margin-bottom: -1px; white-space: nowrap;
  color: var(--ink-2); font-size: .92rem; font-weight: 570;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }

/* ================================================================ steps */

.steps { display: flex; gap: 0; margin-bottom: 2rem; }
.step { flex: 1; position: relative; padding-top: 2.1rem; text-align: center; font-size: .82rem; color: var(--ink-3); }
.step::before {
  content: ""; position: absolute; top: 12px; left: 0; right: 0; height: 2px; background: var(--line);
}
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step .dot {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg-3); border: 2px solid var(--line-2);
  display: grid; place-items: center; font-size: .6rem; color: transparent;
}
.step.is-done { color: var(--ink-2); }
.step.is-done::before { background: var(--ok); }
.step.is-done .dot { background: var(--ok); border-color: var(--ok); color: var(--brand-ink); }
.step.is-active { color: var(--ink); font-weight: 620; }
.step.is-active .dot {
  background: var(--brand); border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(108,140,255,.2); animation: pulse-dot 1.8s infinite;
}
.step.is-failed .dot { background: var(--bad); border-color: var(--bad); }
@keyframes pulse-dot { 50% { box-shadow: 0 0 0 8px rgba(108,140,255,.05); } }
@media (max-width: 700px) {
  .steps { flex-direction: column; gap: .9rem; }
  .step { padding: 0 0 0 2rem; text-align: left; }
  .step::before { display: none; }
  .step .dot { top: 2px; left: 0; transform: none; }
}

/* ============================================================== console */

.console-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; }
@media (max-width: 1000px) { .console-layout { grid-template-columns: 1fr; } }

#console {
  height: 460px; overflow-y: auto; padding: .85rem 1rem;
  background: #05080c; border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--mono); font-size: .81rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
#console::-webkit-scrollbar { width: 10px; }
#console::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; }
#console div { padding: 1px 0; }
.line-err { color: #ff9ba1; }
.line-sys { color: var(--brand); }
.line-install { color: var(--warn); }
.console-input { display: flex; gap: .6rem; margin-top: .7rem; }
.console-input input { font-family: var(--mono); font-size: .85rem; background: #05080c; }

/* ============================================================ file list */

.file-row { display: grid; grid-template-columns: 1fr 110px 170px 92px; gap: .8rem; align-items: center; }
@media (max-width: 760px) { .file-row { grid-template-columns: 1fr 90px; } .file-row .col-hide { display: none; } }
.crumbs { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; font-size: .89rem; }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { color: var(--ink-3); }

/* ============================================================== invoice */

.doc { background: #fff; color: #111; border-radius: var(--r); padding: 2.4rem; }
.doc table { color: #111; }
.doc th { background: #f4f6f8; color: #555; }
.doc th, .doc td { border-color: #e3e7ec; }

/* =============================================================== helpers */

.copy-field { display: flex; gap: .5rem; }
.copy-field input { font-family: var(--mono); font-size: .85rem; }

.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(130deg, var(--brand), var(--brand-2));
  color: var(--brand-ink); font-weight: 700; font-size: .85rem; flex: none;
}

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 95; min-width: 210px;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); padding: .35rem; display: none;
}
.dropdown-menu.is-open { display: block; animation: modal-in .16s ease; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: .55rem; width: 100%;
  padding: .55rem .65rem; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink-2); font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-3); color: var(--ink); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--line); margin: .35rem 0; }

.notif-item { display: flex; gap: .7rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: rgba(108,140,255,.05); margin: 0 -.6rem; padding: .8rem .6rem; border-radius: var(--r-sm); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: .45rem; flex: none; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { justify-content: center; margin-bottom: 1.6rem; font-size: 1.3rem; }
.auth-alt { text-align: center; margin-top: 1.3rem; color: var(--ink-2); font-size: .9rem; }

pre.block {
  background: #05080c; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .85rem 1rem; overflow-x: auto; margin: 0 0 1rem; font-size: .82rem;
}

.divider-text {
  display: flex; align-items: center; gap: .8rem; margin: 1.3rem 0;
  color: var(--ink-3); font-size: .82rem;
}
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media print {
  .no-print, .sidebar, .topbar, .nav, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .main { margin: 0; }
  .doc { padding: 0; }
}
