/* A3JM Workspace (www.a3jm.com). Tokens match apps/hosting-site/site/assets/site.css and the Authentik
   brand CSS: black background, #1d1d1f cards, #2997ff accent, SF Pro, pill buttons, 16px radius. */
:root {
  --bg: #000000;
  --bg-2: #0a0a0c;
  --card: #1d1d1f;
  --card-2: #2a2a2d;
  --fg: #f5f5f7;
  --fg-2: #d2d2d7;
  --muted: #86868b;
  --accent: #2997ff;
  --accent-2: #0a84ff;
  --accent-soft: rgba(41, 151, 255, 0.14);
  --accent-border: rgba(41, 151, 255, 0.4);
  --border: rgba(255, 255, 255, 0.1);
  --border-2: rgba(255, 255, 255, 0.18);
  --good: #30d158; --good-bg: rgba(48, 209, 88, 0.14); --good-border: rgba(48, 209, 88, 0.35);
  --warn: #ffd60a; --warn-bg: rgba(255, 214, 10, 0.12); --warn-border: rgba(255, 214, 10, 0.35);
  --glow: radial-gradient(60% 55% at 78% 8%, rgba(41, 151, 255, 0.26), transparent 70%);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --top-h: 64px;
  --side-w: 320px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.012em; line-height: 1.2; }
p { margin: 0; color: var(--fg-2); }

/* ── top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  background: rgba(0, 0, 0, 0.78); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { height: 100%; max-width: 1480px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand img { height: 30px; width: auto; display: block; }
.brand-name { font-weight: 600; font-size: 15px; color: var(--fg-2); padding-left: 12px; border-left: 1px solid var(--border-2); }

.account { position: relative; }
.avatar-btn {
  display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid var(--border);
  color: var(--fg); padding: 4px 12px 4px 4px; border-radius: 980px; cursor: pointer; font: inherit;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--card); border-color: var(--border-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #2997ff, #5e5ce6); color: #fff; font-weight: 600; font-size: 13px; letter-spacing: .02em;
}
.avatar-name { font-size: 14px; font-weight: 500; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { width: 12px; height: 12px; color: var(--muted); }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--card);
  border: 1px solid var(--border-2); border-radius: 14px; padding: 6px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.menu-who { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-who strong { font-size: 14px; }
.menu-who span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--fg); font-size: 14px; }
.menu a:hover { background: var(--card-2); text-decoration: none; }
.menu a.signout { color: #ff6961; }

/* ── layout: applications left, content right ── */
.layout { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.apps {
  position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 28px 16px 24px 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px;
}
.apps-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 8px; }
.apps-head h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.count { font-size: 12px; color: var(--muted); }
.loading { color: var(--muted); padding: 0 8px; }
.group + .group { margin-top: 14px; }
.group-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 6px 8px; }
.app {
  display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 12px; color: var(--fg);
  border: 1px solid transparent; transition: background .15s, border-color .15s;
}
a.app:hover { background: var(--card); border-color: var(--border); text-decoration: none; }
.app.soon { opacity: .5; cursor: default; }
.app-ico {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, #2997ff, #0a5cc2); color: #fff; font-weight: 600; font-size: 15px;
}
.app-ico img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.app-text { min-width: 0; flex: 1; }
.app-name { font-size: 14.5px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-host { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { flex: 0 0 auto; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 980px; border: 1px solid var(--border); color: var(--muted); }
.tag.net { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.tag.web { color: var(--good); border-color: var(--good-border); background: var(--good-bg); }
.tag.soon { color: var(--warn); border-color: var(--warn-border); background: var(--warn-bg); }
.empty { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.empty-title { color: var(--fg); font-weight: 600; }
.empty p { font-size: 13.5px; }
.empty .btn { align-self: flex-start; margin-top: 4px; }
.empty.warn { border-color: var(--warn-border); }
.empty.pending { border-color: var(--accent-border); background: linear-gradient(135deg, rgba(41, 151, 255, 0.10), rgba(94, 92, 230, 0.06)), var(--card); }
.empty .fine { font-size: 12.5px; color: var(--muted); }
.box-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px;
  box-shadow: 0 0 0 0 rgba(41, 151, 255, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(41, 151, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(41, 151, 255, 0); } }
.legend { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.net { background: var(--accent); }
.dot.web { background: var(--good); }

/* ── main ── */
.main { min-width: 0; padding: 0 clamp(20px, 4vw, 56px) 56px; }
.hero { position: relative; padding: clamp(40px, 8vh, 96px) 0 clamp(32px, 5vh, 56px); }
.hero::before { content: ""; position: absolute; inset: 0 calc(-1 * clamp(20px, 4vw, 56px)); background: var(--glow); pointer-events: none; }
.hero > * { position: relative; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; background: var(--good-bg); color: var(--good); border: 1px solid var(--good-border);
  padding: 4px 12px; border-radius: 980px; font-size: 12px; font-weight: 600;
}
.badge svg { width: 12px; height: 12px; }
.badge.wait { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge.wait svg { display: none; }
.hero h1 { margin-top: 18px; font-size: clamp(34px, 4.8vw, 60px); line-height: 1.05; letter-spacing: -0.025em; max-width: 17ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { margin-top: 18px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; line-height: 1.5; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 980px; font-weight: 600; font-size: 14.5px;
  border: 1px solid transparent; font-family: var(--font); cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { color: var(--fg); border-color: var(--border-2); }
.btn.ghost:hover { background: var(--card-2); }
.btn.small { padding: 8px 16px; font-size: 13.5px; }

.pillars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pillar { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.pill-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); }
.pill-ico svg { width: 22px; height: 22px; }
.pillar h3 { margin-top: 14px; font-size: 16px; }
.pillar p { margin-top: 6px; font-size: 14px; color: var(--muted); }

.start { margin-top: 48px; }
.start h2, .support h2 { font-size: clamp(20px, 2.2vw, 24px); }
.steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.steps li { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.steps .n { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--fg); font-weight: 600; font-size: 13px; }
.steps strong { display: block; font-size: 14.5px; }
.steps p { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.steps em { font-style: normal; color: var(--fg-2); }

.support {
  margin-top: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--accent-border);
  background: linear-gradient(135deg, rgba(41, 151, 255, 0.12), rgba(94, 92, 230, 0.08));
}
.support p { margin-top: 6px; color: var(--muted); }

.foot {
  border-top: 1px solid var(--border); color: #6e6e73; font-size: 13px;
  padding: 20px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.foot a { color: var(--muted); }

/* ── responsive: apps first, then the content ── */
@media (max-width: 1100px) {
  .pillars, .steps { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .apps { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 20px 16px; }
  .legend { margin-top: 0; }
  .main { padding: 0 16px 40px; }
  .avatar-name { display: none; }
  .avatar-btn { padding-right: 8px; }
  .brand-name { display: none; }
}
