/* ==========================================================================
   ALX Cloud — the theme every module shares.
   The same tokens as the ALX Systems website and the cloud portal (site.css):
   near-black ground, one orange accent, system sans for text and a mono face
   for labels and figures. A module's own stylesheet uses these variables and
   adds only what is particular to it.
   ========================================================================== */

:root {
  --accent: #ff7a1a;
  --accent-ink: #0a0e13;          /* text on the accent */
  --bg: #0a0e13;
  --surface: #111821;
  --surface-2: #17202b;
  --surface-3: #1e2935;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #e9eef3;
  --muted: #95a3b2;
  --teal: #3fc1a5;                 /* the second colour: success, the AI domain */
  --ok: #3fc1a5;
  --warn: #ffc15e;
  --bad: #ff8a80;
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 64px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body.alx {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.alx a:not(.alx-btn):not(.alx-balance) { color: var(--accent); text-underline-offset: 3px; }
.alx h1, .alx h2, .alx h3 { line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
.alx :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header: the same bar on every module ---------- */

.alx-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 clamp(16px, 3vw, 28px);
  background: rgba(10, 14, 19, .82);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.alx-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); white-space: nowrap; }
.alx-brand img { height: 34px; width: auto; display: block; }
.alx-brand .alx-product,
.alx-brand .alx-module {
  padding-left: 12px; border-left: 1px solid var(--line-strong);
  font: 600 .72rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.alx-brand .alx-module { color: var(--text); }
.alx-header-nav { display: flex; gap: 4px; margin-left: 12px; }
.alx-header-nav a {
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.alx-header-nav a:hover, .alx-header-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.alx-spacer { flex: 1; }

.alx-account { display: flex; align-items: center; gap: 10px; font-size: .9rem; }
.alx-balance {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  font: 600 .85rem var(--mono); color: var(--accent); text-decoration: none; white-space: nowrap;
}
.alx-balance small { font: 500 .68rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.alx-balance:hover { border-color: var(--accent); }
.alx-user { color: var(--muted); max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .alx-user, .alx-brand .alx-product, .alx-header-nav { display: none; }
}

/* ---------- buttons ---------- */

.alx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: 600 .92rem var(--font); text-decoration: none; cursor: pointer;
  transition: filter .15s, border-color .15s, background-color .15s;
}
.alx-btn-primary { background: var(--accent); color: var(--accent-ink); }
.alx-btn-primary:hover { filter: brightness(1.08); }
.alx-btn-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.alx-btn-outline:hover { border-color: var(--text); }
.alx-btn-ghost { background: transparent; color: var(--muted); }
.alx-btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.alx-btn-sm { min-height: 32px; padding: 0 12px; font-size: .84rem; }
.alx-btn:disabled, .alx-btn[aria-disabled="true"] { opacity: .45; cursor: default; filter: none; }

/* ---------- surfaces and labels ---------- */

.alx-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.alx-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font: 600 .72rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.alx-eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; }
.alx-label { font: 600 .7rem var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.alx-muted { color: var(--muted); }
.alx-mono { font-family: var(--mono); }

.alx-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font: 600 .7rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.alx-tag.ok { color: var(--ok); border-color: rgba(63, 193, 165, .45); }
.alx-tag.run { color: var(--accent); border-color: rgba(255, 122, 26, .5); }
.alx-tag.warn { color: var(--warn); border-color: rgba(255, 193, 94, .4); }
.alx-tag.bad { color: var(--bad); border-color: rgba(255, 138, 128, .4); }

.alx-notice { padding: 12px 14px; border-radius: var(--radius-sm); border-left: 3px solid var(--line-strong); background: var(--surface-2); }
.alx-notice.bad { border-left-color: var(--bad); }
.alx-notice.warn { border-left-color: var(--warn); }
.alx-notice.ok { border-left-color: var(--ok); }

/* ---------- forms ---------- */

.alx input[type=text], .alx input[type=number], .alx input[type=email], .alx input[type=password],
.alx input:not([type]), .alx select, .alx textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit;
}
.alx input:focus, .alx select:focus, .alx textarea:focus { outline: none; border-color: var(--accent); }
.alx textarea { resize: vertical; }
.alx input[type=file] { color: var(--muted); font-size: .85rem; }
.alx input[type=file]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line-strong); font: 600 .82rem var(--font);
}
.alx input[type=file]::file-selector-button:hover { border-color: var(--text); }

/* ---------- the sign-in gate (no session yet) ---------- */

.alx-gate { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 32px 16px; }
.alx-gate .alx-card { width: min(100%, 440px); }
.alx-gate h1 { font-size: 1.6rem; margin: 0; }
.alx-gate .alx-card > * { margin: 0; }
.alx-gate .alx-card > * + * { margin-top: 14px; }
/* While nobody is signed in, the module's own header items (a server status, a menu) have nothing to say. */
.alx-gated [data-alx-app] { display: none !important; }

/* ---------- the price before a job starts ---------- */

.alx-quote { display: flex; align-items: baseline; gap: 8px; font: 600 1rem var(--mono); }
.alx-quote small { font: 500 .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
