/* auth pages — same world as the landing: DeepSeek blue, ice white, tilted panels */
.auth-page { background: var(--white); min-height: 100svh; overflow-x: clip; }

.auth-shell {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr);
}

.auth-main {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(80px, 10vh, 120px) var(--gutter) 48px;
  background:
    radial-gradient(70% 60% at 10% 0%, rgba(77, 107, 254, 0.09), transparent 62%),
    #fff;
  overflow: clip;
}
.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(77, 107, 254, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 107, 254, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 70% at 20% 30%, #000, transparent 78%);
  pointer-events: none;
}

.auth-brand {
  position: absolute;
  top: 26px;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-brand .brand b { font-size: 22px; }
.auth-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
}
.auth-back:hover { color: var(--blue-deep); }

.auth-form {
  position: relative;
  z-index: 2;
  width: min(100%, 470px);
  margin-inline: auto;
}
.auth-form h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 3.8vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.auth-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: clamp(28px, 4.4vh, 42px);
}
.auth-form .field { display: block; margin-bottom: 20px; }
.auth-form .field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 2px;
}
.auth-form .field > span i {
  font-style: normal;
  color: var(--blue-deep);
  letter-spacing: 0.06em;
}
.auth-form input {
  width: 100%;
  height: 48px;
  padding: 6px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.auth-form input:focus { border-bottom-color: var(--blue); }
.auth-form input:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.auth-form input::placeholder { color: #98a3bd; }
.field-row { display: flex; align-items: flex-end; gap: 10px; }
.field-row input { flex: 1; min-width: 0; }
.send-code {
  flex: none;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue-deep);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.send-code:hover { border-color: var(--blue); background: var(--ice); }
.send-code:disabled { opacity: 0.55; cursor: wait; }

.form-error {
  min-height: 1.7em;
  margin: 2px 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #c8322a;
}
.auth-form .btn { width: 100%; }
.auth-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-size: 12px;
  color: var(--muted);
}
.auth-meta a { color: var(--blue-deep); text-decoration: none; border-bottom: 1px solid transparent; }
.auth-meta a:hover { border-bottom-color: currentColor; }

.auth-side {
  position: relative;
  background: var(--navy);
  color: #fff;
  overflow: clip;
  min-height: 100%;
}
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(127, 227, 255, 0.22) 1px, transparent 1.3px),
    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: 26px 26px, 80px 80px, 80px 80px;
  mask-image: radial-gradient(75% 70% at 55% 45%, #000, transparent 82%);
  pointer-events: none;
}
.auth-side .orb {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  left: -12%;
  bottom: -16%;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, rgba(77, 107, 254, 0.6), transparent 68%);
  filter: blur(10px);
}
.auth-side .frame {
  position: absolute;
  inset: 8% 8% 12% 12%;
  border-radius: 8px 46px 8px 46px;
  overflow: hidden;
  transform: rotate(-2.4deg);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  z-index: 2;
}
.auth-side .frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }
.auth-side .frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8, 13, 30, 0.82) 0%, transparent 42%),
              linear-gradient(90deg, rgba(8, 13, 30, 0.32), transparent 40%);
  pointer-events: none;
}
.auth-side .tagline {
  position: absolute;
  z-index: 3;
  left: 12%;
  right: 12%;
  bottom: 16%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.auth-side .tagline p {
  max-width: 13em;
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.auth-side .tagline span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  white-space: nowrap;
}
.auth-side .chips {
  position: absolute;
  z-index: 3;
  left: 12%;
  top: 10%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.auth-side .chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(8, 13, 30, 0.5);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #dce5ff;
}
.auth-side .chip::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}
.auth-side .vlabel {
  position: absolute;
  z-index: 3;
  right: 2.2%;
  top: 12%;
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(220, 229, 255, 0.65);
}

/* entrance */
.js .auth-form > * { opacity: 0; translate: 0 18px; transition: opacity 0.7s var(--ease), translate 0.8s var(--ease); }
.js body.is-ready .auth-form > * { opacity: 1; translate: 0 0; }
.js body.is-ready .auth-form > *:nth-child(1) { transition-delay: 0.04s; }
.js body.is-ready .auth-form > *:nth-child(2) { transition-delay: 0.08s; }
.js body.is-ready .auth-form > *:nth-child(3) { transition-delay: 0.12s; }
.js body.is-ready .auth-form > *:nth-child(4) { transition-delay: 0.16s; }
.js body.is-ready .auth-form > *:nth-child(5) { transition-delay: 0.2s; }
.js body.is-ready .auth-form > *:nth-child(6) { transition-delay: 0.24s; }
.js body.is-ready .auth-form > *:nth-child(7) { transition-delay: 0.28s; }
.js body.is-ready .auth-form > *:nth-child(8) { transition-delay: 0.32s; }
.js .auth-side .frame { clip-path: inset(0 0 100% 0); opacity: 0; transition: clip-path 1.1s var(--ease), opacity 0.5s linear; }
.js body.is-ready .auth-side .frame { clip-path: inset(0 0 0 0); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .auth-form > *, .js .auth-side .frame { opacity: 1 !important; translate: 0 0 !important; clip-path: none !important; transition: none !important; }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-side { min-height: 34svh; order: -1; }
  .auth-side .frame { inset: 9% 10% 14% 10%; }
  .auth-side .tagline { left: 10%; right: 10%; bottom: 10%; }
  .auth-side .tagline p { font-size: 20px; }
  .auth-side .chips { left: 10%; top: 12%; }
  .auth-side .vlabel { display: none; }
  .auth-main { padding: 74px var(--gutter) 40px; justify-content: flex-start; }
  .auth-brand { top: 20px; }
  .auth-form { margin: 0 auto; }
}

@media (max-width: 520px) {
  .auth-side .tagline { display: none; }
  .auth-side { min-height: 28svh; }
  .auth-form h1 { font-size: 2.3rem; }
  .auth-form .field { margin-bottom: 16px; }
}
