/* Company home page: sign-in, then the app tiles.

   SIGN-IN is Argus, in the Night Desk look (the same tokens as Argus Accounting's night-desk.css: the near-black desk,
   the blue glow top-left, the brass glow top-right, the pinstripe, glass panel, brass button, Inter Tight).
   TILES are the client's: their logo and colours (brands/<slug>/brand.css redefines the --brand-* tokens below
   when html[data-view="tiles"]). Plain tiles, a name and an icon each.
   No inline style anywhere (content policy: style-src 'self'). */

@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 300; font-display: swap; src: url('/_argus/fonts/inter-tight-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 400; font-display: swap; src: url('/_argus/fonts/inter-tight-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500; font-display: swap; src: url('/_argus/fonts/inter-tight-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 600; font-display: swap; src: url('/_argus/fonts/inter-tight-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  /* Night Desk (copied from Argus Accounting; do not tidy) */
  --nd-base: #0E1013; --nd-text: #EEF0F4; --nd-muted: #9198A6; --nd-soft: #AEB4C2;
  --nd-brass: #D8BC82; --nd-ink: #0E1013; --nd-steel-hi: #6E93D6;
  --nd-glass: rgba(255,255,255,0.045); --nd-line: rgba(255,255,255,0.10); --nd-line-strong: rgba(255,255,255,0.12);
  --nd-glow-blue: rgba(74,110,170,0.28); --nd-glow-brass: rgba(201,164,92,0.15); --nd-glow-mint: rgba(47,163,138,0.08);
  --nd-pinstripe: repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 14px);
  --input-bg: rgba(255,255,255,0.05); --input-line: rgba(255,255,255,0.18);
  --down-text: #F5B39A; --focus: #D8BC82;
  --font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* the client's colours; a placeholder neutral until brands/<slug>/brand.css sets them */
  --brand-page: #F4F6FA; --brand-ink: #1B2433; --brand-muted: #5B6577; --brand-primary: #1F2747;
  --brand-accent: #C9A45C; --brand-bar: #0B1220; --brand-card: #FFFFFF; --brand-edge: #D9DEE8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-sans); font-size: 15px; line-height: 1.45; color: var(--nd-text);
  background-color: var(--nd-base);
  background-image:
    radial-gradient(900px 560px at 10% 0%, var(--nd-glow-blue), transparent 65%),
    radial-gradient(800px 520px at 95% 12%, var(--nd-glow-brass), transparent 62%),
    radial-gradient(900px 600px at 80% 100%, var(--nd-glow-mint), transparent 70%),
    var(--nd-pinstripe);
  background-attachment: fixed;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;
  padding: 24px 16px;
}
[hidden] { display: none !important; }
body { display: flex; flex-direction: column; }
.view { width: 100%; max-width: 400px; }

h1 { margin: 0 0 12px; font-size: 26px; font-weight: 300; letter-spacing: -0.01em; }
.quiet { color: var(--nd-muted); margin: 0 0 14px; }
a { color: var(--nd-steel-hi); }

/* Night Desk frame (sign-in pages) */
.nd-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px clamp(16px, 4vw, 48px); }
.argus-logo { display: block; height: 22px; width: auto; }
.host { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--nd-muted); }
.host svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nd-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px clamp(16px, 4vw, 48px); border-top: 1px solid var(--nd-line); font-size: 12px; color: var(--nd-muted); }
html[data-view="tiles"] .nd-top, html[data-view="tiles"] .nd-foot { display: none; }
.plain { font-size: 24px; }

/* ── sign-in: Night Desk (FlowSignIn) ────────────────────────────────── */
.view.split { max-width: 1180px; display: flex; flex-wrap: wrap; align-items: center; gap: 48px 64px; padding: 0 clamp(0px, 3vw, 32px); }
.hero { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero .lead { font-size: 15px; color: var(--nd-muted); }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 68px); line-height: 1; font-weight: 200; letter-spacing: -0.035em; }
.hero .sub { margin: 6px 0 0; max-width: 440px; font-size: 18px; line-height: 1.5; color: var(--nd-soft); }
.hero .sub:empty { display: none; }
.pill { align-self: flex-start; margin-top: 8px; font-size: 13px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--nd-line); color: var(--nd-soft); }
.pill:empty { display: none; }
.panel { flex: 0 1 420px; min-width: 0; width: 100%; }
.card {
  display: flex; flex-direction: column; gap: 14px;
  background: rgba(255,255,255,0.05); border: 1px solid var(--nd-line-strong); border-radius: 30px;
  padding: 28px; backdrop-filter: blur(6px);
}
.card h2 { margin: 0; font-size: 24px; font-weight: 400; }
.card-code { background: rgba(110,147,214,0.07); border-color: rgba(110,147,214,0.30); }
.card-code h2 { font-size: 18px; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 13px; color: var(--nd-soft); }
.field input {
  display: block; width: 100%; min-height: 50px; padding: 0 14px; font: inherit; font-size: 16px;   /* 16px: iOS does not zoom */
  color: var(--nd-text); background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.14); border-radius: 16px;
}
.field input.code { text-align: center; letter-spacing: 0.5em; font-size: 22px; font-weight: 300; border-color: rgba(216,188,130,0.5); }
.field input:focus-visible, .btn:focus-visible, .btn-out:focus-visible, .tile:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn {
  display: inline-flex; width: 100%; min-height: 52px; align-items: center; justify-content: center;
  font: inherit; font-size: 16px; font-weight: 600; color: var(--nd-ink); background: var(--nd-brass);
  border: 1px solid var(--nd-brass); border-radius: 999px; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn-ghost { min-height: 48px; font-size: 15px; font-weight: 400; color: var(--nd-text); background: transparent; border-color: rgba(255,255,255,0.28); }
.btn-quiet { min-height: 44px; font-size: 14px; font-weight: 500; color: var(--nd-text); background: rgba(255,255,255,0.05); border-color: var(--nd-line-strong); }
.forgot { align-self: flex-start; font-size: 14px; color: var(--nd-brass); }
.error { margin: 0; padding: 10px 12px; font-size: 14px; color: var(--down-text); background: rgba(222,113,72,0.16); border-radius: 10px; }

/* ── tiles: the client's page (FlowTiles) ────────────────────────────── */
html[data-view="tiles"] { color-scheme: light; }
html[data-view="tiles"] body { color: var(--brand-ink); background: var(--brand-page); background-image: none; }
html[data-view="tiles"] .stage { padding: 0; justify-content: flex-start; align-items: stretch; }
html[data-view="tiles"] .view { max-width: none; display: flex; flex-direction: column; flex: 1; }
.brandbar { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 14px clamp(16px, 4vw, 40px); background: var(--brand-bar); color: #fff; }
.company-logo { display: block; height: 52px; width: auto; max-width: 160px; }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: #212734; color: #fff; font-size: 12px; font-weight: 600; }
.who-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.who-name { font-weight: 600; }
.who-sub { font-size: 12px; color: #A9B2C1; overflow-wrap: anywhere; }
.btn-out { min-height: 38px; padding: 0 14px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.18); background: transparent; color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.btn-out:hover { background: rgba(255,255,255,0.08); }
.tiles-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(32px, 7vw, 72px) clamp(16px, 4vw, 40px) 48px; display: flex; flex-direction: column; }
.tiles-main h1 { margin: 0 0 8px; font-size: 32px; font-weight: 600; color: var(--brand-ink); letter-spacing: -0.01em; }
html[data-view="tiles"] .quiet { color: var(--brand-muted); margin: 0 0 32px; font-size: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 240px;
  text-decoration: none; font-size: 26px; font-weight: 600; color: var(--brand-ink);
  background: var(--brand-card); border: 1px solid var(--brand-edge); border-radius: 8px;
}
.tile:hover { border-color: var(--brand-primary); }
.tile-icon { width: 68px; height: 68px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-primary); color: #fff; }
.tile svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tiles-foot { width: 100%; max-width: 1000px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 40px) 24px; border-top: 1px solid var(--brand-edge); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--brand-muted); }
.by { display: inline-flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.by img { height: 11px; width: auto; filter: invert(1); opacity: 0.6; }

@media (prefers-reduced-motion: no-preference) { .btn, .tile { transition: filter 0.15s, border-color 0.15s; } }
