:root {
  color-scheme: dark;
  --auth-bg: #060f1a;
  --auth-surface: #0d1b2a;
  --auth-surface-raised: #102235;
  --auth-text: #eef3f8;
  --auth-muted: #91a3b6;
  --auth-border: rgba(255, 255, 255, .1);
  --auth-border-strong: rgba(255, 255, 255, .18);
  --auth-accent: #00c896;
  --auth-accent-ink: #04160f;
  --auth-danger: #ff8585;
  --auth-danger-soft: rgba(255, 105, 105, .12);
  --auth-radius: 18px;
  --auth-shadow: 0 38px 90px -45px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(25, 92, 145, .28), transparent 38%),
    radial-gradient(circle at 92% 18%, rgba(0, 200, 150, .13), transparent 32%),
    var(--auth-bg);
  color: var(--auth-text);
  font-family: "IBM Plex Sans", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }

.auth-page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.auth-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 72% 66% at 42% 30%, #000, transparent);
  pointer-events: none;
}

.auth-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 48px, 1420px);
  height: 88px;
  margin-inline: auto;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.auth-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  box-shadow: 0 12px 30px -16px rgba(0, 200, 150, .8);
}

.auth-brand span {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .1px;
}

.auth-brand strong { color: var(--auth-accent); font-weight: 700; }

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  color: #c7d3e0;
  font-size: 13px;
  font-weight: 600;
  transition: transform .22s ease, border-color .22s ease, background-color .22s ease, color .22s ease;
}

.auth-back-link:hover,
.auth-back-link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(0, 200, 150, .35);
  background: rgba(255, 255, 255, .055);
  color: #fff;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  min-height: 100vh;
}

.auth-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 126px 42px 52px;
  overflow: hidden;
}

.auth-visual::after {
  content: "";
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 200, 150, .16), rgba(25, 92, 145, .13) 34%, transparent 69%);
  filter: blur(10px);
  animation: authHalo 8s ease-in-out infinite;
  pointer-events: none;
}

.auth-visual-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 720px);
}

.auth-visual-copy {
  position: absolute;
  left: 0;
  bottom: 32px;
  z-index: 8;
  width: min(390px, 80%);
  padding: 20px 22px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  background: rgba(8, 22, 36, .74);
  box-shadow: 0 24px 55px -34px rgba(0, 0, 0, .9);
  backdrop-filter: blur(18px);
}

.auth-visual-copy span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #8fe3c4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.auth-visual-copy h2 {
  margin: 0 0 8px;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.auth-visual-copy p { margin: 0; color: #a9b8c8; font-size: 14px; }

.auth-robot-shell {
  --robot-x: 50%;
  --robot-y: 38%;
  position: relative;
  width: 100%;
  height: clamp(560px, 50vw, 720px);
  isolation: isolate;
  perspective: 1200px;
}

.auth-robot-shell::before {
  content: "";
  position: absolute;
  inset: -10%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle at var(--robot-x) var(--robot-y), rgba(0, 200, 150, .25), rgba(35, 112, 188, .12) 32%, transparent 67%);
  filter: blur(18px);
  animation: authHalo 7s ease-in-out infinite;
  pointer-events: none;
}

.hero-robot-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 42px;
  background:
    radial-gradient(circle at var(--robot-x) var(--robot-y), rgba(74, 173, 255, .15), transparent 34%),
    linear-gradient(145deg, rgba(14, 31, 49, .85), rgba(5, 14, 24, .38) 56%, rgba(8, 28, 38, .68));
  box-shadow: 0 46px 100px -48px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform: rotateY(-2deg);
  transition: transform .5s cubic-bezier(.2, .75, .2, 1), border-color .3s ease;
}

.auth-robot-shell:hover .hero-robot-stage { transform: rotateY(0deg) translateY(-4px); border-color: rgba(111, 204, 238, .28); }

.hero-robot-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background:
    linear-gradient(rgba(123, 177, 216, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 177, 216, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .76), transparent 78%);
  pointer-events: none;
}

.hero-robot-corner {
  position: absolute;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-color: rgba(143, 227, 196, .48);
  pointer-events: none;
}

.hero-robot-corner--top { top: 22px; left: 22px; border-top: 1px solid; border-left: 1px solid; border-top-left-radius: 12px; }
.hero-robot-corner--bottom { right: 22px; bottom: 22px; border-right: 1px solid; border-bottom: 1px solid; border-bottom-right-radius: 12px; }

.hero-robot-ring {
  position: absolute;
  left: 50%;
  bottom: 5.5%;
  z-index: 1;
  width: 76%;
  height: 18%;
  border: 1px solid rgba(0, 200, 150, .28);
  border-radius: 50%;
  transform: translateX(-50%) rotateX(70deg);
  box-shadow: 0 0 38px rgba(0, 200, 150, .13), inset 0 0 28px rgba(0, 200, 150, .08);
  animation: authRing 5.5s ease-in-out infinite;
  pointer-events: none;
}

.hero-robot-canvas {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: grab;
  opacity: 0;
  transition: opacity .5s ease;
}

.hero-robot-canvas:active { cursor: grabbing; }
.hero-robot-stage--ready .hero-robot-canvas { opacity: 1; }

.hero-robot-loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8fa4b8;
  font-size: 13px;
  pointer-events: none;
  transition: opacity .3s ease;
}

.hero-robot-loader::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, .16);
  border-top-color: var(--auth-accent);
  border-radius: 50%;
  animation: authSpin .8s linear infinite;
}

.hero-robot-stage--ready .hero-robot-loader { opacity: 0; }
.hero-robot-stage--error .hero-robot-loader span { display: none; }
.hero-robot-stage--error .hero-robot-loader::after { content: "Interactive preview unavailable"; }

.auth-form-side {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 118px clamp(28px, 4vw, 72px) 56px;
  border-left: 1px solid rgba(255, 255, 255, .075);
  background: linear-gradient(180deg, rgba(11, 25, 40, .88), rgba(6, 15, 26, .96));
}

.auth-form-wrap { width: min(100%, 470px); }

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #8fe3c4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 12px;
  color: #fff;
  font-family: "Sora", sans-serif;
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1.12;
  letter-spacing: -.5px;
}

.auth-intro { margin: 0 0 34px; color: var(--auth-muted); font-size: 15px; }

.auth-form { display: grid; gap: 19px; }

.auth-field { display: grid; gap: 8px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.auth-field label { color: #dce5ee; font-size: 13px; font-weight: 600; }
.auth-label-link { color: #8fe3c4; font-size: 12.5px; font-weight: 600; }
.auth-label-link:hover, .auth-label-link:focus-visible { color: var(--auth-accent); }

.auth-input-wrap { position: relative; }

.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--auth-border);
  border-radius: 12px;
  outline: 0;
  background: rgba(255, 255, 255, .045);
  color: #fff;
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.auth-input::placeholder { color: #687d91; }
.auth-input:hover { border-color: var(--auth-border-strong); }
.auth-input:focus { border-color: rgba(0, 200, 150, .7); background: rgba(255, 255, 255, .065); box-shadow: 0 0 0 4px rgba(0, 200, 150, .11); }
.auth-input:-webkit-autofill { -webkit-text-fill-color: #fff; box-shadow: 0 0 0 1000px #102235 inset; caret-color: #fff; }
.auth-input[aria-invalid="true"] { border-color: var(--auth-danger); box-shadow: 0 0 0 4px var(--auth-danger-soft); }

.auth-input--password { padding-right: 52px; }

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8fa3b7;
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible { background: rgba(255, 255, 255, .07); color: #fff; }

.auth-field-error { display: none; margin: 0; color: var(--auth-danger); font-size: 12px; }
.auth-field-error.is-visible { display: block; }

.auth-check-row { display: flex; align-items: flex-start; gap: 10px; }
.auth-check-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--auth-accent); }
.auth-check-row label { color: #a9b8c8; font-size: 13px; line-height: 1.45; }
.auth-check-row a { color: #8fe3c4; font-weight: 600; }

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 13px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--auth-accent);
  box-shadow: 0 18px 36px -17px rgba(0, 200, 150, .9);
  color: var(--auth-accent-ink);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.auth-submit i { transition: transform .22s ease; }
.auth-submit:hover, .auth-submit:focus-visible { transform: translateY(-2px); box-shadow: 0 23px 43px -17px rgba(0, 200, 150, 1); }
.auth-submit:hover i { transform: translateX(3px); }
.auth-submit:active { transform: translateY(0); }

.auth-switch { margin: 25px 0 0; color: var(--auth-muted); text-align: center; font-size: 14px; }
.auth-switch a { color: #8fe3c4; font-weight: 700; }
.auth-switch a:hover, .auth-switch a:focus-visible { color: var(--auth-accent); }

.auth-trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, .075);
  color: #74889c;
  font-size: 12px;
}

.auth-trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.auth-trust-row i { color: #8fe3c4; }

.auth-toast-region { position: fixed; top: 24px; right: 24px; z-index: 1000; display: grid; gap: 12px; width: min(380px, calc(100% - 48px)); }

.auth-toast {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 15px;
  border: 1px solid rgba(255, 133, 133, .25);
  border-radius: 14px;
  background: rgba(26, 21, 28, .96);
  box-shadow: 0 22px 56px -28px rgba(0, 0, 0, .9);
  animation: authToastIn .3s ease both;
  backdrop-filter: blur(18px);
}

.auth-toast__icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--auth-danger-soft); color: var(--auth-danger); }
.auth-toast strong { display: block; margin-bottom: 2px; color: #fff; font-size: 13px; }
.auth-toast p { margin: 0; color: #b6c2ce; font-size: 13px; }
.auth-toast button { padding: 3px; border: 0; background: transparent; color: #8295a8; cursor: pointer; }

.auth-dialog[hidden] { display: none; }
.auth-dialog { position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-dialog__backdrop { position: absolute; inset: 0; background: rgba(2, 8, 15, .78); backdrop-filter: blur(10px); }
.auth-dialog__panel { position: relative; z-index: 1; width: min(100%, 600px); max-height: min(760px, calc(100vh - 48px)); overflow: auto; border: 1px solid var(--auth-border-strong); border-radius: 20px; background: #0d1b2a; box-shadow: 0 35px 100px -40px rgba(0, 0, 0, .95); }
.auth-dialog__header, .auth-dialog__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; }
.auth-dialog__header { border-bottom: 1px solid var(--auth-border); }
.auth-dialog__header h2 { margin: 0; color: #fff; font-family: "Sora", sans-serif; font-size: 20px; }
.auth-dialog__body { padding: 22px; color: #a9b8c8; font-size: 14px; }
.auth-dialog__body p:first-child { margin-top: 0; }
.auth-dialog__footer { border-top: 1px solid var(--auth-border); justify-content: flex-end; }
.auth-dialog__close { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--auth-border); border-radius: 10px; background: rgba(255, 255, 255, .04); color: #c7d3e0; cursor: pointer; }
.auth-dialog__button { min-height: 42px; padding: 10px 17px; border: 1px solid var(--auth-border); border-radius: 10px; background: rgba(255, 255, 255, .05); color: #dce5ee; font-weight: 700; cursor: pointer; }
.auth-dialog__button--primary { border-color: transparent; background: var(--auth-accent); color: var(--auth-accent-ink); }

@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authHalo { 0%, 100% { opacity: .72; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes authRing { 0%, 100% { opacity: .45; transform: translateX(-50%) rotateX(70deg) scale(.94); } 50% { opacity: .85; transform: translateX(-50%) rotateX(70deg) scale(1.04); } }
@keyframes authToastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: minmax(0, .92fr) minmax(400px, 1.08fr); }
  .auth-visual { padding-inline: 28px; }
  .auth-visual-copy { left: 16px; bottom: 22px; }
}

@media (max-width: 860px) {
  .auth-header { position: relative; width: min(100% - 36px, 720px); height: 78px; }
  .auth-shell { display: flex; flex-direction: column; min-height: auto; }
  .auth-visual { order: 2; padding: 20px 22px 50px; }
  .auth-visual-inner { width: min(100%, 620px); }
  .auth-robot-shell { height: 390px; }
  .auth-visual-copy { position: relative; left: auto; bottom: auto; width: calc(100% - 32px); margin: -74px auto 0; }
  .auth-form-side { order: 1; padding: 36px 24px 44px; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, .075); background: transparent; }
  .auth-form-wrap { width: min(100%, 560px); }
}

@media (max-width: 520px) {
  .auth-header { width: calc(100% - 28px); }
  .auth-brand span { font-size: 15px; }
  .auth-back-link span { display: none; }
  .auth-back-link { width: 42px; height: 42px; justify-content: center; padding: 0; }
  .auth-form-side { padding: 26px 18px 38px; }
  .auth-title { font-size: 30px; }
  .auth-intro { margin-bottom: 28px; }
  .auth-visual { padding-inline: 14px; }
  .auth-robot-shell { height: 310px; }
  .hero-robot-stage { border-radius: 26px; }
  .auth-visual-copy { width: calc(100% - 20px); padding: 17px; }
  .auth-toast-region { top: 14px; right: 14px; width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
