:root {
  color-scheme: dark;
  --bg: #050507;
  --surface: #0A0A0C;
  --text: #F5F5F7;
  --muted: #86868B;
  --zinc: #6E6E73;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.38);
  --ring: rgba(255, 255, 255, 0.08);
  --recessed: rgba(0, 0, 0, 0.45);
  --danger: #FF453A;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
}

::selection { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.shrink-0 { flex-shrink: 0; }

.wrap {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-wrap: balance;
}

.sub {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.lbl {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 6px;
}

input[type="text"], input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  background: var(--recessed);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 180ms var(--ease-out-expo), box-shadow 180ms var(--ease-out-expo);
}

input:focus-visible {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--ring);
}

.passwrap { position: relative; }
.passwrap input { padding-right: 48px; }

.eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--zinc);
  cursor: pointer;
  border-radius: 10px;
  transition: color 180ms var(--ease-out-expo);
}
.eye:hover { color: var(--text); }
.eye:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.eye svg[hidden] { display: none; }

.otp { margin-bottom: 14px; }
.otp[hidden] { display: none; }

.otpboxes { display: flex; gap: 8px; }

.otpboxes input {
  width: 100%;
  min-width: 0;
  height: 48px;
  margin-bottom: 0;
  padding: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.err {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--danger);
  min-height: 0;
}
.err:empty { display: none; }

.btn {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 100ms var(--ease-out-expo), background-color 180ms var(--ease-out-expo), box-shadow 180ms var(--ease-out-expo);
}
.btn:hover { background: #FFFFFF; box-shadow: 0 4px 20px rgba(255, 255, 255, 0.18); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring), 0 0 0 4px var(--border-focus); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg[hidden] { display: none; }

.spin { animation: vd-rotate 800ms linear infinite; }
@keyframes vd-rotate { to { transform: rotate(360deg); } }

.foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--zinc);
  letter-spacing: 0.02em;
}

@media (max-width: 360px) {
  .card { padding: 20px 16px; }
  .otpboxes { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .spin { animation: none; }
}