:root {
  --bg: #0d0f14;
  --surface: #13161d;
  --surface2: #1a1e28;
  --border: #232736;
  --border2: #2e3347;
  --text: #e8eaf0;
  --text2: #8b90a0;
  --text3: #555a6e;
  --accent: #4f7cff;
  --accent-glow: rgba(79, 124, 255, 0.15);
  --green: #3ecf8e;
  --red: #ff5c5c;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(79, 124, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(79, 124, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

nav {
  position: relative;
  z-index: 1;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 60px;
  gap: 16px;
}

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-logo span {
  color: var(--accent);
}

.nav-back {
  color: var(--text3);
  font-size: 13px;
  text-decoration: none;
  margin-left: auto;
  transition: color .15s;
}

.nav-back:hover {
  color: var(--text2);
}

.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 44px 40px;
  width: 100%;
  max-width: 460px;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text2);
  font-size: 14px;
}

.alert {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.alert.error {
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.2);
  color: var(--red);
  display: block;
}

.alert.success {
  background: rgba(62, 207, 142, 0.08);
  border: 1px solid rgba(62, 207, 142, 0.2);
  color: var(--green);
  display: block;
}

.oauth-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.btn-oauth {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 11px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all .15s;
}

.btn-oauth:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text3);
  font-size: 12px;
  font-family: 'DM Mono', monospace;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-group {
  margin-bottom: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 7px;
  font-family: 'DM Mono', monospace;
}

input[type=email],
input[type=password],
input[type=text] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

input:focus {
  border-color: var(--accent);
}

input::placeholder {
  color: var(--text3);
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.form-row label {
  margin-bottom: 0;
}

.forgot {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.forgot:hover {
  text-decoration: underline;
}

.hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 5px;
  font-family: 'DM Mono', monospace;
}

.perks {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.perk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
}

.perk::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
}

.terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text2);
}

.terms input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.terms a {
  color: var(--accent);
  text-decoration: none;
}

.btn-submit {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  margin-top: 4px;
}

.btn-submit:hover {
  background: #6690ff;
  transform: translateY(-1px);
}

.btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text2);
}

.auth-footer a {
  color: var(--accent);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}