:root {
  --bg: #0f1115;
  --card: #171a21;
  --border: #262b36;
  --text: #e7e9ee;
  --muted: #9aa2b1;
  --accent: #5865F2;
  --danger: #e05263;
  --success: #3fb98a;
  --pending: #d9a441;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

code {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.9em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
/* Staff-only links (Dev Tools / Admin / Support Panel) - kept separate
   from the public marketing nav on the right (Features/Pricing/etc.) by
   living on the left, next to the brand, with a divider so it visually
   reads as "internal tools" rather than part of the public site map. */
.topbar-left-links { display: flex; align-items: center; gap: 14px; margin-left: 18px; padding-left: 18px; border-left: 1px solid var(--border); }
.topbar-left-links a { color: var(--muted); text-decoration: none; font-size: 0.88rem; }
.topbar-left-links a:hover { color: var(--text); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent);
  color: white; font-size: 0.8rem; font-weight: 800;
}
.topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-right a { color: var(--muted); text-decoration: none; }
.topbar-right a:hover { color: var(--text); }
.nav-toggle { display: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }
.footer { text-align: center; color: var(--muted); padding: 28px 24px; font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: 40px; }
.footer p { margin: 4px 0; }
.footer-brand-link { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-brand-link:hover { color: var(--accent); }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.footer-sep { margin: 0 8px; }

.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.75rem; margin-bottom: 10px;
}

.hero { text-align: center; padding: 64px 0 48px; }
.hero h1 { font-size: 2.6rem; margin: 0 0 12px; line-height: 1.15; }
.hero p { max-width: 640px; margin: 0 auto 8px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin: 24px 0 10px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-large { padding: 12px 24px; font-size: 1.05rem; }
.btn-small { padding: 4px 12px; font-size: 0.85rem; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; }

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 40px 0;
}
.feature-card h3 { margin: 4px 0 8px; }
.feature-icon { font-size: 1.6rem; margin-bottom: 10px; }
@media (max-width: 860px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-list { display: flex; flex-direction: column; gap: 14px; margin: 32px 0; }
.feature-row h3 { margin: 0 0 6px; }

.cta-band {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 40px 0; flex-wrap: wrap;
}
.cta-band h2 { margin: 0 0 6px; font-size: 1.3rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(224,82,99,0.15); color: var(--danger); border: 1px solid var(--danger); }
.alert-success { background: rgba(63,185,138,0.15); color: var(--success); border: 1px solid var(--success); }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; border: 1px solid var(--border); }
.badge-approved { color: var(--success); border-color: var(--success); }
.badge-rejected { color: var(--danger); border-color: var(--danger); }
.badge-pending { color: var(--muted); border-color: var(--muted); }
.badge-warning { color: var(--pending); border-color: var(--pending); }

/* Admin modals (Cancel Service / Reinstate Service / Delete Server) -
   plain overlay + centered card, shown/hidden via the `hidden` attribute
   from public/js/site.js (no animation libraries, keeps this CSP-safe
   and dependency-free like everything else on this site). */
body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal-overlay[hidden] { display: none; }
.modal { width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: white; }

.service-block {
  padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: rgba(255,255,255,0.015);
}
.service-block:last-child { margin-bottom: 0; }
.service-block-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.service-block h4 { margin: 0; }
.service-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.payment-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Self-service account settings (account-dashboard.ejs "Settings" card) -
   email, password, and Discord-connect forms. Laid out like a real SaaS
   settings page: a fixed-width label+description column on the left, the
   actual control (input(s) + button) on the right, stacked vertically
   rather than crammed onto one line. */
.settings-row {
  display: flex; gap: 32px; padding: 22px 0; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-row:first-child { border-top: none; padding-top: 4px; }
.settings-row-label { flex: 0 0 240px; }
.settings-row-label h4 { margin: 0 0 4px; font-size: 0.95rem; }
.settings-row-label p { margin: 0; color: var(--muted); font-size: 0.83rem; line-height: 1.5; }
.settings-row-control { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.settings-row-control .form-stack { display: flex; flex-direction: column; gap: 10px; }
.settings-row-control .form-stack label {
  font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: -4px;
}
.settings-row-control input { width: 100%; }
.settings-row-control .form-actions { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.settings-status { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.settings-status-icon { color: var(--success); font-weight: 700; }
@media (max-width: 640px) {
  .settings-row-label { flex-basis: 100%; }
  .settings-row-control { max-width: 100%; }
}

/* Profile header at the top of account-dashboard.ejs - avatar initials +
   name + quick status pills, matching what a real product dashboard shows
   instead of a bare "Welcome, X" heading. */
.account-header { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; flex-wrap: wrap; }
.avatar-circle {
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700;
  flex-shrink: 0;
}
.account-header-meta h1 { margin: 0 0 4px; font-size: 1.5rem; }
.account-header-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* Card header row - icon-ish label + title, used to break up the wall of
   plain <h3>s the dashboard used to be. */
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-header h3 { margin: 0; }
.card-header p { margin: 2px 0 0; }
.card + .card { margin-top: 20px; }
.card-subtitle { color: var(--muted); font-size: 0.85rem; margin: 2px 0 0; }

/* Referenced by account-dashboard.ejs and the admin views, but never
   actually had rules defined until now - was rendering as an unstyled
   browser-default table. */
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.table tr:last-child td { border-bottom: none; }

/* Demo */
.demo-placeholder { margin: 24px 0 40px; padding: 0; overflow: hidden; }
.placeholder-frame {
  aspect-ratio: 16/9; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: linear-gradient(135deg, #1b1f2a, #12141a);
}
.placeholder-play {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 32px 0; }
.gallery-item { margin: 0; text-align: center; }
.placeholder-shot {
  aspect-ratio: 4/3; border-radius: 8px; background: linear-gradient(135deg, #1b1f2a, #12141a);
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem; margin-bottom: 10px;
}
.gallery-item figcaption { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Docs */
.docs-layout { display: grid; grid-template-columns: 200px 1fr; gap: 28px; margin: 32px 0; align-items: start; }
.docs-toc { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; }
.docs-toc a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 0.9rem; }
.docs-toc a:hover { background: var(--card); color: var(--text); }
.docs-content { display: flex; flex-direction: column; gap: 16px; }
.docs-content h3 { margin: 0 0 6px; }
@media (max-width: 760px) { .docs-layout { grid-template-columns: 1fr; } .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; } }

/* Updates */
.updates-list { display: flex; flex-direction: column; gap: 16px; margin: 32px 0; }
.update-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.update-item h3 { margin: 0 0 6px; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 32px 0; }
.pricing-card { display: flex; flex-direction: column; position: relative; }
.pricing-card-highlighted { border-color: var(--accent); }
.pricing-badge {
  position: absolute; top: -12px; right: 16px; background: var(--accent); color: white;
  font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; font-weight: 600;
}
.pricing-card h3 { margin: 6px 0 4px; }
.pricing-price { margin: 4px 0 8px; }
.pricing-amount { font-size: 2rem; font-weight: 800; }
.pricing-features { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pricing-features li { padding-left: 22px; position: relative; font-size: 0.9rem; color: var(--muted); }
.pricing-features li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.pricing-cta { text-align: center; margin-top: auto; }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; } }

/* Purchase */
.purchase-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin: 32px 0; align-items: start; }
.purchase-form { display: flex; flex-direction: column; gap: 6px; }
.purchase-form label { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.purchase-form button { margin-top: 18px; align-self: flex-start; }
.purchase-summary h3 { margin-top: 0; }
.purchase-steps { padding-left: 20px; color: var(--muted); font-size: 0.9rem; display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 800px) { .purchase-layout { grid-template-columns: 1fr; } }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  padding: 9px 10px; border-radius: 6px; border: 1px solid var(--border);
  background: #0d0f14; color: var(--text); font-size: 0.95rem; font-family: inherit; width: 100%;
  display: block;
}
textarea { resize: vertical; min-height: 100px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }

/* Generic form layout - any <form class="form"> gets consistent label/
   input stacking, matching what .purchase-form already had, so this
   isn't reinvented per-page (see account-setup.ejs). */
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.form label:first-of-type { margin-top: 0; }
.form h3 { margin: 22px 0 4px; }
.form h3:first-child { margin-top: 0; }
.form button { margin-top: 18px; align-self: flex-start; }
.form .radio-row { display: flex; gap: 24px; flex-wrap: wrap; margin: 4px 0 2px; }
.form .radio-row label {
  margin-top: 0; display: flex; align-items: center; gap: 6px;
  color: var(--text); font-size: 0.95rem; font-weight: 400;
}
.form .checkbox-row {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 0;
  color: var(--text); font-size: 0.9rem;
}
.form .checkbox-row label { margin-top: 0; color: var(--text); }
.form .field-group { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.form .field-group label:first-of-type { margin-top: 0; }

@media (max-width: 760px) {
  .topbar-right { display: none; }
  .topbar-right.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 24px; gap: 12px; }
  .nav-toggle { display: block; position: fixed; top: 14px; right: 20px; z-index: 60; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; }
}

/* Dashboard shell - left sidebar + main content, shared by the client
   area (/account/*), admin area (/admin/*), and Support Panel (/support/*)
   via partials/client-sidebar.ejs, partials/admin-sidebar.ejs, and
   partials/support-sidebar.ejs respectively. */
.dashboard-shell { display: flex; gap: 32px; align-items: flex-start; margin: 8px 0 40px; }
.sidebar { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.sidebar-title { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 0 8px; }
.sidebar-link { display: block; padding: 9px 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 0.92rem; border-left: 3px solid transparent; }
.sidebar-link:hover { background: var(--card); color: var(--text); }
.sidebar-link.active { background: var(--card); color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.dashboard-main { flex: 1; min-width: 0; }
@media (max-width: 860px) {
  .dashboard-shell { flex-direction: column; gap: 16px; }
  .sidebar { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .sidebar-title { display: none; }
}

/* Support ticket thread (account-support-thread.ejs, support-panel-thread.ejs) */
.ticket-message { padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 10px; }
.ticket-message-staff { background: rgba(88,101,242,0.08); border-color: var(--accent); }
.ticket-message-meta { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 0.78rem; color: var(--muted); }
.ticket-message-body { white-space: pre-wrap; font-size: 0.92rem; margin: 0; }
.ticket-header-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 18px; }

/* Manage Permissions modal (partials/manage-permissions-modal.ejs) */
.permissions-section { margin-bottom: 18px; }
.permissions-section:last-child { margin-bottom: 0; }
.permissions-section h4 { margin: 0 0 4px; }
.permissions-section-desc { color: var(--muted); font-size: 0.82rem; margin: 0 0 10px; }
.permissions-select-all {
  font-weight: 600; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.permissions-list { display: flex; flex-direction: column; gap: 8px; padding-left: 2px; }
.permissions-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); font-size: 0.9rem; margin-top: 0; }

/* Notification bell (partials/header.ejs, public/js/site.js, routes/notifications.js) */
.notification-bell-wrap { position: relative; display: flex; align-items: center; }
.notification-bell-btn {
  background: none; border: none; color: var(--text); font-size: 1.1rem; cursor: pointer;
  position: relative; padding: 4px 6px; line-height: 1;
}
.notification-bell-badge {
  position: absolute; top: -2px; right: -2px; background: #ed4245; color: #fff;
  font-size: 0.62rem; font-weight: 700; line-height: 1; padding: 2px 4px; border-radius: 999px;
  min-width: 15px; text-align: center;
}
.notification-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-height: 420px;
  overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35); z-index: 70;
}
.notification-dropdown-header {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px;
  border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.85rem;
}
.notification-dropdown-list { display: flex; flex-direction: column; }
.notification-item {
  display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); text-decoration: none;
  color: var(--text); cursor: pointer;
}
.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: rgba(255,255,255,0.03); }
.notification-item-unread { border-left: 3px solid var(--accent); background: rgba(88,101,242,0.06); }
.notification-item-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.notification-item-body { font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.notification-item-time { font-size: 0.72rem; color: var(--muted); }
@media (max-width: 760px) {
  .notification-dropdown { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; }
}
