/* Palette and type follow the Strac Vault sign-in page (vault.strac.io). */
:root {
  --bg: #fcfcfd;
  --glow: rgba(233, 215, 254, 0.45);
  --surface: #ffffff;
  --border: #eaecf0;
  --text: #344054;
  --heading: #1f2937;
  --muted: #475467;
  --primary: #7f56d9;
  --primary-dark: #6941c6;
  --primary-50: #f9f5ff;
  --primary-200: #e9d7fe;
  --primary-text: #ffffff;
  --operational: #12b76a;
  --under_maintenance: #7f56d9;
  --degraded_performance: #f79009;
  --partial_outage: #f97316;
  --major_outage: #f04438;
  --nodata: #eaecf0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  color-scheme: light;
}
header.site .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0e14;
    --glow: rgba(127, 86, 217, 0.18);
    --surface: #151821;
    --border: #262b36;
    --text: #d0d5dd;
    --heading: #f2f4f7;
    --muted: #98a2b3;
    --primary: #9e77ed;
    --primary-dark: #b692f6;
    --primary-50: #1d1730;
    --primary-200: #42307d;
    --nodata: #2b303b;
    color-scheme: dark;
  }
  header.site .logo-light { display: none; }
  header.site .logo-dark { display: block; }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(75% 420px at 50% 0, var(--glow), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--primary-dark); }
main { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }

header.site {
  max-width: 860px; margin: 0 auto; padding: 24px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
header.site img { height: 30px; display: block; }
header.site nav { display: flex; gap: 16px; font-size: 14px; font-weight: 500; }
header.site nav a { text-decoration: none; }

.hero { text-align: center; padding: 24px 0 32px; }
.hero h1 {
  margin: 0; font-size: clamp(36px, 7vw, 52px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
  color: var(--heading);
  background: linear-gradient(135deg, var(--heading) 30%, var(--primary));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
h2 { font-size: 17px; margin: 32px 0 12px; color: var(--heading); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Overall status: a white card with a coloured dot, like the Vault's light surfaces. */
.banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 8px 24px -8px rgba(127, 86, 217, 0.25);
  padding: 18px 20px; font-size: 18px; font-weight: 600; color: var(--heading); margin-bottom: 24px;
}
.banner::before {
  content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--muted);
  box-shadow: 0 0 0 4px var(--nodata);
}
.banner.operational::before { background: var(--operational); box-shadow: 0 0 0 4px rgba(18, 183, 106, .18); }
.banner.under_maintenance::before { background: var(--under_maintenance); box-shadow: 0 0 0 4px var(--primary-200); }
.banner.degraded_performance::before { background: var(--degraded_performance); box-shadow: 0 0 0 4px rgba(247, 144, 9, .2); }
.banner.partial_outage::before { background: var(--partial_outage); box-shadow: 0 0 0 4px rgba(249, 115, 22, .2); }
.banner.major_outage::before { background: var(--major_outage); box-shadow: 0 0 0 4px rgba(240, 68, 56, .2); }

/* Incidents */
.incident { border-left: 4px solid var(--major_outage); }
.incident.maintenance { border-left-color: var(--primary); }
.incident h3 { margin: 0 0 8px; font-size: 16px; }
.incident h3 a { color: inherit; text-decoration: none; }
.update { margin-top: 12px; }
.update .status { font-weight: 600; }
.update p { margin: 2px 0; white-space: pre-wrap; }

/* Components */
.group-name { font-weight: 600; margin: 16px 0 4px; }
.component { padding: 14px 0; border-top: 1px solid var(--border); }
.component:first-child { border-top: 0; padding-top: 0; }
.component-head { display: flex; justify-content: space-between; gap: 12px; }
.component-status { font-weight: 500; white-space: nowrap; }
.component-status.operational { color: var(--operational); }
.component-status.under_maintenance { color: var(--under_maintenance); }
.component-status.degraded_performance { color: var(--degraded_performance); }
.component-status.partial_outage { color: var(--partial_outage); }
.component-status.major_outage { color: var(--major_outage); }

.bars { display: flex; gap: 2px; height: 32px; margin: 8px 0 4px; }
.bar { flex: 1; border-radius: 2px; background: var(--nodata); min-width: 2px; }
.bar.operational { background: var(--operational); }
.bar.under_maintenance { background: var(--under_maintenance); }
.bar.degraded_performance { background: var(--degraded_performance); }
.bar.partial_outage { background: var(--partial_outage); }
.bar.major_outage { background: var(--major_outage); }
.bars-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) {
  /* Show the last 30 days on phones. */
  .bar:nth-child(-n+60) { display: none; }
  .bars-legend .days90 { display: none; }
}
@media (min-width: 601px) {
  .bars-legend .days30 { display: none; }
}

/* Forms */
form .row { display: flex; gap: 8px; flex-wrap: wrap; }
input[type=email], input[type=text], input[type=number], input[type=datetime-local], select, textarea {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; box-shadow: var(--shadow);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
input[type=email] { flex: 1; min-width: 220px; }
textarea { width: 100%; min-height: 110px; }
button {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--primary-dark);
  border-radius: 8px; padding: 8px 16px; background: var(--primary); color: var(--primary-text);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08), 0 8px 24px -8px rgba(127, 86, 217, .45);
}
button:hover:not(:disabled) { background: var(--primary-dark); }
button.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow); }
button.secondary:hover:not(:disabled) { background: var(--primary-50); }
button.danger { background: var(--major_outage); border-color: var(--major_outage); box-shadow: var(--shadow); }
button:disabled { opacity: .6; cursor: default; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin: 12px 0; }
.checks label { display: flex; gap: 8px; align-items: center; }
.message { margin-top: 10px; }
.message.error { color: var(--major_outage); }
.message.ok { color: var(--operational); }
.hidden { display: none !important; }

footer.site {
  max-width: 860px; margin: 0 auto; padding: 24px 16px 40px; font-size: 13px; color: var(--muted);
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
}

/* Admin */
.admin-grid { display: grid; gap: 8px; }
.admin-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-row > label { min-width: 140px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--border); vertical-align: top; }
td.wrap { word-break: break-word; }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--primary-50); color: var(--primary-dark); border: 1px solid var(--primary-200); }

.component-status::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; margin-right: 6px; vertical-align: 1px;
}
