/* DEVI custom sign-in — near-black, hairline borders, no glass/glow */
:root {
  --bg: #0a0a0b;
  --card: #111113;
  --border: #1f1f22;
  --stroke: #66666d;
  --t1: #ffffff;
  --t2: #a1a1a8;
  --t3: #8f8f99;
  --accent: #4b8df8;
  --accent-hover: #70a7ff;
  /* Same stops as the site accent in the near-black layer. */
  --accent-blue: #4B8DF8;
  --accent-purple: #8B77EE;
  --accent-gradient: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  --accent-gradient-hover: linear-gradient(90deg, #70A7FF, #9A86F4);
  --accent-ring: #6B82F3;
  --ok: #34c87a;
  --danger: #f07178;
  --radius: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--t1);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; text-decoration-color: var(--accent-purple); }
a:not(.back) {
  background-image: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: slice;
  box-decoration-break: slice;
}
a:not(.back):hover { background-image: var(--accent-gradient-hover); }
a:hover { color: var(--accent-hover); }
.back {
  background-image: none;
  -webkit-text-fill-color: currentColor;
  background-clip: border-box;
}
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
}
.back {
  display: inline-flex;
  align-items: center;
  color: var(--t2);
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
}
.back:hover { color: var(--t1); }

.stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px 48px;
}
.card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
}
.brand {
  display: flex;
  justify-content: center;
  margin: 0 0 28px;
}
.brand img { height: 28px; width: auto; }
h1 {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.2;
  text-align: center;
}
.sub {
  margin: 0 0 28px;
  color: var(--t2);
  font-size: 15px;
  text-align: center;
}
.switch {
  margin: 22px 0 0;
  text-align: center;
  color: var(--t2);
  font-size: 14.5px;
}
.switch a { font-weight: 600; }

/* Future social slot — hidden until Google/GitHub apps exist */
.social { display: none; margin: 0 0 18px; }
.social.ready { display: block; }
.social .provider {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin: 0 0 10px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: transparent;
  color: var(--t1);
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
}
.social .provider:hover { border-color: var(--t3); }
.divider {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  color: var(--t3);
  font-size: 13px;
}
.social.ready + .divider { display: flex; }
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.field { margin: 0 0 16px; }
.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--t1);
  font-weight: 600;
  font-size: 14px;
}
.field label .side {
  font-weight: 500;
  font-size: 13px;
  color: var(--accent);
}
.field label .side:hover { color: var(--accent-hover); }
.field input, .field textarea.keytext {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: transparent;
  color: var(--t1);
  font: inherit;
  font-size: 16px;
}
.field input::placeholder { color: var(--t3); }
.field input:focus, .field textarea.keytext:focus {
  outline: none;
  outline-offset: 0;
  box-shadow: none;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--accent-gradient) border-box;
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}
.pwfield { position: relative; }
.pwfield input { padding-right: 40px; }
.pwfield input::-ms-reveal,
.pwfield input::-ms-clear { display: none; }
.togglepw {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--t3);
  line-height: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.togglepw:hover { color: var(--t2); }
.togglepw:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: -4px;
}
.togglepw svg { display: block; width: 16px; height: 16px; }

.checklist {
  list-style: none;
  margin: -4px 0 18px;
  padding: 0;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: var(--t3);
  font-size: 13.5px;
}
.checklist li::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--stroke);
  flex: none;
}
.checklist li.ok { color: var(--ok); }
.checklist li.ok::before {
  border-color: var(--ok);
  background:
    radial-gradient(circle at 50% 50%, var(--ok) 0 3px, transparent 3.5px);
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius);
  background: #fff;
  color: #0a0a0b;
  font: inherit;
  font-weight: 650;
  font-size: 15px;
  cursor: pointer;
}
.primary:hover { background: #e4e4e7; }
.primary:disabled {
  opacity: .38;
  cursor: not-allowed;
}
.primary.busy { opacity: .72; cursor: wait; }

.formnote {
  margin: 12px 0 0;
  color: var(--t3);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.betanote {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--t2);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}
.betanote strong { color: var(--t1); font-weight: 600; }
.betanote a { color: var(--t1); text-underline-offset: 2px; }

.alts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 0;
}
.alts button {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--t2);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}
.alts button:hover { color: var(--t1); }
.alts button:disabled { opacity: .4; cursor: not-allowed; }

/* Authenticator setup (owner, 10/27/2026). The QR code is always black on white with a white quiet zone drawn into
   the SVG by devi-qr.js, on a white tile, so a phone camera reads it whatever the card behind it is. */
.totpsetup { margin: 4px 0 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.totptitle { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--t1); }
.totpsteps { margin: 0 0 14px; padding-left: 20px; color: var(--t2); font-size: 13px; line-height: 1.5; }
.totpsteps li { margin: 0 0 4px; }
.totpqr {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 14px;
  padding: 4px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.totpqr[hidden] { display: none; }
.totpqr svg { display: block; max-width: 100%; height: auto; }
/* The key field's copy button sits inside the field on the right (owner, 10/27/2026). */
.copyfield { position: relative; }
.field .copyfield .keytext {
  display: block; min-height: 0; padding-right: 52px; resize: none; overflow: hidden; white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; line-height: 1.5; letter-spacing: 0.02em;
}
.copybtn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--t2); cursor: pointer;
}
.copybtn:hover { color: var(--t1); background: color-mix(in srgb, var(--t3) 14%, transparent); }
.copybtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.copybtn .copiedicon, .copybtn.copied .copyicon { display: none; }
.copybtn.copied .copiedicon { display: block; }
.copybtn.copied { color: var(--accent); }
.copynote {
  position: absolute; right: 0; bottom: calc(100% + 6px); padding: 3px 8px; border-radius: 6px;
  background: var(--t1); color: var(--card); font-size: 12px; font-weight: 500; white-space: nowrap; pointer-events: none;
}
.copynote:empty { display: none; }
.totphelp { margin: 0 0 12px; color: var(--t3); font-size: 12.5px; line-height: 1.45; }
.totphelp a { color: var(--accent); }

.notice {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--t2);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: left;
}

.legal {
  margin: 20px 0 0;
  color: var(--t3);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
}
.legal a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover { color: var(--accent-hover); }

.status {
  margin: 14px 0 0;
  min-height: 1.35em;
  color: var(--t2);
  font-size: 14px;
  text-align: center;
}
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }

/* Progressive password reveal */
.step-password {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .35s var(--ease), opacity .28s var(--ease), transform .28s var(--ease);
  pointer-events: none;
}
.step-password.open {
  max-height: 220px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  margin-top: 0;
}

@media (max-width: 480px) {
  .card { padding: 28px 22px 24px; border: 0; background: transparent; }
  .stage { padding: 8px 12px 36px; align-items: flex-start; }
}

/* Sign in / Create account: one page, two tabs (website preview 6). */
.authtabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 26px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.authtabs a, .authtabs a:hover {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  color: var(--t2);
  font-size: 14.5px;
  font-weight: 600;
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
}
.authtabs a:hover { color: var(--t1); }
.authtabs a[aria-selected="true"] { color: var(--t1); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }

/* Light only (website preview 23, owner 10/26/2026): the public site and its sign-in pages are light. These rules
   used to apply only when the switch chose light; they now always win over the dark tokens above. */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e4e4e8;
  --stroke: #c4c4cc;
  --t1: #0b0b0d;
  --t2: #4a4a52;
  --t3: #66666f;
  --accent: #2f6fe0;
  --accent-hover: #2559bd;
  --accent-blue: #2f6fe0;
  --accent-purple: #6e56d8;
  --accent-gradient-hover: linear-gradient(90deg, #2559bd, #5b45c4);
  --accent-gradient: linear-gradient(90deg, #2f6fe0, #6e56d8);
  --ok: #0f7a3d;
  --danger: #b42323;
}
:root .card { box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06); }
:root .brand img { filter: invert(1); }
:root .primary { background: linear-gradient(100deg, #3563EE, #7B4DF2); color: #ffffff; }
:root .primary:hover { background: linear-gradient(100deg, #2F5FE8, #6C3EE6); }
