/* Sign in, password reset and registration: one layout on the kit's tokens. */

.au-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--background-app, var(--background-primary));
  color: var(--text-primary);
  font-family: var(--font-family);
}

.au-tools {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* The theme switch and the language picker are one pair of controls: the same height, edge
   and corner. The switch brings a larger minimum size and padding of its own, undone here. */
.au-tools w-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--kit-control-h);
  min-width: 0;
  height: var(--kit-control-h);
  min-height: 0;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--kit-radius);
  background: var(--background-secondary);
  color: var(--text-primary);
  cursor: pointer;
}

.au-tools w-language::part(trigger) {
  height: var(--kit-control-h);
}

/* The columns' own colour, under both: where they meet on a fraction of a pixel, the page
   behind would otherwise show through as a thin line. */
.au-layout {
  display: flex;
  flex: 1 1 auto;
  min-height: 100vh;
  background: var(--background-primary);
}

/* With a custom footer the columns take the window less the footer, so the footer shows at the bottom
   without scrolling, under both columns. The picture column follows that height instead of its own
   100vh: at 100vh it ran past the columns and covered the footer's middle. */
.au-page.has-custom-footer .au-layout {
  min-height: 0;
}

.au-page.has-custom-footer .au-banner {
  min-height: 0;
}

/* The page stays out of sight until the server's layout choices are applied (auth-shell.js
   revealPage): drawn earlier, it starts in the default two columns and jumps to its own. */
.au-layout[hidden] {
  display: none;
}

/* Shown, the page comes in softly; it waits unseen while the logo is still loading.
   Only a page revealPage has shown: the Preferences preview redraws as it is typed in. */
.au-page.is-revealed .au-layout,
.au-page.is-revealed .au-tools {
  animation: au-in var(--kit-base) var(--kit-ease) both;
}

.au-page:has(> .au-layout[hidden]) .au-tools {
  animation: none;
  visibility: hidden;
}

/* See-through, not hidden: the first field takes the focus while the page waits. */
.au-page.is-settling .au-layout,
.au-page.is-settling .au-tools {
  animation: none;
  opacity: 0;
}

@keyframes au-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .au-page.is-revealed .au-layout,
  .au-page.is-revealed .au-tools {
    animation: none;
  }
}

.au-layout.is-reversed {
  flex-direction: row-reverse;
}

.au-form-col {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.5rem 2rem;
  background: var(--background-primary);
}

/* The picture column runs the full height of the page, edge to edge, and meets the form on
   a slant. A thin lit edge follows the slant. It stays in view while a long form scrolls. */
.au-banner {
  --au-cut: 9rem;
  position: sticky;
  top: 0;
  display: flex;
  flex: 1.15 1 0;
  align-self: stretch;
  min-height: 100vh;
  max-height: 100vh;
  background: var(--background-primary);
}

.au-banner[hidden] {
  display: none;
}

/* The panel shows the streams the page draws itself (auth-scene.js), or the server's own
   brand cover. Until the streams are in, the colour field alone stands in. */
.au-art {
  --au-art-top: var(--accent-color);
  --au-art-bottom: var(--accent-color);
  --au-art-glow: var(--accent-color);
  --au-edge: 2px;
  position: relative;
  flex: 1 1 auto;
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb, var(--au-art-glow) 65%, white);
  clip-path: polygon(var(--au-cut) 0, 100% 0, 100% 100%, 0 100%);
}

.au-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 85% 10%, color-mix(in srgb, var(--au-art-glow) 70%, transparent), transparent 60%),
    radial-gradient(90% 70% at 10% 100%, color-mix(in srgb, var(--au-art-bottom) 60%, black), transparent 70%),
    linear-gradient(200deg, var(--au-art-top), color-mix(in srgb, var(--au-art-bottom) 70%, black));
  clip-path: polygon(
    calc(var(--au-cut) + var(--au-edge)) 0,
    100% 0,
    100% 100%,
    var(--au-edge) 100%
  );
}

/* With the picture on the left, the slant and the light are mirrored so they face the form. */
.au-layout.is-reversed .au-art {
  clip-path: polygon(0 0, calc(100% - var(--au-cut)) 0, 100% 100%, 0 100%);
}

.au-layout.is-reversed .au-art::before {
  background:
    radial-gradient(120% 80% at 15% 10%, color-mix(in srgb, var(--au-art-glow) 70%, transparent), transparent 60%),
    radial-gradient(90% 70% at 90% 100%, color-mix(in srgb, var(--au-art-bottom) 60%, black), transparent 70%),
    linear-gradient(160deg, var(--au-art-top), color-mix(in srgb, var(--au-art-bottom) 70%, black));
  clip-path: polygon(
    0 0,
    calc(100% - var(--au-cut) - var(--au-edge)) 0,
    calc(100% - var(--au-edge)) 100%,
    0 100%
  );
}

.au-layout.is-reversed .au-art.has-image img {
  inset: 3rem calc(var(--au-cut) + 1rem) 3rem 3rem;
}

.au-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--kit-slow) var(--kit-ease);
}

.au-art.is-drawn .au-scene {
  opacity: 1;
}

.au-art img,
.au-art.has-image .au-scene {
  display: none;
}

.au-art.has-image img {
  position: absolute;
  inset: 3rem 3rem 3rem calc(var(--au-cut) + 1rem);
  display: block;
  width: calc(100% - var(--au-cut) - 4rem);
  height: calc(100% - 6rem);
  object-fit: contain;
}

/* The server's header sits above the card, in the flow: however tall it is, it pushes the
   card down instead of covering it. Empty, it only keeps the card clear of the tools. */
.header-container {
  flex: 0 0 auto;
  width: 100%;
  min-height: 3.25rem;
  margin-bottom: 1rem;
  padding: 0 5.5rem;
  text-align: center;
}

.au-form-col:not(:has(> .header-container)) {
  padding-top: 4rem;
}

/* Every page's card is at least as tall as the sign in one, so the logo keeps its place
   when going from one page to the next. */
.au-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  min-height: 23rem;
  margin: auto 0;
}

.au-card--wide {
  max-width: 40rem;
}

/* While a request runs, the kit's Loader covers the card. Here it reaches past the card's
   edges with rounded corners and a soft frosted wash instead of a hard dark block. It blocks
   clicks at once but fades in only after a moment, so a quick answer does not flash it. */
.au-card > .loader-section {
  --au-loader-bleed: 1.25rem;
  inset: calc(-1 * var(--au-loader-bleed));
  width: auto;
  height: auto;
  border-radius: var(--kit-radius-xl);
  background: color-mix(in srgb, var(--background-primary) 70%, transparent);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: au-loader-in var(--kit-slow) var(--kit-ease) 150ms both;
}

/* The spinner sits on a raised disc so it does not read as part of the blurred button behind
   it. The disc turns with the spinner, so its shadow has no offset. */
.au-card > .loader-section .loading-spinner {
  box-sizing: content-box;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0.875rem;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--background-primary);
  box-shadow: 0 0 1.5rem color-mix(in srgb, black 22%, transparent);
  color: color-mix(in srgb, var(--accent-color) 20%, transparent);
}

@keyframes au-loader-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .au-card > .loader-section {
    animation: none;
  }
}

.au-panel[hidden] {
  display: none;
}

.au-logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.au-logo-row .logo,
.au-logo-row img {
  display: block;
  max-width: 14rem;
  max-height: 4.5rem;
}

.au-heading {
  margin: 0 0 1.5rem;
  text-align: center;
}

.au-title {
  margin: 0 0 0.4rem;
  color: var(--text-strong, var(--text-primary));
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.au-subtitle {
  margin: 0;
  color: var(--text-primary);
  opacity: 0.75;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.au-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.au-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.au-field[hidden] {
  display: none;
}

.au-label {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

.au-control {
  position: relative;
  display: flex;
  align-items: center;
}

.au-control-icon {
  position: absolute;
  left: 0.75rem;
  z-index: 1;
  color: var(--text-primary);
  opacity: 0.6;
  font-size: 0.875rem;
  pointer-events: none;
}

/* A field is the kit's own (.input); here it only makes room for its icon and its eye. */
.au-input {
  padding-left: 2.25rem;
}

.au-input--plain {
  padding-left: 0.75rem;
}

.au-input--with-toggle {
  padding-right: 2.5rem;
}

.au-toggle {
  position: absolute;
  right: 0.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: var(--kit-radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.au-toggle:hover,
.au-toggle:focus-visible {
  color: var(--accent-color);
}

.au-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.au-row[hidden] {
  display: none;
}

.au-row--end {
  justify-content: flex-end;
}

/* The ways out of a form sit under its one main button, as plain links. */
.au-row--links {
  margin-top: -0.25rem;
}

.au-row--links > :only-child {
  margin-inline: auto;
}

.au-link--back::before {
  content: "\2190";
  margin-right: 0.35rem;
}

.au-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.au-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.au-check[hidden],
.au-continue[hidden] {
  display: none;
}

/* CrushMFT design/102 section 11: "Remember this browser" on the second step */
.au-remember-2fa {
  margin-top: 0.25rem;
}

.au-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-ink, var(--accent-color));
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.au-link:hover,
.au-link:focus-visible {
  color: var(--accent-color);
}

/* The main button is the kit's filled button, as wide as the form and as tall as its fields. */
.au-submit {
  width: 100%;
  min-height: var(--kit-control-h);
}

.au-continue {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.au-continue::before,
.au-continue::after {
  content: "";
  flex: 1 1 0;
  height: 1px;
  background: var(--rule-color, var(--border-color));
}

.au-continue[hidden] {
  display: none;
}

.au-signed-in {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
}

.au-signed-in[hidden] {
  display: none;
}

.au-sso {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.au-sso[hidden],
.au-sso-btn[hidden],
.au-sso-row [hidden],
#google-signin[hidden] {
  display: none;
}

.au-sso-row {
  display: flex;
  gap: 0.5rem;
}

/* A provider's button is the kit's outlined button, as wide as the form. */
.au-sso-btn {
  width: 100%;
  min-height: var(--kit-control-h);
}

.au-sso-row .au-sso-btn {
  flex: 1 1 0;
  width: auto;
}

.au-sso-btn img {
  height: 1.125rem;
}

.au-generate {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.au-generate[hidden],
.au-generate-panel[hidden] {
  display: none;
}

.au-generate-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.au-generate-panel .au-input {
  flex: 1 1 10rem;
  width: auto;
}

.au-result {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--kit-radius);
  font-size: 0.875rem;
}

.au-result[hidden] {
  display: none;
}

.au-result--success {
  border-color: var(--success-color);
  background: var(--success-color-light);
}

.au-result--error {
  border-color: var(--error-color);
  background: var(--error-color-light);
}

.au-result-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.au-result p {
  margin: 0;
}

.au-result ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.au-message-form {
  margin-bottom: 1rem;
}

.au-message-form:empty {
  display: none;
}

.au-notice {
  margin: 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--kit-radius);
  background: var(--background-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  text-align: center;
}

.au-notice[hidden],
.au-row > .primary-button[hidden] {
  display: none;
}

.au-cookie {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border-top: 1px solid var(--border-color);
  background: var(--background-secondary);
  box-shadow: var(--kit-shadow-lg);
  font-size: 0.875rem;
  animation: slideInUp var(--kit-slow) var(--kit-ease);
}

.au-cookie[hidden] {
  display: none;
}

.au-cookie.is-leaving {
  animation: slideOutDown var(--kit-slow) var(--kit-ease-exit) forwards;
}

.au-cookie-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  padding: 0.25rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

#customFooterLoginPageContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  text-align: center;
}

#customFooterLoginPageContainer[hidden] {
  display: none;
}

.au-dummy-frame {
  display: none;
}

#sign-in-button[aria-busy="true"] {
  cursor: progress;
}

@media (max-width: 768px) {
  .au-banner {
    display: none;
  }

  .au-form-col {
    padding: 0.75rem 1rem 1.5rem;
  }

  .au-card > .loader-section {
    --au-loader-bleed: 0.75rem;
  }

  .header-container {
    min-height: 3.75rem;
    padding: 2.75rem 0 0;
  }

  .au-form-col:not(:has(> .header-container)) {
    padding-top: 4.5rem;
  }
}

/* A touch screen zooms the page in when a field's text is under 16px, and does not zoom back. */
@media (max-width: 768px) and (pointer: coarse) {
  .au-input,
  .au-page :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    font-size: 1rem;
  }
}

/* CrushMFT design 86: "Sign in to continue to <app>" when the App Gateway sent the browser here */
.au-app-note {
  margin: 0 0 12px;
  text-align: center;
  color: var(--cuk-text-muted, #5c6475);
  font-size: 14px;
}
.au-app-note strong {
  color: var(--cuk-text, inherit);
}

/* The passkey step (CrushMFT design/93 section 10): one button, a line under it, the other ways below a rule. */
.au-passkey-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.75rem;
  border-radius: 999px;
  color: var(--accent-ink, var(--accent-color));
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
}

.au-passkey-hint {
  margin: -0.25rem 0 0;
  color: var(--text-primary);
  opacity: 0.75;
  font-size: 0.875rem;
  text-align: center;
}

/* hidden must beat the kit's display rules (its buttons are inline-flex) */
#passkeyStepCard [hidden] {
  display: none !important;
}

.au-passkey-msg {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid color-mix(in srgb, var(--error-color, #d33) 45%, transparent);
  border-radius: var(--kit-radius, 0.5rem);
  background: color-mix(in srgb, var(--error-color, #d33) 10%, transparent);
  color: var(--text-strong, var(--text-primary));
  font-size: 0.875rem;
  line-height: 1.45;
}

.au-passkey-msg a {
  color: var(--accent-ink, var(--accent-color));
  font-weight: 600;
}

.au-passkey-other {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.au-passkey-other .au-continue {
  align-self: stretch;
}

.au-passkey-code {
  align-self: stretch;
}

.au-passkey-code-row {
  display: flex;
  gap: 0.5rem;
}

.au-passkey-code-row .au-input {
  flex: 1 1 auto;
  min-width: 0;
  letter-spacing: 0.15em;
}

/* "Sign in with a passkey" under the sign-in button (design/93 phase 6) */
.au-passkey-signin[hidden] {
  display: none !important;
}

.au-passkey-signin .au-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
