/* WHMCS Front - Full-featured layout */
:root {
  --bg: #0f0f12;
  --bg2: #18181c;
  --bg3: #222228;
  --text: #e4e4e7;
  --text-muted: #a1a1aa;
  --accent: #22c55e;
  --accent-hover: #16a34a;
  --border: #27272a;
  --error: #ef4444;
  --radius: 10px;
  --font: 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.logo:hover { color: var(--accent); }
.nav-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.nav-main a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-main a:hover, .nav-main a.active { color: var(--accent); }
.nav-cart { position: relative; }
.nav-cart .badge {
  background: var(--accent);
  color: var(--bg);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  margin-left: 0.25rem;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.site-main { flex: 1; padding: 2rem 0; }

.hero {
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  padding: 4rem 1rem;
  text-align: center;
  border-radius: 0 0 var(--radius) var(--radius);
}
.hero h1 { font-size: 2.25rem; margin: 0 0 0.5rem; }
.hero-lead { color: var(--text-muted); font-size: 1.1rem; margin: 0 0 1.5rem; }
.hero .btn { margin-top: 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover { background: var(--accent); color: var(--bg); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--error); border-color: var(--error); }

.products-preview h2, .page-products h1, .page-cart h1, .form-section h1, .client-dashboard h1, .client-page h1 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.product-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.product-card:hover { border-color: var(--accent); }
.product-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.product-card h3 a { color: inherit; text-decoration: none; }
.product-card h3 a:hover { color: var(--accent); }
.product-card .price { color: var(--accent); font-weight: 600; margin: 0.25rem 0; }
.product-card .desc { color: var(--text-muted); font-size: 0.9rem; margin: 0.5rem 0 1rem; }
.product-card .btn { margin-top: 0.5rem; }

.filter-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-groups a {
  padding: 0.4rem 0.8rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.filter-groups a:hover, .filter-groups a.active { border-color: var(--accent); color: var(--accent); }

.empty-state { color: var(--text-muted); }
.empty-state a { color: var(--accent); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 2rem; }
.pagination a { color: var(--accent); text-decoration: none; }

/* Product detail */
.breadcrumb { margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.product-detail {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}
.product-order {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 5rem;
}
.product-order label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--text-muted); }
.product-order input[type=number] { width: 80px; padding: 0.5rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.cycle-options { display: flex; flex-direction: column; gap: 0.5rem; }
.cycle-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.cycle-option:has(input:checked) { border-color: var(--accent); background: rgba(34, 197, 94, 0.08); }
.cycle-label { text-transform: capitalize; }
.cycle-price { font-weight: 600; color: var(--accent); }
.cycle-setup { font-size: 0.85rem; color: var(--text-muted); }
.product-description { margin-bottom: 1rem; }
.message { padding: 0.75rem; border-radius: var(--radius); margin-bottom: 1rem; }
.message.success { background: rgba(34, 197, 94, 0.15); color: var(--accent); }
.message.error { background: rgba(239, 68, 68, 0.15); color: var(--error); }

/* Cart */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.cart-table th, .cart-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th { color: var(--text-muted); font-weight: 600; }
.cart-table a { color: var(--accent); text-decoration: none; }
.cart-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Forms */
.form-section { max-width: 480px; margin: 0 auto; }
.form-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.form-card label { display: block; margin: 0.75rem 0 0.25rem; font-size: 0.9rem; color: var(--text-muted); }
.form-card input { width: 100%; padding: 0.6rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.form-card button { margin-top: 1rem; width: 100%; }

/* Client area */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.dashboard-cards .card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.dashboard-cards .card h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--text-muted); }
.dashboard-cards .card .big { font-size: 1.75rem; font-weight: 700; margin: 0.25rem 0; }
.dashboard-cards .card a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }
.sso-link { margin-top: 1.5rem; }
.service-list { display: grid; gap: 1rem; }
.service-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.service-card h3 { margin: 0 0 0.5rem; }
.service-card p { margin: 0.25rem 0; font-size: 0.9rem; color: var(--text-muted); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-muted); font-weight: 600; }
.status { padding: 0.2rem 0.5rem; border-radius: 6px; font-size: 0.85rem; }
.status-paid, .status-active { background: rgba(34, 197, 94, 0.2); color: var(--accent); }
.status-unpaid, .status-pending { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.status-cancelled, .status-closed { background: var(--bg3); color: var(--text-muted); }

.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.text-center { text-align: center; }

@media (max-width: 768px) {
  .nav-main { display: none; }
  .nav-toggle { display: block; }
  .nav-main.is-open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg2); padding: 1rem; border-bottom: 1px solid var(--border); }
  .product-detail { grid-template-columns: 1fr; }
  .product-order { position: static; }
}
