:root {
  color-scheme: dark;
  --page: #0a1723;
  --panel: #102330;
  --border: #294451;
  --text: #edf7ff;
  --muted: #b4c7d4;
  --secondary: #a9becd;
  --accent: #50dfbd;
  --gradient: linear-gradient(100deg, #38a9ff, #50dfbd);
  --header-height: 81px;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
[hidden] { display: none !important; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 16px system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
:where(button, a, input):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 5%;
  background: var(--page);
  border-bottom: 1px solid var(--border);
}

.site-header a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.site-header img { flex: none; object-fit: contain; }
.site-header b { color: var(--accent); }

main {
  position: relative;
  isolation: isolate;
  flex: 1;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(20px, 3vh, 36px) 4%;
  background: radial-gradient(ellipse at top right, #123b43, transparent 70%);
}

/* Match the gradient, grid and pulses in the Customer Portal. */
main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("./assets/honeycomb.svg");
  mask-image: linear-gradient(110deg, #000, transparent 95%);
}

.honeycomb-lights {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  mask-image: linear-gradient(110deg, #000, transparent 95%);
  overflow: hidden;
}

.light-pulse {
  stroke-width: 1.8;
  stroke-dasharray: 24 340;
  animation: honeycomb-flow 8s linear infinite;
  filter: drop-shadow(0 0 3px currentColor);
  opacity: .8;
}

.pulse-blue { stroke: #38a9ff; color: #38a9ff; animation-delay: -2s; }
.pulse-green { stroke: #50dfbd; color: #50dfbd; animation-duration: 10s; animation-delay: -6s; }
.pulse-cyan { stroke: #32e3f5; color: #32e3f5; animation-duration: 9s; animation-delay: -4s; }
@keyframes honeycomb-flow {
  from { stroke-dashoffset: 364; }
  to { stroke-dashoffset: 0; }
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px #0003;
}

.section-label {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 29px);
  letter-spacing: -.035em;
  line-height: 1.2;
}

.auth-panel {
  align-self: center;
  display: grid;
  align-content: start;
  width: min(100%, 460px);
  min-height: 520px;
  padding: 26px clamp(18px, 5vw, 36px);
  text-align: center;
}

.auth-brand img {
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px #37c9c455);
}

#login h1 { margin-top: 7px; }

.login-intro {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.access { align-self: center; padding: 44px 0 16px; }

#access-status {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.5;
}

.spinner {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: session-spin .85s linear infinite;
}

@keyframes session-spin { to { transform: rotate(360deg); } }

.retry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
}

.retry:hover, footer a:hover { text-decoration: underline; }

.google-button, .primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
}

.google-button {
  border: 1px solid #47616e;
  background: transparent;
  color: var(--text);
}

.google-button:hover:not(:disabled) { background: #142936; border-color: var(--accent); }
.google-button svg { flex: none; }

.primary-button {
  margin-top: 16px;
  border: 0;
  background: var(--gradient);
  color: #071722;
}

.primary-button:hover:not(:disabled) { filter: brightness(1.08); }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--secondary);
  font-size: 12px;
}

.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

#login label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  text-align: start;
  font-size: 14px;
}

#login input {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #47616e;
  border-radius: 7px;
  background: var(--page);
  color: var(--text);
  font-size: 16px;
}

#login input:focus { border-color: var(--accent); }

.form-status {
  margin: 12px 0 0;
  color: #78e3ce;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.form-status:empty { margin: 0; }

.dashboard {
  display: grid;
  grid-template-columns: minmax(170px, 216px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  width: min(100%, 1280px);
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  padding: 14px 10px 10px;
}

.sidebar .section-label { padding: 0 10px 8px; }

.sidebar nav {
  display: grid;
  gap: 3px;
}

.sidebar button, .sign-out {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--secondary);
  text-align: start;
  font-size: 14px;
  font-weight: 600;
}

.sidebar button[aria-current="page"] {
  background: #173c40;
  border-color: #34605e;
  color: var(--accent);
}

.sidebar button span { min-width: 0; overflow-wrap: anywhere; }

.sidebar button:hover:not([aria-current]), .sign-out:hover:not(:disabled) {
  background: #172e3c;
  color: var(--text);
}

.sidebar svg, .sign-out svg, .avatar svg, .tile-icon svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace { padding: clamp(16px, 2.3vw, 26px); }

.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.workspace-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.account, .profile {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.account { max-width: 100%; }
.profile-copy { display: grid; justify-items: start; gap: 3px; min-width: 0; }

.avatar, .tile-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #1c3c48;
  color: var(--accent);
}

#identity { font-size: 13px; overflow-wrap: anywhere; }

.role-badge {
  padding: 2px 7px;
  border: 1px solid #34605e;
  border-radius: 999px;
  background: #173c40;
  color: #79e9d5;
  font-size: 11px;
  font-weight: 700;
}

.sign-out { flex: none; border-color: var(--border); }
.sign-out svg { width: 16px; height: 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.tile {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(145deg, #172e3c, #122632);
}

.tile-icon svg { width: 20px; height: 20px; }

.tile h2 {
  margin: 10px 0 0;
  font-size: 17px;
  letter-spacing: -.2px;
  overflow-wrap: anywhere;
}

.tile p, .module-status {
  margin: 6px 0 0;
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.55;
}

.module-status { margin-top: 16px; }

footer {
  padding: 10px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}

@media (min-width: 1120px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  html { scrollbar-gutter: auto; }
  .site-header { padding: 7px 14px; }
  .site-header img { width: 54px; height: 54px; }
  .brand-name { font-size: 14px; }
  main { padding: 12px; }
  .auth-panel { min-height: 486px; padding-block: 18px; }
  .auth-brand img { width: 72px; height: 72px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sidebar { position: static; padding: 8px; }
  .sidebar .section-label { padding: 2px 6px 5px; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar button { padding-inline: 6px; gap: 5px; font-size: 12px; }
  .sidebar svg { width: 16px; height: 16px; }
  .tiles { gap: 9px; margin-top: 12px; }
  .tile { padding: 11px; }
  .tile h2 { font-size: 14px; }
  .tile-icon { width: 28px; height: 28px; }
  .tile-icon svg { width: 17px; height: 17px; }
  .workspace-heading { gap: 10px; padding-bottom: 12px; }
  .account { width: 100%; justify-content: space-between; }
  .sign-out { font-size: 12px; }
  footer { padding: 8px 12px; font-size: 11px; }
}

@media (max-width: 480px) {
  .site-header { gap: 4px; }
  .brand-name { font-size: clamp(11px, 3.1vw, 15px); }
}

@media (max-width: 360px) {
  .site-header img { width: 48px; height: 48px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .honeycomb-lights { display: none; }
  .spinner { animation: none; }
}
