:root {
  --bg: #050810;
  --surface: #0c1120;
  --surface2: #111827;
  --border: rgba(255,255,255,0.06);
  --border2: rgba(255,255,255,0.1);
  --cyan: #00e5c8;
  --cyan-dim: rgba(0,229,200,0.1);
  --cyan-mid: rgba(0,229,200,0.3);
  --violet: #7c6aff;
  --red: #ef4444;
  --text: #e8edf5;
  --text-muted: #6b7a99;
  --text-dim: #3a445c;
  --ff-d: 'Syne', sans-serif;
  --ff-b: 'Instrument Sans', sans-serif;
  --ff-m: 'JetBrains Mono', monospace;
  --radius: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-b);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.auth-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(0,229,200,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(124,106,255,0.05) 0%, transparent 60%);
}
.auth-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 100%);
}
.auth-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  animation: authReveal 0.5s ease both;
}
@keyframes authReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.auth-logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--ff-d); font-size: 1.1rem; font-weight: 700;
  margin-bottom: 1.75rem; justify-content: center;
}
.auth-logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}
.auth-title {
  font-family: var(--ff-d); font-size: 1.3rem; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 0.35rem;
}
.auth-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--ff-m);
}
.input-field {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-family: var(--ff-b); font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.input-field:focus {
  border-color: var(--cyan-mid);
  box-shadow: 0 0 0 3px rgba(0,229,200,0.08);
}
.input-field::placeholder { color: var(--text-dim); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--ff-b); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; border: none;
  background: var(--cyan); color: #050810;
  width: 100%;
}
.btn-primary:hover { background: #00f5d8; box-shadow: 0 0 20px rgba(0,229,200,0.35); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.error-msg {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); padding: 0.6rem 0.8rem; border-radius: var(--radius);
  font-size: 0.78rem; font-family: var(--ff-m);
  display: none;
}
.error-msg.show { display: block; }
.footer-text {
  text-align: center; margin-top: 1.5rem;
  font-size: 0.65rem; color: var(--text-dim); font-family: var(--ff-m);
}
.sso-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.25rem 0 1rem;
}
.sso-divider::before, .sso-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}
.sso-divider span {
  font-size: 0.7rem; color: var(--text-dim); font-family: var(--ff-m);
  white-space: nowrap;
}
.sso-buttons {
  display: flex; gap: 0.75rem;
}
.btn-sso {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  font-family: var(--ff-b); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text);
}
.btn-sso:hover {
  border-color: var(--cyan-mid);
  background: rgba(255,255,255,0.03);
}
.btn-sso:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch {
  text-align: center; margin-top: 1.25rem;
  font-size: 0.78rem; color: var(--text-muted); font-family: var(--ff-b);
}
.auth-switch a {
  color: var(--cyan); text-decoration: none; font-weight: 600;
}
.auth-switch a:hover { text-decoration: underline; }
.success-msg {
  background: rgba(0,229,200,0.1); border: 1px solid rgba(0,229,200,0.2);
  color: var(--cyan); padding: 0.6rem 0.8rem; border-radius: var(--radius);
  font-size: 0.78rem; font-family: var(--ff-m);
  display: none;
}
.success-msg.show { display: block; }
.input-row {
  display: flex; gap: 0.75rem;
}
.input-row .input-group { flex: 1; }
.otp-input {
  text-align: center; font-size: 1.4rem; letter-spacing: 0.5rem;
  font-family: var(--ff-m);
}
.resend-row {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  margin-top: 1rem; font-size: 0.75rem;
}
.resend-row .text-muted { color: var(--text-muted); }
.btn-link {
  background: none; border: none; color: var(--cyan); cursor: pointer;
  font-family: var(--ff-b); font-size: 0.75rem; font-weight: 600;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { opacity: 0.5; cursor: not-allowed; }
.dev-notice {
  display: none; background: rgba(124,106,255,0.1); border: 1px solid rgba(124,106,255,0.25);
  color: var(--violet); padding: 0.6rem 0.8rem; border-radius: var(--radius);
  font-size: 0.78rem; font-family: var(--ff-m); margin-bottom: 0.5rem;
  text-align: center;
}
.hidden { display: none !important; }
