/*
 * ACM Command Hub's look, "D+ · Minimal, with a signature", for Team Desk (2026-09-28).
 * The hub's colours and type, light and dark, are in tokens.css: an exact copy of the hub's packages/ui/src/tokens.css
 * (acm-command-hub), loaded first, so Team Desk never depends on the hub being up. tests/test_tokens.py checks the copy
 * against the version recorded there; when the hub's look changes, copy the file across and update that record.
 * This file holds the frame's own styles, and the "bridge" names that give the pages the hub's colours in light and dark.
 */

:root {
  /* tokens.css takes its fonts from these (the hub's come from next/font); the pages load them from Google Fonts. */
  --font-geist: "Geist";
  --font-newsreader: "Newsreader";
  --font-geist-mono: "Geist Mono";

  /* The bridge: the names Team Tools' pages already use, in the hub's colours. */
  --surface-hover: var(--surface-2);
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-tertiary: var(--muted);
  --accent: var(--btn-bg);
  --accent-hover: var(--btn-hover);
  --success: var(--live-fg);
  --success-bg: var(--live-bg);
  --error: var(--down-fg);
  --error-bg: var(--down-bg);
  --info-bg: var(--surface-2);
  --warn: var(--warn-fg);
  --border: var(--line);
  --border-light: var(--line-soft);
  --card: var(--surface);
  --ok: var(--live-fg);
  --okbg: var(--live-bg);
  --bad: var(--down-fg);
  --badbg: var(--down-bg);
  --purple: var(--ink);
  --purple-light: var(--surface-2);
  --nav-bg: var(--glass);
  --radius: 12px;
  --radius-sm: 8px;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 40px -24px var(--shadow);
  --transition: 0.2s var(--ease);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--link);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
input,
select,
textarea,
button {
  font-family: inherit;
}
input,
select,
textarea {
  background-color: var(--input-bg);
  color: var(--ink);
  border-color: var(--input-line);
}
::placeholder {
  color: var(--faint);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- The soft glow ---------- */

.aurora {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 560px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  border-radius: 50%;
  animation: hb-drift 26s ease-in-out infinite;
}
.aurora span:nth-child(1) {
  left: -160px;
  top: -300px;
  width: 960px;
  height: 720px;
  background: radial-gradient(closest-side, var(--glow-a), transparent);
}
.aurora span:nth-child(2) {
  left: 48%;
  top: -320px;
  width: 980px;
  height: 720px;
  background: radial-gradient(closest-side, var(--glow-b), transparent);
  animation-delay: -9s;
}
.aurora span:nth-child(3) {
  left: 26%;
  top: -60px;
  width: 760px;
  height: 480px;
  background: radial-gradient(closest-side, var(--glow-c), transparent);
  animation-delay: -17s;
}

/* ---------- The frame: top bar, page heading, footer ---------- */

.hb-shell {
  max-width: 1440px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 48px 0;
  display: flex;
  flex-direction: column;
}
.hb-topbar {
  position: sticky;
  top: 12px;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    0 14px 34px -20px var(--shadow);
}
.hb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
}
.hb-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hub-bg);
  color: var(--hub-fg);
}
.hb-crumb {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.hb-grow {
  flex: 1;
}
.hb-menu {
  position: relative;
}
.hb-menu > summary {
  list-style: none;
  cursor: pointer;
}
.hb-menu > summary::-webkit-details-marker {
  display: none;
}
.hb-pill {
  height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--btn2-line);
  background: var(--btn2-bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.hb-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--btn2-line);
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hb-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -18px var(--shadow);
  display: flex;
  flex-direction: column;
}
.hb-panel-head {
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--muted);
}
.hb-panel-head strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.hb-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-size: 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
/* "Sign out of Team Desk" is a form (a POST from this page), drawn like the menu's links */
.hb-item-form {
    display: contents;
}
button.hb-item {
    line-height: inherit;
    letter-spacing: inherit;
}
.hb-item:hover {
  background: var(--surface-2);
}
.hb-item.active {
  font-weight: 600;
}
.hb-item.active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live-fg);
}
.hb-theme {
  padding: 8px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.hb-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.hb-segmented button {
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.hb-segmented button[aria-checked="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 3px rgba(0, 0, 0, 0.08);
}
.hb-head {
  margin: 36px auto 8px;
  padding: 0 24px;
  width: 100%;
  max-width: var(--page-width, 760px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  animation: hb-enter 640ms var(--ease) backwards;
}
.hb-eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--field-line);
  background: var(--glass);
  color: var(--text);
  font: 12px var(--mono);
  text-decoration: none;
}
.hb-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.hb-title em {
  font-style: italic;
}
.hb-lead {
  margin: 0;
  max-width: 640px;
  font-size: 16px;
  color: var(--muted);
}
.hb-page {
  width: 100%;
  animation: hb-enter 640ms var(--ease) 80ms backwards;
}
.hb-footer {
  margin-top: auto;
  padding: 36px 0 28px;
  font-size: 13px;
  color: var(--muted);
}

/* The pages' own large "hero" and navigation are replaced by the frame above. */
body > nav,
.hero {
  display: none !important;
}

/* ---------- Sign-in page ---------- */

.hb-auth {
  min-height: 100vh;
  padding: 48px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hb-auth-main {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hb-auth-card {
  width: min(420px, 100%);
  padding: 32px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -42px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: hb-enter 640ms var(--ease) backwards;
}
.hb-auth-card label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.hb-auth-card input {
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--input-line);
  font-size: 15px;
}
.hb-auth-card .hb-primary,
.hb-auth-card .hb-secondary {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.hb-primary {
  border: 0;
  background: var(--btn-bg);
  color: var(--btn-fg);
}
.hb-primary:hover {
  background: var(--btn-hover);
}
.hb-secondary {
  border: 1px solid var(--btn2-line);
  background: var(--btn2-bg);
  color: var(--ink);
}
.hb-note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.hb-or {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.hb-or::before,
.hb-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.hb-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--down-bg);
  color: var(--down-fg);
  font-size: 14px;
}

/* ---------- Motion ---------- */

@keyframes hb-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes hb-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(48px, 24px);
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .hb-topbar {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---------- Smaller screens ---------- */

@media (max-width: 760px) {
  .hb-head {
    padding: 0 16px;
  }
  .hb-shell {
    padding: 12px 16px 0;
  }
  .hb-topbar {
    top: 8px;
    height: 56px;
    padding: 0 6px 0 12px;
  }
  .hb-brand-name,
  .hb-crumb {
    display: none;
  }
  .hb-round {
    width: 44px;
    height: 44px;
  }
  .hb-pill {
    height: 44px;
  }
  .hb-head {
    margin-top: 24px;
  }
  .hb-title {
    font-size: 40px;
  }
  .hb-lead {
    font-size: 15px;
  }
}

/* The pages' own element rules (button, a, label) must not reach into the frame. */
.hb-topbar button,
.hb-panel button,
.hb-panel a {
  margin: 0;
}
.hb-segmented button {
  width: 100%;
}

/* Disabled buttons, the same everywhere: quiet, but still readable. */
button:disabled,
.btn:disabled {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
