/* IFS new brand: black/white grounds, Purple single accent, Inter, ring motif, sentence case */
:root {
  --bg:#000000; --text:#FFFFFF; --text2:#E1EBEB; --muted:#A3A4A3;
  --surface:#232323; --surface2:#170430; --line:#444444;
  --accent:#A968EB; --accent-strong:#8427E2; --ring:#666766;
  --good:#33FF94; --radius:8px; color-scheme:dark;
}
:root[data-theme="light"] {
  --bg:#FFFFFF; --text:#000000; --text2:#232323; --muted:#666766;
  --surface:#F0F5F5; --surface2:#E1EBEB; --line:#D1D2D1;
  --accent:#8427E2; --ring:#E1EBEB; color-scheme:light;
}
* { box-sizing:border-box; }
/* The hidden attribute must win over display rules on .btn, .secret etc. */
[hidden] { display:none !important; }
html, body { margin:0; background:var(--bg); color:var(--text2); }
body { font-family:"Inter", system-ui, sans-serif; font-size:16px; line-height:1.5; }
a { color:var(--accent); }
a:focus-visible, button:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.wrap { width:100%; max-width:1280px; margin:0 auto; padding:0 clamp(20px, 4vw, 48px); }
@media (min-width: 1680px) { .wrap { max-width:1440px; } }
.muted { color:var(--muted); }
.mt { margin-top:24px; }
h1, h2, h3 { color:var(--text); margin:0; }
h1 { font-weight:200; font-size:clamp(2.4rem, 4.6vw, 4.4rem); line-height:1.05; max-width:22ch; text-wrap:balance; }
h2 { font-weight:200; font-size:clamp(2rem, 3.4vw, 2.6rem); line-height:1.1; margin-bottom:28px; }
h3 { font-weight:500; font-size:1.1rem; }
.lede { font-weight:300; font-size:clamp(1.1rem, 1.6vw, 1.35rem); max-width:52ch; margin:20px 0 0; }
.eyebrow { color:var(--accent); font-weight:500; font-size:.9rem; margin:0 0 14px; }

/* logo swap per theme */
.logo { height:34px; width:auto; display:block; }
.logo-pos { display:none; }
:root[data-theme="light"] .logo-neg { display:none; }
:root[data-theme="light"] .logo-pos { display:block; }

/* top bar */
.topbar { position:sticky; top:0; z-index:10; background:var(--bg); border-bottom:1px solid var(--line); }
.topbar-row { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:68px; flex-wrap:wrap; }
.brand { display:flex; align-items:center; gap:16px; text-decoration:none; }
.brand-name { color:var(--text); font-weight:500; border-left:1px solid var(--line); padding-left:16px; }
.user { display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end; min-width:0; }
.user-name { color:var(--muted); font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:28ch; }

/* hero with ring */
.hero { position:relative; overflow:hidden; padding:clamp(56px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); }
.hero-inner { position:relative; z-index:2; }
.hero-ring { position:absolute; right:-160px; top:-140px; width:620px; height:620px; z-index:1; pointer-events:none; }
.hero-ring circle { fill:none; stroke:var(--ring); stroke-width:96; opacity:.55; }

/* photo hero: dark industrial brand photo, grayscale gradient keeps copy readable.
   The hero always uses dark tokens (photo is dark) in both themes. */
.hero--photo {
  --text:#FFFFFF; --text2:#E1EBEB; --accent:#A968EB; --ring:#666766;
  min-height:min(78vh, 620px); display:flex; align-items:center; background-color:#000000;
  background-image:
    linear-gradient(90deg, #000000 0%, rgba(0,0,0,.92) 30%, rgba(0,0,0,.45) 60%, rgba(0,0,0,.05) 100%),
    linear-gradient(0deg, #000000 0%, rgba(0,0,0,0) 30%),
    url("img/hero-welder.jpg");
  background-size:cover; background-position:right center; background-repeat:no-repeat;
}
.hero--photo .hero-inner { width:100%; }
.hero--photo .hero-ring { right:-220px; top:auto; bottom:-260px; width:720px; height:720px; }
.hero--photo .hero-ring circle { stroke-width:72; opacity:.35; }
.hero--photo .lede { color:#E1EBEB; }
.hero--photo + section { margin-top:-48px; position:relative; z-index:3; padding-bottom:8px; }

/* signed-out and no-access pages */
.photo-page {
  background-color:#000000;
  background-image:linear-gradient(90deg, #000000 0%, rgba(0,0,0,.9) 40%, rgba(0,0,0,.55) 100%), url("img/bg-gears.jpg");
  background-size:cover; background-position:center right; color:#E1EBEB;
}
.photo-page h1 { color:#FFFFFF; }
.photo-page .btn-ghost { color:#FFFFFF; }

/* buttons */
.btn { font:inherit; font-weight:500; font-size:.9rem; border-radius:999px; padding:10px 20px; cursor:pointer;
  text-decoration:none; display:inline-flex; align-items:center; gap:8px; border:1px solid transparent; }
.btn-primary { background:var(--accent-strong); color:#FFFFFF; }
.btn-primary:hover { filter:brightness(1.12); }
.btn-primary[disabled] { opacity:.6; cursor:progress; }
.btn-ghost { background:transparent; color:var(--text); border-color:var(--line); }
.btn-ghost:hover { border-color:var(--accent); }

/* environment cards */
.status { color:var(--muted); margin-bottom:20px; }
.status.error { color:var(--text); background:var(--surface2); padding:16px 20px; border-radius:var(--radius); }
.env-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap:24px; align-items:start; }
.env-card { background:var(--surface); border-radius:var(--radius); padding:clamp(20px, 2.4vw, 28px); display:flex; flex-direction:column; gap:12px; min-width:0; box-shadow:0 12px 32px rgba(0,0,0,.18); }
.env-head { display:flex; align-items:center; gap:10px; font-weight:500; font-size:.9rem; color:var(--muted); }
.dot { width:10px; height:10px; border-radius:50%; background:var(--accent-strong); }
.env-card h3 { font-size:1.4rem; }
.env-url { word-break:break-all; }
.env-note { margin:0; font-size:.95rem; }
.env-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:8px; }
.secret { display:flex; align-items:center; gap:12px; background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:8px 8px 8px 14px; min-width:0; }
.secret .btn { padding:6px 16px; flex-shrink:0; }
.secret-value { flex:1; font-family:ui-monospace, "Cascadia Code", Consolas, monospace; font-size:1rem; color:var(--text); word-break:break-all; user-select:all; }
.secret-timer { margin:0; font-size:.9rem; }

/* guidance */
.guidance { padding:clamp(56px, 8vw, 96px) clamp(20px, 4vw, 40px); }
.cards3 { display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap:24px; }
.card { background:var(--surface); border-radius:var(--radius); padding:24px; }
.card p { margin:8px 0 0; }
.icon { width:32px; height:32px; color:var(--accent); stroke:currentColor; fill:none; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; margin-bottom:14px; }

/* footer */
.footer { border-top:1px solid var(--line); padding:28px 0; }
.footer-row { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; text-align:center; }
.footer .logo { height:28px; }
.footer p { margin:0; font-size:.9rem; }
.footer .logo { margin-bottom:6px; }

/* sign-in, signed-out and no-access pages: content sits on the dark left side of the photo,
   aligned with the main site's content edge, vertically centred at any resolution */
.center-page { min-height:100vh; min-height:100dvh; display:flex; align-items:center; }
.center-page .narrow { width:100%; max-width:1280px; padding-block:clamp(40px, 8vh, 96px); }
@media (min-width: 1680px) { .center-page .narrow { max-width:1440px; } }
.center-page .narrow > * { max-width:min(100%, 620px); }
.center-page h1 { font-size:clamp(2.2rem, 3.6vw, 3.6rem); max-width:18ch; }
.center-page .lede { margin-top:16px; }
.narrow .logo.big { height:clamp(36px, 3.4vw, 48px); margin-bottom:clamp(24px, 5vh, 40px); }
.narrow > .btn, .narrow .env-actions { margin-top:32px; }
.narrow .env-actions .btn { min-width:150px; justify-content:center; }

@media (max-width: 1024px) {
  .user-name { display:none; }
  .hero--photo { min-height:min(70vh, 520px); }
}
@media (max-width: 760px) {
  .hero--photo { min-height:0; background-position:70% center;
    background-image:linear-gradient(0deg, #000000 0%, rgba(0,0,0,.75) 55%, rgba(0,0,0,.35) 100%), url("img/hero-welder.jpg"); }
  .hero--photo + section { margin-top:0; }
  .brand-name, .user-name { display:none; }
  .hero-ring { width:300px; height:300px; right:-150px; top:-150px; }
  .hero--photo { padding-top:48px; }
  .env-actions .btn { flex:1 1 auto; justify-content:center; }
  .photo-page { background-image:linear-gradient(0deg, #000000 0%, rgba(0,0,0,.88) 60%, rgba(0,0,0,.7) 100%), url("img/bg-gears.jpg"); background-position:75% center; }
}
@media (prefers-reduced-motion: reduce) { * { transition:none !important; } }

/* ---------- Sign-in and signed-out pages: brand video background + live status ---------- */
.signin-page { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; background:#000000 url("img/bg-gears.jpg") center / cover no-repeat; color:#E1EBEB; position:relative; overflow-x:hidden; }
.signin-page h1, .signin-page h2 { color:#FFFFFF; }
.bg-video { position:fixed; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; filter:brightness(.7) saturate(.85); }
.bg-shade { position:fixed; inset:0; z-index:1; pointer-events:none;
  background:linear-gradient(90deg, #000000 0%, rgba(0,0,0,.9) 38%, rgba(0,0,0,.55) 70%, rgba(0,0,0,.35) 100%),
             linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 35%); }
.signin-grid { position:relative; z-index:2; flex:1; display:grid; grid-template-columns:minmax(0, 1.15fr) minmax(320px, .85fr);
  gap:clamp(32px, 5vw, 80px); align-items:center; padding-block:clamp(40px, 8vh, 96px); }
.signin-copy > * { max-width:620px; }
.signin-copy .logo.big { height:clamp(36px, 3.4vw, 48px); margin-bottom:clamp(24px, 5vh, 44px); }
.signin-copy h1 { font-size:clamp(2.3rem, 4vw, 3.8rem); max-width:16ch; }
.signin-copy .lede { margin-top:18px; color:#E1EBEB; }
.signin-actions { display:flex; flex-wrap:wrap; gap:14px; margin-top:36px; }
.btn-lg { padding:13px 26px; font-size:1rem; }
.signin-page .btn-ghost { color:#FFFFFF; border-color:rgba(255,255,255,.45); }
.signin-page .btn-ghost:hover { border-color:#A968EB; }
.signin-help { margin-top:24px; font-size:.9rem; color:#A3A4A3; }
.signin-footer { position:relative; z-index:2; padding-bottom:28px; text-align:center; }
.signin-footer p { margin:0; font-size:.85rem; color:#A3A4A3; }

.status-panel { background:rgba(20,20,20,.72); border:1px solid rgba(255,255,255,.12); border-radius:12px;
  padding:clamp(20px, 2.4vw, 28px); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); }
.status-panel-head h2 { font-size:1.25rem; font-weight:500; margin:0; }
.status-checked { margin:6px 0 0; font-size:.85rem; color:#A3A4A3; }
.status-list { list-style:none; margin:20px 0 0; padding:0; display:grid; gap:14px; }
.status-env { display:flex; align-items:center; justify-content:space-between; gap:12px; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:14px 16px; }
.status-env-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.status-env-name { color:#FFFFFF; font-weight:500; }
.status-comps { list-style:none; margin:12px 0 0; padding:0; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.status-comp { display:flex; flex-direction:column; gap:6px; font-size:.85rem; color:#A3A4A3; }
.status-loading, .status-error { color:#A3A4A3; font-size:.95rem; }

/* status pills: functional colours used only for state */
.pill { display:inline-flex; align-items:center; gap:7px; font-size:.8rem; font-weight:500; line-height:1; padding:6px 10px;
  border-radius:999px; white-space:nowrap; width:max-content; }
.pill-dot { width:8px; height:8px; border-radius:50%; background:currentColor; }
.pill-ok   { color:#33FF94; background:rgba(51,255,148,.12); }
.pill-warn { color:#FFC24D; background:rgba(255,194,77,.12); }
.pill-bad  { color:#FF6B6B; background:rgba(255,107,107,.12); }
.pill-idle { color:#A3A4A3; background:rgba(163,164,163,.14); }
:root[data-theme="light"] .env-card .pill-ok   { color:#0B7A43; background:rgba(11,122,67,.1); }
:root[data-theme="light"] .env-card .pill-warn { color:#8A5A00; background:rgba(138,90,0,.1); }
:root[data-theme="light"] .env-card .pill-bad  { color:#B42318; background:rgba(180,35,24,.1); }
:root[data-theme="light"] .env-card .pill-idle { color:#666766; background:rgba(102,103,102,.12); }
.env-head .env-status { margin-left:auto; }

@media (max-width: 960px) {
  .signin-grid { grid-template-columns:1fr; align-items:start; }
  .signin-copy h1 { max-width:20ch; }
}
@media (max-width: 760px) {
  .bg-shade { background:linear-gradient(0deg, #000000 0%, rgba(0,0,0,.88) 55%, rgba(0,0,0,.7) 100%); }
  .signin-actions .btn { flex:1 1 100%; justify-content:center; }
  .status-comps { grid-template-columns:1fr 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .bg-video { display:none; } }

/* environment card banner (brand photo + icon), SharePoint-style */
.env-card { overflow:hidden; }
.env-banner { position:relative; margin:calc(-1 * clamp(20px, 2.4vw, 28px)); margin-bottom:8px; aspect-ratio:16 / 7; background:#000000; }
.env-image { width:100%; height:100%; object-fit:cover; display:block; }
.env-banner::after { content:""; position:absolute; inset:0; background:linear-gradient(0deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 55%); }
.env-icon { position:absolute; left:clamp(20px, 2.4vw, 28px); bottom:-22px; z-index:1; width:52px; height:52px; border-radius:50%;
  display:grid; place-items:center; background:var(--accent-strong); box-shadow:0 6px 18px rgba(0,0,0,.35); }
.env-icon svg { width:28px; height:28px; color:#FFFFFF; stroke:currentColor; fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
.env-banner + .env-head { margin-top:22px; }
.env-url { color:var(--muted); font-size:.9rem; }
.status-env-name { line-height:1.35; }

/* idle sign-out warning */
.idle-banner { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:50; width:min(560px, calc(100% - 32px));
  background:#170430; color:#FFFFFF; border:1px solid #8427E2; border-radius:12px; padding:18px 20px; box-shadow:0 16px 40px rgba(0,0,0,.45);
  display:flex; flex-wrap:wrap; align-items:center; gap:14px 18px; }
.idle-text { margin:0; flex:1 1 260px; font-size:.95rem; }
.idle-actions { display:flex; gap:10px; flex-wrap:wrap; }
.idle-banner .btn-ghost { color:#FFFFFF; border-color:rgba(255,255,255,.45); }
