/*
 * The sign-in page: the web client's front door, as Studio's is its sign-in page
 * (`feature/StudioFeature/Behavior.md` § Account and workspace).
 *
 * Drawn in Home's look, because the page that sends people here is Home at
 * interleaving.ai. These rules came from home.css when Home moved to the root domain,
 * scoped under `.lp-dialog` and keyed off `:root[data-theme]` like the rest of this
 * page. Its palette is Home's, not Studio's.
 *
 * It is a page rather than a dialog: it fills the window and has nothing behind it to
 * go back to. It sits below the shell's own dialogs (`.modal-backdrop` is 100), so an
 * alert — an unreachable backend, say — is drawn over it.
 */
.lp-dialog {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Segoe UI", system-ui, sans-serif;
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-std: cubic-bezier(.32, .72, 0, 1);
  --bg: #F7F7F8; --surface: #FFFFFF; --surface-2: #F4F4F5;
  --line: #E4E4E7; --line-strong: #D1D1D6; --text: #18181B; --text-2: #52525B; --text-3: #67676F;
  --hover: rgba(24, 24, 27, .05); --brand: #18181B; --on-brand: #FFFFFF;
  --accent: #FF5A1F; --accent-hover: #FF6A33; --accent-press: #E84D14; --accent-text: #C2410C; --on-accent: #18181B;
  --accent-muted: rgba(255, 90, 31, .12);
  --danger-muted: rgba(217, 48, 54, .1); --danger-text: #C42A31;
  position: fixed; inset: 0; z-index: 80; overflow: auto;
  display: grid; place-items: center; padding: 16px;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
:root[data-theme="dark"] .lp-dialog {
  --bg: #0B0B0D; --surface: #141416; --surface-2: #18181B;
  --line: #26262C; --line-strong: #3A3A42; --text: #EDEDF0; --text-2: #B4B4BC; --text-3: #8E8E97;
  --hover: rgba(255, 255, 255, .06); --brand: #EDEDF0; --on-brand: #18181B;
  --accent: #FF6B33; --accent-hover: #FF7B47; --accent-press: #EE5C26; --accent-text: #FF8A5C; --on-accent: #18181B;
  --accent-muted: rgba(255, 107, 51, .16);
  --danger-muted: rgba(242, 85, 90, .16); --danger-text: #FF7B7F;
  color-scheme: dark;
}
:where(.lp-dialog) *, :where(.lp-dialog) *::before, :where(.lp-dialog) *::after { box-sizing: border-box; }
:where(.lp-dialog) a { color: inherit; text-decoration: none; }
:where(.lp-dialog) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:where(.lp-dialog) h2, :where(.lp-dialog) p { margin: 0; }
.lp-dialog :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.lp-dialog ::selection { background: var(--accent-muted); }

.lp-dialog .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: 600 15px/1 var(--font); white-space: nowrap; cursor: pointer; transition: background-color .1s var(--ease-out), border-color .1s var(--ease-out), color .1s var(--ease-out), transform .18s var(--ease-std); }
.lp-dialog .btn:active { transform: translateY(1px); }
.lp-dialog .btn-primary { background: var(--accent); color: var(--on-accent); }
.lp-dialog .btn-primary:hover { background: var(--accent-hover); }
.lp-dialog .btn-primary:active { background: var(--accent-press); }
.lp-dialog .btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.lp-dialog .btn-secondary:hover { background: var(--surface-2); }
.lp-dialog .btn-lg { height: 52px; padding: 0 24px; border-radius: 14px; font-size: 16px; }
/* Interleave's icon, as on Home. */
.lp-dialog .bmark { flex: none; display: block; }
.lp-dialog .bmark.lg { width: 44px; height: 44px; }

.lp-dialog .lp-modal { width: min(440px, 100%); padding: 32px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .5); display: grid; gap: 18px; }
.lp-dialog .lp-modal h2 { font: 600 24px/1.2 var(--display); letter-spacing: -.02em; }
.lp-dialog .lp-modal h2:focus { outline: none; }
.lp-dialog .lp-modal > p { font-size: 15px; color: var(--text-2); margin-top: -8px; }
.lp-dialog .si-form { display: grid; gap: 8px; }
.lp-dialog .si-form label { font: 600 13px/1.3 var(--font); color: var(--text); }
.lp-dialog .si-form .si-gap { margin-top: 8px; }
.lp-dialog .si-form input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  font: 400 15px/1 var(--font); transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.lp-dialog .si-form input::placeholder { color: var(--text-3); }
.lp-dialog .si-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.lp-dialog .si-err { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--danger-muted); color: var(--danger-text); font-size: 13.5px; line-height: 1.4; }
.lp-dialog .si-submit { margin-top: 12px; width: 100%; }
.lp-dialog .si-submit:disabled { opacity: .6; cursor: progress; }
.lp-dialog .si-refused { display: grid; gap: 8px; font-size: 15px; color: var(--text-2); }
.lp-dialog .lp-modal .si-fine { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-3); text-align: center; }
.lp-dialog .si-fine a { color: var(--accent-text); font-weight: 600; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .lp-dialog .btn { transition: none; }
}

/* `signin.html`: the same card, framed by Home's sign-in modal. The page around it is
   transparent so Home's dimmed page shows past the card's corners, and Home draws the
   shadow, since a frame clips one drawn inside it. The document's colour scheme follows
   the theme Home passes, because a frame whose scheme differs from its embedder's is
   painted on an opaque backdrop. */
html.signin-frame { color-scheme: light; background: transparent; }
html.signin-frame[data-theme="dark"] { color-scheme: dark; }
html.signin-frame body { margin: 0; background: transparent; }
html.signin-frame [hidden] { display: none !important; }
.lp-dialog.embedded { position: static; inset: auto; z-index: auto; display: block; padding: 0; overflow: visible; background: transparent; }
.lp-dialog.embedded .lp-modal { width: 100%; box-shadow: none; }
