:root {
  --bg: #1d1a24;
  --bg-2: #24202d;
  --card: #2e2a39;
  --line: #3d364b;
  --text: #e4e1ea;
  --muted: #a39fae;
  --accent: #f28b8b;
  --accent-2: #e46f70;
  --ok: #5fcf8e;
  --warn: #f2c46d;
  --bad: #f07272;
  --radius: 12px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 32px 0 56px; }

/* ---------- header ---------- */

.site-header { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: block; width: 108px; overflow: hidden; }
.brand img { height: 40px; max-width: none; display: block; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--card); text-decoration: none; }
.nav a.cta { color: #fff; background: var(--accent-2); }
.nav a.cta:hover { background: var(--accent); }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: .9rem; padding: 24px 0; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); margin-right: 16px; }

/* ---------- blocks ---------- */

.hero { text-align: center; padding: 40px 0 24px; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 640px; margin: 0 auto 1.6em; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card.narrow { max-width: 520px; margin: 0 auto; }
.card h3 { color: var(--text); }
.card p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.section { margin-top: 48px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 48px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-2); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* ---------- forms ---------- */

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { color: var(--muted); font-size: .88rem; margin-top: 4px; }

.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 11px 20px; font: inherit; font-weight: 600;
  background: var(--accent-2); color: #fff; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--accent); text-decoration: none; }
.btn.secondary { background: var(--line); color: var(--text); }
.btn.secondary:hover { background: #4b4360; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn.block { width: 100%; margin-top: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
form.inline { display: inline; }

.tabs { display: flex; gap: 8px; margin: 8px 0 4px; }
.tabs label { margin: 0; font-weight: 500; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.only-m3u, .only-xtream { display: none; }
#type-m3u:checked ~ .only-m3u, #type-xtream:checked ~ .only-xtream { display: block; }

/* ---------- messages ---------- */

.alert { border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.alert.error { color: #ffd2d2; background: rgba(240, 114, 114, .12); border-color: rgba(240, 114, 114, .5); }
.alert.notice { color: #d4f7e3; background: rgba(95, 207, 142, .12); border-color: rgba(95, 207, 142, .5); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.badge.active { background: rgba(95, 207, 142, .18); color: var(--ok); }
.badge.trial { background: rgba(242, 196, 109, .18); color: var(--warn); }
.badge.expired, .badge.disabled { background: rgba(240, 114, 114, .18); color: var(--bad); }
.badge.paid { background: rgba(95, 207, 142, .18); color: var(--ok); }
.badge.pending { background: rgba(242, 196, 109, .18); color: var(--warn); }
.badge.failed { background: rgba(240, 114, 114, .18); color: var(--bad); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--bg-2); color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.mono, .mono { font-family: ui-monospace, Consolas, monospace; }
td.url { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 24px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .n { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .88rem; }

.price { font-size: 2.4rem; font-weight: 800; color: var(--text); }
.pay-buttons { display: grid; gap: 10px; margin-top: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.pager { display: flex; gap: 8px; margin-top: 16px; align-items: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h1 { margin: 0; }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 6px 0 0; color: var(--muted); }

@media (max-width: 640px) {
  main { padding-top: 20px; }
  .site-header .container { padding-top: 10px; padding-bottom: 10px; }
  .card { padding: 16px; }
}

#type-m3u:checked ~ .tabs label[for=type-m3u],
#type-xtream:checked ~ .tabs label[for=type-xtream] { background: var(--accent-2); color: #fff; }
