/* Shared sign-in, signup and password reset surfaces. SVG artwork is decorative. */
.login-shell {
  --ink: #0F1A2E;
  --ink-2: #526074;
  --accent: #3D52E0;
  --accent-ink: #0F1A2E;
  --line: #E3E5E9;
  --surface: #fff;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px 44px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  position: relative;
  isolation: isolate;
  background: #F7F5EF;
}

.login-shell .login-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat;
  filter: blur(9px);
  opacity: .65;
}
.login-shell .login-backdrop--spacebar {
  background-image: url("login-spacebar.svg");
  background-size: 1100px auto;
  background-size: min(1200px, 130vw) auto;
  background-position: right -220px bottom -60px;
}
.login-shell .login-backdrop--orbit { filter: none; }
.login-shell .login-orbit-art {
  position: absolute; left: -200px; top: 50%; transform: translateY(-50%);
  width: 1000px; height: 1000px;
  width: min(1100px, 140vw); height: min(1100px, 140vw);
}
.login-shell .login-orbit-system { position: relative; width: 100%; height: 100%; transform-origin: 46% 48%; }
.login-shell .login-blue-plane { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform-origin: 46% 48%; }
.login-shell .login-orbit-art svg { display: block; width: 100%; height: 100%; opacity: .8; }
.login-shell .login-orange-plane { position: absolute; top: 0; left: 0; }
.login-shell .orbit-line { filter: blur(5px); }
.login-shell .orbit-turn, .login-shell .orbit-counter { transform-origin: 0 0; transform-box: view-box; }
.login-shell .login-footerbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.login-shell .login-wordmark { margin-left: auto; }
.login-shell .login-motion-toggle { min-height: 44px; padding: 9px 13px; border: 1px solid #8C95A3; border-radius: 8px; background: #F7F5EF; color: #526074; font: 13px/1.4 var(--sans); cursor: pointer; }
.login-shell .login-motion-toggle:hover { background: #fff; color: #0F1A2E; }
.login-shell .login-motion-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-shell .login-motion-toggle[hidden] { display: none !important; }
.login-shell .login-backdrop--caret {
  background-image: url("login-caret.svg");
  background-size: 1100px auto;
  background-size: min(1200px, 140vw) auto;
  background-position: right -240px center;
  filter: blur(12px);
}
.login-shell .login-wordmark { justify-self: end; align-self: flex-end; position: relative; }

.login-shell .login-card {
  flex: none;
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 42px 44px 36px;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15,26,46,.04), 0 24px 60px -32px rgba(15,26,46,.18);
}

.login-shell .login-card h1 {
  margin: 0 0 8px;
  font: 500 34px/1.1 Georgia, serif;
  letter-spacing: -.02em;
  text-align: center;
}
.login-shell .login-card .login-title { margin-bottom: 28px; text-align: left; }
.login-shell .login-subtitle { margin: 0 0 26px; color: var(--ink-2); font-size: 14.5px; line-height: 1.55; text-align: center; }
.login-shell .form { gap: 16px; }
.login-shell .field label { display: block; margin-bottom: 6px; padding-left: 3px; color: var(--ink); font-size: 12.5px; font-weight: 600; }
.login-shell .field label.sr { margin: 0; padding: 0; }
.login-shell .form input {
  height: 44px;
  padding: 11px 12px;
  border-color: var(--line-strong, #8C95A3);
  border-radius: 8px;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.login-shell .form input::placeholder { color: #737C8B; }
.login-shell .form input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,82,224,.12); }
.login-shell .login-forgot { display: flex; justify-content: flex-end; margin-top: -4px; font-size: 13px; font-weight: 600; }
.login-shell a { text-decoration: underline; text-underline-offset: .15em; }
.login-shell .login-forgot a, .login-shell .login-footer a { text-decoration: none; }
.login-shell a:hover { text-decoration: underline; }
.login-shell .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.login-shell .btn-primary { margin-top: 4px; background: var(--ink); color: #fff; border-color: var(--ink); }
.login-shell .btn-primary:hover { background: #1A2540; box-shadow: 0 8px 20px -8px rgba(15,26,46,.25); }
.login-shell .login-arrow { transition: transform .2s; }
.login-shell .btn-primary:hover .login-arrow { transform: translateX(2px); }
.login-shell .or { margin: 22px 0 14px; gap: 14px; font-size: 12px; font-weight: 600; letter-spacing: .14em; }
.login-shell .or::before, .login-shell .or::after { border-color: #ECEEF1; }
.login-shell .login-google { padding: 11px; border-color: var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500; gap: 10px; }
.login-shell .login-google:hover { background: #F7F5EF; border-color: #C6CBD3; }
.login-shell .login-google-icon { width: 18px; height: 18px; flex: none; }
.login-shell .login-terms { margin-top: 16px; font-size: 12px; line-height: 1.55; }
.login-shell .login-footer { margin-top: 22px; text-align: center; font-size: 13px; }
.login-shell .message { margin-bottom: 18px; padding: 12px 14px; font-size: 13px; overflow-wrap: anywhere; }
.login-shell .message-error { background: #FDECE9; border-color: #F3C8C1; color: #7C1D14; }
.login-shell .message-ok { background: #EAF5EF; border-color: #BEDDCC; color: #0F5034; }

/* Only the blue plane turns. Its changing pitch projects the vector curve and
   sphere together, so the ellipse bends with perspective instead of sliding
   beneath the sphere. The orange plane remains a fixed visual reference. */
@keyframes login-blue-precess {
  0% { transform: perspective(1400px) rotateY(15deg) rotateX(0deg) rotateZ(0deg); }
  25% { transform: perspective(1400px) rotateY(0deg) rotateX(15deg) rotateZ(90deg); }
  50% { transform: perspective(1400px) rotateY(-15deg) rotateX(0deg) rotateZ(180deg); }
  75% { transform: perspective(1400px) rotateY(0deg) rotateX(-15deg) rotateZ(270deg); }
  100% { transform: perspective(1400px) rotateY(15deg) rotateX(0deg) rotateZ(360deg); }
}
@keyframes login-orbit-turn { to { transform: rotate(360deg); } }
@keyframes login-orbit-counter { to { transform: rotate(-360deg); } }
@keyframes login-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-backdrop-settle {
  from { transform: translate(-12px, 10px) rotate(-1deg); }
  to { transform: translate(0, 0) rotate(0); }
}
/* Opt in: browsers without this preference query keep the static design.
   The entrance stops after 4s; continuous orbit motion requires the pause control. */
@media (prefers-reduced-motion: no-preference) {
  /* The script reveals the pause control before enabling continuous motion. */
  @supports (transform: perspective(1400px) rotateY(15deg)) {
    .login-shell .login-orbit-art[data-motion-enabled="true"] .login-blue-plane { animation: login-blue-precess 120s linear infinite paused; }
  }
  .login-shell .login-orbit-art[data-motion-enabled="true"] .orbit-turn { animation: login-orbit-turn 28s linear infinite paused; }
  .login-shell .login-orbit-art[data-motion-enabled="true"] .orbit-counter { animation: login-orbit-counter 28s linear infinite paused; }
  .login-shell .login-orbit-art[data-motion-enabled="true"] .orbit-blue { animation-duration: 36s; animation-direction: reverse; }
  .login-shell .login-orbit-art[data-motion-running="true"] .login-blue-plane,
  .login-shell .login-orbit-art[data-motion-running="true"] .orbit-turn,
  .login-shell .login-orbit-art[data-motion-running="true"] .orbit-counter { animation-play-state: running; }
  .login-shell .login-card { animation: login-slide-up .5s cubic-bezier(.22,1,.36,1); }
  .login-shell .login-backdrop:not(.login-backdrop--orbit) { animation: login-backdrop-settle 4s ease-out; }
}
@media (max-width: 480px) {
  .login-shell { padding: 24px 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); gap: 24px; }
  .login-shell .login-card { padding: 32px 24px; }
  .login-shell .login-card h1 { font-size: 28px; }
  .login-shell .login-backdrop--spacebar { background-position: right -120px bottom 80px; }
  .login-shell .login-orbit-art { left: -100px; top: 10%; transform: none; }
  .login-shell .login-backdrop--caret { background-position: right -100px center; }
}
@media (prefers-reduced-motion: reduce) {
  .login-shell .login-card { animation: none; }
  .login-shell *, .login-shell *::before, .login-shell *::after { transition: none; }
}
@media (forced-colors: active) {
  .login-shell .login-backdrop { display: none; }
  .login-shell .form input:focus { outline-color: Highlight; border-color: Highlight; box-shadow: none; }
}
