/* Cosmic authentication surfaces */

body.cosmic-auth-body {
  min-height: 100vh;
  background: #050814;
  color: rgba(241, 238, 230, 0.9);
}

body.cosmic-auth-body .site-nav {
  background: rgba(5, 8, 20, 0.72);
  border-bottom-color: rgba(239, 199, 120, 0.18);
  backdrop-filter: blur(18px);
}

body.cosmic-auth-body .site-nav .nav-logo {
  color: #f2d18e;
}

body.cosmic-auth-body .site-nav .nav-links a,
body.cosmic-auth-body .site-nav .nav-btn {
  color: rgba(241, 238, 230, 0.68);
}

body.cosmic-auth-body .site-nav .nav-links a:hover,
body.cosmic-auth-body .site-nav .nav-btn:hover {
  color: #f6ddaa;
}

body.cosmic-auth-body .site-nav .nav-cta {
  border-radius: 2px;
  color: #f6ddaa;
}

.cosmic-auth-page {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(7.5rem, 13vh, 10rem) 1.5rem 4rem;
  background: #050814;
}

.cosmic-auth-backdrop,
.cosmic-auth-backdrop::after,
.cosmic-auth-canvas,
.cosmic-auth-3d,
.cosmic-auth-image {
  position: absolute;
  inset: 0;
}

.cosmic-auth-backdrop {
  z-index: -2;
  overflow: hidden;
  background: #050814;
}

.cosmic-auth-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 44%;
  opacity: 0.36;
  filter: saturate(0.82) contrast(1.06);
  transform: scale(1.06);
}

.cosmic-auth-backdrop::after {
  content: "";
  background:
    linear-gradient(90deg, rgba(3, 6, 16, 0.9), rgba(3, 6, 16, 0.44) 47%, rgba(3, 6, 16, 0.82)),
    linear-gradient(180deg, rgba(3, 6, 16, 0.44), rgba(3, 6, 16, 0.9));
}

.cosmic-auth-canvas {
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.16;
  mix-blend-mode: screen;
}

.cosmic-auth-3d {
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.84;
  pointer-events: none;
}

.cosmic-auth-backdrop::after {
  z-index: 1;
  pointer-events: none;
}

.cosmic-auth-page .auth-shell {
  position: relative;
  width: min(100%, 1080px);
  max-width: 1080px;
  margin: 0 auto;
}

.cosmic-auth-page .auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.82fr);
  gap: clamp(2.4rem, 7vw, 7rem);
  align-items: center;
}

.auth-identity {
  max-width: 31rem;
  padding: 1rem 0;
}

.auth-identity-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: #8fd5cf;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
}

.auth-identity-kicker::before {
  content: "";
  width: 2.6rem;
  height: 1px;
  background: #8fd5cf;
  box-shadow: 0 0 14px rgba(143, 213, 207, 0.66);
}

.auth-identity h1 {
  margin-top: 1.6rem;
  color: #f2eee6;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.18;
}

.auth-identity h1 span {
  color: #efc778;
}

.auth-identity-copy {
  max-width: 27rem;
  margin-top: 1.6rem;
  color: rgba(241, 238, 230, 0.66);
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  line-height: 2;
}

.auth-identity-rule {
  width: min(100%, 23rem);
  height: 1px;
  margin-top: 2.4rem;
  background: linear-gradient(90deg, rgba(239, 199, 120, 0.66), transparent);
}

.auth-identity-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.6rem;
  margin-top: 1rem;
  color: rgba(241, 238, 230, 0.44);
  font-family: "Cinzel", "Noto Sans SC", sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.14em;
}

.auth-form-column {
  width: 100%;
}

.cosmic-auth-page .auth-eyebrow {
  margin-bottom: 0.9rem;
  color: rgba(241, 238, 230, 0.48);
  font-family: "Cinzel", "Noto Sans SC", sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-align: left;
}

.cosmic-auth-page .auth-title-wrap {
  justify-content: flex-start;
  margin-bottom: 1.2rem;
}

.cosmic-auth-page .auth-title-wrap::before,
.cosmic-auth-page .auth-title-wrap::after {
  display: none;
}

.cosmic-auth-page .auth-title-wrap h1 {
  color: #f2eee6;
  font-size: clamp(1.45rem, 4vw, 2rem);
  letter-spacing: 0.1em;
}

.cosmic-auth-page .auth-card {
  border: 1px solid rgba(239, 199, 120, 0.26);
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(14, 21, 37, 0.88), rgba(8, 13, 25, 0.78));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: clamp(1.5rem, 4vw, 2.2rem);
}

.cosmic-auth-page .auth-card h2 {
  color: #f4eee1;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.cosmic-auth-page .auth-card .intro {
  color: rgba(241, 238, 230, 0.55);
  font-size: 0.78rem;
  line-height: 1.8;
}

.cosmic-auth-page .auth-field label {
  color: rgba(241, 238, 230, 0.55);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.cosmic-auth-page .field-optional {
  color: rgba(241, 238, 230, 0.36);
  font-size: 0.68em;
  letter-spacing: 0.03em;
  font-weight: 400;
}

.cosmic-auth-page .auth-field input,
.cosmic-auth-page .auth-field select {
  border-color: rgba(241, 238, 230, 0.16);
  border-radius: 1px;
  background: rgba(4, 8, 18, 0.56);
  color: #f1eee6;
  font-family: "Noto Sans SC", system-ui, sans-serif;
}

.cosmic-auth-page .auth-field input::placeholder {
  color: rgba(241, 238, 230, 0.28);
}

.cosmic-auth-page .auth-field input:focus,
.cosmic-auth-page .auth-field select:focus {
  border-color: rgba(239, 199, 120, 0.7);
  box-shadow: 0 0 0 3px rgba(239, 199, 120, 0.08);
}

.cosmic-auth-page .auth-field .hint {
  color: rgba(241, 238, 230, 0.38);
}

.cosmic-auth-page .auth-message {
  color: rgba(241, 238, 230, 0.7);
}

.cosmic-auth-page .auth-message.error {
  color: #f29a9a;
}

.cosmic-auth-page .auth-message.success {
  color: #8fd5cf;
}

.cosmic-auth-page .auth-submit {
  border-color: rgba(239, 199, 120, 0.66);
  border-radius: 1px;
  background: rgba(239, 199, 120, 0.12);
  color: #f6ddaa;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0.12em;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.cosmic-auth-page .auth-submit:hover:not(:disabled) {
  border-color: #efc778;
  background: rgba(239, 199, 120, 0.21);
  transform: translateY(-1px);
}

.cosmic-auth-page .auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
}

.cosmic-auth-page .auth-code-row button {
  min-width: 7.8rem;
  border: 1px solid rgba(255, 224, 161, 0.58);
  border-radius: 8px;
  background: rgba(255, 218, 143, 0.1);
  color: #ffe4ac;
  cursor: pointer;
  font: 500 0.7rem "Noto Sans SC", system-ui, sans-serif;
  padding: 0 0.85rem;
}

.cosmic-auth-page .auth-code-row button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.cosmic-auth-page .auth-switch,
.cosmic-auth-page .auth-back {
  color: rgba(241, 238, 230, 0.48);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 0.75rem;
}

.cosmic-auth-page .auth-switch a,
.cosmic-auth-page .auth-back a {
  color: #efc778;
}

.cosmic-auth-page .auth-footer-note {
  margin-top: 1.6rem;
  color: rgba(241, 238, 230, 0.34);
  font-family: "Cinzel", "Noto Sans SC", sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
}

@media (max-width: 820px) {
  .cosmic-auth-page {
    padding-top: 6.8rem;
  }

  .cosmic-auth-page .auth-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .auth-identity {
    max-width: 38rem;
    padding: 0;
  }

  .auth-identity h1 {
    margin-top: 1rem;
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .auth-identity-copy,
  .auth-identity-rule,
  .auth-identity-meta {
    display: none;
  }

  .cosmic-auth-page .auth-title-wrap {
    margin-bottom: 0.85rem;
  }
}

@media (max-width: 560px) {
  body.cosmic-auth-body .site-nav {
    padding: 0.9rem 1rem;
  }

  body.cosmic-auth-body .site-nav .nav-logo {
    font-size: 0.76rem;
    letter-spacing: 0.16em;
  }

  body.cosmic-auth-body .site-nav .nav-links {
    gap: 0.65rem;
  }

  body.cosmic-auth-body .site-nav .nav-links li:nth-child(2),
  body.cosmic-auth-body .site-nav .nav-links li:nth-child(3) {
    display: none;
  }

  body.cosmic-auth-body .site-nav .nav-cta {
    padding: 0.45rem 0.65rem;
  }

  .cosmic-auth-page {
    padding: 6.2rem 1rem 2.5rem;
  }

  .cosmic-auth-page .auth-card {
    padding: 1.3rem 1.1rem 1.2rem;
  }

  .cosmic-auth-page .auth-title-wrap h1 {
    font-size: 1.3rem;
  }

  .cosmic-auth-page .auth-code-row {
    grid-template-columns: 1fr;
  }

  .cosmic-auth-page .auth-code-row button {
    min-height: 2.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-auth-image {
    transform: none;
  }

  .cosmic-auth-3d {
    opacity: 0.54;
  }
}

/* One continuous deep-space field replaces the old abstract constellation object. */
.cosmic-auth-deep-space {
  position: absolute;
  /* Keep the WebGL field above the readability wash so its motion remains visible. */
  z-index: 3;
  inset: 0;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.cosmic-auth-deep-space .xillion-deep-space-canvas,
.cosmic-auth-deep-space .xillion-deep-space-fallback-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.cosmic-auth-image {
  z-index: 0;
  opacity: 0.74;
  filter: saturate(0.64) contrast(1.06) brightness(0.66);
}

.cosmic-auth-backdrop::after {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(2, 5, 14, 0.7), rgba(2, 5, 14, 0.22) 49%, rgba(2, 5, 14, 0.64)),
    linear-gradient(180deg, rgba(2, 5, 14, 0.22), rgba(2, 5, 14, 0.72));
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-auth-deep-space {
    background: #050814;
  }
}

.cosmic-auth-page .cosmic-auth-backdrop {
  z-index: 0;
}

.cosmic-auth-page .auth-shell {
  /* The form stays in front of the animated field while the field remains visible around it. */
  z-index: 4;
}

/* Bright rotating-galaxy treatment shared by login and registration. */
body.cosmic-auth-body {
  background: #102d76;
}

body.cosmic-auth-body .site-nav {
  background: linear-gradient(180deg, rgba(8, 20, 65, 0.8), rgba(13, 31, 83, 0.56));
  border-bottom-color: rgba(205, 229, 255, 0.24);
  box-shadow: 0 0.8rem 3rem rgba(18, 38, 112, 0.2);
  backdrop-filter: blur(20px) saturate(1.3);
}

body.cosmic-auth-body .site-nav .nav-logo {
  color: #fff0c9;
  text-shadow: 0 0 1rem rgba(255, 217, 143, 0.25);
}

body.cosmic-auth-body .site-nav .nav-links a,
body.cosmic-auth-body .site-nav .nav-btn {
  color: rgba(237, 247, 255, 0.82);
}

.cosmic-auth-page {
  background:
    radial-gradient(circle at 72% 27%, rgba(181, 143, 255, 0.48), transparent 34%),
    radial-gradient(circle at 24% 72%, rgba(49, 191, 239, 0.36), transparent 42%),
    linear-gradient(145deg, #102d74, #356fc4 48%, #7956c6);
}

.cosmic-auth-backdrop {
  background: #153b8b;
}

.cosmic-auth-backdrop::before {
  position: absolute;
  z-index: 1;
  inset: -18%;
  content: "";
  background:
    radial-gradient(ellipse at 76% 28%, rgba(255, 251, 242, 0.24), transparent 17%),
    radial-gradient(ellipse at 40% 58%, rgba(100, 222, 255, 0.18), transparent 32%),
    radial-gradient(ellipse at 84% 74%, rgba(214, 137, 255, 0.2), transparent 35%);
  mix-blend-mode: screen;
  filter: blur(24px);
  pointer-events: none;
  animation: authAuroraFloat 8s ease-in-out infinite alternate;
}

.cosmic-auth-image {
  opacity: 0.9;
  object-position: 55% 46%;
  filter: saturate(1.12) contrast(1.03) brightness(1.02);
  transform: scale(1.08);
  animation: authGalaxyDrift 12s ease-in-out infinite alternate;
}

.cosmic-auth-backdrop::after {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(5, 21, 70, 0.68) 0%, rgba(8, 31, 88, 0.3) 42%, rgba(35, 35, 111, 0.14) 68%, rgba(34, 23, 96, 0.34) 100%),
    linear-gradient(180deg, rgba(8, 24, 73, 0.12), rgba(6, 17, 61, 0.56));
}

.cosmic-auth-deep-space {
  filter: saturate(1.32) brightness(1.2);
}

.auth-identity-kicker {
  color: rgba(207, 247, 255, 0.94);
  text-shadow: 0 0 1.25rem rgba(92, 220, 255, 0.52);
}

.auth-identity-kicker::before {
  background: #a5ecff;
  box-shadow: 0 0 1rem rgba(117, 225, 255, 0.8);
}

.auth-identity h1 {
  color: #fff;
  text-shadow: 0 0 2.3rem rgba(120, 209, 255, 0.28), 0 1rem 3.5rem rgba(21, 33, 107, 0.34);
}

.auth-identity h1 span {
  color: #ffe2a8;
  text-shadow: 0 0 1.8rem rgba(255, 207, 119, 0.28);
}

.auth-identity-copy {
  color: rgba(244, 249, 255, 0.88);
  text-shadow: 0 0.3rem 1.4rem rgba(10, 31, 91, 0.5);
}

.auth-identity-rule {
  background: linear-gradient(90deg, rgba(255, 223, 158, 0.86), rgba(126, 223, 255, 0.36), transparent);
}

.auth-identity-meta,
.cosmic-auth-page .auth-eyebrow {
  color: rgba(229, 244, 255, 0.68);
}

.cosmic-auth-page .auth-title-wrap h1 {
  color: #fff;
  text-shadow: 0 0 1.8rem rgba(123, 215, 255, 0.3);
}

.cosmic-auth-page .auth-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(220, 239, 255, 0.48);
  background: linear-gradient(145deg, rgba(19, 49, 122, 0.72), rgba(54, 39, 116, 0.58));
  box-shadow:
    0 2.2rem 6.5rem rgba(24, 33, 105, 0.34),
    0 0 3.5rem rgba(87, 196, 255, 0.1),
    inset 0 1px rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(1.28);
}

.cosmic-auth-page .auth-card::after {
  position: absolute;
  top: 0;
  left: -32%;
  width: 28%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
  box-shadow: 0 0 1.3rem rgba(119, 218, 255, 0.78);
  pointer-events: none;
  animation: authCardScan 5.4s ease-in-out infinite;
}

.cosmic-auth-page .auth-card h2 {
  color: #fff;
}

.cosmic-auth-page .auth-card .intro,
.cosmic-auth-page .auth-field label,
.cosmic-auth-page .auth-switch,
.cosmic-auth-page .auth-back,
.cosmic-auth-page .auth-field .hint {
  color: rgba(236, 245, 255, 0.76);
}

.cosmic-auth-page .auth-field input,
.cosmic-auth-page .auth-field select {
  border-color: rgba(224, 239, 255, 0.34);
  background: rgba(11, 31, 91, 0.42);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07);
}

.cosmic-auth-page .auth-field input::placeholder {
  color: rgba(230, 242, 255, 0.48);
}

.cosmic-auth-page .auth-field input:-webkit-autofill,
.cosmic-auth-page .auth-field input:-webkit-autofill:hover,
.cosmic-auth-page .auth-field input:-webkit-autofill:focus {
  border-color: rgba(224, 239, 255, 0.34);
  -webkit-text-fill-color: #fff;
  box-shadow: 0 0 0 1000px #193777 inset, inset 0 1px rgba(255, 255, 255, 0.07);
  caret-color: #fff;
  transition: background-color 9999s ease-out 0s;
}

.cosmic-auth-page .auth-field input:focus,
.cosmic-auth-page .auth-field select:focus {
  border-color: rgba(150, 227, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(105, 213, 255, 0.14), 0 0 1.5rem rgba(105, 213, 255, 0.12);
}

.cosmic-auth-page .auth-submit {
  border-color: rgba(255, 221, 157, 0.9);
  background: linear-gradient(90deg, rgba(255, 215, 137, 0.18), rgba(119, 214, 255, 0.12));
  color: #fff0c5;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.cosmic-auth-page .auth-submit:hover:not(:disabled) {
  border-color: #ffe0a0;
  background: linear-gradient(90deg, rgba(255, 215, 137, 0.3), rgba(119, 214, 255, 0.2));
  box-shadow: 0 0 1.8rem rgba(255, 210, 126, 0.13);
}

.cosmic-auth-page .auth-switch a,
.cosmic-auth-page .auth-back a {
  color: #ffe0a1;
}

@keyframes authGalaxyDrift {
  from { transform: scale(1.08) translate3d(-1.8%, -1%, 0); }
  to { transform: scale(1.18) translate3d(2.2%, 1.3%, 0); }
}

@keyframes authAuroraFloat {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) scale(1.07); }
}

@keyframes authCardScan {
  0%, 16% { left: -32%; opacity: 0; }
  34%, 66% { opacity: 1; }
  86%, 100% { left: 108%; opacity: 0; }
}

@media (max-width: 820px) {
  .cosmic-auth-image {
    object-position: 62% 38%;
    opacity: 0.88;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cosmic-auth-image,
  .cosmic-auth-backdrop::before,
  .cosmic-auth-page .auth-card::after {
    animation: none;
  }
}
