:root {
  --bg-base: #15111E;
  --bg-surface: #1F1830;
  --bg-elevated: #2A2040;
  --bg-deeper: #0F0C18;
  --border: #3A2C55;
  --border-bright: #5A3F7A;
  --fg-primary: #F2EAFF;
  --fg-secondary: #A090C0;
  --fg-tertiary: #6A5F8A;
  --fg-muted: #4A4060;
  --neon-pink: #FF2E9F;
  --neon-purple: #B967FF;
  --neon-cyan: #05D9E8;
  --neon-red: #FF3D5A;
  --neon-green: #00FF9D;
  --gradient-primary: linear-gradient(135deg, #FF2E9F 0%, #FF6B35 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--fg-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(185, 103, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(185, 103, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 46, 159, 0.10) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(185, 103, 255, 0.08) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}
.auth-card {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.auth-card.wide { max-width: 560px; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.auth-brand-mark {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.auth-brand-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--fg-secondary);
  text-transform: uppercase;
}
.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin: 8px 0 6px;
}
.auth-subtitle {
  font-size: 13.5px;
  color: var(--fg-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--fg-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input {
  width: 100%;
  background: var(--bg-deeper);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--fg-primary);
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(185, 103, 255, 0.15);
}
.field input.totp {
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 18px;
  letter-spacing: 8px;
  text-align: center;
}
.field .help {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  margin-top: 4px;
  line-height: 1.4;
}
.btn-primary {
  width: 100%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.05s ease, filter 0.15s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.alert {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  background: rgba(255, 61, 90, 0.10);
  border: 1px solid rgba(255, 61, 90, 0.3);
  color: #FFB0BB;
  display: none;
}
.alert.info {
  background: rgba(5, 217, 232, 0.08);
  border: 1px solid rgba(5, 217, 232, 0.25);
  color: #9FE9F0;
  display: block;
}
.alert.success {
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.25);
  color: #9FFFC9;
}
.alert.visible { display: block; }
.totp-block {
  background: var(--bg-deeper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin: 14px 0 18px;
  display: flex;
  gap: 18px;
  align-items: center;
}
.totp-qr {
  width: 144px; height: 144px;
  flex-shrink: 0;
  background: white;
  padding: 8px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.totp-qr img, .totp-qr canvas { width: 128px; height: 128px; }
.totp-info { font-size: 12.5px; color: var(--fg-secondary); line-height: 1.5; }
.totp-info code {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--bg-base);
  border-radius: 6px;
  font-family: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--neon-cyan);
  word-break: break-all;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.muted-link {
  color: var(--fg-tertiary);
  font-size: 12.5px;
  text-decoration: none;
}
.muted-link:hover { color: var(--neon-purple); }
