:root {
  color-scheme: dark;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: #f7f5fc;
  background: #080f20;
  font-synthesis: none;
  --lavender: #b9adff;
  --muted: #abb0c4;
  --gold: #d6a568;
  --input-surface: #1b2235;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #05091708 55%, #05091770), url("observatory.webp") center / cover no-repeat;
  pointer-events: none;
}
.observatory-atmosphere { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.night-wisp {
  position: absolute; width: 62vw; height: 24vh; border-radius: 50%; opacity: .28;
  background: radial-gradient(ellipse, #acb0e53b, #8f8dcb12 42%, transparent 70%);
  filter: blur(28px); animation: wisp-drift 34s ease-in-out infinite alternate;
}
.wisp-one { left: -20%; bottom: 6%; transform: rotate(-12deg); }
.wisp-two { right: -22%; top: 12%; opacity: .2; animation-duration: 43s; animation-delay: -19s; }
.wisp-three { left: 15%; bottom: -12%; width: 80vw; opacity: .24; animation-duration: 39s; animation-delay: -12s; }
.floating-sparks { position: absolute; inset: 0; }
.floating-sparks i {
  position: absolute; left: var(--spark-x, 10%); bottom: -20px; width: 3px; height: 3px;
  border-radius: 50%; background: #ffe3ad; opacity: 0;
  box-shadow: 0 0 7px 2px #edb66b66, 0 0 18px 4px #d9ac4926;
  animation: spark-rise var(--spark-time, 24s) linear infinite;
  animation-delay: var(--spark-delay, -6s);
}
.floating-sparks i:nth-child(2) { --spark-x: 19%; --spark-time: 29s; --spark-delay: -21s; }
.floating-sparks i:nth-child(3) { --spark-x: 29%; --spark-time: 32s; --spark-delay: -9s; width: 2px; height: 2px; }
.floating-sparks i:nth-child(4) { --spark-x: 38%; --spark-time: 26s; --spark-delay: -17s; }
.floating-sparks i:nth-child(5) { --spark-x: 48%; --spark-time: 35s; --spark-delay: -28s; width: 2px; height: 2px; }
.floating-sparks i:nth-child(6) { --spark-x: 57%; --spark-time: 28s; --spark-delay: -12s; }
.floating-sparks i:nth-child(7) { --spark-x: 66%; --spark-time: 31s; --spark-delay: -24s; }
.floating-sparks i:nth-child(8) { --spark-x: 75%; --spark-time: 25s; --spark-delay: -4s; width: 2px; height: 2px; }
.floating-sparks i:nth-child(9) { --spark-x: 84%; --spark-time: 34s; --spark-delay: -18s; }
.floating-sparks i:nth-child(10) { --spark-x: 93%; --spark-time: 27s; --spark-delay: -8s; }
.floating-sparks i:nth-child(11) { --spark-x: 4%; --spark-time: 30s; --spark-delay: -23s; width: 2px; height: 2px; }
.floating-sparks i:nth-child(12) { --spark-x: 53%; --spark-time: 33s; --spark-delay: -3s; width: 2px; height: 2px; }
@keyframes spark-rise {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: .65; }
  48% { transform: translate3d(24px, -48vh, 0); opacity: .35; }
  75% { opacity: .6; }
  100% { transform: translate3d(-12px, -105vh, 0); opacity: 0; }
}
@keyframes wisp-drift {
  from { transform: translate3d(-3%, 4%, 0) rotate(-8deg) scale(1); }
  to { transform: translate3d(9%, -12%, 0) rotate(4deg) scale(1.12); }
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #d5cbff; outline-offset: 5px; }
.back-link { position: absolute; top: 28px; left: 40px; z-index: 1; display: inline-flex; gap: 12px; align-items: center; min-height: 44px; color: #bdc2d2; font-size: 16px; }
.back-link:hover { color: white; }
.back-link span { font-size: 24px; }
.portal { min-height: 100svh; display: flex; flex-direction: column; align-items: center; padding: 52px 24px 26px; }
.portal-brand { text-align: center; margin-bottom: 30px; }
.portal-brand img { width: 280px; height: 88px; object-fit: contain; filter: brightness(0) invert(1); }
.portal-tagline { margin: 12px 0 0; color: #d5ab89; font: 400 32px/1.25 var(--font-display); text-shadow: 0 2px 14px #080e20; }
.tagline-divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 15px auto 12px; color: var(--gold); }
.tagline-divider svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.tagline-divider span { width: 58px; height: 1px; background: linear-gradient(90deg, transparent, #d6a568a6); }
.tagline-divider span:last-child { transform: rotate(180deg); }
.portal-subtagline { margin: 0; color: #e1d6d1; font: 400 20px/1.4 var(--font-display); text-shadow: 0 2px 14px #080e20; }
.login-card {
  width: 100%; max-width: 508px; padding: 40px;
  border: 1px solid var(--gold); border-radius: 24px;
  background: linear-gradient(145deg, #101526f7, #0d1526f5);
  box-shadow: 0 20px 64px #02061580, 0 0 0 1px #dfa55814, inset 0 1px 0 #ffdfb222;
}
.card-heading { margin-bottom: 28px; }
h1 { margin: 0 0 8px; font: 400 52px/1.12 var(--font-display); letter-spacing: -.025em; }
.card-heading p { color: var(--muted); font-size: 20px; line-height: 1.5; margin: 0; }
.field + .field { margin-top: 18px; }
label { display: block; margin-bottom: 8px; font-size: 16px; line-height: 1.4; font-weight: 500; }
input {
  display: block; width: 100%; min-width: 0; height: 50px; border: 1px solid #666d83; border-radius: 10px;
  color: #f7f5fc; background: var(--input-surface); padding: 12px 15px; font-size: 17px;
  box-shadow: inset 0 1px 3px #02061530; transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #a1a5ba; opacity: 1; }
input:focus { outline: 2px solid var(--lavender); outline-offset: 2px; border-color: var(--lavender); }
/* Browsers paint saved credentials separately from the normal input background.
   Cover that fill while retaining the focus ring and readable text/caret. */
input:autofill {
  transition: none;
  box-shadow: inset 0 0 0 1000px var(--input-surface);
  -webkit-text-fill-color: #f7f5fc;
  caret-color: #f7f5fc;
}
input:-webkit-autofill {
  transition: none;
  -webkit-box-shadow: inset 0 0 0 1000px var(--input-surface);
  box-shadow: inset 0 0 0 1000px var(--input-surface);
  -webkit-text-fill-color: #f7f5fc;
  caret-color: #f7f5fc;
}
.password-field { position: relative; }
.password-field input { padding-right: 54px; }
.password-toggle { position: absolute; right: 3px; top: 3px; width: 44px; height: 44px; display: grid; place-items: center; color: #f7f5fc; background: transparent; border: 0; border-radius: 7px; }
.password-toggle:hover { background: #b9adff16; }
.password-toggle svg { width: 24px; height: 24px; }
.eye-slash { display: none; }
.password-toggle[aria-pressed="true"] .eye-slash { display: block; }
.text-link { display: inline; border: 0; padding: 0; background: transparent; color: var(--lavender); font-size: inherit; line-height: inherit; text-align: inherit; }
.text-link:hover:not(:disabled) { color: #d6cdff; text-decoration: underline; text-underline-offset: 4px; }
.forgot-link { display: block; margin: 5px 0 0 auto; min-height: 40px; font-size: 16px; }
.sign-in-button { display: flex; justify-content: center; align-items: center; gap: 13px; width: 100%; min-height: 56px; margin-top: 21px; padding: 12px 16px; border: 1px solid #d0c4ff50; border-radius: 10px; background: linear-gradient(110deg, #b2a1fc, #aca0f8); color: #101225; font-size: 19px; font-weight: 600; box-shadow: 0 4px 22px #8b75f51a; transition: background .15s, box-shadow .15s; }
.sign-in-button span { font-size: 27px; line-height: 1; font-weight: 400; }
.sign-in-button:hover { background: #c3b6ff; box-shadow: 0 4px 26px #8b75f538; }
.sign-in-button:active { background: #a899ed; }
.divider { display: flex; align-items: center; gap: 20px; margin: 24px 0; color: var(--muted); font-size: 16px; }
.divider::before, .divider::after { content: ""; height: 1px; background: #353d50; flex: 1; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; min-height: 54px; border: 1px solid #666d83; border-radius: 10px; padding: 12px; background: #080e1a30; font-size: 18px; font-weight: 500; }
.google-button svg { width: 25px; height: 25px; flex-shrink: 0; }
.google-button:hover:not(:disabled) { border-color: var(--lavender); background: #b9adff0b; }
button:disabled { cursor: not-allowed; color: #aeb2c5; }
.google-button:disabled { border-color: #454d63; }
.google-button:disabled svg { opacity: .55; }
.coming-soon { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.5; }
.signup-prompt { margin: 22px 0 -4px; color: var(--muted); font-size: 16px; line-height: 1.75; text-align: center; }
.signup-prompt button { min-height: 44px; }
.preview-feedback { margin: 16px 0 0; padding: 12px; border: 1px solid #665c8b; border-radius: 8px; color: #d8cff6; background: #b9adff0a; font-size: 14px; line-height: 1.6; }
.portal-footer { margin-top: auto; padding-top: 42px; text-align: center; color: #b4b9cc; font-size: 14px; line-height: 1.6; text-shadow: 0 1px 6px #030916; }
.portal-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.portal-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.portal-footer a:hover { color: white; text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 1000px) {
  .portal {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 508px);
    grid-template-rows: 1fr auto; column-gap: clamp(40px, 5vw, 80px); row-gap: 24px;
    width: 100%; max-width: 1320px; margin-inline: auto; padding: 96px 48px 24px;
  }
  .portal-brand { margin-bottom: 0; text-align: left; }
  .portal-brand img { width: 300px; height: 94px; }
  .portal-tagline { max-width: 540px; margin-top: 32px; font-size: clamp(46px, 4.5vw, 68px); line-height: 1.08; text-wrap: balance; }
  .tagline-divider { justify-content: flex-start; gap: 16px; margin: 26px 0 20px; }
  .tagline-divider svg { width: 24px; height: 24px; }
  .tagline-divider span:first-child { display: none; }
  .tagline-divider span:last-child { width: 132px; }
  .portal-subtagline { font-size: clamp(23px, 2.1vw, 30px); text-wrap: balance; }
  .portal-footer { grid-column: 2; margin-top: 0; padding-top: 0; }
}
@media (max-width: 680px) {
  .back-link { top: 12px; left: 20px; font-size: 14px; }
  .portal { padding: 74px 18px 22px; }
  .portal-brand { margin-bottom: 24px; }
  .floating-sparks i:nth-child(n+7) { display: none; }
  .portal-brand img { width: 224px; height: 70px; }
  .portal-tagline { font-size: clamp(22px, 5.8vw, 28px); margin-top: 10px; }
  .portal-subtagline { font-size: 18px; }
  .tagline-divider { margin-block: 12px 10px; }
  .login-card { padding: 28px 24px; border-radius: 20px; background: #101626f5; }
  h1 { font-size: 42px; }
  .card-heading { margin-bottom: 24px; }
  .card-heading p { font-size: 17px; }
  .portal-footer { padding-top: 28px; }
  body::before { background-position: 58% center; }
}
@media (max-width: 360px) {
  .portal { padding-inline: 12px; }
  .login-card { padding: 26px 20px; }
  .google-button { font-size: 16px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .night-wisp, .floating-sparks i { animation: none; }
  .floating-sparks { display: none; }
}

[hidden] { display: none !important; }
.preview-notice { color: #d5ab89; font-size: 13px; line-height: 1.5; margin: 0 0 20px; }
.back-to-sign-in { margin-top: 20px; min-height: 44px; }
.password-guidance { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.setup-secret { display: block; margin: 16px 0; padding: 12px; border: 1px solid #666d83; border-radius: 10px; overflow-wrap: anywhere; user-select: all; font-size: 18px; letter-spacing: .06em; }
.sign-in-button:disabled { background: #7d73b0; color: #101225; }
