/* Sign in, as a dialog on every signed-out page (layouts/_sign_in_dialog): no separate page.
   Self-contained, like lookup.css, so it reads the same on the landing page (home.css) and the
   other pages (application.css). The header's and the gate's Sign in open it as an HTML popover;
   a link to #sign-in opens it with :target, and a page that needs a sign-in sends you here with it open (.is-open,
   ?sign_in=required). None of them needs a script. */
.sign-in-dialog {
  --si-surface: #fff; --si-text: #14161c; --si-muted: #5d6474; --si-line: rgba(20, 22, 28, .14);
  --si-accent: #2563eb; --si-button: #111113; --si-button-text: #fff;
  --si-alert: rgba(220, 38, 38, .08); --si-note: rgba(37, 99, 235, .08);
  --si-shadow: 0 1px 2px rgba(20, 22, 28, .06), 0 24px 60px -18px rgba(20, 22, 28, .45);
}
@media (prefers-color-scheme: dark) {
  .sign-in-dialog {
    --si-surface: #1c1c1f; --si-text: #f2f2f3; --si-muted: #a3a3aa; --si-line: rgba(255, 255, 255, .16);
    --si-accent: #6ea2ff; --si-button: #f2f2f3; --si-button-text: #111113;
    --si-alert: rgba(248, 113, 113, .14); --si-note: rgba(110, 162, 255, .14);
    --si-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -18px rgba(0, 0, 0, .9);
  }
}

.sign-in-dialog { width: min(24rem, calc(100vw - 2rem)); margin: auto; padding: 1.9rem 1.5rem 1.5rem; border: 1px solid var(--si-line);
  border-radius: 20px; background: var(--si-surface); color: var(--si-text); box-shadow: var(--si-shadow); text-align: center;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; }
.sign-in-dialog::backdrop { background: rgba(10, 10, 12, .45); }
/* Opened by a link to #sign-in, or open from the server: the same dialog, in the middle of the screen, over a dimmed page. */
.sign-in-dialog:target, .sign-in-dialog.is-open { display: block; position: fixed; inset: 0; z-index: 100; height: fit-content; max-height: calc(100vh - 2rem);
  overflow: auto; box-shadow: var(--si-shadow), 0 0 0 100vmax rgba(10, 10, 12, .45); }
.sign-in-dialog:not(:target, .is-open) .si-close-target, .sign-in-dialog:is(:target, .is-open) .si-close-popover { display: none; }

.si-close { position: absolute; top: .6rem; right: .6rem; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--si-muted); font: inherit; font-size: 1.4rem; line-height: 1;
  text-decoration: none; cursor: pointer; }
.si-close:hover { color: var(--si-text); background: rgba(127, 127, 127, .14); text-decoration: none; }
.si-brand { display: inline-flex; align-items: center; gap: .55rem; margin-bottom: 1.1rem; font-weight: 700; font-size: 1.1rem; letter-spacing: -.01em; }
.sign-in-dialog h2 { margin: 0 0 .3rem; font-size: 1.4rem; line-height: 1.2; letter-spacing: -.01em; }
.sign-in-dialog p { margin: 0; color: var(--si-muted); }
.si-note { margin: 1rem 0 0 !important; padding: .6rem .8rem; border-radius: 12px; background: var(--si-note); color: var(--si-text) !important;
  font-size: .9rem; text-align: left; }
.si-note.is-alert { background: var(--si-alert); }

.sign-in-dialog .sign-in-buttons { display: grid; gap: .65rem; margin: 1.4rem 0 1.1rem; }
.sign-in-dialog .sign-in-form { margin: 0; }
.sign-in-dialog .button-provider { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 2.9rem;
  padding: .6rem 1.25rem; border: 1px solid transparent; border-radius: 999px; font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; }
.sign-in-dialog .button-primary.button-provider { background: var(--si-button); color: var(--si-button-text); }
/* Google's button colors (light and dark). */
.sign-in-dialog .button-google { background: #fff; color: #1f1f1f; border-color: #747775; }
@media (prefers-color-scheme: dark) {
  .sign-in-dialog .button-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
}
.sign-in-dialog .button-provider:hover { opacity: .88; }
.si-terms { font-size: .8rem; }
.si-terms a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The sign-in buttons' loading state (sign_in.js): everywhere the buttons are (this dialog, admin's "Sign in again"). */
.sign-in-buttons.is-loading .button-provider { opacity: .45; cursor: progress; }
.sign-in-buttons.is-loading .button-provider.is-pressed { opacity: .7; }
.sign-in-status { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: -.35rem 0 1rem; font-size: .875rem; }
.sign-in-status[hidden] { display: none; }
.sign-in-spinner { width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: sign-in-spin .7s linear infinite; opacity: .8; }
@keyframes sign-in-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sign-in-spinner { animation-duration: 1.6s; } }
