:root {
  --bg: #0b0f14;
  --surface: #121922;
  --surface-2: #182231;
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef4fb;
  --muted: #9dabbb;
  --brand: #15b8a6;
  --brand-2: #3b82f6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --page-bg-color: #0b0f14;
  --page-bg-image: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg-color);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background:
    linear-gradient(145deg, rgba(21, 184, 166, 0.18), transparent 32%),
    linear-gradient(35deg, rgba(59, 130, 246, 0.14), transparent 38%),
    var(--page-bg-color);
}

body.has-custom-background::before {
  background:
    linear-gradient(180deg, rgba(11, 15, 20, 0.72), rgba(11, 15, 20, 0.9)),
    var(--page-bg-image) center / cover fixed,
    var(--page-bg-color);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  font-weight: 900;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: 72px 0 52px;
  gap: 44px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: #b9fff6;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 650px;
  margin: 22px 0 32px;
  color: #c8d3df;
  font-size: 19px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(21, 184, 166, 0.18);
}

.button.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.danger {
  background: var(--danger);
  box-shadow: none;
}

.button.small {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
}

.hero-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.78);
  box-shadow: var(--shadow);
}

.screen-top {
  display: flex;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
}

.dot:nth-child(2) {
  background: var(--warning);
}

.dot:nth-child(3) {
  background: var(--brand-2);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 18px;
}

.preview-tile {
  min-height: 116px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent),
    var(--surface-2);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.preview-tile.wide {
  grid-column: span 2;
  min-height: 150px;
  background:
    linear-gradient(135deg, rgba(21, 184, 166, 0.28), rgba(59, 130, 246, 0.2)),
    var(--surface-2);
}

.preview-tile.has-image {
  background-color: var(--surface-2);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.section {
  padding: 72px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.plans-grid,
.devices-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.plan-card,
.device-card,
.admin-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.86);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

body[data-card-style="solid"] .plan-card,
body[data-card-style="solid"] .device-card {
  background: #121922;
  box-shadow: none;
}

body[data-card-style="outline"] .plan-card,
body[data-card-style="outline"] .device-card {
  background: rgba(11, 15, 20, 0.58);
  border-color: var(--brand);
  box-shadow: none;
}

.plan-card {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  padding: 24px;
}

.plan-card.featured {
  border-color: rgba(21, 184, 166, 0.55);
}

.tag {
  align-self: flex-start;
  margin-bottom: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #041311;
  background: #8cf8ed;
  font-size: 12px;
  font-weight: 900;
}

.plan-card h3,
.device-card h3 {
  margin: 0 0 10px;
  font-size: 23px;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 12px;
}

.price strong {
  font-size: 40px;
}

.price span {
  color: var(--muted);
  font-weight: 700;
}

.description {
  color: var(--muted);
  line-height: 1.6;
}

.features {
  flex: 1;
  margin: 18px 0 20px;
  padding: 0;
  list-style: none;
}

.features li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  color: #d9e3ed;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.features li::before {
  content: "✓";
  color: var(--brand);
  font-weight: 900;
}

.device-card {
  overflow: hidden;
}

.device-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: var(--surface-2);
}

.device-body {
  padding: 18px;
}

.download-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.download-code code {
  color: #b9fff6;
  font-weight: 900;
  white-space: nowrap;
}

.site-footer {
  padding: 28px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  display: grid;
  width: min(430px, 100%);
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 25, 34, 0.92);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 34px;
}

[hidden] {
  display: none !important;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(9, 13, 18, 0.86);
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.sidebar-nav a {
  padding: 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-nav a.active {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.admin-main {
  padding: 28px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-card {
  padding: 20px;
}

.admin-card.full {
  grid-column: 1 / -1;
}

.admin-card h2 {
  margin: 0 0 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #c8d3df;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.field input[type="file"] {
  padding: 9px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.upload-row input[type="file"] {
  min-width: 0;
}

.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  cursor: pointer;
  font-weight: 800;
}

.field textarea {
  min-height: 98px;
  resize: vertical;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

td img {
  width: 62px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice {
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid rgba(21, 184, 166, 0.35);
  border-radius: 8px;
  color: #c9fff9;
  background: rgba(21, 184, 166, 0.08);
}

@media (max-width: 900px) {
  .hero,
  .admin-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .plans-grid,
  .devices-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 48px 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .plans-grid,
  .devices-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .plan-card {
    min-height: auto;
    padding: 18px;
  }

  .plan-card h3 {
    font-size: 21px;
  }

  .price strong {
    font-size: 34px;
  }

  .price span,
  .plan-card .description,
  .features li {
    font-size: 15px;
  }

  .device-body {
    padding: 16px;
  }

  .device-card h3 {
    font-size: 20px;
  }

  .device-card .description {
    font-size: 15px;
  }

  .download-code {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .download-code code {
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }
}
