:root {
  --ink: #0f1115;
  --accent: #2f7d4f;
  --accent-hover: #276942;
  --accent-soft: #e4efe5;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-alt: #f4f3ee;
  --border: #e7e5dd;
  --border-strong: #d8d5cc;
  --text: #111418;
  --text-dim: #5b6168;
  --text-muted: #8b9099;
  --danger: #b23a2a;
  --danger-soft: #f6dcd6;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 14px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.03), 0 6px 24px rgba(15, 17, 21, 0.04);
  --ring-accent: 0 0 0 3px var(--accent-soft);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.page-footer {
  padding: 20px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
.page-footer a {
  color: var(--text-dim);
}

/* ---------- brand ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.brand .mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand .mark::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.brand .dot {
  color: var(--accent);
}

/* ---------- layout: split (login/password) ---------- */
.split {
  flex: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px;
}
.split-left h1 {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 28px 0 16px;
  color: var(--text);
}
.split-left h1 .accent {
  color: var(--accent);
}
.split-left p.lead {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.55;
  max-width: 420px;
  margin: 0;
}
.split-left .taglines {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.split-left .taglines .dot {
  color: var(--border-strong);
}

/* ---------- layout: centered (error/approval/oob/device) ---------- */
.centered {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}
.centered .panel {
  max-width: 440px;
  width: 100%;
}

/* ---------- card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
}
.card .card-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card .card-subtitle {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 2px;
  margin-bottom: 22px;
}

/* ---------- form ---------- */
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.input-wrap {
  position: relative;
}
.input-wrap .icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}
.input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0 12px 0 40px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring-accent);
}
.input::placeholder {
  color: var(--text-muted);
}
.input.no-icon {
  padding-left: 12px;
}
.input.mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.04em;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 0 18px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.checkbox .box {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, border-color 120ms ease;
}
.checkbox input:checked + .box {
  background: var(--accent);
  border-color: var(--accent);
}
.checkbox input:checked + .box::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease,
    box-shadow 120ms ease;
  text-decoration: none;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #1d2126;
  color: #fff;
  text-decoration: none;
}
.btn-primary:focus-visible {
  box-shadow: var(--ring-accent);
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface-alt);
  text-decoration: none;
}
.btn-block {
  width: 100%;
}

/* ---------- alert ---------- */
.alert {
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(178, 58, 42, 0.2);
}
.alert-error h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}
.alert-error p {
  margin: 0;
}

/* ---------- hint ---------- */
.hint {
  text-align: center;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---------- connector buttons (login.html) ---------- */
.connector-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.connector-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.connector-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-alt);
  text-decoration: none;
}

/* ---------- code input (oob / device) ---------- */
.code-input {
  width: 100%;
  height: 52px;
  text-align: center;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.code-input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring-accent);
}

/* ---------- scope list (approval) ---------- */
.scope-list {
  margin: 14px 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text);
}
.scope-list li {
  padding: 3px 0;
}
.panel-heading {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}
.panel-sub {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0 0 20px;
}

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px;
  }
  .split-left h1 {
    font-size: 30px;
    margin: 16px 0 12px;
  }
  .split-left .taglines {
    font-size: 11.5px;
  }
  .card {
    padding: 22px;
  }
}
