@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --text: #f4f5fb;
  --muted: rgba(244, 245, 251, 0.52);
  --accent: #6366f1;
  --font: "Montserrat", system-ui, sans-serif;
  --ui: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16vh 24px 8vh;
  font-family: var(--ui);
  background: #05060a;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #05060a;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
}

.b1 {
  width: 58vw;
  height: 58vw;
  min-width: 320px;
  min-height: 320px;
  top: -22%;
  left: -16%;
  background: #312e81;
  opacity: 0.42;
  animation: drift 20s ease-in-out infinite;
}

.b2 {
  width: 46vw;
  height: 46vw;
  min-width: 280px;
  min-height: 280px;
  right: -18%;
  bottom: -20%;
  background: #4c1d95;
  opacity: 0.32;
  animation: drift 24s ease-in-out infinite reverse;
}

.b3 {
  width: 30vw;
  height: 30vw;
  min-width: 200px;
  min-height: 200px;
  top: 48%;
  left: 40%;
  background: #1e1b4b;
  opacity: 0.35;
  animation: drift 18s ease-in-out infinite;
  animation-delay: -8s;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5%, -6%); }
}

.form {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
}

h1 {
  margin: 0 0 28px;
  text-align: center;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.glass {
  display: block;
  position: relative;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--spin),
    rgba(165, 180, 252, 0.15),
    rgba(99, 102, 241, 0.95),
    rgba(34, 211, 238, 0.7),
    rgba(167, 139, 250, 0.9),
    rgba(99, 102, 241, 0.35),
    rgba(165, 180, 252, 0.15)
  );
  animation: spin 7s linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.85;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.14) 50%,
    transparent 62%
  );
  background-size: 220% 100%;
  animation: sheen 5.5s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: 0.45;
}

.glass input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
}

.glass input::placeholder {
  color: var(--muted);
  font-family: var(--font);
  font-weight: 700;
  opacity: 1;
}

.glass:focus-within::before {
  opacity: 1;
  animation-duration: 3s;
}

@keyframes spin {
  to { --spin: 360deg; }
}

@keyframes sheen {
  0%, 100% { background-position: 120% 0; }
  50% { background-position: -20% 0; }
}

.btn {
  width: 100%;
  height: 52px;
  margin: 0 0 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 16px;
  color: #eef0ff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: #4338ca;
}

.btn:hover {
  background: #4f46e5;
}

.btn-alt {
  background: #25264a;
  color: #d7daf5;
}

.btn-alt:hover {
  background: #2c2e58;
}

.or {
  margin: 4px 0 12px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .blob, .glass::before, .glass::after { animation: none; }
}
