/* signin.css — the OAuth sign-in and consent page (AI connect, MCP·4, Mock B).
 *
 * The look is the terminal's own sign-in screen
 * (ui/src/components/shell/LoginScreen.css): a brand surface drawn in Mason
 * Westbridge's corporate palette in every theme, so its colours are fixed here
 * and there is no dark form. The `.login__*` rules are that file's; the
 * `.oa__*` rules are the pieces the OAuth page adds, built from the same navy,
 * slate ramp and soft line (Mock B, accepted 2026-09-28).
 *
 * Served from /oauth/assets/ beside the page, so the page's CSP stays
 * `default-src 'self'`: no inline style, no embedded-data URI, nothing third-party.
 */

/* Inter (SIL OFL 1.1, see Inter-OFL.txt): the terminal's own file, which keeps
 * the cv11 / ss01 letterforms the sign-in screen switches on. */
@font-face {
  font-family: 'Inter';
  src: url('Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #ffffff;
}

.login {
  --login-navy: #1f3664;
  --login-navy-hover: #172a4d;
  --login-ink: #101828;
  --login-ink-2: #475467;
  --login-ink-3: #667085;
  --login-line: #d0d5dd;
  --login-line-soft: #eaecf0;
  --login-error: #b42318;
  --login-fill: #f9fafb;
  --login-disabled: #98a2b3;

  min-height: 100vh;
  display: flex;
  background: #ffffff;
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  color: var(--login-ink);
}

/* ── Hero (left) ─────────────────────────────────────────────────────────── */

/* The terminal's window is a fixed height; a browser page can be taller than
 * the viewport (the consent list), so the panel stays one viewport tall and
 * holds its place while the form side scrolls. */
.login__hero {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  flex: 1 1 50%;
  overflow: hidden;
  background-color: #0b1d3a;
  background-image: url('hero.jpg');
  background-size: cover;
  background-position: 57% center;
  cursor: default;
  user-select: none;
}

.login__hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(6, 18, 38, 0.25) 0%, rgba(6, 18, 38, 0) 35%, rgba(6, 18, 38, 0) 70%, rgba(6, 18, 38, 0.35) 100%);
}

/* ── Panel (right) ───────────────────────────────────────────────────────── */

.login__panel {
  flex: 1 1 50%;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 40px 16px;
}

.login__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* The corporate logo, centred over the title: the tile rises in, a light
 * sheen crosses it once, and a soft navy halo breathes slowly behind it. */
.login__logo {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  animation: login-logo-in 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.login__logo::before {
  content: '';
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(31, 54, 100, 0.16), rgba(31, 54, 100, 0.05) 60%, rgba(31, 54, 100, 0) 100%);
  opacity: 0.5;
  animation: login-logo-glow 6s ease-in-out 900ms infinite;
}

.login__logo-tile {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #1f3664;
}

.login__logo-tile img {
  display: block;
  width: 100%;
  height: 100%;
}

.login__logo-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(210, 240, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: login-logo-sheen 1400ms ease-in-out 650ms both;
}

@keyframes login-logo-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes login-logo-sheen {
  to { transform: translateX(120%); }
}

@keyframes login-logo-glow {
  0%, 100% { opacity: 0.5; transform: scale(0.94); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .login__logo,
  .login__logo::before,
  .login__logo-tile::after {
    animation: none;
  }
}

.login__main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 0;
}

.login__card {
  width: 100%;
  max-width: 360px;
}

.login__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.login__subtitle {
  margin: 4px 0 0;
  color: var(--login-ink-2);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.login__subtitle a {
  color: var(--login-navy);
  text-decoration: none;
  font-weight: 500;
}

.login__subtitle a:hover {
  text-decoration: underline;
}

.login__notice {
  margin-top: 16px;
  padding: 8px 12px;
  border: 1px solid #fedf89;
  border-radius: 6px;
  background: #fffaeb;
  color: #93370d;
  font-size: 12px;
  line-height: 1.45;
}

.login__notice b {
  font-weight: 600;
}

.login__notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}

.login__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.login__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login__label {
  color: var(--login-ink-2);
  font-size: 12px;
  font-weight: 500;
}

.login__input-wrap {
  position: relative;
}

.login__input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--login-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--login-ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.login__input--with-toggle {
  padding-right: 42px;
}

.login__input:hover {
  border-color: #98a2b3;
}

.login__input:focus {
  border-color: var(--login-navy);
  box-shadow: 0 0 0 3px rgba(31, 54, 100, 0.14);
}

.login__toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--login-ink-3);
  cursor: pointer;
}

/* Drawn only once signin.js is running: without it the button could do nothing. */
.login__toggle[hidden] {
  display: none;
}

.login__toggle:hover,
.login__toggle:focus-visible {
  color: var(--login-ink);
}

.login__toggle[aria-pressed='false'] .eye-cross {
  display: none;
}

.login__error {
  color: var(--login-error);
  font-size: 12px;
  line-height: 1.5;
}

.login__submit {
  height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: var(--login-navy);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease;
}

.login__submit:hover:not(:disabled) {
  background: var(--login-navy-hover);
}

.login__submit:focus-visible,
.login__cancel:focus-visible {
  outline: 2px solid var(--login-navy);
  outline-offset: 2px;
}

.login__submit:disabled {
  background: var(--login-disabled);
  cursor: not-allowed;
}

.login__helper {
  margin: 0;
  color: var(--login-ink-3);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Disclosures ─────────────────────────────────────────────────────────── */

.login__disclosures {
  width: 100%;
  max-width: 640px;
  padding-top: 12px;
  border-top: 1px solid var(--login-line-soft);
  color: var(--login-ink-3);
  font-size: 10px;
  line-height: 1.5;
}

.login__disclosures p {
  margin: 0 0 6px;
}

.login__disclosures strong {
  color: var(--login-ink-2);
  font-weight: 600;
}

.login__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  margin-top: 8px;
}

.login__legal a {
  color: var(--login-ink-2);
  text-decoration: none;
}

.login__legal a:hover {
  color: var(--login-navy);
  text-decoration: underline;
}

/* ── The OAuth page's own pieces (not in LoginScreen.css; built from its tokens) ── */

.oa__who {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--login-line-soft);
  border-radius: 6px;
  background: var(--login-fill);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.oa__who-label {
  font-size: 12px;
  color: var(--login-ink-3);
}

.oa__who-host {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--login-ink);
  overflow-wrap: anywhere;
}

.oa__who-small {
  font-size: 12px;
  color: var(--login-ink-2);
  overflow-wrap: anywhere;
}

.oa__who-small b {
  font-weight: 500;
  color: var(--login-ink);
}

.oa__section {
  margin-top: 2px;
  color: var(--login-ink-2);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.oa__scopes {
  margin-top: -8px;
  border-top: 1px solid var(--login-line-soft);
}

.oa__scope {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--login-line-soft);
  cursor: pointer;
}

.oa__scope.is-off {
  cursor: default;
}

.oa__scope input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  border: 1px solid var(--login-line);
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.oa__scope input:hover {
  border-color: #98a2b3;
}

.oa__scope input:checked {
  background: var(--login-navy) url('check.svg') center / 14px no-repeat;
  border-color: var(--login-navy);
}

.oa__scope input:focus-visible {
  outline: 2px solid var(--login-navy);
  outline-offset: 2px;
}

.oa__scope input:disabled {
  background: #f2f4f7;
  border-color: var(--login-line-soft);
  cursor: not-allowed;
}

.oa__scope-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.oa__scope-name {
  font-size: 14px;
  color: var(--login-ink);
  font-weight: 500;
}

.oa__scope-name span {
  font-weight: 400;
  font-size: 12px;
  color: var(--login-ink-3);
  margin-left: 6px;
}

.oa__scope-help {
  font-size: 12px;
  color: var(--login-ink-2);
  line-height: 1.45;
}

.oa__scope.is-off .oa__scope-name,
.oa__scope.is-off .oa__scope-help {
  color: var(--login-ink-3);
}

.oa__life {
  margin: -2px 0 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--login-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.oa__life svg {
  flex: none;
  margin-top: 2px;
  color: var(--login-ink-3);
}

/* Allow comes first in the document, so Enter in a field presses it and never
 * Cancel; the row is drawn reversed, which puts Cancel on the left as Mock B
 * has it. */
.oa__actions {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
  margin-top: 2px;
}

.oa__actions > * {
  flex: 1;
}

.oa__actions--single {
  margin-top: 16px;
}

.login__cancel {
  height: 40px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--login-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--login-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.login__cancel:hover {
  background: var(--login-fill);
  border-color: #98a2b3;
}

.oa__facts {
  margin: 16px 0 0;
  border-top: 1px solid var(--login-line-soft);
}

.oa__fact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--login-line-soft);
  font-size: 13px;
}

.oa__fact dt {
  flex: none;
  color: var(--login-ink-3);
}

.oa__fact dd {
  margin: 0;
  color: var(--login-ink);
  font-weight: 500;
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.oa__body {
  margin: 12px 0 0;
  color: var(--login-ink-2);
  font-size: 13px;
  line-height: 1.55;
}

.oa__body b {
  color: var(--login-ink);
  font-weight: 600;
}

.oa__alt {
  margin-top: 14px;
  text-align: center;
}

/* ── The setup pages (MCP·11): steps, a copyable address, the app list ── */

.oa__gap {
  margin-top: 18px;
}

.oa__code {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--login-line);
  border-radius: 6px;
  background: var(--login-fill);
}

.oa__code code,
.oa__steps code,
.oa__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--login-ink);
}

.oa__code code {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  user-select: all;
}

.oa__copy {
  flex: none;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--login-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--login-ink);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.oa__copy[hidden] {
  display: none;
}

.oa__copy:hover {
  border-color: #98a2b3;
}

.oa__copy:focus-visible,
.oa__apps a:focus-visible,
.oa__alt a:focus-visible {
  outline: 2px solid var(--login-navy);
  outline-offset: 2px;
}

.oa__steps {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: oa-step;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.oa__steps > li {
  position: relative;
  padding-left: 34px;
  color: var(--login-ink-2);
  font-size: 13px;
  line-height: 1.55;
  counter-increment: oa-step;
}

.oa__steps > li::before {
  content: counter(oa-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--login-navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.oa__steps b {
  color: var(--login-ink);
  font-weight: 600;
}

.oa__apps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.oa__apps a {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 14px;
  border: 1px solid var(--login-line);
  border-radius: 6px;
  color: var(--login-ink);
  text-decoration: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.oa__apps a:hover {
  border-color: var(--login-navy);
  background: var(--login-fill);
}

.oa__app-name {
  font-size: 14px;
  font-weight: 600;
}

.oa__app-name::after {
  content: ' →';
  color: var(--login-navy);
}

.oa__app-help {
  font-size: 12px;
  color: var(--login-ink-2);
}

.oa__notes {
  margin: 6px 0 0;
  border-top: 1px solid var(--login-line-soft);
}

.oa__notes > div {
  padding: 8px 0;
  border-bottom: 1px solid var(--login-line-soft);
}

.oa__notes dt {
  color: var(--login-ink);
  font-size: 13px;
  font-weight: 500;
}

.oa__notes dd {
  margin: 2px 0 0;
  color: var(--login-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

.oa__alt a {
  color: var(--login-navy);
  font-weight: 500;
  text-decoration: none;
}

.oa__alt a:hover {
  text-decoration: underline;
}

/* Too narrow for both halves: the form alone, as the terminal's screen does
 * below 720px. */
@media (max-width: 719px) {
  .login__hero { display: none; }
  .login__panel { padding-inline: 24px; }
}
