/* Sign-in page: a 3D logo stage on the left, one quiet form on the right. */

.login-page {
  background: #050a16;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  min-height: 100vh;
}

/* ---------- showcase ---------- */

.showcase {
  --size: clamp(220px, 23vw, 330px);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-right: 1px solid rgba(39, 57, 107, 0.35);
  background:
    radial-gradient(640px 520px at 50% 44%, rgba(37, 99, 235, 0.3), transparent 70%),
    linear-gradient(180deg, #07112a 0%, #050a16 100%);
}

.floor {
  position: absolute;
  left: -25%;
  right: -25%;
  bottom: 0;
  height: 70%;
  background-image:
    linear-gradient(rgba(125, 179, 251, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 179, 251, 0.32) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(420px) rotateX(58deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  animation: floor-flow 3.2s linear infinite;
}

.showcase-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 24px;
}

.stage {
  position: relative;
  width: var(--size);
  aspect-ratio: 354 / 341;
  perspective: 900px;
}

.glow {
  position: absolute;
  inset: -34%;
  background: radial-gradient(closest-side, rgba(56, 140, 255, 0.5), transparent 72%);
  filter: blur(12px);
  animation: breathe 5s ease-in-out infinite;
}

.ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(125, 179, 251, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(72deg);
  animation: orbit 16s linear infinite;
}

.ring::after {
  content: "";
  position: absolute;
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px 2px var(--cyan);
}

.ring-a {
  width: 150%;
  aspect-ratio: 1;
}

.ring-b {
  width: 195%;
  aspect-ratio: 1;
  border-color: rgba(125, 179, 251, 0.16);
  animation-duration: 26s;
  animation-direction: reverse;
}

.ring-b::after {
  background: var(--accent-light);
  box-shadow: 0 0 12px 2px var(--accent);
}

.float {
  position: absolute;
  inset: 0;
  perspective: 900px;
  animation: bob 6s ease-in-out infinite;
}

.tilt {
  position: absolute;
  inset: 0;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}

.logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 26px 34px rgba(20, 100, 255, 0.4));
}

/* A light sweep that only lights up the logo itself. */
.shine {
  position: absolute;
  inset: 0;
  -webkit-mask: url("/assets/logo.png") center / contain no-repeat;
  mask: url("/assets/logo.png") center / contain no-repeat;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.8) 50%, transparent 62%);
  background-size: 300% 100%;
  animation: shine 5.5s ease-in-out infinite;
}

.ground {
  position: absolute;
  right: 10%;
  bottom: -16%;
  left: 10%;
  height: 12%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), transparent);
  filter: blur(6px);
  animation: ground 6s ease-in-out infinite;
}

.wordmark {
  margin-top: 84px;
  padding-left: 0.55em;
  color: var(--text);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.55em;
}

.wordmark span {
  color: var(--accent-light);
  font-weight: 650;
}

.tagline {
  margin-top: 10px;
  color: var(--dim);
  font-size: 14px;
}

/* ---------- form ---------- */

.login {
  align-self: center;
  justify-self: center;
  width: min(360px, 100% - 48px);
  padding: 48px 0;
  animation: login-in 0.5s ease both;
}

.login-brand {
  display: none;
  width: 56px;
  margin: 0 auto 28px;
}

.login-brand img {
  display: block;
  width: 56px;
  height: auto;
}

.login-head {
  margin-bottom: 32px;
}

.login-head h1 {
  font-size: 28px;
  font-weight: 650;
}

.login-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
}

.login-form {
  display: grid;
  gap: 18px;
}

.login-form:not(.hidden) {
  animation: login-in 0.3s ease both;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  font: inherit;
  font-size: 15.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 12px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.login-field input::placeholder {
  color: var(--dim);
}

.login-field input:hover {
  background: rgba(255, 255, 255, 0.06);
}

.login-field input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.login-field input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  box-shadow: 0 0 0 100px #101a33 inset;
}

.login-error {
  color: var(--danger);
  font-size: 14px;
}

.login-error:empty {
  display: none;
}

.login-button {
  height: 48px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 650;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.login-button:hover {
  background: #5a98f8;
}

.login-button:active {
  transform: scale(0.99);
}

.login-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.login-switch {
  margin-top: 28px;
  color: var(--muted);
  font-size: 14.5px;
}

.login-switch button {
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-light);
  background: none;
  border: 0;
  cursor: pointer;
}

.login-switch button:hover {
  text-decoration: underline;
}

/* ---------- motion ---------- */

@keyframes login-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes orbit {
  to {
    transform: translate(-50%, -50%) rotateX(72deg) rotateZ(360deg);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(-9px);
  }
  50% {
    transform: translateY(9px);
  }
}

@keyframes ground {
  0%,
  100% {
    opacity: 0.55;
    transform: scaleX(0.9);
  }
  50% {
    opacity: 0.9;
    transform: scaleX(1.05);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes shine {
  0%,
  45% {
    background-position: 0% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

@keyframes floor-flow {
  to {
    background-position: 0 64px;
  }
}

/* ---------- small screens: just the form ---------- */

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
  }

  .showcase {
    display: none;
  }

  .login {
    padding: 56px 0;
  }

  .login-brand {
    display: block;
  }

  .login-head {
    text-align: center;
  }

  .login-switch {
    text-align: center;
  }
}
