/* The sign-in screen is a screen, not a dialog over a ghost
   Part of the cascade; see src/styles/index.css. */

/* ==========================================================================
   CONNECT_SIGNIN_SCREEN_V1 — 2026-09-16
   `html[data-signin="required"]` is set by services/session.js for the one
   state where nobody is signed in and no screen has been drawn.

   Before this the visitor got the entire workspace shell — rail, topbar,
   context panel — rendered empty and blurred behind the sign-in card: 841px of
   dead grey at 1440x900, 1021px at 1920x1080, and a rail of unreadable labels
   that reads as an app that failed to load rather than a door to knock on. The
   public-site audit reported it as an empty section at every one of the nine
   viewports.

   Nothing here changes the dialog. The shell simply stops being drawn until
   there is something to draw in it.
   ========================================================================== */

html[data-signin="required"] #app,
html[data-signin="required"] .connect-bubble-root,
html[data-signin="required"] .tabbar {
  display: none !important;
}

/*  With the shell gone the backdrop is the screen, so it carries the page's
    own surface rather than a blur over nothing. */
html[data-signin="required"] .modal-back {
  /*  The shell surface, not the canvas: --bg is #FFFFFF in the Day theme and a
      white card on a white field is not a card. --bg-2 is the colour the
      workspace's own chrome sits on. */
  background: var(--bg-2, var(--bg)) !important;
  backdrop-filter: none !important;
  padding: var(--s-5, 20px);
}

/*  The card is the only thing on the screen: it gets the width and the weight
    of one, and its heading is an h1 rather than the 13.5px dialog title. */
html[data-signin="required"] .modal {
  width: min(420px, 100%);
  border-radius: 18px;
  box-shadow: var(--v7-shadow-float, 0 24px 64px rgba(0, 0, 0, .28));
}

html[data-signin="required"] .modal-head {
  padding: var(--s-6, 24px) var(--s-6, 24px) var(--s-3, 12px);
  border-bottom: 0;
}

/*  A sign-in screen with no mark on it is a form, not a product. The wordmark
    is drawn above the heading from the same asset the rail uses. */
html[data-signin="required"] .modal-head::before {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: var(--s-3, 12px);
  background: center / contain no-repeat url("/static/landing/assets/connect-mark.svg");
}

html[data-signin="required"] .modal-head {
  display: block;
}

html[data-signin="required"] .modal-head h1 {
  margin: 0;
  font-size: var(--t-xl, 20px);
  font-weight: 640;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--ink);
}

html[data-signin="required"] .modal-body {
  padding: 0 var(--s-6, 24px) var(--s-6, 24px);
}

/*  The card's own prose: the explanatory line under the Google button and the
    Privacy/Terms pair were 11.1px, which is the dialog density applied to what
    is now body copy on a screen of its own. */
html[data-signin="required"] .modal-body :is(p, a, div) {
  font-size: 12.5px;
  line-height: 1.55;
}

/*  A phone shows the card full width rather than a letterboxed panel. */
@media (max-width: 640px) {
  html[data-signin="required"] .modal {
    width: 100%;
  }
  html[data-signin="required"] .modal-back {
    place-items: start center;
    padding-top: max(var(--s-8, 40px), var(--safe-top, 0px));
  }
}

/* ==========================================================================
   CONNECT_SIGNIN_EXPERIENCE_V1 — 2026-10-12
   The sign-in screen as a page of its own (features/signin/screen.js): a brand
   panel that says what Connect is, and a form panel with Google, one
   email-and-password form, registration with an email code and a phone code,
   a forgotten password and an email-code sign-in.

   The rules above still dress the workspace chooser, which stays a dialog.
   Everything here is scoped by the screen's id, `#signin`: the later layers
   paint every p, span, li, label and input of the product, and an id is the
   one thing their class and attribute selectors cannot outrank.
   ========================================================================== */

/*  The page is the origin backdrop (src/site/connect-theme.css); the brand
    stage on the left keeps its own artwork. */
html[data-signin="required"] body {
  background: transparent;
}

#signin {
  --si-brand-bg: #0B0F14;
  --si-brand-ink: #F4F1EC;
  --si-brand-ink-2: rgba(244, 241, 236, .74);
  --si-amber: #E1A062;
  --si-mint: #58C69D;
  --si-good: var(--ok, #1F9D63);
  --si-bad: var(--bad, #C93B3B);
  --si-radius: 12px;
  /*  Its own scroll container. The shell keeps html and body at the viewport
      with overflow hidden (15-v9-integration) and scrolls inside #app, which
      is not drawn here - so a page in the body's flow could not be scrolled by
      touch, and the registration button sat below a fold nobody could reach. */
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: minmax(440px, 1.08fr) minmax(400px, 1fr);
  grid-auto-rows: minmax(100%, auto);
  color: var(--ink);
  background: transparent;
  font-family: inherit;
}

#signin .si-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/*  Later layers colour every p, span, li and label with the theme's ink, and
    every heading with !important. This page owns its colours: an unclassed
    span inside a button, link, label or list item takes its parent's. */
#signin :is(button, a, label, li, .si-logo) > span { color: inherit; }
#signin .si-brand .si-brand-title { color: var(--si-brand-ink) !important; }
#signin .si-trust li,
#signin .si-steps li { color: inherit; }
#signin .si-logo span { color: var(--si-brand-ink); }

/* ---------- the brand panel ---------- */
#signin .si-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vh, 32px);
  padding: clamp(28px, 4vw, 56px);
  color: var(--si-brand-ink);
  background:
    radial-gradient(120% 90% at 0% 0%, #1A222D 0%, transparent 60%),
    linear-gradient(160deg, #10161E 0%, var(--si-brand-bg) 60%, #07090C 100%);
}

#signin .si-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(90% 70% at 50% 40%, #000 0%, transparent 80%);
  mask-image: radial-gradient(90% 70% at 50% 40%, #000 0%, transparent 80%);
}

#signin .si-aurora {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

#signin .si-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  animation: si-drift 22s ease-in-out infinite alternate;
}

#signin .si-aurora span:nth-child(1) { width: 460px; height: 460px; right: -120px; top: -140px; background: var(--si-amber); opacity: .34; }
#signin .si-aurora span:nth-child(2) { width: 380px; height: 380px; left: -140px; bottom: -120px; background: var(--si-mint); opacity: .22; animation-delay: -7s; }
#signin .si-aurora span:nth-child(3) { width: 320px; height: 320px; left: 38%; top: 42%; background: var(--cx-accent); opacity: .2; animation-delay: -13s; }

@keyframes si-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

#signin .si-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

#signin .si-logo img {
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 24px rgba(0, 0, 0, .35);
}

#signin .si-logo small {
  font-size: 14px;
  font-weight: 500;
  /*  Every <small> in the product is repainted with !important (61). */
  color: var(--si-brand-ink-2) !important;
}

#signin .si-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--si-brand-ink-2);
}

#signin .si-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--si-mint);
  animation: si-pulse 2.4s ease-out infinite;
}

@keyframes si-pulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 198, 157, .55); }
  80%, 100% { box-shadow: 0 0 0 10px rgba(88, 198, 157, 0); }
}

#signin .si-brand-title {
  margin: 0;
  max-width: 19ch;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.1;
  font-weight: 680;
  letter-spacing: -0.025em;
  color: var(--si-brand-ink);
}

#signin .si-rotate {
  display: inline-block;
  color: var(--si-amber);
  transition: opacity .22s ease, transform .22s ease;
}

#signin .si-rotate.is-out {
  opacity: 0;
  transform: translateY(-8px);
}

#signin .si-brand-lead {
  margin: 16px 0 0;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.6;
  color: var(--si-brand-ink-2);
}

#signin .si-channels {
  --px: 0;
  --py: 0;
  position: relative;
  flex: 1;
  min-height: 250px;
  max-height: 420px;
}

#signin .si-ch {
  position: absolute;
  margin: 0;
  width: clamp(140px, 13.5vw, 200px);
  aspect-ratio: 480 / 756;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .09);
  animation: si-float 7s ease-in-out infinite;
  transition: translate .4s cubic-bezier(.2, .7, .2, 1);
}

#signin .si-ch img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#signin .si-ch figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
}

#signin .si-ch-1 { left: 2%; top: 14%; translate: calc(var(--px) * -18px) calc(var(--py) * -12px); rotate: -9deg; animation-delay: -1s; }
#signin .si-ch-2 { left: 33%; top: 0; z-index: 2; scale: 1.06; translate: calc(var(--px) * 12px) calc(var(--py) * 10px); animation-delay: -3s; }
#signin .si-ch-3 { left: 63%; top: 16%; translate: calc(var(--px) * 24px) calc(var(--py) * 16px); rotate: 9deg; animation-delay: -5s; }

@keyframes si-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

#signin .si-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--si-brand-ink-2);
}

#signin .si-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#signin .si-trust svg,
#signin .si-verified svg,
#signin .si-steps svg,
#signin .si-done-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#signin .si-trust svg { color: var(--si-mint); }

/* ---------- the form panel ---------- */
#signin .si-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px);
  background: transparent;
}

#signin .si-card {
  width: min(448px, 100%);
  transition: opacity .15s ease, transform .15s ease;
}

#signin .si-card.is-leaving { opacity: 0; transform: translateY(6px); }
#signin .si-card.is-entering { opacity: 0; transform: translateY(-6px); }

#signin .si-head h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 690;
  letter-spacing: -0.025em;
  color: var(--ink);
  outline: none;
}

#signin .si-sub {
  margin: 0 0 22px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}

#signin .si-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--control-border, var(--line));
  border-radius: var(--si-radius);
  background: var(--surface-input, var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}

#signin .si-google:hover:not(:disabled) {
  border-color: var(--ink-3);
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .35);
  transform: translateY(-1px);
}

#signin .si-google:disabled { opacity: .7; cursor: progress; }
#signin .si-google-g { width: 20px; height: 20px; flex: none; }

#signin .si-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  font-size: 12.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

#signin .si-divider::before,
#signin .si-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

#signin .si-form {
  display: grid;
  gap: 16px;
}

#signin .si-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

#signin .si-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#signin .si-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#signin .si-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

#signin .si-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--control-border, var(--line));
  border-radius: var(--si-radius);
  background: var(--surface-input, var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

#signin .si-input::placeholder { color: var(--ink-3); }

#signin .si-input:hover { border-color: var(--control-border-hover, var(--ink-3)); }

#signin .si-input:focus,
#signin .si-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}

#signin .si-input-wrap { position: relative; }
#signin .si-input-wrap .si-input { padding-right: 56px; }

#signin .si-reveal {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

#signin .si-reveal:hover { color: var(--ink); background: var(--surface-hover, rgba(0, 0, 0, .04)); }

#signin .si-reveal svg,
#signin .si-code-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#signin .si-caps {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--warn, #B7791F);
}

#signin .si-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-3);
}

#signin .si-meter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

#signin .si-meter span {
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  transition: background .2s ease;
}

#signin .si-meter[data-score="1"] span:nth-child(-n+1) { background: var(--si-bad); }
#signin .si-meter[data-score="2"] span:nth-child(-n+2) { background: var(--warn, #D69E2E); }
#signin .si-meter[data-score="3"] span:nth-child(-n+3) { background: #3BA776; }
#signin .si-meter[data-score="4"] span { background: var(--si-good); }

#signin .si-phone {
  display: grid;
  grid-template-columns: minmax(118px, 136px) 1fr;
  gap: 8px;
}

#signin .si-cc {
  padding: 0 8px 0 12px;
  font-size: 15px;
  cursor: pointer;
}

#signin .si-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 14.5px;
  color: var(--ink-2);
  cursor: pointer;
}

#signin .si-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

#signin .si-terms { align-items: flex-start; }
#signin .si-terms input { margin-top: 3px; }
#signin .si-terms span { line-height: 1.55; }
/*  Links inside the sentence: the same line, a 44px hit area. */
#signin .si-terms a {
  display: inline-block;
  padding: 12px 0;
  margin: -12px 0;
  color: var(--accent);
  font-weight: 600;
}

#signin .si-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: -4px;
}

#signin .si-primary,
#signin .si-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: var(--si-radius);
  font: inherit;
  font-size: 15.5px;
  font-weight: 650;
  cursor: pointer;
}

#signin .si-primary {
  width: 100%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink, #fff);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform .12s ease, filter .15s ease;
}

#signin .si-primary:hover:not(:disabled) { filter: brightness(1.07); transform: translateY(-1px); }
#signin .si-primary:active:not(:disabled) { transform: translateY(0); }
#signin .si-primary:disabled { opacity: .75; cursor: progress; }

#signin .si-primary.is-busy::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: si-spin .7s linear infinite;
}

@keyframes si-spin { to { transform: rotate(360deg); } }

#signin .si-secondary {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 14.5px;
}

#signin .si-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-underline-offset: 3px;
}

#signin .si-link:hover { text-decoration: underline; }
#signin .si-link:disabled { color: var(--ink-3); cursor: default; text-decoration: none; }
#signin .si-link-sm { font-size: 13.5px; }
#signin .si-alt { margin: 6px auto 0; }

#signin .si-switch {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: var(--ink-2);
}

#signin .si-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--si-radius);
  font-size: 14px;
  line-height: 1.5;
}

#signin .si-banner-bad {
  border: 1px solid color-mix(in srgb, var(--si-bad) 38%, transparent);
  background: color-mix(in srgb, var(--si-bad) 9%, var(--bg));
  color: var(--ink);
}

#signin .si-banner-info {
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  color: var(--ink);
}

#signin .si-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 16px;
}

#signin .si-back-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 0 14px -6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}

/* ---------- progress ---------- */
#signin .si-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--ink-3);
}

#signin .si-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#signin .si-steps li + li::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line);
}

#signin .si-steps li > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
}

#signin .si-steps li.is-now { color: var(--ink); font-weight: 600; }
#signin .si-steps li.is-now > span { border-color: var(--accent); background: var(--accent); color: var(--accent-ink, #fff); }
#signin .si-steps li.is-done { color: var(--ink-2); }
#signin .si-steps li.is-done > span { border-color: var(--si-good); background: var(--si-good); color: #fff; }
#signin .si-steps li.is-done svg { width: 13px; height: 13px; }

/* ---------- codes ---------- */
#signin .si-codes {
  display: grid;
  gap: 14px;
}

#signin .si-code {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  transition: border-color .2s ease, background .2s ease;
}

#signin .si-form .si-code {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  border: 0;
  background: none;
}

#signin .si-code.is-verified {
  border-color: color-mix(in srgb, var(--si-good) 55%, transparent);
  background: color-mix(in srgb, var(--si-good) 6%, var(--panel));
}

#signin .si-code-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

#signin .si-otp {
  display: grid;
  gap: 8px;
}

#signin .si-otp-boxes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  max-width: 340px;
}

/*  The real input lies over the six boxes and must stay invisible. Both themes
    paint every text input with `!important` (61-colour-unification), so the
    properties that make it see-through say so too. */
#signin .si-otp-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  caret-color: transparent;
  font-size: 16px;
  letter-spacing: 3em;
  cursor: text;
}

#signin .si-otp-input::selection { background: transparent; }
#signin .si-otp-input:disabled { cursor: default; }

#signin .si-otp-box {
  position: relative;
  display: grid;
  place-items: center;
  height: 54px;
  border: 1.5px solid var(--control-border, var(--line));
  border-radius: 12px;
  background: var(--surface-input, var(--panel));
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}

#signin .si-otp-box.is-filled {
  border-color: color-mix(in srgb, var(--ink) 30%, var(--line));
  animation: si-pop .14s ease-out;
}

#signin .si-otp-box.is-caret {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

#signin .si-otp-box.is-caret:empty::after {
  content: "";
  width: 2px;
  height: 24px;
  background: var(--accent);
  animation: si-blink 1s steps(1) infinite;
}

@keyframes si-pop { from { transform: scale(.92); } to { transform: scale(1); } }
@keyframes si-blink { 50% { opacity: 0; } }

#signin .si-otp.is-error .si-otp-boxes { animation: si-shake .32s ease; }
#signin .si-otp.is-error .si-otp-box { border-color: var(--si-bad); }
#signin .si-otp.is-done .si-otp-box { border-color: var(--si-good); color: var(--si-good); }
#signin .si-otp.is-busy .si-otp-box { opacity: .6; }

@keyframes si-shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

#signin .si-field-error {
  margin: 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--si-bad);
}

#signin .si-code-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

#signin .si-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
  color: var(--si-good);
}

/* ---------- signed in ---------- */
#signin .si-done {
  padding: 24px 0;
  text-align: center;
}

#signin .si-done-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--si-good);
  color: #fff;
  box-shadow: 0 16px 40px -14px var(--si-good);
  animation: si-pop .3s ease-out;
}

#signin .si-done-mark svg {
  width: 38px;
  height: 38px;
  stroke-width: 3;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: si-draw .45s .12s ease-out forwards;
}

@keyframes si-draw { to { stroke-dashoffset: 0; } }

/* ---------- the footer ---------- */
#signin .si-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  width: min(448px, 100%);
  font-size: 13.5px;
  color: var(--ink-3);
}

#signin .si-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  text-decoration: none;
}

#signin .si-foot a:hover { color: var(--ink); text-decoration: underline; }

#signin .si-legal {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/*  Desktop: the brand stays where it is while a long form scrolls beside it. */
@media (min-width: 1025px) {
  #signin .si-brand {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100dvh;
  }
}

/* ---------- tablet and phone: the brand becomes a header band ---------- */
@media (max-width: 1024px) {
  #signin {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: auto;
  }
  #signin .si-brand {
    gap: 14px;
    padding: 24px clamp(16px, 5vw, 40px) 26px;
  }
  #signin .si-channels { display: none; }
  #signin .si-brand-title { max-width: 26ch; font-size: clamp(22px, 4.2vw, 30px); }
  #signin .si-brand-lead { margin-top: 10px; font-size: 15px; }
  #signin .si-eyebrow { margin-bottom: 12px; }
  #signin .si-panel { justify-content: flex-start; padding-top: 32px; }
}

@media (max-width: 640px) {
  #signin .si-brand { padding: 18px 16px 20px; }
  #signin .si-brand-lead,
  #signin .si-trust { display: none; }
  #signin .si-brand-title { font-size: 21px; }
  #signin .si-eyebrow { font-size: 12.5px; }
  #signin .si-panel { padding: 24px 16px 28px; gap: 20px; }
  #signin .si-head h1 { font-size: 26px; }
  #signin .si-row { grid-template-columns: minmax(0, 1fr); }
  #signin .si-code { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  #signin .si-code-icon { display: none; }
  #signin .si-otp-boxes { gap: 6px; }
  #signin .si-otp-box { height: 50px; font-size: 20px; }
  #signin .si-foot { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  #signin *,
  #signin *::before,
  #signin *::after {
    animation: none !important;
    transition: none !important;
  }
  #signin .si-done-mark svg { stroke-dashoffset: 0; }
}
