/* IPTV Spree website — matches player branding */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --base: #0B0E1A;
  --surface: #171D33;
  --raised: #222A47;
  --ink: #F4F5FB;
  --muted: #9AA1C4;
  --spree-a: #FF4D6D;
  --spree-b: #FFB347;
  --grad: linear-gradient(100deg, var(--spree-a), var(--spree-b));
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--base);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--spree-b); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(1100px, 92vw); margin: 0 auto; }
body.page-sub { display: flex; flex-direction: column; min-height: 100vh; }
body.page-sub > .wrap { flex: 1; display: flex; flex-direction: column; }
body.page-sub .site-footer { margin-top: auto; }

.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.logo {
  display: inline-flex; align-items: center; gap: 0.35em;
  font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink) !important; text-decoration: none !important;
}
.logo:hover { opacity: 0.9; text-decoration: none !important; }
.logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.nav a:hover { color: var(--ink); text-decoration: none; }

.hero {
  padding: 72px 0 48px;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 16px; }
.hero h1 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--grad); color: #1A0A10; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: rgba(255,255,255,0.1); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 48px 0; }
.card {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 28px;
}
.card h3 { margin-bottom: 10px; font-size: 1.2rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card .icon { font-size: 2rem; margin-bottom: 12px; }

.pricing { margin: 64px 0; text-align: center; }
.pricing h2 { font-size: 2rem; margin-bottom: 8px; }
.pricing > p { color: var(--muted); margin-bottom: 32px; }
.price-cards { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.price-card {
  background: var(--surface); border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 32px; width: min(300px, 100%);
}
.price-card.featured { border-color: rgba(255,179,71,0.45); box-shadow: 0 0 40px rgba(255,77,109,0.12); }
.price-card h3 { font-size: 1.1rem; color: var(--muted); margin-bottom: 8px; }
.price-card .amount { font-size: 2.4rem; font-weight: 800; margin-bottom: 4px; }
.price-card .amount small { font-size: 1rem; font-weight: 400; color: var(--muted); }
.price-card ul { list-style: none; text-align: left; margin: 20px 0; color: var(--muted); font-size: 0.9rem; }
.price-card li { padding: 6px 0; }
.price-card li::before { content: "✓ "; color: var(--spree-b); }

.panel {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08); padding: 32px; max-width: 480px; margin: 32px auto;
}
.panel h1 { font-size: 1.6rem; margin-bottom: 8px; color: var(--ink); }
.panel .sub { color: var(--muted); margin-bottom: 24px; font-size: 0.95rem; line-height: 1.5; }
.panel a { color: var(--spree-b); }
.panel-wide { max-width: 560px; }
.panel-center { text-align: center; }
.panel-cta { margin-top: 20px; }
.panel-price-cards { margin: 0 0 20px; justify-content: center; }
.panel-price-cards .price-card { width: min(220px, 100%); padding: 22px; cursor: pointer; }
.price-note { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.pay-note { color: var(--muted); font-size: 0.8rem; margin-top: 16px; text-align: center; }
.pay-legal { color: var(--muted); font-size: 0.78rem; margin-top: 12px; text-align: center; line-height: 1.5; }
.pay-legal a { color: var(--spree-b); }

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tab {
  flex: 1; padding: 10px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--raised); color: var(--muted); font-weight: 600;
}
.tab.active { background: var(--grad); color: #1A0A10; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%; padding: 12px 14px; margin-bottom: 16px;
  background: var(--raised); border: 2px solid transparent; border-radius: 10px;
  color: var(--ink); font-size: 1rem;
}
input:focus { outline: none; border-color: var(--spree-b); }

.msg { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.msg.ok { background: rgba(80,200,120,0.15); color: #8ce8a8; }
.msg.err { background: rgba(255,77,109,0.15); color: #ff8fa0; }
.msg.info { background: rgba(255,179,71,0.12); color: var(--spree-b); }

.qr-box { text-align: center; margin: 20px 0; }
.qr-box img { border-radius: 12px; background: #fff; padding: 8px; max-width: 220px; }

.site-footer {
  margin-top: 40px;
  padding: 14px 0 18px;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: rgba(154, 161, 196, 0.6);
  font-size: 0.7rem;
  line-height: 1.4;
}
.site-footer a {
  color: rgba(154, 161, 196, 0.75);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: var(--ink); text-decoration: none; }
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.footer-meta { margin: 0; }
.footer-sep { margin: 0 0.35em; opacity: 0.35; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
}
.footer-links a {
  white-space: nowrap;
  padding: 2px 0;
}

.legal-page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 24px auto 28px;
  padding: clamp(24px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
}
.legal-page h1 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--ink);
}
.legal-page .legal-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.legal-page h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 24px 0 8px;
  color: var(--ink);
}
.legal-page p, .legal-page li {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 10px;
  line-height: 1.6;
}
.legal-page ul, .legal-page ol { margin: 0 0 14px 1.2em; }
.legal-page a { color: var(--spree-b); text-decoration: none; }
.legal-page a:hover { text-decoration: underline; }
.legal-page .legal-callout {
  background: var(--raised);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 0.9rem;
}
.legal-page .legal-callout strong { color: var(--ink); }

.page-flow { flex: 1; width: 100%; }

.checkbox-row {
  display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 18px;
  font-size: 0.85rem; color: var(--muted); line-height: 1.45;
}
.checkbox-row input { width: auto; margin: 3px 0 0; flex-shrink: 0; }
.checkbox-row a { color: var(--spree-b); }

.section-head { margin-bottom: 16px; }
.section-head h2 { font-size: 1.05rem; margin: 0 0 6px; color: var(--ink); font-weight: 700; }
.section-note { color: var(--muted); font-size: 0.85rem; line-height: 1.45; margin: 0; }

.playlist-section {
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.playlist-list { display: flex; flex-direction: column; gap: 12px; }
.playlist-card {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  background: var(--raised); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 16px;
}
.playlist-card-main { min-width: 0; flex: 1; }
.playlist-card-name { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.playlist-card-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.playlist-card-detail {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem; color: var(--ink); word-break: break-all;
}
.playlist-card-updated { color: var(--muted); font-size: 0.78rem; margin-top: 8px; }
.playlist-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,179,71,0.15); color: var(--spree-b); font-size: 0.75rem; font-weight: 600;
}
.playlist-card-actions { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-ghost.danger { color: #ff8fa0; }
.btn-ghost.danger:hover { background: rgba(255,77,109,0.12); }

.compliance-strip {
  background: transparent; border: none; border-radius: 0;
  padding: 0; margin: 32px 0 0; text-align: center;
}
.compliance-strip h2 { display: none; }
.compliance-strip p { display: none; }
.compliance-strip .footer-links { margin-bottom: 0; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--surface); border-right: 1px solid rgba(255,255,255,0.06);
  padding: 24px 16px;
}
.admin-sidebar h2 { font-size: 1rem; margin-bottom: 24px; }
.admin-sidebar nav a {
  display: block; padding: 10px 14px; border-radius: 8px; color: var(--muted); margin-bottom: 4px;
}
.admin-sidebar nav a.active, .admin-sidebar nav a:hover { background: var(--raised); color: var(--ink); text-decoration: none; }
.admin-main { padding: 28px 32px; overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { background: var(--surface); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(255,255,255,0.06); }
.stat .val { font-size: 1.8rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.badge.trial { background: rgba(255,179,71,0.2); color: var(--spree-b); }
.badge.active { background: rgba(80,200,120,0.2); color: #8ce8a8; }
.badge.expired { background: rgba(255,77,109,0.2); color: #ff8fa0; }
.badge.none { background: rgba(255,255,255,0.08); color: var(--muted); }
.admin-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-actions button { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; border: none; cursor: pointer; background: var(--raised); color: var(--ink); }
.admin-actions button.danger,
.admin-toolbar .danger,
.admin-actions .danger { background: rgba(255,77,109,0.25); color: #ff8fa0; }
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-main input,
.admin-main select {
  width: auto;
  flex: 1 1 180px;
  max-width: 320px;
  margin-bottom: 0;
}
.admin-main .admin-toolbar .btn,
.admin-main .admin-actions .btn,
.admin-main .admin-toolbar button,
.admin-main .admin-actions button {
  margin-bottom: 0;
  flex-shrink: 0;
  width: auto;
  padding: 10px 18px;
  font-size: 0.85rem;
}
.admin-main .admin-toolbar input,
.admin-main .admin-actions select {
  padding: 10px 14px;
  font-size: 0.88rem;
}
.household-code {
  font-family: ui-monospace, monospace;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  background: var(--raised);
  padding: 12px 20px;
  border-radius: 10px;
  display: inline-block;
  margin: 12px 0;
}
.device-table code.device-id,
code.device-id {
  font-size: 0.78rem;
  word-break: break-all;
  white-space: normal;
  display: inline-block;
  max-width: 280px;
}
.device-table td { vertical-align: top; }

/* Customer map (admin dashboard) */
.map-panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  margin-bottom: 28px;
  overflow: hidden;
}
.map-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.map-panel-header h2 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.map-panel-header .map-meta { color: var(--muted); font-size: 0.82rem; }
.map-panel-toggle {
  background: var(--raised);
  border: none;
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}
.map-panel-body { height: 0; overflow: hidden; transition: height 0.25s ease; }
.map-panel.open .map-panel-body { height: 380px; }
.map-panel-body.provider-body.open-static { height: auto; max-height: 280px; overflow: auto; padding: 0 12px 12px; }
.chart-panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
}
.rev-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}
.rev-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 4px;
}
.rev-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--spree-b), #ff6b35);
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}
#customer-map { width: 100%; height: 380px; background: #1a1d24; }
.map-empty {
  padding: 24px 18px;
  color: var(--muted);
  font-size: 0.9rem;
}
.system-banner {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.88rem;
  border: 1px solid rgba(255,179,71,0.35);
  background: rgba(255,179,71,0.1);
  color: var(--ink);
}
.system-banner.ok {
  border-color: rgba(80,200,120,0.35);
  background: rgba(80,200,120,0.08);
}
.system-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.system-pill {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
}
.system-pill.good { color: #8ce8a8; border-color: rgba(80,200,120,0.35); }
.system-pill.warn { color: var(--spree-b); border-color: rgba(255,179,71,0.35); }
.expiring-list { margin-bottom: 24px; }
.expiring-list h3 { font-size: 0.95rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.expiring-list ul { margin: 0; padding-left: 18px; font-size: 0.88rem; color: var(--ink); }
.expiring-list li { margin-bottom: 4px; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.backup-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  font-family: ui-monospace, monospace; font-size: 0.95rem;
}
.backup-codes span {
  background: var(--raised); padding: 10px 12px; border-radius: 8px; text-align: center;
}
.auth-panel { max-width: 420px; width: 100%; }
.wizard-steps {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
  font-size: 0.75rem; color: var(--muted);
}
.wizard-steps span { padding: 4px 8px; border-radius: 999px; background: rgba(255,255,255,0.06); }
.wizard-steps span.active { background: rgba(99,179,255,0.2); color: var(--ink); }
.wizard-steps span.done { background: rgba(80,200,120,0.15); color: #8fd4a8; }
.hidden { display: none !important; }

@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.06); }
}
