/* Sturnus portal — dark theme.
   Status colours mirror loader/src/ui_main.h so the site and the loader
   describe a subscription with the same colour. */

:root {
    --bg: #08090c;
    --bg-soft: #0d0f14;
    --panel: rgba(255, 255, 255, 0.026);
    --panel-solid: #10131a;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    --text: #e8eaf0;
    --text-dim: #8a90a0;
    --text-faint: #5a6070;

    --accent: #7f9cee;
    --accent-soft: rgba(127, 156, 238, 0.12);

    --available: #7fee83;
    --updating: #eeea7f;
    --frozen: #7fc0ee;
    --unavailable: #808080;
    --danger: #ee7f7f;

    --radius: 12px;
    --radius-sm: 8px;
    --mono: ui-monospace, "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Ambient glow behind the page, cheap and static. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(700px 420px at 15% -8%, rgba(127, 156, 238, 0.13), transparent 70%),
        radial-gradient(620px 380px at 88% 4%, rgba(127, 238, 131, 0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    margin: 0 0 12px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 { font-size: 40px; font-weight: 650; }
h2 { font-size: 26px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }

p { margin: 0 0 14px; color: var(--text-dim); }

code, .mono { font-family: var(--mono); font-size: 0.92em; }

.wrap {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* --------------------------------------------------------------- header --- */
header.top {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(8, 9, 12, 0.78);
    border-bottom: 1px solid var(--border);
}

header.top .wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 62px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    font-size: 17px;
    letter-spacing: 0.04em;
    color: var(--text);
    text-decoration: none;
}

.logo:hover { text-decoration: none; }

.logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), #5f6fd0);
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    color: #0a0b10;
}

nav.links {
    display: flex;
    gap: 22px;
    margin-left: 12px;
}

nav.links a {
    color: var(--text-dim);
    font-size: 14px;
}

nav.links a:hover,
nav.links a.active {
    color: var(--text);
    text-decoration: none;
}

/* --------------------------------------------------------------- buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #08090c;
    font-weight: 600;
}

.btn.primary:hover:not(:disabled) {
    background: #93aaf2;
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-dim);
}

.btn.ghost:hover:not(:disabled) {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
}

.btn.danger {
    border-color: rgba(238, 127, 127, 0.4);
    color: var(--danger);
}

.btn.danger:hover:not(:disabled) {
    background: rgba(238, 127, 127, 0.12);
}

.btn.sm { padding: 5px 11px; font-size: 13px; }
.btn.lg { padding: 12px 24px; font-size: 15px; }

/* ---------------------------------------------------------------- inputs -- */
label.field {
    display: block;
    margin-bottom: 14px;
}

label.field > span {
    display: block;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.32);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder { color: var(--text-faint); }

select option { background: var(--panel-solid); }

textarea { resize: vertical; min-height: 74px; }

/* ---------------------------------------------------------------- panels -- */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.card + .card { margin-top: 16px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card-head h3 { margin: 0; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --------------------------------------------------------------- badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid currentColor;
    line-height: 1.6;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge.s0 { color: var(--unavailable); }
.badge.s1 { color: var(--available); }
.badge.s2 { color: var(--updating); }
.badge.s3 { color: var(--frozen); }
.badge.plain { color: var(--text-dim); }
.badge.plain::before { display: none; }
.badge.danger { color: var(--danger); }

/* ----------------------------------------------------------------- stats -- */
.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.stat .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.stat .value {
    font-size: 28px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------- tables -- */
.table-scroll { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    font-weight: 600;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    vertical-align: middle;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
tbody tr:last-child td { border-bottom: none; }

/* ------------------------------------------------------------------ tabs -- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    overflow-x: auto;
}

.tab {
    padding: 11px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-dim);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: -1px;
}

.tab:hover { color: var(--text); }

.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ----------------------------------------------------------------- modal -- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(4, 5, 8, 0.72);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal {
    width: 100%;
    max-width: 420px;
    background: var(--panel-solid);
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    padding: 26px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.modal.wide { max-width: 560px; }

/* ---------------------------------------------------------------- toasts -- */
#toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 40px));
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--panel-solid);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    font-size: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.18s ease-out;
}

.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--available); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ misc -- */
.progress {
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}

.progress > i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--accent);
    transition: width 0.3s;
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    font-size: 14px;
}

.kv:last-child { border-bottom: none; }
.kv > span:first-child { color: var(--text-dim); }
.kv > span:last-child { text-align: right; word-break: break-all; }

.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-faint);
    font-size: 14px;
}

.hint {
    font-size: 13px;
    color: var(--text-faint);
    margin-top: 8px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

/* --------------------------------------------------------------- landing -- */
.hero {
    padding: 92px 0 72px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(36px, 6vw, 58px);
    margin-bottom: 18px;
}

.hero p.lead {
    font-size: 18px;
    max-width: 620px;
    margin: 0 auto 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel);
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.eyebrow b { color: var(--available); font-weight: 600; }

section.block { padding: 56px 0; }

section.block > .wrap > h2 { margin-bottom: 8px; }
section.block > .wrap > p.section-lead { margin-bottom: 30px; max-width: 620px; }

.feature h3 { display: flex; align-items: center; gap: 9px; }

.feature .ico {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    display: grid;
    place-items: center;
    font-size: 15px;
}

.feature p { margin: 0; font-size: 14px; }

.product-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Cards in a grid row stretch to the tallest one; keep the action buttons
   pinned to the bottom instead of floating in the middle of the gap. */
.product-card > .row:last-child { margin-top: auto; }

.product-card .top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.product-card .game {
    font-size: 13px;
    color: var(--text-faint);
    margin-top: 2px;
}

footer.bottom {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    margin-top: 40px;
    color: var(--text-faint);
    font-size: 13px;
}

footer.bottom .wrap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------- responsive - */
@media (max-width: 720px) {
    .wrap { padding: 0 16px; }
    nav.links { display: none; }
    .hero { padding: 60px 0 44px; }
    .card { padding: 18px; }
    header.top .wrap { gap: 12px; }
}
