:root {
  --background-blur: 0px;
  --panel-radius: 18px;
  --glass-opacity: 0.35;
  --primary-text: #f5f5f5;
  --secondary-text: #c7c7c7;
  --accent-color: #6fb1ff;
}

:root[data-theme="light"] {
  --primary-text: #1a1a1a;
  --secondary-text: #444;
  --accent-color: #1a6fd6;
  --glass-opacity: 0.55;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--primary-text);
  background: #000;
}

#background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--background-blur));
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.background-image.visible {
  opacity: 1;
}

#widget-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.widget-container {
  position: absolute;
  padding: 1rem 1.25rem;
  border-radius: var(--panel-radius);
  background: rgba(20, 20, 20, var(--glass-opacity));
  backdrop-filter: blur(12px);
  transition: opacity 0.4s ease-in-out;
}

.widget-container.updating {
  opacity: 0.85;
}

/* Set automatically by the dashboard core when a provider's data has aged
   past its TTL (e.g. the Edge Agent stopped pushing) -- dims the widget
   rather than silently showing data that may no longer be current. */
.widget-container.stale {
  opacity: 0.5;
}

#pairing-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

.pairing-card {
  text-align: center;
  color: var(--primary-text);
}

.pairing-card h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.pairing-label {
  color: var(--secondary-text);
  margin: 0 0 1.5rem;
  font-size: 1.1rem;
}

.pairing-code {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 1.5rem;
  color: var(--accent-color);
}

.pairing-status {
  color: var(--secondary-text);
  font-size: 1rem;
}

#access-denied {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--primary-text);
  font-size: 1.5rem;
  text-align: center;
  padding: 2rem;
}

.hidden {
  display: none !important;
}
