/* HostBMS — "Nebula" client area theme. Dark glassy blue; tokens match docs/SPEC.md (Look and feel). */

:root {
  --bg-base: #070E1F;
  --bg-base-2: #0C1A36;
  --bg-elevated: #0F1E3D;
  --glass-panel: rgba(20, 40, 80, 0.55);
  --glass-solid: #132544;
  --glass-border: rgba(120, 170, 255, 0.18);
  --accent: #3B8BFF;
  --accent-glow: #5AA8FF;
  --text-primary: #E6EEFF;
  --text-muted: #8FA3C8;
  --success: #2FD18A;
  --warning: #FFB547;
  --danger: #FF5C7A;
  --info: #38C6F4;
  --radius: 10px;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  font: 15px/1.55 var(--font-ui); color: var(--text-primary);
  background:
    radial-gradient(ellipse 80% 50% at 15% -5%, rgba(59, 139, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(56, 198, 244, 0.12), transparent 60%),
    radial-gradient(ellipse at 50% 0%, var(--bg-base-2), var(--bg-base) 70%) fixed, var(--bg-base);
}
a { color: var(--accent-glow); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 10px; font-weight: 650; line-height: 1.25; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.text-right { text-align: right; }
.mt { margin-top: 16px; }
.prewrap { white-space: pre-wrap; }
:focus-visible { outline: 2px solid var(--accent-glow); outline-offset: 2px; box-shadow: 0 0 0 4px rgba(90, 168, 255, 0.4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glass {
  background: var(--glass-solid); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.12), 0 10px 30px rgba(0, 0, 0, 0.35);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-panel); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: var(--glass-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(15, 30, 61, 0.92); border-bottom: 1px solid var(--glass-border); }
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgba(15, 30, 61, 0.7); backdrop-filter: blur(14px); } }
.header-inner { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; color: var(--text-primary); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg, var(--accent-glow), var(--accent) 55%, #1C4FB8); box-shadow: 0 0 14px rgba(59, 139, 255, 0.6); }
.topnav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--text-muted); font-weight: 500; }
.topnav a:hover, .topnav a.active { color: var(--text-primary); background: rgba(59, 139, 255, 0.14); text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-link { position: relative; }
.cart-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; font-size: 11px; line-height: 18px; text-align: center; background: var(--accent); color: #fff; }
.inline-form { display: inline; margin: 0; }
.currency-form select { width: auto; padding: 5px 8px; }

/* Layout */
.page { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 20px 40px; }
.with-sidebar { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.sidebar .panel { margin-bottom: 16px; }
.sidebar .panel h3 { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--glass-border); }
.sidebar ul { list-style: none; margin: 0; padding: 6px; }
.sidebar li a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; color: var(--text-primary); }
.sidebar li a:hover, .sidebar li a.active { background: rgba(59, 139, 255, 0.16); text-decoration: none; }
.panel { padding: 18px 20px; margin-bottom: 18px; }
.panel-flush { padding: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.site-footer { border-top: 1px solid var(--glass-border); padding: 18px 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Hero */
.hero { text-align: center; padding: 56px 20px 40px; }
.hero h1 { font-size: 40px; letter-spacing: -0.02em; }
.hero p { font-size: 18px; color: var(--text-muted); max-width: 620px; margin: 0 auto 22px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { display: block; padding: 20px; color: var(--text-primary); }
.tile:hover { text-decoration: none; border-color: rgba(90, 168, 255, 0.5); transform: translateY(-1px); }
.tile h3 { font-size: 17px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { display: flex; flex-direction: column; padding: 16px 18px; color: var(--text-primary); }
.stat:hover { text-decoration: none; border-color: rgba(90, 168, 255, 0.5); }
.stat-value { font: 650 28px/1.2 var(--font-mono); }
.stat-label { color: var(--text-muted); }

/* Order form templates */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.product-card { display: flex; flex-direction: column; padding: 22px; position: relative; }
.product-card.featured { border-color: rgba(90, 168, 255, 0.7); box-shadow: 0 0 0 1px rgba(90, 168, 255, 0.4), 0 14px 40px rgba(59, 139, 255, 0.25); }
.product-card .badge-ribbon { position: absolute; top: -11px; left: 22px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--accent); color: #fff; }
.price { margin: 10px 0 14px; }
.price .amount { font: 700 32px/1.1 var(--font-mono); }
.price .per { color: var(--text-muted); }
.features { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.features li { padding: 6px 0 6px 22px; position: relative; border-top: 1px solid var(--glass-border); }
.features li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.product-list .row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--glass-border); }
.product-list .row:first-child { border-top: 0; }
.product-list .row .grow { flex: 1; }
.compare th, .compare td { text-align: center; }
.compare td:first-child, .compare th:first-child { text-align: left; }
.compare .featured-col { background: rgba(59, 139, 255, 0.1); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--glass-border); vertical-align: top; }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
table.data tbody tr:hover { background: rgba(59, 139, 255, 0.06); }
table.data .num { text-align: right; font-family: var(--font-mono); white-space: nowrap; }
table.data .empty { color: var(--text-muted); text-align: center; padding: 26px; }

/* Forms */
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%; padding: 9px 12px; color: var(--text-primary); font: inherit;
  background: rgba(7, 14, 31, 0.6); border: 1px solid var(--glass-border); border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90, 168, 255, 0.35); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; margin: 12px 0 6px; color: var(--text-muted); font-weight: 500; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text-primary); font-weight: 400; }
.check input { width: auto; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.help { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.text-danger { color: var(--danger); }
fieldset { border: 1px solid var(--glass-border); border-radius: 8px; padding: 8px 16px 14px; margin: 14px 0; }
legend { color: var(--text-muted); padding: 0 6px; font-weight: 600; }
.choice { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; margin: 6px 0; border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-primary); font-weight: 400; }
.choice:hover { border-color: rgba(90, 168, 255, 0.5); }
.choice input { width: auto; margin: 0 8px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 15px var(--font-ui); cursor: pointer; color: var(--text-primary); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); box-shadow: 0 0 18px rgba(59, 139, 255, 0.4); color: #fff; }
.btn-primary:hover { background: var(--accent-glow); }
.btn-ghost { background: transparent; border-color: var(--glass-border); color: var(--text-muted); }
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent); }
.btn-success { background: rgba(47, 209, 138, 0.18); color: var(--success); border-color: rgba(47, 209, 138, 0.5); }
.btn-danger { background: rgba(255, 92, 122, 0.16); color: var(--danger); border-color: rgba(255, 92, 122, 0.45); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { color: var(--success); background: rgba(47, 209, 138, 0.14); }
.badge-warning { color: var(--warning); background: rgba(255, 181, 71, 0.14); }
.badge-danger { color: var(--danger); background: rgba(255, 92, 122, 0.14); }
.badge-info { color: var(--info); background: rgba(56, 198, 244, 0.14); }
.badge-muted { color: var(--text-muted); background: rgba(143, 163, 200, 0.14); }

.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 12px; }
.alert-success { color: #C9F7E2; background: rgba(47, 209, 138, 0.14); border: 1px solid rgba(47, 209, 138, 0.4); }
.alert-info { color: #CDEFFC; background: rgba(56, 198, 244, 0.12); border: 1px solid rgba(56, 198, 244, 0.4); }
.alert-warning { color: #FFE7C2; background: rgba(255, 181, 71, 0.12); border: 1px solid rgba(255, 181, 71, 0.4); }
.alert-danger { color: #FFD0D9; background: rgba(255, 92, 122, 0.14); border: 1px solid rgba(255, 92, 122, 0.4); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 18px; margin: 8px 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; text-align: right; }
.totals { max-width: 380px; margin-left: auto; }
.auth-wrap { max-width: 440px; margin: 20px auto; }
.auth-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.summary { position: sticky; top: 80px; }
.gateway-instructions { padding: 12px 14px; border-radius: 8px; background: rgba(7, 14, 31, 0.5); border: 1px solid var(--glass-border); }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.status-big { font-size: 22px; font-weight: 700; }

@media (max-width: 900px) {
  .with-sidebar, .auth-split { grid-template-columns: 1fr; }
  .summary { position: static; }
  .hero h1 { font-size: 30px; }
}
.reply-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.reply-head .small { margin-left: auto; }
.reply.staff { border-left: 3px solid var(--accent); }
.reply-body h2 { margin-top: 18px; }
.reply-body pre { overflow-x: auto; padding: 12px; border-radius: 8px; background: rgba(7, 14, 31, 0.6); }
.reply-body code { font-family: var(--font-mono); font-size: 13px; padding: 1px 5px; border-radius: 4px; background: rgba(7, 14, 31, 0.6); }
.reply-body pre code { padding: 0; background: none; }
.divider { border: 0; border-top: 1px solid var(--glass-border); margin: 20px 0; }
input[type="file"] { color: var(--text-muted); }

/* Section tabs inside a module panel (e.g. KarnakPanel: Overview, Domains, DNS...) */
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--glass-border); }
.subtabs a { padding: 8px 12px; color: var(--text-muted); text-decoration: none; }
.subtabs a:hover { color: var(--text-primary); }
.subtabs a.active { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--accent); }
.panel details > summary { list-style: none; cursor: pointer; display: inline-block; }
.panel details > summary::-webkit-details-marker { display: none; }
.panel details[open] > form { margin-top: 10px; text-align: left; }

/* Postcode address finder (addresslookup.tpl) */
.address-lookup { margin: 6px 0 16px; padding: 14px 16px 10px; border: 1px dashed var(--glass-border); border-radius: var(--radius, 10px); background: rgba(59, 139, 255, 0.06); }
.address-lookup[hidden], .address-lookup .al-pick[hidden] { display: none; }
.address-lookup .al-title { margin: 0 0 8px; font-weight: 650; }
.address-lookup .al-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) auto; gap: 0 12px; align-items: end; }
.address-lookup .al-action { padding-bottom: 14px; }
.address-lookup .al-pick { margin-top: 4px; }
@media (max-width: 640px) { .address-lookup .al-row { grid-template-columns: 1fr; } .address-lookup .al-action { padding-bottom: 6px; } }

/* Signup spam check (register.tpl). The honeypot is off-screen, not display:none, so bots still see it. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.human-check input { max-width: 240px; }

/* Branded email shown in a sandboxed frame (email history, email log, template preview) */
.email-frame { display: block; width: 100%; height: 760px; margin-top: 12px; border: 1px solid var(--glass-border); border-radius: 12px; background: #070e1f; }
.pow-check { display: flex; align-items: center; gap: 8px; margin: 10px 0 2px; color: var(--text-muted); font-size: 13px; }
.pow-check[hidden] { display: none; }
.pow-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pow-pulse 1s ease-in-out infinite; }
.pow-done .pow-dot { background: #22c55e; box-shadow: 0 0 8px #22c55e; animation: none; }
@keyframes pow-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pow-dot { animation: none; } }

/* "Ways to pay" strip on the home page (visitors) */
.pay-logos { text-align: center; margin: 32px 0 8px; }
.pay-logo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pay-logo-list li { display: flex; }
.pay-logo-list img { display: block; width: 120px; height: 42px; border-radius: 8px; box-shadow: 0 0 0 1px var(--glass-border); }
.pay-logo-text { display: flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 8px; background: var(--glass-solid); border: 1px solid var(--glass-border); color: var(--text-primary); font-weight: 600; font-size: 14px; }

/* Live chat widget (assets/js/livechat.js) */
.livechat { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 32px); }
.livechat[hidden] { display: none; }
.livechat-launcher { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1px solid rgba(120, 170, 255, 0.4); background: var(--accent); color: #fff; font: 600 14px/1 var(--font-ui); cursor: pointer; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 18px rgba(59, 139, 255, 0.45); }
.livechat-launcher:hover { background: var(--accent-glow); }
.livechat-dot { width: 9px; height: 9px; border-radius: 50%; background: #9aa9c4; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.livechat-dot.on { background: var(--success); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 8px var(--success); }
.livechat-badge { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }
.livechat-bubble { width: 280px; max-width: 100%; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.livechat-bubble-text { margin: 0 0 12px; font-weight: 600; }
.livechat-bubble-actions, .livechat-row { display: flex; gap: 8px; flex-wrap: wrap; }
.livechat-panel { width: 360px; max-width: 100%; height: min(520px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); }
.livechat-panel[hidden], .livechat-bubble[hidden] { display: none; }
.livechat-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: rgba(12, 26, 54, 0.9); border-bottom: 1px solid var(--glass-border); }
.livechat-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.livechat-head-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.livechat-sub { font-size: 12px; color: var(--text-muted); }
.livechat-icon { background: transparent; border: 1px solid var(--glass-border); color: var(--text-muted); border-radius: 6px; padding: 4px 9px; font: 13px/1.2 var(--font-ui); cursor: pointer; }
.livechat-icon:hover { color: var(--text-primary); border-color: var(--accent); }
.livechat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 10px; overflow-y: auto; }
.livechat-note { margin: 0; color: var(--text-muted); font-size: 14px; }
.livechat-form { display: flex; flex-direction: column; gap: 10px; }
.livechat-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.livechat-field input, .livechat-field textarea, .livechat-field select, .livechat-compose textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--glass-border); background: rgba(7, 14, 31, 0.7); color: var(--text-primary); font: 14px/1.4 var(--font-ui); resize: vertical; }
.livechat-status { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--warning); }
.livechat-status:empty { min-height: 0; }
.livechat-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin: -14px -14px 0; padding: 14px; }
.livechat-msg { max-width: 85%; padding: 8px 11px; border-radius: 12px; font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.livechat-me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.livechat-them { align-self: flex-start; background: var(--glass-solid); border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; }
.livechat-system { align-self: center; max-width: 100%; background: transparent; color: var(--text-muted); font-size: 12px; text-align: center; padding: 2px 8px; }
.livechat-who { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; white-space: normal; }
.livechat-text { display: block; }
.livechat-compose { display: flex; gap: 8px; align-items: flex-end; border-top: 1px solid var(--glass-border); margin: 0 -14px -14px; padding: 10px 14px; }
.livechat-compose[hidden], .livechat [hidden] { display: none !important; }
.livechat-compose textarea { flex: 1; resize: none; }
.livechat-typing { min-height: 16px; margin: 4px 0 6px; font-size: 12px; font-style: italic; color: var(--text-muted); }
.livechat-file { color: inherit; text-decoration: underline; font-weight: 600; overflow-wrap: anywhere; }
.livechat-file-size { margin-left: 6px; font-size: 11px; opacity: .75; }
.livechat-attach { flex: none; }
.livechat-again { align-self: center; }
@media (max-width: 480px) {
  .livechat { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .livechat-launcher { align-self: flex-end; }
  .livechat-panel, .livechat-bubble { width: auto; }
}
