:root {
  --auth-bg: #020617;
  --auth-bg-mid: #0f172a;
  --auth-bg-soft: #111827;
  --auth-card: rgba(10, 15, 28, 0.72);
  --auth-card-strong: rgba(15, 23, 42, 0.88);
  --auth-line: rgba(255, 255, 255, 0.14);
  --auth-text: #f8fafc;
  --auth-muted: #9ca3af;
  --auth-orange: #f26d35;
  --auth-blue: #4f8cff;
  --auth-green: #42d392;
  --auth-red: #ff6b6b;
  --auth-font: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-body,
.auth-body button,
.auth-body input,
.auth-body textarea,
.auth-body select,
.bl-auth-nav,
.bl-auth-nav button,
.bl-auth-nav a {
  font-family: var(--auth-font);
}

.auth-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 14%, rgba(79, 140, 255, 0.22), transparent 28%),
    radial-gradient(circle at 78% 10%, rgba(242, 109, 53, 0.18), transparent 24%),
    linear-gradient(135deg, var(--auth-bg), var(--auth-bg-mid) 50%, var(--auth-bg-soft));
}

/* Ambient auth page atmosphere. */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.auth-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 92px 92px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.88), transparent 78%);
}

.auth-glow,
.auth-streak {
  position: absolute;
  display: block;
}

.auth-glow {
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(28px);
  opacity: 0.42;
  animation: authFloat 12s ease-in-out infinite;
}

.auth-glow-one {
  top: 9%;
  left: -90px;
  background: rgba(79, 140, 255, 0.35);
}

.auth-glow-two {
  right: -100px;
  bottom: 8%;
  background: rgba(242, 109, 53, 0.28);
  animation-delay: -4s;
}

.auth-glow-three {
  top: 42%;
  left: 50%;
  width: 240px;
  height: 240px;
  background: rgba(66, 211, 146, 0.16);
  animation-delay: -7s;
}

.auth-streak {
  width: 220px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: rotate(-18deg);
  animation: authStreak 7s linear infinite;
}

.auth-streak-one {
  top: 24%;
  left: -240px;
}

.auth-streak-two {
  top: 70%;
  left: -260px;
  animation-delay: -3s;
}

/* Premium split auth layout. */
.auth-shell {
  position: relative;
  min-height: 100vh;
}

.auth-site-header {
  background: rgba(244, 240, 232, 0.9);
}

.auth-main {
  display: grid;
  grid-template-columns: minmax(0, min(460px, calc(100vw - 32px)));
  width: 100%;
  margin-left: calc(50% - 50vw);
  place-content: center;
  place-items: center;
  min-height: calc(100vh - 82px);
  padding: clamp(18px, 3vw, 36px) 0;
}

/* Shared login/signup panel. */
.auth-panel {
  position: relative;
  isolation: isolate;
  padding: 14px;
  border: 1px solid var(--auth-line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    var(--auth-card);
  box-shadow: 0 26px 86px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(28px);
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 27px;
  background: linear-gradient(135deg, rgba(242, 109, 53, 0.18), transparent 38%, rgba(79, 140, 255, 0.16));
  opacity: 0.8;
}

.auth-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.52);
}

.auth-switch-button {
  position: relative;
  z-index: 2;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(248, 250, 252, 0.64);
  cursor: pointer;
  font-weight: 800;
}

.auth-switch-button.is-active {
  color: #fff;
}

.auth-switch-indicator {
  position: absolute;
  top: 5px;
  left: 5px;
  width: calc(50% - 5px);
  height: calc(100% - 10px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--auth-orange), #ff9a62);
  box-shadow: 0 12px 34px rgba(242, 109, 53, 0.35);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-panel.is-signup .auth-switch-indicator {
  transform: translateX(100%);
}

.auth-form-stage {
  position: relative;
  margin-top: 20px;
  transition: height 260ms ease;
}

.premium-auth-form {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.985);
  transition: opacity 260ms ease, transform 260ms ease;
}

.premium-auth-form.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.auth-form-heading h2 {
  margin: 2px 0 6px;
  color: #fff;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
  letter-spacing: 0;
}

.auth-form-heading p {
  margin: 0;
  color: var(--auth-muted);
  font-size: 0.86rem;
}

/* Floating-label form controls and validation states. */
.floating-field {
  position: relative;
}

.floating-field input {
  width: 100%;
  min-height: 50px;
  padding: 18px 48px 7px 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.44);
  color: #fff;
  outline: 0;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

.floating-field label {
  position: absolute;
  top: 15px;
  left: 44px;
  color: rgba(248, 250, 252, 0.54);
  font-size: 0.88rem;
  pointer-events: none;
  transition: transform 180ms ease, color 180ms ease, font-size 180ms ease;
}

.floating-field input:focus,
.floating-field input:not(:placeholder-shown) {
  background: rgba(2, 6, 23, 0.68);
}

.floating-field input:focus {
  border-color: rgba(242, 109, 53, 0.62);
  box-shadow: 0 0 0 4px rgba(242, 109, 53, 0.12), 0 14px 38px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.72rem;
  transform: translateY(-12px);
}

.field-icon {
  position: absolute;
  top: 16px;
  left: 15px;
  z-index: 2;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: rgba(242, 109, 53, 0.92);
  font-size: 0.75rem;
  font-weight: 900;
}

.eye-toggle {
  position: absolute;
  top: 8px;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 250, 252, 0.78);
  cursor: pointer;
  transition: transform 180ms ease, color 180ms ease, background 180ms ease;
}

.eye-toggle:hover,
.eye-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.04);
}

.eye-toggle span::before {
  content: "";
  display: block;
  width: 17px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 999px / 70%;
}

.eye-toggle span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, transform 180ms ease;
}

.eye-toggle.is-visible span::after {
  width: 19px;
  height: 2px;
  transform: translate(-50%, -50%) rotate(-35deg);
}

.auth-field-error {
  min-height: 0;
  margin: 5px 4px 0;
  color: #ff9a9a;
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-field-error:empty {
  display: none;
}

.floating-field.is-invalid input {
  border-color: rgba(255, 107, 107, 0.82);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.11);
}

.premium-auth-form.is-shaking {
  animation: authShake 360ms ease;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.86rem;
  font-weight: 700;
}

.auth-row a,
.remember-option {
  color: rgba(248, 250, 252, 0.72);
}

.auth-row a:hover {
  color: var(--auth-orange);
}

.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.remember-option input {
  accent-color: var(--auth-orange);
}

.auth-submit {
  min-height: 46px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.auth-submit {
  position: relative;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 26%),
    linear-gradient(135deg, var(--auth-orange), #ff8d55);
  color: #fff;
  box-shadow: 0 18px 44px rgba(242, 109, 53, 0.28);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-110%);
  transition: transform 420ms ease;
}

.auth-submit:hover::before,
.auth-submit:focus-visible::before {
  transform: translateX(110%);
}

.auth-submit:hover,
.auth-submit:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 24px 58px rgba(242, 109, 53, 0.36);
}

.auth-submit.is-loading {
  pointer-events: none;
  opacity: 0.82;
}

.submit-loader {
  position: absolute;
  top: 50%;
  right: 20px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 999px;
  opacity: 0;
  animation: authSpin 720ms linear infinite;
}

.auth-submit.is-loading .submit-loader {
  opacity: 1;
}

/* Password feedback. */
.password-meter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  color: rgba(248, 250, 252, 0.7);
  font-size: 0.82rem;
}

.password-meter-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.password-meter-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: var(--auth-red);
  transition: width 240ms ease, background 240ms ease;
}

.password-rule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin: -3px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(248, 250, 252, 0.52);
  font-size: 0.78rem;
}

.password-rule-list li::before {
  content: "x";
  margin-right: 7px;
  color: var(--auth-red);
  font-weight: 900;
}

.password-rule-list li.is-met {
  color: rgba(248, 250, 252, 0.86);
}

.password-rule-list li.is-met::before {
  content: "ok";
  color: var(--auth-green);
}

/* Toast, success checkmark, and navbar profile integration. */
.auth-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  width: min(390px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.86);
  color: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 200ms ease, transform 200ms ease;
  backdrop-filter: blur(22px);
  font-family: var(--auth-font);
  font-weight: 800;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.auth-toast.is-error {
  border-color: rgba(255, 107, 107, 0.34);
  color: #ffd1d1;
}

.success-check {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
}

.success-check span {
  position: relative;
  width: 94px;
  height: 94px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--auth-green), #b8f7d2);
  box-shadow: 0 22px 70px rgba(66, 211, 146, 0.38);
  transform: scale(0.7);
}

.success-check span::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 25px;
  width: 38px;
  height: 20px;
  border-left: 5px solid #052e1a;
  border-bottom: 5px solid #052e1a;
  transform: rotate(-45deg);
}

.success-check.is-visible {
  opacity: 1;
  animation: successFade 820ms ease forwards;
}

.success-check.is-visible span {
  animation: successPop 620ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.bl-auth-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.bl-auth-avatar {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(242, 109, 53, 0.35);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(242, 109, 53, 0.96), rgba(79, 140, 255, 0.82)),
    #111827;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(21, 24, 32, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.bl-auth-avatar:hover,
.bl-auth-avatar:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(21, 24, 32, 0.24);
}

.bl-auth-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 70;
  width: 240px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.88);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(24px);
}

.bl-auth-nav.is-open .bl-auth-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.bl-auth-user {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  color: #fff;
}

.bl-auth-user span:first-child {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  background: rgba(242, 109, 53, 0.18);
  color: #ffd7c8;
  font-weight: 900;
}

.bl-auth-user strong,
.bl-auth-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bl-auth-user strong {
  font-size: 0.94rem;
}

.bl-auth-user small {
  color: rgba(248, 250, 252, 0.58);
  font-size: 0.78rem;
}

.bl-auth-menu a,
.bl-auth-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(248, 250, 252, 0.78);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.bl-auth-menu a:hover,
.bl-auth-menu button:hover,
.bl-auth-menu a:focus-visible,
.bl-auth-menu button:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: translateX(2px);
}

.bl-auth-menu hr {
  height: 1px;
  margin: 8px 0;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes authFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -18px, 0) scale(1.05);
  }
}

@keyframes authStreak {
  to {
    transform: translateX(calc(100vw + 520px)) rotate(-18deg);
  }
}

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

@keyframes authShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(7px);
  }
  75% {
    transform: translateX(-4px);
  }
}

@keyframes successPop {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes successFade {
  0%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (max-width: 920px) {
  .auth-main {
    grid-template-columns: minmax(0, min(460px, calc(100vw - 32px)));
    place-content: center;
    place-items: center;
  }

}

@media (max-width: 640px) {
  .auth-body .page-shell {
    width: min(100% - 24px, 1180px);
  }

  .auth-main {
    padding: 18px 0 32px;
  }

  .auth-panel {
    padding: 12px;
    border-radius: 20px;
  }

  .password-rule-list {
    grid-template-columns: 1fr;
  }

  .auth-row {
    align-items: center;
    flex-direction: row;
    font-size: 0.8rem;
  }

  .bl-auth-menu {
    right: -4px;
    width: min(240px, calc(100vw - 34px));
  }
}
