/* EVO Console — base palette + login layout. Dark cyber-SOC theme. */

/* Dancing-starfish keyframes (1198 lines) — the SVG markup lives in
   /console-next/static/starfish/dances/, the @keyframes that drive
   them live in this imported file. */
@import "/console-next/static/starfish/rsf-dance.css";

/* ── Busy overlay ── */
#evo-busy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 32, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
#evo-busy-overlay[hidden] { display: none; }
.evo-busy-card {
  background: #131c2e;
  border: 1px solid #233149;
  border-radius: 8px;
  padding: 1.5rem 2rem;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}
.evo-busy-svg {
  width: 96px;
  height: 96px;
  color: #4ec9b0;          /* the SVGs use currentColor — this picks the brand teal */
  display: block;
}
.evo-busy-svg svg { width: 100%; height: 100%; }
.evo-busy-msg {
  color: #e6edf6;
  font-size: 0.95rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}

/* Inline starfish (e.g. next to a button that triggers async work) */
.evo-starfish-inline {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-block;
  vertical-align: middle;
  color: currentColor;
}
.evo-starfish-inline svg { width: 100%; height: 100%; }

/* Inline busy block — emitted by evoBusy.inlineHtml(msg). The starfish
   does its dance via the SVG's own animateTransform / <animate> tags
   (no CSS keyframes needed). Sized for in-card use, not a full-screen
   takeover — that's evoBusy.show()/hide() with #evo-busy-overlay. */
.evo-busy-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  color: var(--fg, #e6edf6);
  font-size: 0.875rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.evo-busy-inline-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: inline-block;
  color: var(--accent, #4ec9b0);
}
.evo-busy-inline-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}
.evo-busy-inline-msg {
  color: var(--fg-muted, #8a96ad);
  line-height: 1.4;
}

/* Password input + eye toggle. Wraps a single password input so the
   eye button can absolute-position to the right edge without altering
   the surrounding form layout. The input keeps its own padding-right
   reserved so the typed text never overlaps the button. */
.evo-pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.evo-pw-wrap > input {
  width: 100%;
  padding-right: 2.4rem;
  box-sizing: border-box;
}
.evo-pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0.25rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fg-muted, #8a96ad);
  border-radius: 4px;
  transition: color 0.12s, background-color 0.12s;
}
.evo-pw-toggle:hover,
.evo-pw-toggle:focus-visible {
  color: var(--fg, #e6edf6);
  background: rgba(255, 255, 255, 0.06);
}
.evo-pw-toggle[aria-pressed="true"] {
  color: var(--accent, #4ec9b0);
}
.evo-pw-toggle:focus-visible {
  outline: 2px solid var(--accent, #4ec9b0);
  outline-offset: 1px;
}
.evo-pw-toggle svg { display: block; }


:root {
  /* Dark theme (default — SOC-night palette) */
  --bg:          #0b1220;
  --bg-card:    #131c2e;
  --bg-deep:    #0a111e;   /* darker surfaces (sidebar, form inputs) */
  --bg-elev:    #0e1626;   /* elevated bars (admin header) */
  --bg-soft:    #1f2a44;   /* buttons, code badges, subtle pills */
  --fg:         #e6edf6;
  --fg-muted:   #8a96ad;
  --accent:     #4ec9b0;
  --accent-rgb: 78,201,176;  /* used for translucent accents (active nav) */
  --accent-2:   #569cd6;
  --danger:     #e57373;
  --border:     #233149;
  --shadow:     0 6px 24px rgba(0,0,0,0.45);
  --radius:     6px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Light theme overrides — applied when the admin chrome (or any other
   container) carries data-theme="light". The selector targets the
   .evo-admin wrapper because the topbar toggle sets data-theme there;
   for non-admin pages add the attribute on <body> as needed. */
.evo-admin[data-theme="light"],
body[data-theme="light"] {
  --bg:          #f4f6fb;
  --bg-card:    #ffffff;
  --bg-deep:    #eef1f7;
  --bg-elev:    #ffffff;
  --bg-soft:    #e3e8f1;
  --fg:         #1a2233;
  --fg-muted:   #5a6a82;
  --accent:     #1d8a72;
  --accent-rgb: 29,138,114;
  --accent-2:   #2e6db8;
  --danger:     #b03434;
  --border:     #d6dde9;
  --shadow:     0 6px 24px rgba(20,30,50,0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); min-height: 100vh; }
body { display: flex; flex-direction: column; }

a, a:visited { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.evo-header {
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.evo-logo { font-weight: 700; letter-spacing: 0.06em; color: var(--accent); font-size: 1.05rem; }

.evo-main {
  flex: 1; padding: 2rem 1rem; display: flex; justify-content: center;
}
.evo-footer {
  padding: 0.75rem 1rem; color: var(--fg-muted); font-size: 0.8rem;
  border-top: 1px solid var(--border); text-align: center;
}

.evo-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow);
  width: 100%; max-width: 28rem;
}
.evo-card h1 { margin-top: 0; font-size: 1.4rem; }

.evo-login form { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
/* Each label+input pair in its own field container. Explicit `for=`
   label association (no input-nested-in-label) so browser password
   managers reliably identify the username + current-password fields. */
.evo-login-field { display: flex; flex-direction: column; gap: 0.25rem; }
.evo-login-field label { font-size: 0.9rem; color: var(--fg-muted); cursor: pointer; }
.evo-login input {
  background: var(--bg-deep); color: var(--fg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.55rem 0.7rem; font-size: 1rem;
}
.evo-login input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.evo-btn {
  display: inline-block; padding: 0.55rem 1.1rem; border-radius: var(--radius);
  background: var(--bg-soft); color: var(--fg); border: 1px solid var(--border);
  font-size: 0.95rem; cursor: pointer; text-decoration: none;
}
.evo-btn:hover:not([disabled]) { background: var(--bg-deep); }
.evo-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
/* Click + keyboard focus states must keep the same colour family — without
   these, browsers fall back to OS-default :active rendering which on a
   teal/dark theme can briefly invert the button to look "dark on dark". */
.evo-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.evo-btn:active:not([disabled]) {
  transform: translateY(1px);
}
.evo-btn--primary {
  background: var(--accent); color: #0a121e; border-color: var(--accent); font-weight: 600;
}
.evo-btn--primary:hover:not([disabled]) { background: var(--accent); filter: brightness(1.1); }
.evo-btn--primary:active:not([disabled]) {
  background: var(--accent); color: #0a121e; filter: brightness(0.95);
}
.evo-btn--primary:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.evo-btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.evo-btn--sso { display: block; text-align: center; margin: 0.5rem 0; }

.evo-divider { border: 0; border-top: 1px solid var(--border); margin: 1rem 0 0.25rem; }
.evo-divider-label {
  display: block; text-align: center; color: var(--fg-muted); font-size: 0.8rem;
  margin-top: -0.7rem; background: var(--bg-card); width: fit-content; padding: 0 0.5rem;
  margin-left: auto; margin-right: auto;
}

.evo-error {
  background: #321616; color: #ffb4b4; border: 1px solid #5e2d2d;
  padding: 0.55rem 0.75rem; border-radius: var(--radius); font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.evo-warning {
  background: #2a2615; color: #f0d075; border: 1px solid #6e5a18;
  padding: 0.55rem 0.75rem; border-radius: var(--radius); font-size: 0.85rem;
  margin: 0.75rem 0;
}
.evo-warning a { color: #ffd97a; }

.evo-fineprint { margin-top: 1rem; font-size: 0.85rem; color: var(--fg-muted); }
.evo-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0.5rem 0 1rem; }
.evo-kv dt { color: var(--fg-muted); font-size: 0.85rem; }
.evo-kv dd { margin: 0; }
.evo-kv code { font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", monospace; color: var(--accent); }

.evo-inline-form { display: inline-block; margin-right: 0.5rem; }

/* ── ADR-20070 Phase 4: GUID resolution chip ────────────────────────────
   Inline pill: "<name> [<short-guid>…] [📋]". Touch-friendly copy via
   the explicit button (works on mobile where hover is unreliable). */
.evo-guid {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 0.92em;
  vertical-align: middle;
  white-space: nowrap;
}
.evo-guid-name { color: var(--fg); font-weight: 500; }
.evo-guid-short {
  font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", monospace;
  font-size: 0.85em;
  color: var(--fg-muted);
}
.evo-guid-copy {
  background: none; border: 0; padding: 0 2px; margin: 0;
  cursor: pointer;
  color: var(--fg-muted);
  font-size: 0.9em;
  line-height: 1;
}
.evo-guid-copy:hover { color: var(--accent); }
.evo-guid-copy:focus-visible { outline: 2px solid var(--accent); border-radius: 3px; }
/* Raw GUID (no association in registry yet) — show short form + tooltip. */
.evo-guid-raw {
  font-family: ui-monospace, "Cascadia Mono", "JetBrains Mono", monospace;
  font-size: 0.85em;
  color: var(--fg-muted);
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

/* ── ADR-20077: input gated behind a master toggle (e.g. apiKey
   gated by Virtual Assistant enabled). Provides an affordance so
   the operator sees the field can't be edited until they flip
   the toggle on. */
input.evo-input-disabled,
input[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}
