/* bouncer UI, in fleetctl's look (fleetctl/ui/app.css): same tokens, same
   login card. bouncer's pages are plain forms, so the styles sit on the
   elements rather than on fleetctl's classes. */
:root {
  --page: #f3f4fa;
  --panel: #ffffff;
  --panel-2: #f7f7fc;
  --text: #171a2b;
  --text-2: #4b5068;
  --muted: #7d8299;
  --line: #e8e9f2;
  --line-strong: #d7d9e6;

  --accent: #5b4ee8;
  --accent-2: #7b61f2;
  --accent-text: #ffffff;
  --accent-soft: rgba(91, 78, 232, 0.09);
  --accent-soft-2: rgba(91, 78, 232, 0.16);
  --accent-ring: rgba(91, 78, 232, 0.35);

  --good: #0f8a3c;
  --good-soft: rgba(12, 163, 12, 0.11);
  --bad: #c42f2f;
  --bad-soft: rgba(208, 59, 59, 0.1);

  --shadow-lg: 0 24px 60px rgba(30, 26, 90, 0.22);
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0d0f1c;
    --panel: #171a2e;
    --panel-2: #1d2036;
    --text: #eceefa;
    --text-2: #b9bdd6;
    --muted: #8a8fab;
    --line: #262a44;
    --line-strong: #323756;

    --accent: #8b83ff;
    --accent-2: #a78bfa;
    --accent-text: #0d0f1c;
    --accent-soft: rgba(139, 131, 255, 0.12);
    --accent-soft-2: rgba(139, 131, 255, 0.2);
    --accent-ring: rgba(139, 131, 255, 0.45);

    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, 0.12);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, 0.13);

    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }
code { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12.5px; }

/* ---- the card in the middle of the page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft-2), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--page);
}
.login {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 30px 24px;
  box-shadow: var(--shadow-lg);
}
.login.wide { width: min(560px, 100%); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.2px; padding: 0 0 18px; }
.brand img { width: 28px; height: 28px; }
h1 { font-size: 17px; font-weight: 650; margin: 0 0 6px; letter-spacing: -0.1px; }
h2 {
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  margin: 22px 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
p { margin: 10px 0; }

/* ---- fields (fleetctl .field) ---- */
form { margin: 0; }
label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 550; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
input[type="email"], input[type="password"], input[type="text"] {
  font-weight: 400;
  font-size: 14px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  outline: 0;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--panel); }

/* ---- buttons (fleetctl .btn.primary / .btn.ghost) ---- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-text);
  box-shadow: 0 6px 16px var(--accent-ring);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.05s;
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--accent-ring); }
button.quiet {
  width: auto;
  background: none;
  box-shadow: none;
  color: var(--text-2);
  border-color: var(--line-strong);
  padding: 8px 14px;
}
button.quiet:hover { filter: none; border-color: var(--accent); color: var(--accent); }

/* ---- notices (fleetctl .notice) ---- */
.notice { border-radius: 12px; padding: 10px 14px; margin: 12px 0; background: var(--panel-2); border: 1px solid var(--line); }
.notice.ok { background: var(--good-soft); border-color: transparent; color: var(--good); }
.notice.error { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

/* ---- two-factor setup ---- */
.qr { display: block; margin: 14px auto; width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 6px; }
.codes {
  columns: 2;
  margin: 14px 0;
  padding: 12px 12px 12px 34px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 13.5px;
}
ul.orgs { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
ul.orgs a {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  font-weight: 600;
  color: var(--text);
}
ul.orgs a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
