* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #061018;
  --panel: rgba(15, 30, 41, 0.86);
  --panel-strong: #0d1c27;
  --text: #f4fbff;
  --muted: #88a1b2;
  --border: rgba(255,255,255,0.09);
  --blue: #168cff;
  --cyan: #17d6d0;
  --green: #39e88d;
  --red: #ff4d5f;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(22,140,255,0.12), transparent 28rem),
    radial-gradient(circle at 90% 20%, rgba(57,232,141,0.08), transparent 26rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hidden {
  display: none !important;
}

.brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.auth-layout {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: center;
}

.hero {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  margin: 10px 0 16px;
  font-size: clamp(2.7rem, 8vw, 5.5rem);
  line-height: 0.92;
  letter-spacing: -0.065em;
  max-width: 700px;
}

.eyebrow {
  color: var(--green);
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0;
}

.water-mark {
  position: absolute;
  right: 5%;
  top: 9%;
  width: min(31vw, 310px);
  aspect-ratio: 1;
  border-radius: 50% 50% 58% 42% / 60% 42% 58% 40%;
  border: 1px solid var(--border);
  transform: rotate(35deg);
  overflow: hidden;
  opacity: 0.75;
}

.water-fill {
  position: absolute;
  inset: 42% -15% -15%;
  background: linear-gradient(160deg, var(--blue), var(--cyan), var(--green));
  transform: rotate(-8deg);
  border-radius: 45% 55% 0 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 26px;
  backdrop-filter: blur(14px);
}

.auth-card {
  width: 100%;
}

.tabs {
  display: flex;
  padding: 4px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
}

.tab.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

label {
  display: block;
  color: #bfd0db;
  font-size: 0.85rem;
  margin-bottom: 16px;
}

input {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--border);
  background: #081620;
  color: var(--text);
  border-radius: 13px;
  padding: 13px 14px;
  outline: none;
}

input:focus {
  border-color: rgba(23,214,208,0.7);
  box-shadow: 0 0 0 3px rgba(23,214,208,0.09);
}

.primary {
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 13px 16px;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
  color: #031018;
  font-weight: 850;
}

.primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.message {
  min-height: 22px;
  color: #f1c66f;
  font-size: 0.86rem;
  margin: 14px 0 0;
}

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

.small {
  font-size: 0.8rem;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 14px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.warn {
  background: #f4b63d;
}

.dashboard {
  display: grid;
  gap: 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 11px;
  padding: 9px 12px;
}

.usage-panel {
  min-height: 310px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(22,140,255,0.07), rgba(23,214,208,0.035) 55%, rgba(57,232,141,0.03)),
    var(--panel-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.usage-panel::before {
  content: "";
  position: absolute;
  width: 140%;
  height: 140%;
  top: -85%;
  background: radial-gradient(ellipse at center, rgba(23,214,208,0.20), transparent 55%);
  pointer-events: none;
}

.usage-label {
  color: var(--muted);
  letter-spacing: 0.15em;
  font-size: 0.76rem;
  font-weight: 800;
}

.usage-value {
  margin: 8px 0 6px;
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
}

.unit {
  font-size: 0.24em;
  color: var(--muted);
  letter-spacing: -0.02em;
  margin-left: 5px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.pill {
  min-width: 28px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(57,232,141,0.10);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 800;
}

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

.device-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,0.025);
  padding: 18px;
}

.device-name {
  font-weight: 800;
  font-size: 1.05rem;
}

.device-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.78rem;
}

.online {
  color: var(--green);
}

.empty-state {
  min-height: 180px;
  border: 1px dashed var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  gap: 6px;
  padding: 22px;
}

.empty-state strong {
  color: var(--text);
}

.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 5px;
  background: linear-gradient(135deg, rgba(22,140,255,.14), rgba(57,232,141,.14));
  border: 1px solid var(--border);
  color: var(--cyan);
  font-weight: 900;
}

code {
  color: var(--cyan);
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 24px, 620px);
    padding-top: 18px;
  }

  .auth-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
  }

  .hero {
    min-height: 260px;
    width: 100%;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 15vw, 4.5rem);
  }

  .water-mark {
    width: 190px;
    right: -12px;
    top: 12px;
  }

  .panel {
    border-radius: 22px;
    padding: 20px;
  }

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

  .usage-panel {
    min-height: 270px;
  }
}
