/* Signing in where you are: the remembered account and the ways in, on the Log in
   page and in the shelf the header lowers. */

/* ── The account ── */
.sign-in-who :where(p) {
  margin: 0;
}

.sign-in-hello {
  margin: 0;
}

.sign-in-name {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sign-in-note {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.35em;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

/* What "remembered" means waits behind the words: hover shows it, a tap or
   Enter keeps it open, since a touch screen cannot hover. */
.sign-in-why-button {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: help;
}

.sign-in-why .choice-hint {
  top: calc(100% + 8px);
  bottom: auto;
}

.sign-in-why:has(.sign-in-why-button:focus-visible) .choice-hint,
.sign-in-why:has([aria-expanded="true"]) .choice-hint {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

@media (hover: none) {
  .sign-in-why:has([aria-expanded="true"]) .choice-hint {
    display: block;
  }
}

/* ── Another account: one of the others, or none of them ── */
.sign-in-accounts[open] {
  flex-basis: 100%;
}

.sign-in-accounts summary {
  width: max-content;
  max-width: 100%;
  list-style: none;
  cursor: pointer;
}

.sign-in-accounts summary::-webkit-details-marker {
  display: none;
}

.sign-in-accounts-word {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 40%, transparent);
  text-underline-offset: 3px;
  transition: color 280ms ease, text-decoration-color 280ms ease;
}

.sign-in-accounts summary:hover .sign-in-accounts-word {
  color: var(--link-hover);
  text-decoration-color: var(--link-hover);
}

.sign-in-account-list {
  margin: 16px 0 0;
  padding: 0;
  max-width: 440px;
  list-style: none;
}

.sign-in-account-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
}

.sign-in-account {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--link);
  transition: color 280ms ease;
}

.sign-in-account:hover {
  color: var(--link-hover);
}

.sign-in-account[aria-current] {
  color: var(--ink);
}

.sign-in-account-remove {
  flex: none;
  margin: 0;
}

.sign-in-account-remove button {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 280ms ease;
}

.sign-in-account-remove button:hover {
  color: var(--ink);
}

.sign-in-another {
  display: inline-block;
  margin-top: 8px;
  color: var(--link);
  transition: color 280ms ease;
}

.sign-in-another:hover {
  color: var(--link-hover);
}

/* ── The ways in: one composed pair ──
   This file loads ahead of base.html's own styles, so a rule that overrides a
   shared class (.btn, .mfa-fallback) needs the extra class to win. */
.sign-in-go {
  margin-top: 40px;
}

.sign-in-go .sign-in-choices {
  margin-top: 0;
}

.sign-in-go input[type="checkbox"] {
  margin-left: 0;
}

.sign-in-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 16px;
}

.sign-in-pair .sign-in-passkey {
  padding: 14px 28px;
  font-size: 14px;
  white-space: nowrap;
}

.sign-in-pair .sign-in-password {
  margin: 0;
}

.sign-in-pair .sign-in-password[open] {
  order: 2;
  flex-basis: 100%;
}

/* What a passkey asks for, under the button it belongs to, with the fold open or shut. */
.sign-in-pair .sign-in-passkey-note {
  order: 1;
  flex-basis: 100%;
  margin: -8px 0 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.sign-in-password form {
  margin-top: 8px;
}

.sign-in-go .error {
  margin: 16px 0 0;
}

.sign-in-go form .actions {
  margin-top: 16px;
}

/* ── The shelf ──
   The shelf itself (how it hangs from the bar, its veil and the spread's spine) is
   shared with the account shelf and lives in base.html: .header-shelf,
   .header-shelf-backdrop, .shelf-spread. What follows is what the sign-in shelf
   holds. The action is a word at the greeting's size, not a black block (user
   decision, 2026-11-06). */
.sign-in-shelf .sign-in-hello,
.sign-in-shelf .sign-in-word {
  font-family: var(--font-serif);
  font-size: clamp(36px, 3.2vw, 54px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sign-in-shelf .sign-in-word {
  appearance: none;
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  white-space: nowrap;
  cursor: pointer;
}

.sign-in-arrow {
  display: inline-block;
  margin-left: 0.32em;
  transition: transform 320ms ease;
}

.sign-in-word:hover .sign-in-arrow {
  transform: translateX(6px);
}

/* Enter is already waiting here when the shelf opens; a keyboard sees a quiet line. */
.sign-in-shelf .sign-in-word:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.sign-in-shelf .sign-in-name,
.sign-in-with {
  font-family: var(--font-serif);
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.35;
}

.sign-in-shelf .sign-in-name {
  margin-top: 0;
}

.sign-in-with {
  color: var(--muted);
}

.sign-in-not-you,
.sign-in-ways {
  margin-top: 12px;
}

.sign-in-ways {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
}

.sign-in-fold {
  appearance: none;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 280ms ease;
}

.sign-in-fold:hover,
.sign-in-fold[aria-expanded="true"] {
  color: var(--ink);
}

/* The one box in the shelf stays small, so it does not turn the shelf into a form. */
.sign-in-shelf .sign-in-choices {
  margin: 0;
}

.sign-in-shelf .checkbox-row {
  gap: 8px;
  margin: 0;
}

.sign-in-shelf .checkbox-label {
  font-size: 13.5px;
  line-height: 1.5;
  cursor: pointer;
  transition: color 280ms ease;
}

.sign-in-shelf .checkbox-row:hover .checkbox-label {
  color: var(--ink);
}

.sign-in-shelf input[type="checkbox"] {
  appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 12px;
  height: 12px;
  margin: 0;
  border: 1px solid var(--faint);
  border-radius: 2px;
  background: none;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.sign-in-shelf .checkbox-row:hover input[type="checkbox"] {
  border-color: var(--muted);
}

.sign-in-shelf input[type="checkbox"]:checked {
  border-color: var(--ink);
  background: var(--ink);
}

.sign-in-shelf input[type="checkbox"]:checked::after {
  content: "";
  width: 6px;
  height: 3px;
  border-bottom: 1px solid var(--accent-ink);
  border-left: 1px solid var(--accent-ink);
  transform: translateY(-1px) rotate(-45deg);
}

/* The folds open beneath their own page. */
.sign-in-accounts-panel {
  width: min(440px, 100%);
  margin-top: 16px;
}

.sign-in-accounts-panel .sign-in-account-list {
  margin: 0;
  max-width: none;
}

.sign-in-accounts-panel .sign-in-account-list li {
  flex-direction: row-reverse;
}

.sign-in-accounts-panel .sign-in-another {
  font-size: 13.5px;
}

.sign-in-accounts-panel a {
  text-decoration: none;
}

.sign-in-remembered {
  max-width: 46ch;
  margin: 12px 0 0 auto;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.sign-in-spread > .sign-in-more {
  width: min(420px, 100%);
  margin-top: 16px;
}

.sign-in-spread > .sign-in-more:not(:has(> :not([hidden]))) {
  display: none;
}

.sign-in-more .error {
  margin: 0 0 16px;
}

.sign-in-shelf-password form {
  display: flex;
  align-items: flex-end;
  gap: 24px;
}

.sign-in-shelf-password .field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.sign-in-shelf-password .actions {
  flex: none;
  margin: 0;
}

.sign-in-shelf-password .btn,
.sign-in-shelf-password .btn:hover {
  padding: 0 0 12px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 14px;
}

.sign-in-shelf-password .btn::after {
  content: "→";
  margin-left: 12px;
  font-weight: 400;
}

/* An account with no passkey yet: the password takes the word's place. */
.sign-in-spread > .sign-in-password-only {
  grid-row: 1 / span 2;
  align-self: end;
  width: min(420px, 100%);
}

/* ── A visitor nobody remembers: the Log in page, lowered ──
   Everything the Log in page holds (user decision, 2026-11-17): signing in on the
   left page, an organization's way in on the right, each a column hugging the spine,
   both starting on one top line. The actions are words, as on every shelf. On a short
   screen the shelf scrolls itself; the script measures where the bar ends. */
.sign-in-shelf:has(> .guest-door-spread) {
  max-height: calc(100svh - var(--shelf-top, 88px));
  overflow-y: auto;
}

/* Doubled classes: this sheet loads before base.html's own rules. */
.shelf-spread.guest-door-spread {
  align-items: start;
}

.shelf-spread.guest-door-spread > .guest-pane {
  width: min(420px, 100%);
  text-align: left;
}

.guest-greeting,
.guest-register-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 300;
  color: var(--ink);
  text-box: trim-both cap alphabetic;
}

.guest-greeting {
  font-size: clamp(36px, 3.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.guest-register-title {
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.guest-login-form {
  margin-top: 32px;
}

.guest-login-form .field {
  margin: 0 0 24px;
}

.guest-pane .password-wrap {
  position: relative;
}

.guest-pane .password-wrap input {
  padding-right: 52px;
}

.guest-pane .password-toggle {
  position: absolute;
  right: 0;
  bottom: 8px;
  padding: 4px 2px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: color 200ms ease;
}

.guest-pane .password-toggle:hover {
  color: var(--ink);
}

.guest-pane .sign-in-choices {
  display: grid;
  gap: 8px;
}

.actions.guest-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  margin: 32px 0 0;
}

.guest-go {
  appearance: none;
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-serif);
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.guest-go:hover .sign-in-arrow {
  transform: translateX(6px);
}

.guest-go:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

/* Google sits alone beneath "Sign in →", in the shelf's quiet words: the provider's
   own mark and its name, nothing more. Its own line already says it is the other
   way in, so it needs no "or with"; the name keeps the mark at the scale of text. */
.guest-google-word {
  appearance: none;
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
  cursor: pointer;
  transition: color 280ms ease;
}

.guest-google-word:hover {
  color: var(--ink);
}

.guest-google-word .provider-icon {
  width: 13px;
  height: 13px;
  margin: 0 6px 0 0;
  vertical-align: -2px;
}

/* The right page reads: serif prose, the reading layer. */
.guest-pane-register p,
.guest-pane-register li {
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
}

.guest-pane-register p {
  margin: 16px 0 0;
}

.guest-pane-register p:first-of-type {
  margin-top: 32px;
}

.guest-pane-register .list {
  margin: 16px 0 0;
  padding-left: 18px;
}

.guest-begin {
  margin-top: 32px;
}

@media (max-width: 800px) {
  .sign-in-spread > .sign-in-name { order: 1; }
  .sign-in-spread > .sign-in-not-you { order: 2; }
  .sign-in-spread > .sign-in-accounts-panel { order: 3; width: 100%; }
  .sign-in-spread > .sign-in-go-word { order: 4; margin-top: 24px; }
  .sign-in-spread > .sign-in-with { order: 5; }
  .sign-in-spread > .sign-in-ways { order: 6; margin-top: 16px; }
  .sign-in-spread > .sign-in-more { order: 7; width: 100%; }
  .sign-in-spread > .sign-in-password-only { order: 4; grid-row: auto; width: 100%; margin-top: 24px; }

  .shelf-spread.guest-door-spread > .guest-pane {
    width: 100%;
  }

  .shelf-spread.guest-door-spread > .guest-pane-register {
    margin-top: 56px;
  }
  .sign-in-spread > .sign-in-hello { order: 0; }

  .sign-in-accounts-panel .sign-in-account-list li {
    flex-direction: row;
  }

  .sign-in-remembered {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .sign-in-pair .sign-in-passkey {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sign-in-arrow {
    transition: none;
  }
}

/* A grid's row gap appears whole the moment a fold makes a new row, and cannot be
   eased, so the remembered spread says the same layout as each row's own margin. Desktop
   rows sit 14px apart (the quiet words 24px further, the folds 16px). */
.shelf-spread.sign-in-spread {
  row-gap: 0;
}

.sign-in-spread > :is(.sign-in-name, .sign-in-with) {
  margin-top: 14px;
}

.sign-in-spread > :is(.sign-in-accounts-panel, .sign-in-more) {
  margin-top: 30px;
}

.sign-in-spread > :is(.sign-in-not-you, .sign-in-ways) {
  margin-top: 26px;
}

@media (min-width: 801px) {
  .sign-in-shelf .sign-in-spread > :is(.sign-in-not-you, .sign-in-ways) {
    margin-top: 38px;
  }
}

/* One column (8px apart before), the same sums. */
@media (max-width: 800px) {
  .sign-in-spread > :is(.sign-in-name, .sign-in-with) { margin-top: 8px; }
  .sign-in-spread > .sign-in-not-you { margin-top: 20px; }
  .sign-in-spread > :is(.sign-in-accounts-panel, .sign-in-ways, .sign-in-more) { margin-top: 24px; }
  .sign-in-spread > :is(.sign-in-go-word, .sign-in-password-only) { margin-top: 32px; }
}

/* The press reaches the shelf's words: the same tone and the same breath as every
   word that acts on a buyer page. The password's word is a .btn-primary dressed as a
   word, so it must not take the button's dark block. */
body.user-surface :is(.sign-in-fold, .sign-in-word, .guest-go, .sign-in-account, .sign-in-account-remove button,
                      .sign-in-forgot, .sign-in-another, .guest-google-word, .password-toggle) {
  -webkit-tap-highlight-color: transparent;
}

body.user-surface :is(.sign-in-fold, .sign-in-word, .guest-go, .sign-in-account, .sign-in-account-remove button,
                      .sign-in-forgot, .sign-in-another, .guest-google-word, .password-toggle,
                      .sign-in-shelf-password .btn):is(.is-pressed, [aria-busy="true"]) {
  background: none;
  color: var(--press-word);
  transition-duration: var(--press-in);
  transition-timing-function: var(--press-in-ease);
}

body.user-surface :is(.sign-in-fold, .sign-in-word, .guest-go, .sign-in-account, .sign-in-account-remove button,
                      .sign-in-forgot, .sign-in-another, .guest-google-word, .password-toggle,
                      .sign-in-shelf-password .btn).is-releasing {
  transition-duration: var(--press-out);
  transition-timing-function: var(--press-out-ease);
}

/* What a passkey asks for is a note in the help-text voice (serif italic), as the
   Log in page's note already is. Where there is a mouse it waits, its place kept, and
   comes in as the pointer reaches "Sign in" or a keyboard focuses it. A touch screen
   cannot hover and its tap is the sign-in itself, so there it simply stays. */
.sign-in-shelf .sign-in-with {
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

@media (hover: hover) and (pointer: fine) {
  .sign-in-shelf .sign-in-with {
    opacity: 0;
    transition: opacity 520ms ease;
  }

  .sign-in-shelf .sign-in-spread:has(.sign-in-word:hover, .sign-in-word:focus-visible, .sign-in-with:hover) .sign-in-with {
    opacity: 1;
    transition-duration: 220ms;
  }
}

/* One verb. With the password open there are two "Sign in →"; the one the password
   stands in for steps back to --muted, and comes forward under the pointer. */
.sign-in-spread:has([data-sign-in-fold="password"][aria-expanded="true"]) .sign-in-word {
  color: var(--muted);
  transition: color 280ms ease;
}

.sign-in-spread:has([data-sign-in-fold="password"][aria-expanded="true"]) .sign-in-word:hover {
  color: var(--ink);
}

/* Every password field has its own line under it: what went wrong, if anything,
   and the way out. The shelf keeps its place; the field is emptied and keeps the cursor.
   The action stands alone. In the remembered shelf the word sits beside the field, so the
   line wraps beneath both. */
.sign-in-shelf-password form {
  flex-wrap: wrap;
  row-gap: 12px;
}

.sign-in-shelf-password .actions {
  order: 1;
}

.sign-in-shelf-password .sign-in-after-field {
  order: 2;
  flex-basis: 100%;
}

.guest-pane .sign-in-after-field {
  margin-top: 12px;
}

.sign-in-after-field {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
}

.sign-in-shelf .sign-in-after-field {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
}

.sign-in-wrong {
  color: var(--danger);
}

.sign-in-wrong:empty {
  position: absolute;
}

.sign-in-forgot {
  color: var(--muted);
  text-decoration: none;
  transition: color 280ms ease;
}

.sign-in-forgot:hover {
  color: var(--ink);
}

/* Turned to another account, the way back to the one it came from: a return, so
   .link-back's arrow and voice. It sits in the shelf's top margin, so both pages still
   start on one line. */
.guest-pane-sign-in {
  position: relative;
}

.guest-pane-sign-in .guest-back {
  position: absolute;
  left: 0;
  bottom: calc(100% + 24px);
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 800px) {
  .guest-pane-sign-in .guest-back {
    position: static;
    display: inline-block;
    margin-bottom: 24px;
  }
}

.auth-shell .sign-in-after-field {
  margin: 12px 0 0;
}

.sign-in-go .field:has(+ .sign-in-after-field) {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sign-in-shelf .sign-in-with {
    transition: none;
  }
}
