/* Sign in: one KingsChat button on the left, the product's red pencil at work on the right. */
body.auth { display: grid; grid-template-columns: minmax(360px, 480px) 1fr; min-height: 100dvh; height: auto; }
.auth-panel { display: flex; flex-direction: column; gap: 48px; padding: 32px 48px; background: var(--bg); }
.auth-panel::after { content: ""; height: 24px; } /* balances the logo row so the form sits at true centre */
.auth-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.auth-brand img { border-radius: 6px; box-shadow: 0 0 0 1px var(--hair); }

/* the form reads top to bottom as one group: title, why, the action, then the privacy note right under it */
.auth-form { display: flex; flex-direction: column; width: 100%; max-width: 360px; margin: auto 0; }
.auth-form h1 { margin: 0 0 12px; font-size: 48px; font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }
.auth-sub { margin: 0 0 32px; max-width: 32ch; line-height: 1.5; font-size: 15px; color: var(--muted); }

.auth-error { margin: -16px 0 16px; font-size: 13px; color: var(--mark); }
.auth-error[hidden] { display: none; }

.auth-submit {
  height: 44px; padding: 0 24px; border: 0; border-radius: var(--r-sm);
  background: var(--btn); color: var(--btn-ink); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background-color 150ms var(--ease), transform 100ms var(--ease), opacity 150ms var(--ease);
}
.auth-submit:active:not(:disabled) { transform: scale(0.98); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-submit:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .auth-submit:hover:not(:disabled) { background: var(--btn-hover); } }

.auth-kc { display: inline-flex; align-items: center; justify-content: center; gap: 12px; text-decoration: none; }
.auth-kc img { border-radius: 6px; flex-shrink: 0; }
.auth-kc[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.auth-note { margin: 16px 0 0; font-size: 12px; line-height: 1.5; color: var(--faint); }

/* the signature: the product at work. A message types itself, then the red pencil fixes it (login-demo.js) */
.auth-art { container-type: size; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 64px clamp(48px, 6vw, 128px); background: var(--surface); overflow: hidden; }
.auth-field { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.auth-stage { position: relative; display: grid; }
.auth-stage > * { grid-area: 1 / 1; }
.auth-sample { margin: 0; max-width: 15ch; font-size: clamp(32px, min(9cqw, 8cqh), 88px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 500; color: var(--ink); text-wrap: balance; transition: opacity 300ms var(--ease), filter 300ms var(--ease); }
.auth-sample.is-out { opacity: 0; filter: blur(4px); }
.auth-ghost { visibility: hidden; }
.auth-sample .fix { white-space: nowrap; }
/* the strike draws through left to right as the word greys */
.auth-sample del {
  color: var(--faint); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 58% / 100% 0.06em;
  transition: color 260ms var(--ease), background-size 260ms var(--ease);
}
.auth-sample del.is-typed { color: var(--ink); background-size: 0 0.06em; filter: none; }
/* a struck mistake drifts slightly out of focus; new letters blur into focus as they land */
.auth-sample del { filter: blur(1.5px); transition: color 260ms var(--ease), background-size 260ms var(--ease), filter 420ms var(--ease); }
.auth-ch { animation: ch-in 360ms var(--ease) both; }
@keyframes ch-in { from { opacity: 0; filter: blur(8px); } }
.auth-sample ins { color: var(--mark); text-decoration: none; }
.auth-caret { display: inline-block; width: 0.06em; height: 0.9em; margin-left: 0.04em; vertical-align: -0.08em; background: var(--mark); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* below laptop width (tablets, opened foldables, phones): one centred column, the art steps aside */
@media (max-width: 1023px) {
  body.auth { grid-template-columns: 1fr; }
  .auth-panel { align-items: center; padding: 24px; gap: 32px; }
  .auth-brand { align-self: flex-start; }
  .auth-form { max-width: 400px; margin: auto; }
  /* the pixel field fills the screen behind the form; the example sentence steps aside */
  .auth-panel { position: relative; z-index: 1; background: transparent; }
  .auth-art { position: fixed; inset: 0; z-index: 0; padding: 0; background: var(--bg); }
  .auth-stage { display: none; }
}
@media (max-width: 599px) {
  .auth-panel { align-items: stretch; }
  .auth-form { max-width: none; margin: auto 0; }
}
