/* UI2 roles copied from @aura/system (tokens.css, ui2/*.css). This page cannot import
   them: it is deployed on its own so it stays up when Oro is down. */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --border: oklch(0.922 0 0);
  --border-width: 0.5px;
  --input: color-mix(in oklch, var(--border) 92%, var(--foreground));
  --border-list: color-mix(in oklch, var(--input) 60%, transparent);
  --interaction-hover: rgb(0 0 0 / 4%);
  --interaction-pressed: rgb(0 0 0 / 12%);
  --interaction-focus: rgb(0 0 0 / 40%);
  --status-ok: rgb(34 197 94);
  --status-caution: rgb(234 179 8);
  --status-risk: oklch(0.577 0.245 27.325);
  --status-none: color-mix(in oklch, var(--border) 70%, var(--background));
  --radius-control: 12px;
  --radius-icon-button: 10px;
  --radius-card: 14px;
  --radius-chip: 10px;
  --control-icon-size: 28px;
  --motion-fast: 150ms;
  --motion-normal: 200ms;
  --motion-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --motion-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --orb-gold: #ffd47b;
  --orb-base: #f7883b;
  --orb-red: #e84920;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.21 0 0);
    --foreground: oklch(0.92 0 0);
    --card: oklch(0.25 0 0);
    --muted: oklch(0.3 0 0);
    --muted-foreground: oklch(0.72 0 0);
    --border: oklch(1 0 0 / 10%);
    --interaction-hover: rgb(255 255 255 / 6%);
    --interaction-pressed: rgb(255 255 255 / 18%);
    --interaction-focus: rgb(255 255 255 / 55%);
    --status-risk: oklch(0.704 0.191 22.216);
    --status-none: color-mix(in oklch, var(--foreground) 12%, transparent);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-color: var(--input);
}

a:hover {
  text-decoration-color: currentColor;
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 12px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--orb-gold), var(--orb-base) 55%, var(--orb-red));
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

.brand-divider {
  width: var(--border-width);
  height: 16px;
  background: var(--input);
}

.brand-label {
  color: var(--muted-foreground);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-icon-size);
  height: var(--control-icon-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius-icon-button);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--motion-ease);
}

.icon-button:hover {
  background: var(--interaction-hover);
}

.icon-button:active {
  background: var(--interaction-pressed);
}

.icon-button:focus-visible {
  outline: 1px solid var(--interaction-focus);
  outline-offset: 2px;
}

.icon-button[data-busy="true"] svg {
  animation: spin 0.8s linear infinite;
}

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

/* Cards */
.card {
  border: var(--border-width) solid var(--input);
  border-radius: var(--radius-card);
  background: var(--card);
}

.section + .section {
  margin-top: 48px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 14px;
  font-weight: 500;
}

/* Status colours are one decision, reused by the dot, pill, bars and legend. */
[data-status="operational"],
[data-level="operational"] {
  --level: var(--status-ok);
}
[data-status="degraded"],
[data-level="degraded"] {
  --level: var(--status-caution);
}
[data-status="outage"],
[data-level="outage"] {
  --level: var(--status-risk);
}
[data-status="checking"],
[data-level="none"] {
  --level: var(--status-none);
}

.status-dot {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--level);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--level) 18%, transparent);
}

[data-status="checking"] .status-dot {
  animation: pulse 1.2s var(--motion-ease) infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.4;
  }
}

/* Service list */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.row {
  padding: 16px 20px;
}

.row + .row {
  border-top: var(--border-width) solid var(--border-list);
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.row-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 8px;
  min-width: 0;
}

.name {
  font-weight: 500;
}

.pill {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 2px 10px 2px 8px;
  border: var(--border-width) solid var(--input);
  border-radius: var(--radius-chip);
  font-size: 12px;
  white-space: nowrap;
}

.bars {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
  height: 28px;
}

.bar {
  border-radius: 2px;
  background: var(--level);
  transition: opacity var(--motion-fast) var(--motion-ease);
}

.bars:hover .bar {
  opacity: 0.55;
}

.bars .bar:hover {
  opacity: 1;
}

.bars-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--level);
}

/* Incidents */
.empty {
  padding: 20px;
  color: var(--muted-foreground);
}

.incident {
  padding: 16px 20px;
}

.incident + .incident {
  margin-top: 12px;
}

.incident-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.incident-title {
  font-weight: 500;
}

.timeline {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-top: var(--border-width) solid var(--border-list);
}

.timeline .step {
  font-weight: 500;
}

@media (max-width: 520px) {
  .bars {
    grid-template-columns: repeat(45, 1fr);
  }

  .bars .bar:nth-child(-n + 45) {
    display: none;
  }

  .bars-foot span:first-child {
    visibility: hidden;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
