/* Keystone hosted sign-in pages. Neural Inverse tokens (brand/tokens.css) for light and dark,
   selected by the colour-scheme media query below. The markup is identical in both schemes; only these
   tokens change. Spacing is on a 4 px grid. Organization branding may set --org-accent and
   --org-on-accent (validated hex, contrast-checked); everything else stays Neural Inverse. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("/oauth2/assets/d8bce822db092746/fonts/Geist-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("/oauth2/assets/b0a0867cda44efef/fonts/Geist-Medium.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/oauth2/assets/e4507fb4fb5f832f/fonts/GeistMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/oauth2/assets/85b99e603f84a47d/fonts/GeistMono-Medium.woff2") format("woff2"); }

:root {
  --ni-bg: #F4F6F9;
  --ni-card: #FFFFFF;
  --ni-surface: #F4F6F9;
  --ni-fg: #16191F;
  --ni-muted: #5F6774;
  --ni-border: #DCE1E8;
  --ni-input-border: #8A93A1;
  --ni-accent: #2A6FD6;
  --ni-on-accent: #FFFFFF;
  --ni-success: #1F8A4C;
  --ni-danger: #C93C3C;
  --ni-warning: #A86A12;
  --ni-success-bg: #EAF6EF;
  --ni-danger-bg: #FBEDED;
  --ni-info-bg: #EDF3FC;
  --ni-highlight: rgba(42, 111, 214, .20);
  --ni-shadow: rgba(16, 24, 40, .08);
  --ni-font: "Geist", "Helvetica Neue", Arial, sans-serif;
  --ni-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ni-ease-out: cubic-bezier(.2, .7, .2, 1);
  --ni-ease-in-out: cubic-bezier(.45, 0, .25, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ni-bg: #111317;
    --ni-card: #191C22;
    --ni-surface: #111317;
    --ni-fg: #E8EBF0;
    --ni-muted: #9AA2AF;
    --ni-border: #2A2F38;
    --ni-input-border: #5A6270;
    --ni-accent: #5BA0F7;
    --ni-on-accent: #111317;
    --ni-success: #4CC27E;
    --ni-danger: #F06A6A;
    --ni-warning: #E3A63F;
    --ni-success-bg: #15261D;
    --ni-danger-bg: #2B1A1C;
    --ni-info-bg: #16202F;
    --ni-highlight: rgba(91, 160, 247, .24);
    --ni-shadow: rgba(0, 0, 0, .45);
  }
}

:root {
  --accent: var(--org-accent, var(--ni-accent));
  --on-accent: var(--org-on-accent, var(--ni-on-accent));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ni-bg);
  color: var(--ni-fg);
  font-family: var(--ni-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 24px;
  gap: 24px;
}
.card {
  width: 100%;
  max-width: 400px;
  background: var(--ni-card);
  border: 1px solid var(--ni-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px var(--ni-shadow);
  padding: 32px;
  animation: ni-enter 240ms var(--ni-ease-out) both;
}
@media (max-width: 440px) {
  .shell { padding-top: 24px; justify-content: flex-start; }
  .card { padding: 24px 20px; }
}

.brand { display: flex; align-items: center; min-height: 32px; margin-bottom: 24px; }
.brand-mark { width: 24px; height: 32px; display: block; }
.org-logo { display: block; height: 32px; width: auto; max-width: 200px; object-fit: contain; }
.org-name { margin: 0; font-size: 16px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; }

h1 { margin: 0 0 8px; font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.lead { margin: 0 0 24px; color: var(--ni-muted); overflow-wrap: anywhere; }
.lead strong, .alert strong { color: var(--ni-fg); font-weight: 500; }
p { margin: 0; }

.form { display: flex; flex-direction: column; gap: 16px; margin: 0 0 16px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
label { font-size: 13px; line-height: 20px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"] {
  height: 32px;
  width: 100%;
  padding: 0 8px;
  border: 1px solid var(--ni-input-border);
  border-radius: 6px;
  background: var(--ni-card);
  color: var(--ni-fg);
  font: inherit;
  transition: border-color 150ms var(--ni-ease-out), box-shadow 150ms var(--ni-ease-out);
}
input[readonly] { background: var(--ni-surface); color: var(--ni-muted); }
input[aria-invalid="true"] { border-color: var(--ni-danger); }
.mono, code { font-family: var(--ni-mono); }
input.mono { letter-spacing: 0.08em; }
code { font-size: 12px; overflow-wrap: anywhere; }
.hint { color: var(--ni-muted); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ni-highlight); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  transition: opacity 150ms var(--ni-ease-out), transform 150ms var(--ni-ease-out);
}
.button:active { transform: translateY(1px); }
.button[disabled] { cursor: default; opacity: .6; }
.button-primary { background: var(--accent); color: var(--on-accent); }
.button-primary:hover { opacity: .92; text-decoration: none; }
.button-secondary { background: transparent; color: var(--ni-fg); border-color: var(--ni-input-border); }
.button-secondary:hover { background: var(--ni-surface); text-decoration: none; }
.form-actions { flex-direction: row; gap: 8px; }
.form-actions .button { flex: 1; }
.actions { margin: 0 0 16px; }

.alert {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 12px;
  margin: 0 0 16px;
  border-radius: 6px;
  border: 1px solid;
  overflow-wrap: anywhere;
}
.alert .icon { flex: none; margin-top: 2px; }
.alert:focus { outline: 2px solid var(--ni-danger); outline-offset: 2px; }
.alert-error { color: var(--ni-fg); background: var(--ni-danger-bg); border-color: var(--ni-danger); }
.alert-error .icon { color: var(--ni-danger); }
.alert-error a { color: var(--ni-fg); }
.alert-success { color: var(--ni-fg); background: var(--ni-success-bg); border-color: var(--ni-success); }
.alert-success .icon { color: var(--ni-success); }
.alert-info { color: var(--ni-fg); background: var(--ni-info-bg); border-color: var(--ni-border); }
.alert-info .icon { color: var(--accent); }

.disclosure summary { cursor: pointer; color: var(--accent); font-size: 13px; line-height: 20px; }
.disclosure[open] summary { margin-bottom: 8px; }

.scopes { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.scopes li { display: flex; gap: 8px; align-items: flex-start; }
.scopes .icon { flex: none; margin-top: 2px; color: var(--ni-success); }

.aside { margin: 16px 0 0; color: var(--ni-muted); font-size: 13px; text-align: center; }
.reference { margin: 16px 0 0; color: var(--ni-muted); font-size: 12px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--ni-muted); font-size: 13px; }
.spinner {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--ni-border); border-top-color: var(--accent);
  animation: ni-spin 800ms linear infinite;
}

.footer { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ni-muted); font-size: 12px; line-height: 16px; }
.secured { display: inline-flex; align-items: center; gap: 4px; }
.footer-mark { width: 9px; height: 12px; display: block; }
.org-links { display: flex; gap: 16px; }
.org-links a { color: var(--ni-muted); }

@keyframes ni-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ni-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-property: opacity !important;
    transition-duration: 150ms !important;
  }
  .button:active { transform: none; }
}

@media (forced-colors: active) {
  .button-primary { border-color: ButtonText; }
  .alert { border-color: CanvasText; }
}
