:root {
  --ink: #0c1424;
  --muted: #5c6b82;
  --line: #e3e8f1;
  --accent: #3157d5;
  --accent-hover: #2546b8;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: #070c17;
  -webkit-font-smoothing: antialiased;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(380px, 0.95fr);
}

.shell.leaving {
  animation: leave 0.35s ease forwards;
}

.brand {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 64px 72px;
  color: #f3f6fb;
  background:
    radial-gradient(520px 320px at 0% 0%, rgba(49, 87, 213, 0.35), transparent 70%),
    linear-gradient(165deg, #121c33 0%, #070c17 70%);
  animation: panel-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.brand-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at 30% 40%, #000 10%, transparent 72%);
  animation: drift 32s linear infinite;
}

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

.orb-a {
  width: 280px;
  height: 280px;
  right: -40px;
  bottom: 8%;
  background: rgba(49, 87, 213, 0.45);
  animation: float-a 16s ease-in-out infinite;
}

.orb-b {
  width: 180px;
  height: 180px;
  left: 18%;
  top: 12%;
  background: rgba(96, 165, 250, 0.22);
  animation: float-b 18s ease-in-out infinite;
}

.sweep {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #8eabff, transparent);
  transform: translateX(-100%);
  animation: sweep 1.6s 0.2s ease forwards;
}

.brand-copy {
  position: relative;
  max-width: 460px;
}

.logo-light {
  display: block;
  height: 28px;
  width: auto;
  margin-bottom: 36px;
  filter: invert(1) brightness(1.15);
  animation: rise 0.7s 0.05s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.logo-dark {
  display: none;
  height: 24px;
  width: auto;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9eb4ff;
}

.brand h1 {
  margin: 12px 0 0;
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.lede {
  margin: 16px 0 0;
  max-width: 38ch;
  color: #b7c2d6;
  font-size: 16px;
  line-height: 1.55;
}

.points {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.points li {
  display: flex;
  align-items: center;
  gap: 14px;
}

.point-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d5e0ff;
}

.point-icon svg { width: 18px; height: 18px; }

.points strong {
  display: block;
  font-size: 14px;
  font-weight: 650;
}

.points small {
  display: block;
  margin-top: 2px;
  color: #93a0b8;
  font-size: 13px;
}

.panel {
  display: grid;
  place-items: center;
  padding: 40px 28px;
  background:
    radial-gradient(700px 320px at 80% -10%, rgba(49, 87, 213, 0.08), transparent 60%),
    #f5f7fb;
  animation: panel-in-right 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card {
  width: min(420px, 100%);
}

.panel .eyebrow { color: var(--accent); }

.card h2 {
  margin: 8px 0 0;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.panel-lede {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}

.field span:first-child {
  font-size: 13px;
  font-weight: 650;
}

.control {
  position: relative;
  display: block;
}

.control > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #8b97ab;
  transition: color 0.18s ease;
  pointer-events: none;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.field input::placeholder { color: #a0aab8; }

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.14);
}

.field:focus-within .control > svg { color: var(--accent); }

#password { padding-right: 48px; }

.ghost-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #6b778c;
  cursor: pointer;
  padding: 0;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ghost-toggle svg { width: 18px; height: 18px; }
.ghost-toggle .eye-off { display: none; }
.ghost-toggle.is-visible .eye-open { display: none; }
.ghost-toggle.is-visible .eye-off { display: block; }
.ghost-toggle:hover { color: var(--ink); background: #eef2f7; }

.error {
  margin: 16px 0 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  animation: rise 0.25s ease both;
}

.submit {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 22px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #3d66e8 0%, var(--accent) 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(49, 87, 213, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 62%);
  transform: translateX(-120%);
}

.submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 22px rgba(49, 87, 213, 0.34);
  transform: translateY(-1px);
}

.submit:hover::after { animation: sheen 0.75s ease; }
.submit:active { transform: translateY(0); }
.submit:disabled { cursor: progress; }

.submit.busy .submit-label { opacity: 0; }
.submit.busy .spinner { opacity: 1; }

.spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  opacity: 0;
  animation: spin 0.7s linear infinite;
}

.secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0f7b55;
  box-shadow: 0 0 0 0 rgba(15, 123, 85, 0.5);
  animation: pulse 2.2s ease-out infinite;
}

.reveal {
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--d, 0ms);
}

.shake { animation: shake 0.42s ease; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

@keyframes panel-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes leave {
  to { opacity: 0; transform: scale(0.985); }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(52px); }
}

@keyframes float-a {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-24px, -18px, 0); }
}

@keyframes float-b {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, 16px, 0); }
}

@keyframes sweep {
  to { transform: translateX(100%); }
}

@keyframes sheen {
  from { transform: translateX(-120%); }
  to { transform: translateX(120%); }
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 123, 85, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(15, 123, 85, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 123, 85, 0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .brand { padding: 28px 24px 24px; }
  .brand h1 { font-size: 30px; }
  .lede, .points { display: none; }
  .logo-light { margin-bottom: 18px; }
  .panel { padding: 28px 20px 40px; align-items: start; }
  .logo-dark { display: none; }
}

@media (max-width: 520px) {
  .brand { padding: 22px 20px 18px; }
  .card h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .shell, .brand, .panel, .reveal, .logo-light, .grid, .orb, .sweep, .spinner, .dot, .submit::after, .error {
    animation: none;
  }
  .reveal, .logo-light, .brand, .panel { opacity: 1; transform: none; }
}
