/* Server-rendered account and admin sign-in surfaces. Uses workspace-tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--ws-canvas); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--ws-text);
  background: radial-gradient(ellipse 44rem 24rem at 5% 0%, var(--ws-accent-soft), transparent 82%), var(--ws-canvas);
  font: 400 14px/1.55 var(--ws-font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; accent-color: var(--ws-accent); }
a { color: var(--ws-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:is(button, a, input, textarea, select, summary):focus-visible { outline: 2px solid var(--ws-focus); outline-offset: 3px; }
.auth-topbar {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ws-space-4);
  padding: 12px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--ws-border);
  background: color-mix(in srgb, var(--ws-surface) 85%, transparent);
}
.auth-brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.auth-brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.auth-brand strong { display: block; color: var(--ws-text-strong); font-size: 14px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.auth-brand small { display: block; margin-top: 3px; color: var(--ws-muted); font-size: 11px; font-weight: 650; letter-spacing: .09em; line-height: 1; text-transform: uppercase; }
.theme-control { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ws-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.theme-control select {
  width: auto;
  min-width: 104px;
  height: 36px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-control);
  color: var(--ws-text);
  background: var(--ws-surface);
  cursor: pointer;
}
.container, .admin-login {
  width: min(calc(100% - 32px), 520px);
  margin: 24px auto;
  padding: clamp(24px, 4vw, 38px);
  align-self: center;
  border: 1px solid var(--ws-border);
  border-radius: var(--ws-radius-panel);
  background: var(--ws-surface);
  box-shadow: var(--ws-shadow-card);
}
.container > :first-child, .admin-login > :first-child { margin-top: 0; }
.admin-login { width: min(calc(100% - 32px), 460px); }
.admin-login > img { display: block; width: 56px; height: 56px; object-fit: contain; margin: 0 0 18px; }
.hero { padding: 0 0 16px; background: transparent; }
h1, .hero h1, .admin-login h1 {
  margin: 0 0 8px;
  color: var(--ws-text-strong);
  font-size: clamp(24px, 3vw, 27px);
  font-weight: 660;
  line-height: 1.23;
  letter-spacing: -.045em;
}
.hero h1 span { color: var(--ws-accent); }
h2 { color: var(--ws-text-strong); }
.subtitle, p.subtitle, .hero p { margin: 0 0 24px; color: var(--ws-muted); font-size: 14px; line-height: 1.55; }
p { margin: 0 0 12px; }
label:not(.theme-control) { display: block; margin: 17px 0 7px; color: var(--ws-text); font-size: 12px; font-weight: 650; line-height: 1.35; }
label .subtitle { font-size: 12px; font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]), textarea {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--ws-border-strong);
  border-radius: var(--ws-radius-control);
  color: var(--ws-text);
  background: var(--ws-surface);
  box-shadow: 0 1px 2px rgb(15 30 17 / 3%) inset;
  outline: none;
  transition: border-color var(--ws-motion-fast) ease, box-shadow var(--ws-motion-fast) ease;
  appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ws-muted); opacity: .78; }
input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus { border-color: var(--ws-focus); box-shadow: 0 0 0 3px var(--ws-accent-soft); }
input:disabled, textarea:disabled { cursor: not-allowed; opacity: .6; background: var(--ws-surface-muted); }
textarea { min-height: 180px; resize: vertical; font-family: var(--ws-font-mono); font-size: 12px; line-height: 1.65; }
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  padding: 9px 15px;
  border: 1px solid var(--ws-accent);
  border-radius: var(--ws-radius-control);
  color: var(--ws-accent-contrast);
  background: var(--ws-accent);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ws-motion-fast) ease, border-color var(--ws-motion-fast) ease, transform var(--ws-motion-fast) ease;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) { border-color: var(--ws-accent-hover); background: var(--ws-accent-hover); text-decoration: none; }
button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
button.secondary, .btn-secondary, #loginForm #submitBtn, #password-login-btn { border-color: var(--ws-border-strong); color: var(--ws-text); background: var(--ws-surface); }
button.secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled), #loginForm #submitBtn:hover:not(:disabled), #password-login-btn:hover:not(:disabled) { border-color: var(--ws-focus); background: var(--ws-surface-hover); }
#skipBtn { border-color: transparent; color: var(--ws-muted); background: transparent; }
#skipBtn:hover:not(:disabled) { border-color: var(--ws-border); color: var(--ws-text); background: var(--ws-surface-hover); }
details { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--ws-border); color: var(--ws-muted); }
details > summary { color: var(--ws-accent); font-size: 12px; font-weight: 650; cursor: pointer; }
.fallback { display: grid; gap: 0; }
.mode-link { display: block; margin-top: 15px; text-align: center; font-size: 12px; }
.hidden { display: none !important; }
.footer, .links { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ws-border); color: var(--ws-muted); font-size: 12px; text-align: center; }
.footer a, .links a, .link { color: var(--ws-accent); font-weight: 650; }
.auth-help { margin-top: 16px; color: var(--ws-muted); font-size: 12px; line-height: 1.6; }
.error, .error-msg, .login-error, .success, .success-msg { margin-top: 14px; padding: 11px 12px; border-radius: var(--ws-radius-control); font-size: 12px; line-height: 1.45; }
.error:empty, .error-msg:empty, .login-error:empty, .success:empty, .success-msg:empty { display: none !important; }
.error, .error-msg, .login-error { color: var(--ws-danger); background: var(--ws-danger-soft); }
.success, .success-msg { color: var(--ws-success); background: var(--ws-success-soft); }
.code-display, code, .device-code, #deviceCodeInput { font-family: var(--ws-font-mono) !important; }
.code-display { padding: 12px; border: 1px solid var(--ws-border); border-radius: var(--ws-radius-control); color: var(--ws-text); background: var(--ws-surface-muted); overflow-wrap: anywhere; }
.qr-container { display: grid; place-items: center; min-height: 160px; padding: 16px; border: 1px dashed var(--ws-border-strong); border-radius: var(--ws-radius-card); background: var(--ws-surface-muted); }
.qr-container img { display: block; max-width: 100%; height: auto; border-radius: 6px; }
.device-claim-row { display: flex; align-items: end; gap: 10px; margin-top: 12px; }
.device-claim-row input { flex: 1; min-width: 0; text-align: center; font-size: 19px !important; letter-spacing: .24em; text-transform: uppercase; }
.device-claim-row button { width: auto; min-width: 120px; margin: 0; }
#deviceSuccess { color: var(--ws-success) !important; }
.info { margin-top: 9px; color: var(--ws-muted); font-size: 12px; line-height: 1.55; }
.result { display: none; margin-top: 16px; padding: 12px; border-radius: var(--ws-radius-control); font-size: 12px; line-height: 1.5; }
.result.success { color: var(--ws-success); background: var(--ws-success-soft); }
.result.error { color: var(--ws-danger); background: var(--ws-danger-soft); }
.passkey-list { margin: 18px 0; }
.passkey-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; padding: 12px; border: 1px solid var(--ws-border); border-radius: var(--ws-radius-control); background: var(--ws-surface-muted); }
.passkey-item strong { display: block; color: var(--ws-text-strong); font-size: 12px; }
.passkey-item small { color: var(--ws-muted); font-size: 11px; }
.passkey-item button { width: auto; min-height: 34px; margin: 0; padding: 6px 11px; border-color: var(--ws-danger); color: var(--ws-danger); background: transparent; font-size: 11px; }
.passkey-item button:hover:not(:disabled) { border-color: var(--ws-danger); color: var(--ws-text-inverse); background: var(--ws-danger); }
.empty-state { padding: 18px; border: 1px dashed var(--ws-border-strong); border-radius: var(--ws-radius-control); color: var(--ws-muted); text-align: center; }
@media (max-width: 560px) {
  .auth-topbar { min-height: 64px; padding: 10px 16px; }
  .auth-brand img { width: 32px; height: 32px; }
  .theme-control > span { display: none; }
  .container, .admin-login { width: calc(100% - 24px); margin: 22px auto; padding: 23px 20px; }
  .device-claim-row { flex-direction: column; align-items: stretch; }
  .device-claim-row button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
