/* RFReference authentication UI */
@property --auth-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

#authOverlay {
  background:
    radial-gradient(circle at 50% 35%, rgba(20, 92, 170, .18), transparent 44%),
    rgba(0, 4, 14, .78);
  backdrop-filter: blur(4px) saturate(.82);
  -webkit-backdrop-filter: blur(4px) saturate(.82);
}

#authOverlay .modal.modalAuthCard {
  --auth-angle: 0deg;
  width: min(470px, 100%);
  position: relative;
  padding: 24px 34px 26px;
  border: 1px solid transparent;
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 27, 53, .985), rgba(4, 13, 31, .99)) padding-box,
    conic-gradient(from var(--auth-angle),
      rgba(38, 186, 255, .25),
      rgba(35, 112, 255, .95),
      rgba(255, 157, 56, .75),
      rgba(35, 112, 255, .95),
      rgba(38, 186, 255, .25)) border-box;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .72),
    0 0 42px rgba(0, 126, 255, .18),
    inset 0 1px 0 rgba(255, 255, 255, .06);
  animation: authBorderOrbit 9s linear infinite, authCardIn .2s ease-out both;
}

#authOverlay .modal.modalAuthCard::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: -2px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ff9a38, #ffe08a, #44caff, transparent);
  filter: blur(.2px) drop-shadow(0 0 9px rgba(255, 163, 64, .8));
  opacity: .88;
  pointer-events: none;
}

@keyframes authBorderOrbit {
  to { --auth-angle: 360deg; }
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#authOverlay .modal.modalAuthCard .modalTop {
  position: relative;
  justify-content: center;
  min-height: 42px;
  margin: 0 0 4px;
}

#authOverlay .modal.modalAuthCard .modalTitle {
  padding: 0 46px;
  font-size: 29px;
  line-height: 1.15;
  letter-spacing: .15px;
  color: #f5fbff;
  text-shadow: 0 0 16px rgba(72, 195, 255, .48);
}

#authOverlay .modal.modalAuthCard .modalClose {
  position: absolute;
  top: -5px;
  right: -15px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  line-height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(92, 167, 255, .42);
  background: rgba(8, 23, 48, .82);
  color: #b9d9ff;
  font-size: 17px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

#authOverlay .modal.modalAuthCard .modalClose:hover {
  color: #fff;
  border-color: rgba(67, 196, 255, .8);
  background: rgba(18, 58, 104, .82);
  filter: none;
}

#authOverlay .modal.modalAuthCard .modalBody {
  display: block;
  max-height: calc(100vh - 150px);
  padding: 0 3px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(48, 151, 255, .45) transparent;
}

.authFormShell {
  width: 100%;
  margin: 0 auto;
}

.authIntro {
  margin: 0 0 18px;
  text-align: center;
  color: rgba(224, 234, 249, .82);
  font-size: 13px;
  line-height: 1.5;
}

.authIntro strong {
  color: #fff;
}

.authField {
  margin-bottom: 13px;
}

.authFieldLabel {
  display: block;
  margin: 0 0 6px;
  color: #f5f8ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1px;
}

.authInputWrap {
  position: relative;
}

.authFieldIcon,
.authPasswordToggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #91a7c7;
  pointer-events: none;
}

.authFieldIcon {
  left: 2px;
}

.authFieldIcon svg,
.authPasswordToggle svg,
.authButtonIcon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.authPasswordToggle {
  right: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.authPasswordToggle:hover {
  color: #4ed2ff;
}

.authInput {
  width: 100%;
  height: 45px;
  padding: 0 42px 0 42px;
  border-radius: 11px;
  border: 1px solid rgba(142, 176, 223, .36);
  outline: none;
  background: linear-gradient(180deg, rgba(18, 35, 62, .8), rgba(9, 23, 45, .88));
  color: #fff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.authInput.noTrailingIcon {
  padding-right: 14px;
}

.authInput::placeholder {
  color: rgba(180, 196, 220, .55);
}

.authInput:hover {
  border-color: rgba(120, 184, 255, .55);
}

.authInput:focus {
  border-color: #2fbfff;
  background: linear-gradient(180deg, rgba(18, 42, 74, .9), rgba(9, 27, 52, .94));
  box-shadow: 0 0 0 3px rgba(30, 164, 255, .12), 0 0 18px rgba(14, 133, 255, .14);
}

.authInput:disabled {
  opacity: .52;
}

.authHint {
  min-height: 15px;
  margin-top: 5px;
  color: rgba(191, 204, 226, .68);
  font-size: 11px;
  line-height: 1.35;
}

.authHint:empty {
  min-height: 0;
}

.authHint .err,
.authStatus.error {
  color: #ff9a9a;
}

.authHint .ok,
.authStatus.success {
  color: #7dffab;
}

.authInlineAction {
  display: flex;
  justify-content: flex-end;
  margin: -5px 0 13px;
}

.authTextButton,
.authTextLink {
  padding: 0;
  border: 0;
  background: transparent;
  color: #22bdff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.authTextButton:hover,
.authTextLink:hover {
  color: #79ddff;
  text-decoration: underline;
}

.authCaptcha {
  margin: 14px 0 13px;
  padding: 12px 13px 11px;
  border-radius: 13px;
  border: 1px solid rgba(126, 164, 215, .3);
  background: linear-gradient(180deg, rgba(22, 39, 69, .68), rgba(12, 27, 51, .72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.authCaptchaTitle {
  margin-bottom: 3px;
  color: #f5f8ff;
  font-size: 13px;
  font-weight: 900;
}

.authCaptchaQuestion {
  color: rgba(210, 221, 239, .78);
  font-size: 11px;
}

.authCaptchaRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 115px;
  gap: 10px;
  margin-top: 9px;
}

.authCaptcha .authInput {
  height: 39px;
}

.authCaptchaRefresh {
  min-width: 0;
  width: 100%;
  height: 39px;
  border-radius: 10px;
  border: 1px solid rgba(163, 182, 219, .32);
  background: linear-gradient(180deg, rgba(94, 107, 137, .48), rgba(45, 55, 82, .62));
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.authCaptchaRefresh:hover {
  border-color: rgba(60, 194, 255, .72);
  background: linear-gradient(180deg, rgba(64, 110, 160, .58), rgba(36, 70, 112, .68));
}

.authCaptchaRefresh:disabled {
  opacity: .5;
  cursor: wait;
}

.authPrimaryButton,
.authSecondaryButton {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 48px;
  border-radius: 11px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .15px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.authPrimaryButton {
  border: 1px solid rgba(54, 219, 255, .9);
  background: linear-gradient(180deg, #16bdf5, #0968db);
  color: #fff;
  box-shadow:
    0 10px 28px rgba(0, 118, 255, .3),
    0 0 18px rgba(0, 190, 255, .22),
    inset 0 1px 0 rgba(255,255,255,.35);
}

.authPrimaryButton::before {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-125%) skewX(-24deg);
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.36), transparent);
  animation: authButtonSweep 4.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes authButtonSweep {
  0%, 55% { transform: translateX(-145%) skewX(-24deg); }
  80%, 100% { transform: translateX(285%) skewX(-24deg); }
}

.authPrimaryButton:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.authPrimaryButton:disabled {
  opacity: .48;
  cursor: not-allowed;
  box-shadow: none;
}

.authButtonIcon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
}

.authButtonIcon.left { left: 15px; }
.authButtonIcon.right { right: 15px; }

.authStatus {
  margin-top: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.authStatus:empty {
  display: none;
}

.authStatus.error {
  border-color: rgba(255, 115, 115, .24);
  background: rgba(145, 30, 44, .13);
}

.authStatus.success {
  border-color: rgba(78, 255, 148, .22);
  background: rgba(24, 120, 73, .13);
}

.authStatus .authSecondaryButton {
  height: 38px;
  margin-top: 9px;
  padding: 0 14px;
  border: 1px solid rgba(61, 183, 255, .55);
  background: rgba(16, 75, 132, .42);
  color: #dff6ff;
  font-size: 12px;
}

.authSwitch {
  margin-top: 19px;
  padding-top: 16px;
  border-top: 1px solid rgba(161, 184, 220, .16);
  text-align: center;
  color: rgba(204, 215, 233, .72);
  font-size: 12px;
}

.authResult {
  padding: 12px 4px 2px;
  text-align: center;
}

.authResultIcon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 17px;
  border-radius: 50%;
  border: 1px solid rgba(62, 215, 255, .55);
  background: radial-gradient(circle, rgba(28, 167, 235, .34), rgba(10, 50, 96, .2));
  color: #61dcff;
  font-size: 31px;
  box-shadow: 0 0 28px rgba(21, 175, 255, .28);
}

.authResult h3 {
  margin: 0 0 9px;
  font-size: 22px;
  color: #fff;
}

.authResult p {
  margin: 0 0 20px;
  color: rgba(213, 224, 242, .78);
  font-size: 13px;
  line-height: 1.55;
}

.authSpinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.38);
  border-top-color: #fff;
  animation: authSpin .75s linear infinite;
}

@keyframes authSpin { to { transform: rotate(360deg); } }

/* Standalone pages: email confirmation and password change */
.authStandalone {
  min-height: 100vh;
  position: relative;
  display: grid;
  place-items: center;
  padding: 150px 18px 40px;
  overflow: hidden;
}

.authStandalone::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 35%, rgba(16, 95, 178, .28), transparent 42%),
    linear-gradient(rgba(0, 5, 15, .68), rgba(0, 3, 10, .86)),
    url("assets/bg.jpg") center / cover no-repeat;
}

.authStandaloneLogo {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(470px, 78vw);
  filter: drop-shadow(0 0 18px rgba(255, 113, 30, .38));
}

.authStandaloneCard {
  --auth-angle: 0deg;
  width: min(470px, 100%);
  padding: 30px 34px 32px;
  border: 1px solid transparent;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(13, 27, 53, .985), rgba(4, 13, 31, .99)) padding-box,
    conic-gradient(from var(--auth-angle), #23c8ff, #2969ff, #ff993f, #2969ff, #23c8ff) border-box;
  box-shadow: 0 30px 90px rgba(0,0,0,.7), 0 0 42px rgba(0,126,255,.18);
  animation: authBorderOrbit 9s linear infinite, authCardIn .2s ease-out both;
  text-align: center;
}

.authStandaloneCard h1 {
  margin: 0 0 10px;
  font-size: 28px;
  color: #f5fbff;
  text-shadow: 0 0 16px rgba(72, 195, 255, .4);
}

.authStandaloneCard > p {
  margin: 0 0 20px;
  color: rgba(214, 225, 242, .78);
  font-size: 13px;
  line-height: 1.55;
}

.authStandaloneCard .authFormShell {
  text-align: left;
}

@media (max-width: 560px) {
  #authOverlay {
    padding: 10px;
    align-items: center;
  }

  #authOverlay .modal.modalAuthCard {
    padding: 20px 18px 22px;
    border-radius: 19px;
  }

  #authOverlay .modal.modalAuthCard .modalTitle {
    font-size: 25px;
  }

  #authOverlay .modal.modalAuthCard .modalClose {
    right: -4px;
  }

  .authCaptchaRow {
    grid-template-columns: minmax(0, 1fr) 82px;
  }

  .authStandalone {
    padding-top: 125px;
  }

  .authStandaloneCard {
    padding: 25px 19px 27px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #authOverlay .modal.modalAuthCard,
  .authStandaloneCard,
  .authPrimaryButton::before {
    animation: none;
  }
}
