@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg:           #000000;
  --bg2:          #0d0d0d;
  --bg3:          #181818;
  --border:       #1e1e1e;
  --border2:      #2e2e2e;
  --text:         #f0f0f0;
  --text2:        #c0c0c0;
  --muted:        #555555;
  --accent:       #22a04e;
  --accent2:      #2ecc66;
  --accent-bg:    #0a1a0f;
  --accent-border:#1a4a2a;
  --red:          #f87171;
  --red-bg:       rgba(248,113,113,0.08);
  --red-border:   rgba(248,113,113,0.25);
  --yellow:       #fbbf24;
  --yellow-bg:    rgba(251,191,36,0.08);
  --yellow-border:rgba(251,191,36,0.25);
  --blue:         #60a5fa;
  --radius:       12px;
  --radius-sm:    8px;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

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

a { text-decoration: none; color: inherit; }

/* ── Wrap ── */
.auth-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}

/* ── Logo ── */
.auth-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; letter-spacing: -0.4px;
}
.auth-logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff;
}
.auth-logo-text { color: #fff; }
.auth-logo-text em { font-style: normal; color: var(--accent); }

/* ── Card ── */
.auth-card {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.auth-card h1 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 14px; color: var(--muted); margin-bottom: 24px;
}

/* ── Alert ── */
.auth-alert {
  display: none; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5; margin-bottom: 20px;
}
.auth-alert.show { display: flex; }
.auth-alert.error   { background: var(--red-bg);    border: 1px solid var(--red-border);    color: var(--red); }
.auth-alert.success { background: var(--accent-bg); border: 1px solid var(--accent-border); color: var(--accent2); }
.auth-alert.warning { background: var(--yellow-bg); border: 1px solid var(--yellow-border); color: var(--yellow); }

/* ── Form ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.auth-input {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s;
  outline: none;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--muted); }

.input-wrap { position: relative; }
.input-wrap .auth-input { padding-right: 44px; }
.toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; padding: 4px;
  transition: color .15s;
}
.toggle-pass:hover { color: var(--text); }

/* ── Buttons ── */
.btn-full {
  width: 100%; padding: 11px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px;
}
.btn-full:hover { background: var(--accent2); }

.btn-full-outline {
  width: 100%; padding: 10px;
  background: none; color: var(--muted);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: border-color .15s, color .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px; text-align: center;
}
.btn-full-outline:hover { border-color: var(--accent); color: var(--text); }

.btn-ghost {
  background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 500; cursor: pointer;
  padding: 6px 10px; border-radius: 6px; font-family: inherit;
  transition: color .15s, background .15s;
}
.btn-ghost:hover { color: var(--text); background: var(--bg3); }

/* ── Divider ── */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}

/* ── Footer text ── */
.auth-footer-text {
  font-size: 13px; color: var(--muted); text-align: center;
}
.auth-footer-text a { color: var(--accent); transition: color .15s; }
.auth-footer-text a:hover { color: var(--accent2); }

/* ── Terms ── */
.terms-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--muted); margin-top: 4px;
}
.terms-check input[type=checkbox] { margin-top: 2px; accent-color: var(--accent); }
.terms-check a { color: var(--accent); }

/* ── Test notice ── */
.test-notice {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--yellow-bg); border: 1px solid var(--yellow-border);
  color: var(--yellow); font-size: 12px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}

/* ── OTP input ── */
.otp-inputs {
  display: flex; gap: 8px; justify-content: center; margin: 20px 0;
}
.otp-digit {
  width: 48px; height: 56px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 22px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  text-align: center; outline: none;
  transition: border-color .15s;
}
.otp-digit:focus { border-color: var(--accent); }
.otp-digit.filled { border-color: var(--border2); }

/* ── QR block ── */
.qr-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; padding: 24px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius); margin: 20px 0;
}
.qr-block #qrcode canvas,
.qr-block #qrcode img { border-radius: 8px; }
.qr-hint { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }

/* ── Steps ── */
.setup-steps {
  display: flex; align-items: center; gap: 0;
  margin-bottom: 28px; position: relative;
}
.setup-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex: 1; position: relative; z-index: 1;
}
.setup-steps::before {
  content: ''; position: absolute; top: 15px; left: 15%; right: 15%;
  height: 1px; background: var(--border2); z-index: 0;
}
.step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.step-dot.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-dot.done   { background: var(--accent-bg); border-color: var(--accent); color: var(--accent2); }
.step-label { font-size: 11px; color: var(--muted); }
.step-label.active { color: var(--accent2); }

/* ── Recovery codes ── */
.recovery-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin: 16px 0;
}
.recovery-code {
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg3); border: 1px solid var(--border2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text2);
  text-align: center; letter-spacing: 1px;
  user-select: all;
}
.recovery-actions {
  display: flex; gap: 8px; margin-top: 8px;
}
.recovery-actions button {
  flex: 1; padding: 9px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 13px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: border-color .15s, color .15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.recovery-actions button:hover { border-color: var(--accent); color: var(--accent2); }

/* ── Secret key display ── */
.secret-key {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); margin: 12px 0;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent2);
  letter-spacing: 1px; word-break: break-all;
}
.secret-key span { flex: 1; }

/* ── App list ── */
.app-list {
  display: flex; gap: 10px; margin: 16px 0;
}
.app-badge {
  flex: 1; padding: 10px 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); text-align: center;
  font-size: 12px; color: var(--muted);
}
.app-badge i { display: block; font-size: 20px; margin-bottom: 4px; color: var(--text2); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .form-row  { grid-template-columns: 1fr; }
  .otp-digit { width: 40px; height: 48px; font-size: 18px; }
  .recovery-grid { grid-template-columns: 1fr; }
  .app-list { flex-direction: column; }
}
