@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --bg-soft: rgba(10, 10, 15, 0.86);
  --panel: rgba(10, 10, 15, 0.82);
  --panel-strong: rgba(0, 255, 255, 0.08);
  --text: #f4fbff;
  --muted: rgba(244, 251, 255, 0.64);
  --dim: rgba(244, 251, 255, 0.38);
  --line: rgba(0, 255, 255, 0.26);
  --line-strong: rgba(0, 255, 255, 0.72);
  --accent: #00ffff;
  --accent-soft: rgba(0, 255, 255, 0.14);
  --warning: #ffd166;
  --danger: #ff4444;
  --success: #63ffb0;
  --shadow: 0 0 24px rgba(0, 255, 255, 0.24), inset 0 0 24px rgba(0, 255, 255, 0.03);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at center, rgba(0, 255, 255, 0.04) 0%, rgba(10, 10, 15, 0.36) 38%, var(--bg) 100%),
    linear-gradient(rgba(10, 10, 15, 0.74), rgba(10, 10, 15, 0.92)),
    url("/assets/login-bg.png") center / cover fixed;
  color: var(--text);
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 255, 255, 0.055) 2px, rgba(0, 255, 255, 0.055) 3px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 255, 255, 0.04) 2px, rgba(0, 255, 255, 0.04) 3px);
  background-size: 40px 40px;
}

body::after {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 255, 255, 0.04), transparent 14%, transparent 86%, rgba(0, 255, 255, 0.04)),
    radial-gradient(ellipse at center, transparent 40%, rgba(10, 10, 15, 0.82) 100%);
}

button,
input {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  padding: 0 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 18px rgba(0, 255, 255, 0.04);
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, border-color 160ms ease;
}

button:hover,
button:focus-visible {
  background: rgba(0, 255, 255, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.38), inset 0 0 18px rgba(0, 255, 255, 0.08);
  outline: none;
}

button.secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 28px;
}

.auth-panel {
  position: relative;
  width: min(460px, 100%);
  margin: 10vh auto 0;
  padding: 30px;
  background: var(--bg-soft);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(5px);
}

.auth-panel::before,
.auth-panel::after,
.server-card::before,
.server-card::after,
.audit-panel::before,
.audit-panel::after,
.account-panel::before,
.account-panel::after,
.vps-panel::before,
.vps-panel::after,
.vultr-panel::before,
.vultr-panel::after,
.summary-grid article::before,
.summary-grid article::after,
.metric-card::before,
.metric-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.auth-panel::before,
.server-card::before,
.audit-panel::before,
.account-panel::before,
.vps-panel::before,
.vultr-panel::before,
.summary-grid article::before,
.metric-card::before {
  top: -2px;
  left: -2px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
}

.auth-panel::after,
.server-card::after,
.audit-panel::after,
.account-panel::after,
.vps-panel::after,
.vultr-panel::after,
.summary-grid article::after,
.metric-card::after {
  right: -2px;
  bottom: -2px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand.compact {
  padding-bottom: 0;
  border-bottom: 0;
}

.brand.compact h1 {
  font-size: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
  font-size: 22px;
  text-shadow: 0 0 10px var(--accent);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.28), inset 0 0 14px rgba(0, 255, 255, 0.08);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  color: var(--accent);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.72);
}

h2 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h3 {
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

p,
span,
small {
  color: var(--muted);
}

a {
  color: var(--accent);
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input {
  width: 100%;
  min-height: 44px;
  border-radius: 0;
  border: 1px solid rgba(0, 255, 255, 0.42);
  background: rgba(5, 7, 11, 0.9);
  color: var(--text);
  padding: 0 12px;
  box-shadow: inset 0 0 14px rgba(0, 255, 255, 0.03);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.28), inset 0 0 14px rgba(0, 255, 255, 0.06);
  outline: none;
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
  text-shadow: 0 0 7px rgba(255, 68, 68, 0.5);
}

.dashboard {
  display: grid;
  gap: 22px;
  max-width: 1480px;
  margin: 0 auto;
}

.topbar,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 16px 0 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-badge {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 255, 255, 0.05);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-grid article {
  position: relative;
  min-height: 112px;
  padding: 17px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 22px rgba(0, 255, 255, 0.025);
}

.summary-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-grid strong {
  color: var(--accent);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.vps-panel,
.vultr-panel {
  position: relative;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

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

.metric-card {
  position: relative;
  min-height: 108px;
  padding: 16px;
  background: rgba(5, 7, 11, 0.72);
  border: 1px solid rgba(0, 255, 255, 0.18);
  box-shadow: inset 0 0 18px rgba(0, 255, 255, 0.025);
}

.metric-card.compact {
  min-height: 96px;
}

.metric-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  min-width: 0;
  color: var(--accent);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
}

.bandwidth-module {
  margin-top: 14px;
  padding: 16px;
  background: rgba(5, 7, 11, 0.72);
  border: 1px solid rgba(0, 255, 255, 0.18);
  box-shadow: inset 0 0 18px rgba(0, 255, 255, 0.025);
}

.bandwidth-head,
.bandwidth-legend,
.bandwidth-row,
.bandwidth-facts {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bandwidth-head,
.bandwidth-legend {
  justify-content: space-between;
  flex-wrap: wrap;
}

.bandwidth-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.16);
}

.bandwidth-head h3 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bandwidth-legend {
  margin: 12px 0 22px;
  justify-content: flex-end;
}

.bandwidth-legend span,
.bandwidth-facts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bandwidth-legend i {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1px solid rgba(0, 255, 255, 0.25);
}

.legend-free {
  background: rgba(154, 186, 255, 0.48);
}

.legend-instance {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.48);
}

.legend-potential {
  background: rgba(178, 188, 220, 0.46);
}

.bandwidth-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 92px;
  min-height: 62px;
  align-items: center;
}

.bandwidth-row > span,
.bandwidth-row > strong {
  color: var(--text);
  font-size: 13px;
}

.bandwidth-row > strong {
  justify-self: end;
  color: var(--muted);
}

.bandwidth-track,
.bandwidth-usage-line {
  position: relative;
  height: 30px;
}

.bandwidth-track {
  --free: 0%;
  --instance: 0%;
  --potential: 100%;
  border: 1px solid rgba(0, 255, 255, 0.18);
  background: rgba(178, 188, 220, 0.34);
  overflow: visible;
  box-shadow: inset 0 0 14px rgba(0, 255, 255, 0.035);
}

.bandwidth-fill {
  position: absolute;
  inset: 0 auto 0 0;
}

.bandwidth-fill.free {
  width: var(--free);
  background: rgba(154, 186, 255, 0.48);
}

.bandwidth-fill.instance {
  width: var(--instance);
  background: linear-gradient(90deg, rgba(154, 186, 255, 0.48) var(--free), var(--accent) var(--free));
}

.bandwidth-fill.potential {
  width: var(--potential);
  background: linear-gradient(90deg, transparent var(--instance), rgba(178, 188, 220, 0.42) var(--instance));
}

.bandwidth-usage-line {
  border-left: 1px solid rgba(0, 255, 255, 0.28);
}

.bandwidth-marker {
  position: absolute;
  top: -21px;
  width: 2px;
  height: 50px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.7);
  transform: translateX(-1px);
}

.bandwidth-marker::before,
.bandwidth-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}

.bandwidth-marker::before {
  top: -8px;
  border-bottom: 7px solid var(--accent);
}

.bandwidth-marker::after {
  bottom: -8px;
  border-top: 7px solid var(--accent);
}

.bandwidth-marker em {
  position: absolute;
  left: 50%;
  top: -30px;
  min-width: max-content;
  transform: translateX(-50%);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  text-shadow: none;
}

.bandwidth-marker.near-start em {
  left: 0;
  transform: translateX(0);
}

.bandwidth-marker.near-end em {
  right: 0;
  left: auto;
  transform: translateX(0);
}

.bandwidth-marker.usage {
  top: -10px;
  height: 42px;
}

.bandwidth-marker.usage em {
  left: 0;
  top: 43px;
  transform: translateX(0);
}

.bandwidth-facts {
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 255, 255, 0.16);
}

.bandwidth-facts strong {
  color: var(--accent);
  font-weight: 700;
}

.server-list {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}

.server-card,
.audit-panel,
.account-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.server-card {
  padding: 18px;
}

.server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.server-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0 9px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  text-transform: uppercase;
}

.health {
  color: var(--text);
}

.services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.service {
  min-height: 0;
  padding: 14px;
  background: rgba(5, 7, 11, 0.72);
  border: 1px solid rgba(0, 255, 255, 0.18);
  box-shadow: inset 0 0 18px rgba(0, 255, 255, 0.025);
}

.service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.18);
}

.service-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.service-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: var(--muted);
  font-size: 13px;
}

.service-row strong,
.service-row a,
.service-row > span:last-child {
  justify-self: end;
  text-align: right;
}

.service a {
  word-break: break-word;
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.35);
}

.service-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 255, 255, 0.18);
  line-height: 1.45;
}

.status-expected,
.status-active,
.status-in-build {
  color: var(--success);
  text-shadow: 0 0 7px rgba(99, 255, 176, 0.45);
}

.status-planned,
.status-needs-live-probe,
.status-local-only {
  color: var(--warning);
  text-shadow: 0 0 7px rgba(255, 209, 102, 0.38);
}

.critical {
  color: var(--danger);
  text-shadow: 0 0 7px rgba(255, 68, 68, 0.5);
}

.audit-panel {
  padding: 16px;
  position: sticky;
  top: 16px;
}

.audit-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.audit-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.16);
  color: var(--muted);
}

.audit-list strong {
  color: var(--accent);
}

.account-panel {
  padding: 16px;
}

.account-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}

.account-form .form-error {
  grid-column: 1 / -1;
}

.form-error.success {
  color: var(--success);
  text-shadow: 0 0 7px rgba(99, 255, 176, 0.45);
}

@media (max-width: 1080px) {
  .account-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .billing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 920px) {
  .shell {
    padding: 14px;
  }

  .auth-panel {
    margin-top: 8vh;
    padding: 24px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .summary-grid,
  .metric-grid,
  .billing-grid,
  .content-grid,
  .account-form {
    grid-template-columns: 1fr;
  }

  .audit-panel {
    position: static;
  }

  .server-head,
  .service-head {
    align-items: stretch;
    flex-direction: column;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .service-row strong,
  .service-row a,
  .service-row > span:last-child {
    justify-self: start;
    text-align: left;
  }

  .bandwidth-row {
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 86px;
  }

  .bandwidth-row > strong {
    justify-self: start;
  }

  .bandwidth-legend,
  .bandwidth-facts {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .brand {
    align-items: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 19px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 16px;
  }

  button {
    width: 100%;
  }
}
