:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --background: #101311;
  --surface: #171b18;
  --surface-raised: #1c211d;
  --border: #2a302b;
  --text: #f0f3ef;
  --muted: #8d9990;
  --subtle: #68736b;
  --green: #9ce8a8;
  --green-strong: #65cf7d;
  --green-dark: #193322;
  --red: #ff7777;
  --amber: #f1c878;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(52, 94, 62, 0.1), transparent 38rem),
    var(--background);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: min(100% - 48px, 1060px);
  min-height: 100vh;
  margin: 0 auto;
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #e9eee9;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #35443a;
  border-radius: 9px;
  background: #19231b;
}

.brand-mark svg {
  width: 18px;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.brand-divider {
  padding: 0 4px;
  color: #59645b;
  font-weight: 400;
}

.secure-label,
.eyebrow,
.card-label,
.entity-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.secure-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #89958b;
  font-size: 9px;
  letter-spacing: 0.13em;
}

.secure-dot,
.connection-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--green-strong);
  box-shadow: 0 0 10px rgba(101, 207, 125, 0.4);
}

.auth-layout {
  min-height: calc(100vh - 82px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0 56px;
}

.auth-card {
  width: min(100%, 410px);
  padding: 39px 40px 30px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(28, 34, 29, 0.98), rgba(22, 26, 23, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #9ba89d;
  font-size: 9px;
}

.eyebrow-line {
  width: 17px;
  height: 1px;
  background: var(--green-strong);
}

.auth-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-top: 37px;
  border: 1px solid #324337;
  border-radius: 13px;
  background: #1c2a20;
}

.auth-icon svg {
  width: 23px;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

h1,
h2,
p {
  margin-top: 0;
}

.auth-card h1,
.page-heading h1 {
  margin: 22px 0 9px;
  font-size: clamp(29px, 5vw, 36px);
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1.15;
}

.accent-period {
  color: var(--green);
}

.auth-description,
.heading-copy {
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth-card label {
  display: block;
  margin-bottom: 9px;
  color: #c4cdc5;
  font-size: 11px;
  font-weight: 600;
}

.password-wrap input {
  width: 100%;
  height: 47px;
  padding: 0 14px;
  border: 1px solid #343c35;
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: #111512;
  font-size: 13px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.password-wrap input::placeholder {
  color: #69736b;
}

.password-wrap input:focus {
  border-color: #77be83;
  box-shadow: 0 0 0 3px rgba(101, 207, 125, 0.1);
}

.button {
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.button-primary {
  color: #102015;
  background: var(--green);
  box-shadow: 0 5px 16px rgba(91, 190, 110, 0.11);
}

.button-primary:hover:not(:disabled) {
  background: #b0f0b8;
}

.sign-in-button {
  width: 100%;
  min-height: 46px;
  justify-content: space-between;
  margin-top: 15px;
  padding: 0 15px;
}

.sign-in-button svg {
  width: 18px;
}

.form-message {
  min-height: 16px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 11px;
}

.auth-footnote {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--subtle);
  font-size: 10px;
  text-align: center;
}

.security-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 0;
  color: #818d83;
  font-size: 10px;
}

.security-note svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  stroke: #b89a5f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.2;
}

.control-layout {
  width: min(100%, 700px);
  margin: 0 auto;
  padding: 78px 0 28px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 31px;
}

.page-heading h1 {
  margin-top: 17px;
  margin-bottom: 8px;
  font-size: clamp(31px, 6vw, 42px);
}

.heading-copy {
  margin-bottom: 0;
}

.button-quiet {
  min-height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  color: #aab4ab;
  background: transparent;
}

.button-quiet:hover:not(:disabled) {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.button-quiet svg {
  width: 16px;
}

.status-card,
.actions-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(27, 32, 28, 0.96), rgba(22, 26, 23, 0.96));
}

.status-card {
  padding: 22px 24px 0;
}

.card-topline,
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-label {
  color: #a4afa6;
  font-size: 9px;
}

.connection-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #9eaaa0;
  font-size: 10px;
}

.status-content {
  min-height: 147px;
  display: flex;
  align-items: center;
  gap: 19px;
}

.status-icon {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #3b443d;
  border-radius: 16px;
  background: #242a25;
  color: #acb6ad;
}

.status-icon svg {
  width: 33px;
  height: 33px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.status-icon.is-on {
  border-color: #345840;
  background: #1b3021;
  color: var(--green);
  box-shadow: inset 0 0 20px rgba(80, 177, 101, 0.06);
}

.status-icon.is-off {
  border-color: #55453a;
  background: #2b241f;
  color: var(--amber);
}

.status-icon.is-unknown {
  color: #9aa39c;
}

.status-copy h2 {
  margin: 0 0 7px;
  font-size: clamp(22px, 4vw, 27px);
  font-weight: 620;
  letter-spacing: -0.04em;
}

.status-copy p {
  max-width: 500px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-footer {
  min-height: 41px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #7d887f;
  font-size: 9px;
}

.entity-label {
  color: #69756c;
  font-size: 8px;
}

.actions-card {
  margin-top: 16px;
  padding: 21px 24px 17px;
}

.actions-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.actions-header h2 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 650;
}

.actions-header p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.refresh-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9ba69d;
  cursor: pointer;
  font-size: 10px;
  white-space: nowrap;
}

.refresh-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.toggle-track {
  width: 28px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid #424a43;
  border-radius: 10px;
  background: #303630;
  transition: background 140ms ease, border-color 140ms ease;
}

.toggle-track span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a3ada4;
  transition: transform 140ms ease, background 140ms ease;
}

.refresh-toggle input:checked + .toggle-track {
  border-color: #56805d;
  background: #294530;
}

.refresh-toggle input:checked + .toggle-track span {
  transform: translateX(12px);
  background: var(--green);
}

.refresh-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.toggle-interval {
  color: #768178;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 21px;
}

.turn-on-button {
  min-width: 153px;
}

.button-secondary {
  border-color: #384039;
  color: #c2cbc3;
  background: #202520;
}

.button-secondary:hover:not(:disabled) {
  border-color: #566259;
  background: #252c26;
}

.button-danger {
  border-color: #593c3b;
  color: #ffb0a9;
  background: #2a1e1e;
}

.button-danger:hover:not(:disabled) {
  border-color: #80504c;
  background: #352322;
}

.turn-off-button {
  min-width: 153px;
}

.button-secondary.is-loading svg {
  animation: spin 850ms linear infinite;
}

.action-message {
  min-height: 14px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.action-message.is-pending {
  color: var(--amber);
}

.action-message.is-success {
  color: var(--green);
}

.action-message.is-error {
  color: var(--red);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 21px;
  color: #68736b;
  font-size: 9px;
}

.footer-separator {
  padding: 0 3px;
  color: #49534b;
}

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

@media (max-width: 600px) {
  .page-shell {
    width: min(100% - 32px, 1060px);
  }

  .topbar {
    height: 68px;
  }

  .auth-layout {
    min-height: calc(100vh - 68px);
    padding: 32px 0;
  }

  .auth-card {
    padding: 31px 25px 24px;
  }

  .auth-icon {
    margin-top: 29px;
  }

  .control-layout {
    padding-top: 46px;
  }

  .status-card {
    padding: 19px 17px 0;
  }

  .status-content {
    min-height: 133px;
    gap: 14px;
  }

  .status-icon {
    width: 53px;
    height: 53px;
    border-radius: 14px;
  }

  .status-icon svg {
    width: 29px;
  }

  .actions-card {
    padding: 19px 17px 14px;
  }

  .actions-header {
    align-items: center;
    gap: 10px;
  }

  .refresh-toggle {
    gap: 6px;
    font-size: 9px;
  }

  .page-footer {
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 390px) {
  .secure-label {
    font-size: 8px;
  }

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

  .action-buttons {
    flex-direction: column;
  }

  .turn-on-button,
  .button-secondary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}