:root {
  --accent: #e50914;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 35%, transparent);
  --bg: #0a0a0c;
  --bg-elevated: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text: #f5f5f7;
  --text-muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --max: 1180px;
}

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

html { scroll-behavior: smooth; }

body.fx-portal {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(91, 156, 255, 0.08), transparent);
}

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

.fx-wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.fx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, 0.82);
  backdrop-filter: blur(16px);
}

.fx-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.fx-logo img { height: 36px; width: auto; display: block; }

.fx-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.fx-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}
.fx-nav a:hover, .fx-nav a.active { color: var(--text); }
.fx-nav a.btn-nav {
  background: var(--accent);
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}
.fx-nav a.btn-nav:hover { filter: brightness(1.1); text-decoration: none; }

.fx-menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Hero */
.fx-hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
}

.fx-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.1;
}

.fx-hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 1.5rem;
}

.fx-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  margin-bottom: 1.25rem;
}

.fx-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.fx-status-pill.warn { color: #f0b429; border-color: rgba(240, 180, 41, 0.4); background: rgba(240, 180, 41, 0.12); }
.fx-status-pill.warn::before { background: #f0b429; box-shadow: 0 0 12px #f0b429; }

.fx-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; }

/* Buttons */
.fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s;
}
.fx-btn:hover { text-decoration: none; transform: translateY(-1px); }
.fx-btn-primary { background: var(--accent); color: #fff; }
.fx-btn-primary:hover { filter: brightness(1.08); color: #fff; }
.fx-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.fx-btn-ghost:hover { background: var(--bg-card); color: var(--text); }
.fx-btn-outline {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.fx-btn-sm { padding: 0.45rem 0.9rem; font-size: 0.82rem; }
.fx-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Grid & cards */
.fx-section { padding: 2.5rem 0; }
.fx-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.fx-section-desc { color: var(--text-muted); margin: 0 0 1.5rem; }

.fx-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.fx-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.fx-card:hover {
  background: var(--bg-card-hover);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.fx-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.fx-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.fx-card .meta { margin-top: 1rem; font-size: 0.82rem; color: var(--text-muted); }

.fx-stat-card .value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

/* Pricing */
.fx-pricing-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.fx-price-card {
  position: relative;
  padding: 1.75rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
}
.fx-price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}
.fx-price-card .badge {
  position: absolute;
  top: -10px;
  right: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.fx-price-card .price {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0 0;
}
.fx-price-card .period { color: var(--text-muted); font-size: 0.9rem; }
.fx-price-card ul {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
}
.fx-price-card li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.fx-price-card li::before { content: "✓ "; color: var(--accent); }

/* Device cards */
.fx-device-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.fx-device-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.fx-device-card.revoked { opacity: 0.55; }
.fx-device-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.fx-device-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.fx-device-meta { font-size: 0.82rem; color: var(--text-muted); }
.fx-device-meta span { display: block; }
.fx-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(61, 214, 140, 0.15);
  color: #3dd68c;
}
.fx-tag.off { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; }

/* Charts admin */
.fx-chart-row {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.fx-chart-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  min-height: 280px;
}
.fx-chart-box canvas { max-height: 240px; }

/* Tables */
.fx-table-wrap { overflow-x: auto; }
table.fx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.fx-table th, .fx-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.fx-table th { color: var(--text-muted); font-weight: 600; }

/* Forms */
.fx-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.fx-form input, .fx-form select, .fx-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1rem;
}
.fx-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* FAQ */
.fx-faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  padding: 0.85rem 1rem;
}
.fx-faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.fx-faq summary::-webkit-details-marker { display: none; }
.fx-faq p { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

/* Legal prose */
.fx-legal { max-width: 720px; margin: 0 auto; }
.fx-legal h2 { font-size: 1.25rem; margin-top: 2rem; }
.fx-legal p, .fx-legal li { color: var(--text-muted); }

/* Footer */
.fx-footer {
  margin-top: 4rem;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.fx-footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 2rem;
}
.fx-footer h4 { margin: 0 0 0.75rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.fx-footer ul { list-style: none; padding: 0; margin: 0; }
.fx-footer li { margin: 0.4rem 0; }
.fx-footer a { color: var(--text-muted); font-size: 0.88rem; text-decoration: none; }
.fx-footer a:hover { color: var(--text); }
.fx-footer-bottom {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.fx-flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  margin-bottom: 1.25rem;
}
.fx-error { color: #ff6b6b; margin-bottom: 1rem; }

.fx-commerce-banner {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: rgba(91, 156, 255, 0.1);
  border: 1px dashed rgba(91, 156, 255, 0.4);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.fx-version-chip {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

@media (max-width: 768px) {
  .fx-menu-toggle { display: block; }
  .fx-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-elevated);
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
  }
  .fx-nav.open { display: flex; }
  .fx-header-inner { position: relative; flex-wrap: wrap; }
}
