:root {
  color-scheme: dark;
  --background: #0e1116;
  --surface: #161a21;
  --surface-raised: #1b2029;
  --border: #2a303b;
  --text: #f0f2f5;
  --muted: #929baa;
  --accent: #62d8e8;
  --green: #5ed09a;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-size: 16px;
}

.site-header {
  height: 66px;
  border-bottom: 1px solid var(--border);
  background: #11151b;
}

.header-inner,
main {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
  font-weight: 700;
}

.brand small {
  padding: 3px 7px;
  border: 1px solid #3a4351;
  border-radius: 4px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.mark {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  transform: rotate(45deg);
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d8ad62;
}

.pill.online .status-dot { background: var(--green); }
.pill.offline .status-dot { background: #df7180; }

main { padding: 54px 0 36px; }

.intro {
  max-width: 620px;
  margin-bottom: 36px;
}

.kicker {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.15rem, 6vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.intro > p:last-child {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

h2 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -.015em;
}

.status-panel,
.signin-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.status-panel { padding: 22px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: .77rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.metrics article {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--border);
}

.metrics article:last-child { border-right: 0; }
.metric-label { display: block; color: var(--muted); font-size: .75rem; }
.metrics strong { display: block; margin-top: 8px; font-size: 1.25rem; }
.metrics small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }

.signin-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 36px;
  margin-top: 18px;
  padding: 30px;
}

.signin-copy > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.55;
}

.signin-copy ol {
  display: grid;
  gap: 15px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.signin-copy li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.signin-copy li > span {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #46505f;
  border-radius: 50%;
  color: var(--muted);
  font-size: .68rem;
}

.signin-copy strong,
.signin-copy small { display: block; }
.signin-copy strong { font-size: .84rem; }
.signin-copy small { margin-top: 3px; color: var(--muted); font-size: .75rem; }

.signin-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
}

.signin-card.approved { border-color: #39745b; }

label {
  display: block;
  margin-bottom: 7px;
  color: #c8cdd6;
  font-size: .76rem;
  font-weight: 600;
}

input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #353d49;
  border-radius: 6px;
  outline: none;
  background: #11151b;
  color: var(--text);
  font: inherit;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(98, 216, 232, .12);
}

#device-code {
  height: 51px;
  text-align: center;
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: .14em;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  border: 1px solid #73deeb;
  border-radius: 6px;
  background: var(--accent);
  color: #071317;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover { background: #79e2ef; }
button:disabled { cursor: wait; opacity: .65; }

.form-message {
  min-height: 20px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.form-message[data-state="error"] { color: #ef8995; }
.form-message[data-state="success"] { color: var(--green); }

.privacy-note {
  margin: 7px 0 0;
  color: #77808e;
  font-size: .68rem;
  line-height: 1.45;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 2px 0;
  color: #6f7886;
  font-size: .72rem;
}

@media (max-width: 760px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .signin-panel { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .header-inner, main { width: min(100% - 24px, 980px); }
  .site-header { height: 58px; }
  main { padding-top: 38px; }
  .pill { font-size: 0; }
  .pill .status-dot { display: block; }
  .status-panel, .signin-panel { padding: 18px; }
  .metrics, .field-row { grid-template-columns: 1fr; }
  .metrics article { border-right: 0; border-bottom: 1px solid var(--border); }
  .metrics article:last-child { border-bottom: 0; }
  footer { flex-direction: column; }
}

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