/*
 * Public Client Login, Fable Frontispiece Composition A.
 * Cardless ruled instrument; greeting → auth → quote footnote → canonical footer.
 */

html:has(body.aa-login-page) {
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior-y: none;
}

body.aa-login-page.aa-chrome-page {
  display: flex;
  flex-direction: column;
  height: 100svh;
  height: 100dvh;
  min-height: 0 !important;
  max-height: 100dvh;
  overflow: hidden !important;
  overscroll-behavior-y: none;
  color: #f4f8fc;
  background:
    radial-gradient(circle at 70% 12%, rgba(48, 84, 118, 0.16), transparent 34%),
    linear-gradient(180deg, #050b12 0%, #07111c 54%, #081521 100%);
}

html[data-theme="light"] body.aa-login-page.aa-chrome-page {
  color: #141820;
  background:
    radial-gradient(ellipse 120% 55% at 18% 0%, rgba(206, 228, 248, 0.42) 0%, transparent 58%),
    radial-gradient(ellipse 100% 65% at 88% 18%, rgba(192, 218, 242, 0.28) 0%, transparent 62%),
    linear-gradient(180deg, #f7fbff 0%, #eef5fc 28%, #e8f1fa 52%, #f3f9ff 78%, #ffffff 100%);
}

html[data-theme="stellar"] body.aa-login-page.aa-chrome-page {
  color: #f4f8fc;
  background:
    radial-gradient(circle at 72% 18%, rgba(53, 92, 128, 0.14), transparent 32%),
    linear-gradient(180deg, #03070c 0%, #07111c 54%, #081521 100%);
}

body.aa-login-page .aa-chrome-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--aa-chrome-z-header, 30);
}

body.aa-login-page .aa-chrome-header-spacer {
  display: block !important;
  height: calc(var(--aa-chrome-header-height, 120px) + 16px) !important;
}

body.aa-login-page .aa-login-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100dvh;
  overflow: hidden;
}

body.aa-login-page .pl-login-main {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

body.aa-login-page .pl-frontispiece {
  --pl-control-gap: clamp(14px, 2vh, 18px);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-width: min(360px, calc(100% - 32px));
  margin: 0 auto;
  padding:
    clamp(8px, 1.6vh, 14px)
    max(20px, env(safe-area-inset-right))
    clamp(12px, 2vh, 18px)
    max(20px, env(safe-area-inset-left));
}

.pl-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.aa-login-page .pl-greeting {
  margin: 0 0 var(--pl-control-gap);
  font-size: clamp(2rem, 7.2vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-align: left;
  text-transform: none;
  flex-shrink: 0;
}

body.aa-login-page .pl-auth {
  flex-shrink: 0;
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0 auto 0 0;
}

body.aa-login-page .pl-field {
  position: relative;
  margin: 0 0 var(--pl-control-gap);
  padding-left: 12px;
}

body.aa-login-page .pl-field:last-of-type {
  margin-bottom: 0;
}

body.aa-login-page .pl-field label {
  display: block;
}

body.aa-login-page .pl-field label:not(.pl-visually-hidden) {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.68;
}

body.aa-login-page .pl-field input {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 8px 0 7px;
  border: 0;
  border-bottom: 1px solid rgba(191, 220, 246, 0.34);
  border-radius: 0;
  background: transparent;
  color: #e8f4ff;
  caret-color: #e8f4ff;
  font-size: 18px;
  font-weight: 450;
  line-height: 1.25;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  z-index: 1;
}

body.aa-login-page .pl-field::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2px;
  height: 24px;
  pointer-events: none;
  opacity: 0.82;
  background: linear-gradient(
    180deg,
    rgba(121, 189, 241, 0.28) 0%,
    rgba(124, 206, 255, 0.62) 55%,
    rgba(121, 189, 241, 0.55) 100%
  );
  background-size: 100% 220%;
  background-position: 0 120%;
  animation: pl-rail-shimmer-vertical 7.8s ease-in-out infinite;
}

body.aa-login-page .pl-field:nth-of-type(2)::before {
  animation-duration: 8.9s;
  animation-delay: 1.1s;
}

body.aa-login-page .pl-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  opacity: 0.55;
  background: linear-gradient(
    90deg,
    rgba(121, 189, 241, 0.42) 0%,
    rgba(121, 189, 241, 0.08) 12%,
    rgba(124, 206, 255, 0.42) 50%,
    rgba(121, 189, 241, 0.08) 88%,
    transparent 100%
  );
  background-size: 220% 100%;
  background-position: 120% 0;
  animation: pl-rail-shimmer 7.4s ease-in-out infinite;
}

body.aa-login-page .pl-field:nth-of-type(2)::after {
  animation-duration: 8.6s;
  animation-delay: 1.2s;
}

@keyframes pl-rail-shimmer {
  0%,
  100% {
    background-position: 120% 0;
    opacity: 0.42;
  }
  50% {
    background-position: -20% 0;
    opacity: 0.72;
  }
}

@keyframes pl-rail-shimmer-vertical {
  0%,
  100% {
    background-position: 0 120%;
    opacity: 0.72;
  }
  50% {
    background-position: 0 -20%;
    opacity: 0.92;
  }
}

html[data-theme="light"] body.aa-login-page .pl-field::before {
  background: linear-gradient(
    180deg,
    rgba(31, 95, 115, 0.32) 0%,
    rgba(31, 95, 115, 0.62) 55%,
    rgba(31, 95, 115, 0.55) 100%
  );
  background-size: 100% 220%;
  opacity: 0.88;
}

html[data-theme="light"] body.aa-login-page .pl-field::after {
  background: linear-gradient(
    90deg,
    rgba(31, 95, 115, 0.34) 0%,
    rgba(31, 95, 115, 0.06) 12%,
    rgba(31, 95, 115, 0.28) 50%,
    rgba(31, 95, 115, 0.06) 88%,
    transparent 100%
  );
  background-size: 220% 100%;
  opacity: 0.68;
}

html[data-theme="stellar"] body.aa-login-page .pl-field::before {
  opacity: 0.78;
}

html[data-theme="stellar"] body.aa-login-page .pl-field::after {
  opacity: 0.62;
}

body.aa-login-page .pl-field input:focus {
  border-bottom-color: rgba(121, 189, 241, 0.95);
  box-shadow: 0 1px 0 rgba(121, 189, 241, 0.85);
}

body.aa-login-page .pl-field input:-webkit-autofill,
body.aa-login-page .pl-field input:-webkit-autofill:hover,
body.aa-login-page .pl-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e8f4ff;
  caret-color: #e8f4ff;
  transition: background-color 99999s ease-out 0s;
  box-shadow: 0 0 0 1000px transparent inset !important;
  background-color: transparent !important;
}

body.aa-login-page .pl-field input::selection {
  background: rgba(154, 208, 255, 0.38);
  color: #f4f9ff;
}

html[data-theme="stellar"] body.aa-login-page .pl-field input,
html[data-theme="stellar"] body.aa-login-page .pl-field input[type="text"],
html[data-theme="stellar"] body.aa-login-page .pl-field input[type="password"] {
  color: #f2f8ff;
  caret-color: #f2f8ff;
}

html[data-theme="stellar"] body.aa-login-page .pl-field input:-webkit-autofill,
html[data-theme="stellar"] body.aa-login-page .pl-field input:-webkit-autofill:hover,
html[data-theme="stellar"] body.aa-login-page .pl-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f2f8ff;
  caret-color: #f2f8ff;
}

html[data-theme="stellar"] body.aa-login-page .pl-field input::selection {
  background: rgba(154, 208, 255, 0.4);
  color: #f2f8ff;
}

html[data-theme="dark"] body.aa-login-page .pl-field input,
html[data-theme="dark"] body.aa-login-page .pl-field input[type="text"],
html[data-theme="dark"] body.aa-login-page .pl-field input[type="password"] {
  color: #f7f2e8;
  caret-color: #f7f2e8;
}

html[data-theme="dark"] body.aa-login-page .pl-field input:-webkit-autofill,
html[data-theme="dark"] body.aa-login-page .pl-field input:-webkit-autofill:hover,
html[data-theme="dark"] body.aa-login-page .pl-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #f7f2e8;
  caret-color: #f7f2e8;
}

html[data-theme="dark"] body.aa-login-page .pl-field input::selection {
  background: rgba(228, 211, 154, 0.38);
  color: #f7f2e8;
}

html[data-theme="light"] body.aa-login-page .pl-field input,
html[data-theme="light"] body.aa-login-page .pl-field input[type="text"],
html[data-theme="light"] body.aa-login-page .pl-field input[type="password"] {
  color: #141c26;
  caret-color: #141c26;
  border-bottom-color: rgba(31, 95, 115, 0.28);
}

html[data-theme="light"] body.aa-login-page .pl-field input:-webkit-autofill,
html[data-theme="light"] body.aa-login-page .pl-field input:-webkit-autofill:hover,
html[data-theme="light"] body.aa-login-page .pl-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #141c26;
  caret-color: #141c26;
}

html[data-theme="light"] body.aa-login-page .pl-field input::selection {
  background: rgba(42, 111, 191, 0.28);
  color: #141c26;
}

body.aa-login-page .pl-error {
  min-height: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #e8a0a0;
}

body.aa-login-page .pl-error:not(:empty) {
  min-height: 18px;
  margin-top: 8px;
}

html[data-theme="light"] body.aa-login-page .pl-error {
  color: #9a3030;
}

body.aa-login-page .pl-submit {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 56px;
  margin-top: var(--pl-control-gap);
  padding: 12px 0 12px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: clamp(1.25rem, 5vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  text-shadow: 0 0 0 transparent;
  transition: color 0.2s ease, text-shadow 0.2s ease, opacity 0.2s ease;
}

html[data-theme="light"] body.aa-login-page .pl-submit {
  color: rgba(20, 28, 38, 0.88);
  text-shadow: 0 0 8px rgba(31, 95, 115, 0.12);
}

html[data-theme="stellar"] body.aa-login-page .pl-submit {
  color: rgba(218, 239, 255, 0.98);
  text-shadow:
    0 0 10px rgba(124, 206, 255, 0.46),
    0 0 22px rgba(96, 178, 255, 0.28);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
}

body.aa-login-page .pl-submit:hover,
body.aa-login-page .pl-submit:focus-visible {
  color: rgba(121, 189, 241, 0.98);
  text-shadow:
    0 0 10px rgba(124, 206, 255, 0.42),
    0 0 20px rgba(96, 178, 255, 0.24);
  outline: 2px solid rgba(121, 189, 241, 0.55);
  outline-offset: 4px;
}

html[data-theme="light"] body.aa-login-page .pl-submit:hover,
html[data-theme="light"] body.aa-login-page .pl-submit:focus-visible {
  color: rgba(31, 95, 115, 0.98);
  text-shadow: 0 0 10px rgba(31, 95, 115, 0.22);
  outline-color: rgba(31, 95, 115, 0.45);
}

body.aa-login-page .pl-submit:active {
  opacity: 0.82;
}

body.aa-login-page .pl-submit-arrow {
  display: none;
}

body.aa-login-page .pl-quote-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  position: relative;
  width: 100%;
  max-width: 360px;
  margin-left: 0;
  margin-right: auto;
  margin-top: var(--pl-control-gap);
  margin-bottom: auto;
  padding:
    clamp(10px, 1.6vh, 16px)
    0
    clamp(4px, 1vh, 10px)
    clamp(12px, 2vw, 18px);
  border: 0;
  border-radius: 0;
  background: transparent;
}

body.aa-login-page .pl-quote-block::before,
body.aa-login-page .pl-quote-block::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: rgba(191, 220, 246, 0.28);
}

body.aa-login-page .pl-quote-block::before {
  top: 0;
  left: 0;
  width: clamp(28px, 8vw, 48px);
  height: 1px;
}

body.aa-login-page .pl-quote-block::after {
  top: 0;
  left: 0;
  width: 1px;
  height: clamp(28px, 6vh, 48px);
}

html[data-theme="light"] body.aa-login-page .pl-quote-block::before,
html[data-theme="light"] body.aa-login-page .pl-quote-block::after {
  background: rgba(31, 95, 115, 0.28);
}

body.aa-login-page .pl-quote-zone {
  position: relative;
  margin: 0;
}

body.aa-login-page .pl-quote-assemble {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

body.aa-login-page .pl-quote {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 32ch;
  font-family: Georgia, "Times New Roman", "Iowan Old Style", Palatino, serif;
  font-size: clamp(1.02rem, 3.1vw, 1.38rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.45;
  text-wrap: pretty;
  opacity: 0;
  transition: opacity 420ms ease;
}

body.aa-login-page .pl-quote.is-settled {
  opacity: 1;
}

body.aa-login-page .pl-quote[data-quote-length="short"] {
  font-size: clamp(1.16rem, 3.6vw, 1.62rem);
}

body.aa-login-page .pl-quote[data-quote-length="long"] {
  font-size: clamp(1.06rem, 3.1vw, 1.42rem);
  line-height: 1.48;
}

body.aa-login-page .pl-attribution {
  margin: 10px 0 0;
  opacity: 0;
  transition: opacity 480ms ease 120ms;
}

body.aa-login-page .pl-attribution.is-visible {
  opacity: 1;
}

body.aa-login-page .pl-attribution-rule {
  display: block;
  width: 2.5ch;
  height: 0;
  margin-bottom: 8px;
  border-top: 1px solid rgba(191, 220, 246, 0.22);
}

body.aa-login-page .pl-attribution-name {
  display: block;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
}

body.aa-login-page .pl-attribution-role {
  display: block;
  margin-top: 4px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.68;
}

html[data-theme="light"] body.aa-login-page .pl-attribution-role {
  opacity: 0.7;
}

body.aa-login-page .fb-login-plate,
body.aa-login-page .fb-login-greeting-block {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  body.aa-login-page .pl-quote,
  body.aa-login-page .pl-attribution {
    transition: opacity 200ms ease;
  }

  body.aa-login-page .pl-quote-assemble {
    display: none !important;
  }

  body.aa-login-page .pl-field::before,
  body.aa-login-page .pl-field::after {
    animation: none;
    background-position: 50% 0;
  }

  body.aa-login-page .pl-field::before {
    background-position: 0 50%;
    opacity: 0.82;
  }

  body.aa-login-page .pl-field::after {
    opacity: 0.68;
  }

  html[data-theme="light"] body.aa-login-page .pl-field::before {
    opacity: 0.88;
  }
}

@media (max-width: 430px) {
  body.aa-login-page .pl-frontispiece {
    max-width: min(340px, calc(100% - 24px));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  body.aa-login-page .pl-auth {
    max-width: min(360px, 100%);
  }

  body.aa-login-page .pl-greeting {
    font-size: clamp(1.85rem, 8.4vw, 2.5rem);
    margin-bottom: var(--pl-control-gap);
  }

  body.aa-login-page .pl-quote {
    max-width: 30ch;
    font-size: clamp(0.98rem, 3.4vw, 1.18rem);
  }
}

@media (min-width: 1024px) {
  body.aa-login-page .pl-frontispiece {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
  }

  body.aa-login-page .pl-greeting {
    width: 100%;
    text-align: left;
  }

  body.aa-login-page .pl-auth {
    width: 100%;
    max-width: 360px;
    margin-left: 0;
    margin-right: auto;
    justify-self: auto;
    align-self: flex-start;
  }

  body.aa-login-page .pl-quote-block {
    width: 100%;
    max-width: 360px;
    margin-left: 0;
    margin-right: auto;
    align-self: flex-start;
    justify-content: flex-start;
  }
}
