/* The shell's look. One file, no build step, custom properties only.
 *
 * Taken from the EO Home Page canvas. Two typefaces and one accent:
 *   Archivo        everything a person reads
 *   IBM Plex Mono  everything a person compares: job numbers, hours, counts
 *
 * ⚠️ Numbers that sit under one another are tabular-nums on purpose. A job list
 * where the digits do not line up is a list people scan wrong.
 *
 * ⛔ Module-owned classes are prefixed `m-`. Everything here is `eo-`. A module
 * may use the tokens; it may not restyle the chrome.
 */

:root {
  /* ground */
  --eo-bg: #EFF3F1;
  --eo-surface: #FFFFFF;
  --eo-surface-soft: #FAFCFB;
  --eo-line: #D7DFDB;
  --eo-line-soft: #E7EDEA;

  /* ink */
  --eo-ink: #14201D;
  --eo-ink-2: #46554F;
  --eo-ink-3: #5E6D66;
  --eo-ink-4: #7C8B84;

  /* the one accent */
  --eo-accent: #0D6A62;
  --eo-accent-dark: #094B45;
  --eo-accent-bright: #6FD3C4;
  --eo-accent-wash: #E4EFE9;

  /* the header is its own small dark world */
  --eo-head: #14201D;
  --eo-head-inset: #24322E;
  --eo-head-line: #3A4A45;
  --eo-head-text: #B9C7C2;
  --eo-head-mute: #8FA29C;
  --eo-head-strong: #E7EEEB;

  /* state. Each has a fill light enough to carry its own text at 4.5:1. */
  --eo-critical: #A33529;
  --eo-critical-bg: #F6E2DF;
  --eo-warn: #8A5410;
  --eo-warn-bg: #F5EADA;
  --eo-good: #2E6B3D;
  --eo-good-bg: #E4EFE7;
  --eo-cross: #55597A;
  --eo-cross-bg: #EAEBF2;

  --eo-radius: 3px;
  --eo-sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --eo-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--eo-sans);
  background: var(--eo-bg);
  color: var(--eo-ink);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--eo-accent); }
a:hover { color: var(--eo-accent-dark); }

.eo-boot { padding: 48px; color: var(--eo-ink-3); font-family: var(--eo-sans); }

/* ── header ───────────────────────────────────────────────────────────────── */

.eo-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  height: 58px;
  background: var(--eo-head);
  flex-shrink: 0;
}

.eo-brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #FFFFFF;
  text-decoration: none;
  flex-shrink: 0;
}
.eo-brand:hover { color: #FFFFFF; }

.eo-org-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 12px;
  background: var(--eo-head-inset);
  border: 1px solid var(--eo-head-line);
  border-radius: var(--eo-radius);
  color: var(--eo-head-strong);
  font-family: var(--eo-mono);
  font-size: 13px;
  cursor: pointer;
  max-width: 320px;
}
.eo-org-switch:focus-visible { outline: 2px solid var(--eo-accent-bright); outline-offset: 1px; }

.eo-org-static {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--eo-mono);
  font-size: 13px;
  color: var(--eo-head-text);
}
.eo-org-slug { color: var(--eo-accent-bright); font-weight: 600; }
.eo-org-name { font-family: var(--eo-sans); }

.eo-spacer { flex-grow: 1; }

.eo-who { font-size: 13.5px; color: var(--eo-head-text); flex-shrink: 0; }

/* ── the freshness pill, in the header ────────────────────────────────────── */

.eo-fresh {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  background: var(--eo-head-inset);
  border-radius: var(--eo-radius);
  flex-shrink: 0;
}
.eo-fresh-label { font-size: 12px; color: var(--eo-head-text); }
.eo-dot { width: 7px; height: 7px; border-radius: 50%; background: #5BBF7A; flex-shrink: 0; }
.eo-dot-stale { background: var(--eo-warn); }
.eo-dot-unknown { background: var(--eo-head-mute); }

.eo-age {
  font-family: var(--eo-mono);
  font-size: 12px;
  color: var(--eo-head-strong);
  font-variant-numeric: tabular-nums;
}
.eo-age-stale { color: #F0C48A; }
.eo-age-unknown { color: var(--eo-head-mute); }

/* ── tabs ─────────────────────────────────────────────────────────────────── */

.eo-modnav {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 28px;
  height: 46px;
  background: var(--eo-surface);
  border-bottom: 1px solid var(--eo-line);
  flex-shrink: 0;
}
.eo-modnav a {
  display: flex;
  align-items: center;
  padding: 0 15px;
  font-size: 14px;
  font-weight: 500;
  color: var(--eo-ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.eo-modnav a:hover { color: var(--eo-ink); }
.eo-modnav a.active { font-weight: 600; color: var(--eo-ink); border-bottom-color: var(--eo-accent); }

.eo-main { padding: 30px 28px 40px; }

/* ── page furniture ───────────────────────────────────────────────────────── */

.eo-eyebrow {
  font-family: var(--eo-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eo-ink-3);
  margin-bottom: 7px;
}

.eo-h1 {
  margin: 0;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--eo-ink);
}

.eo-sub { margin: 7px 0 0; font-size: 14.5px; color: var(--eo-ink-2); }

.eo-primary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 18px;
  background: var(--eo-accent);
  color: #FFFFFF;
  border: 0;
  border-radius: var(--eo-radius);
  text-decoration: none;
  font-family: var(--eo-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.eo-primary:hover { background: var(--eo-accent-dark); color: #FFFFFF; }

.eo-muted { color: var(--eo-ink-3); font-size: 13px; }

.eo-notice { max-width: 620px; margin: 64px auto; padding: 0 24px; }
.eo-notice h1 { font-size: 24px; letter-spacing: -0.015em; margin: 0 0 10px; }
.eo-notice p { color: var(--eo-ink-2); line-height: 1.55; margin: 0 0 18px; }

.eo-denied { max-width: 560px; margin: 56px auto; padding: 0 24px; }
.eo-denied h2 { font-size: 20px; margin: 0 0 8px; }
.eo-denied p { color: var(--eo-ink-2); margin: 0; }

/* A banner that says the page is built on data that stopped moving. */
.eo-stale-banner {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 15px;
  margin-bottom: 20px;
  background: var(--eo-warn-bg);
  border-left: 3px solid var(--eo-warn);
  border-radius: 0 var(--eo-radius) var(--eo-radius) 0;
  font-size: 13px;
  color: #5E3A0B;
}

/* ── modal, toast ─────────────────────────────────────────────────────────── */

.eo-modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 32, 29, 0.42);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.eo-modal {
  background: var(--eo-surface);
  border-radius: var(--eo-radius);
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 48px rgba(20, 32, 29, 0.24);
}
.eo-modal-wide { width: min(940px, 100%); }
.eo-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--eo-line);
}
.eo-modal-head h2 { margin: 0; font-size: 17px; }
.eo-modal-body { padding: 20px; overflow: auto; }
.eo-x {
  border: 0; background: none; font-size: 22px; line-height: 1;
  color: var(--eo-ink-3); cursor: pointer; padding: 4px 8px;
}

.eo-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60;
  padding: 12px 18px; border-radius: var(--eo-radius); font-size: 14px;
  box-shadow: 0 8px 24px rgba(20, 32, 29, 0.2);
}
.eo-toast-info { background: var(--eo-ink); color: #FFFFFF; }
.eo-toast-warn { background: var(--eo-warn-bg); color: #5E3A0B; }
.eo-toast-error { background: var(--eo-critical-bg); color: var(--eo-critical); }

/* ── phone ────────────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .eo-header { padding: 0 16px; gap: 12px; }
  .eo-modnav { padding: 0 16px; overflow-x: auto; }
  .eo-main { padding: 20px 16px 32px; }
  .eo-h1 { font-size: 24px; }
  .eo-who, .eo-org-name { display: none; }
}

/* ── Sign-in ─────────────────────────────────────────────────────────────────
 *
 * Structurally the Fusion (Shop 1) sign-in, so the RMS apps share one front
 * door: dark full-bleed field, hero mark left, brand and button right, the
 * right column collapsing on submit so the mark glides to centre.
 *
 * ⛔ EO's teal, not Fusion's amber. See the note at the top of signin.js.
 *
 * The two columns stack with flex-wrap rather than a media query, which is what
 * Fusion does: one rule that handles narrow screens AND portrait tablets,
 * instead of a breakpoint somebody has to keep in step with the hero width.
 */
.eo-signin {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: var(--eo-head);
}

.eo-signin-cols {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 56px;
  padding: 16px;
  transition: gap 0.45s ease;
}
.eo-signin.is-signing-in .eo-signin-cols { gap: 0; }

.eo-signin-hero { position: relative; flex-shrink: 0; }

/* ⚠️ A PHOTOGRAPH, not a mark on a transparent field. Fusion's glow is a
 * drop-shadow, which is right for a logo and useless here: on a rectangle it
 * only traces the edge. A hairline and a real cast shadow lift it off the
 * field instead. It also needs more room than Fusion's logo cap, because a 3:2
 * photo at 420px wide is 280px tall and reads as a thumbnail, not a hero.
 *
 * max-height with height:auto scales the whole thing down proportionally, so
 * the button is never pushed off a short laptop screen. */
.eo-signin-hero img {
  display: block;
  width: min(560px, 48vw);
  max-height: 62vh;
  height: auto;
  border: 1px solid rgba(233, 238, 235, 0.10);
  border-radius: var(--eo-radius);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.eo-signin-wait {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: var(--eo-accent-bright);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3em;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.eo-signin.is-signing-in .eo-signin-wait {
  opacity: 1;
  animation: eo-signin-pulse 1.4s ease-in-out infinite;
}
@keyframes eo-signin-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.eo-signin-panel {
  min-width: 280px;
  max-width: 340px;
  overflow: hidden;
  text-align: center;
  transition: opacity 0.35s ease, max-width 0.5s ease, transform 0.45s ease;
}
.eo-signin.is-signing-in .eo-signin-panel {
  min-width: 0;
  max-width: 0;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
}

/* Fixed width with the two ends pushed apart, so the mark and the tagline read
 * as one aligned block rather than two centred things of different lengths. */
.eo-signin-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 216px;
  margin: 0 auto 18px;
}
.eo-signin-mark {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--eo-accent-bright);
}
.eo-signin-tag { font-size: 14px; color: var(--eo-head-mute); }

.eo-signin-lead {
  margin: 0 0 18px;
  color: var(--eo-head-text);
  font-size: 14px;
}

.eo-signin-ms {
  display: block;
  width: 230px;
  margin: 0 auto;
  padding: 13px 0;
  border: 1px solid var(--eo-head-line);
  border-radius: var(--eo-radius);
  background: var(--eo-head-inset);
  color: var(--eo-head-strong);
  font-family: var(--eo-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.eo-signin-ms:hover:not(:disabled) { border-color: var(--eo-accent-bright); color: #FFFFFF; }
.eo-signin-ms:focus-visible { outline: 2px solid var(--eo-accent-bright); outline-offset: 2px; }
.eo-signin-ms:disabled { opacity: 0.6; cursor: default; }
.eo-signin-ms svg { vertical-align: -2px; margin-right: 8px; }

/* ⚠️ NOT --eo-critical. That red is tuned for dark text on a light page and is
 * unreadable on this field; this one clears 4.5:1 against --eo-head. */
.eo-signin-error {
  width: 230px;
  margin: 12px auto 0;
  color: #FF8A7A;
  font-size: 13px;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .eo-signin-cols,
  .eo-signin-panel,
  .eo-signin-wait { transition: none; }
  .eo-signin.is-signing-in .eo-signin-wait { animation: none; }
}

/* Once the columns have wrapped there is nothing left to share the width with,
 * so the two-column cap starves the photo. 980px is where the 560 hero + 56 gap
 * + 280 panel + padding stops fitting. min() keeps the 560px ceiling, so it does
 * no harm if this fires a few pixels before the wrap actually happens. */
@media (max-width: 980px) {
  .eo-signin-hero img { width: min(560px, 86vw); }
}
