:root {
  --bg: #0e1621;
  --bg-card: #17212b;
  --bg-soft: #242f3d;
  --text: #f5f5f5;
  --muted: #8b98a5;
  --accent: #2aabee;
  --accent-hover: #229ed9;
  --danger: #e53935;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top, #1b2836 0%, var(--bg) 55%);
  color: var(--text);
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  text-align: center;
}

.logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
}

.title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.qr-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-wrap.mobile {
  width: 100%;
  max-width: 280px;
  height: auto;
  min-height: 120px;
  background: transparent;
  box-shadow: none;
}

.qr-img {
  width: 248px;
  height: 248px;
  object-fit: contain;
}

.qr-loading,
.qr-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #17212b;
  font-size: 0.92rem;
}

.qr-wrap.mobile .qr-loading,
.qr-wrap.mobile .qr-error {
  position: static;
  min-height: 120px;
  border-radius: 14px;
  background: var(--bg-soft);
  color: var(--text);
}

.hidden { display: none !important; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(42, 171, 238, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.98); }

.btn.outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(42, 171, 238, 0.45);
}

.steps {
  text-align: left;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.steps li + li { margin-top: 6px; }

.status {
  min-height: 22px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--accent);
}

.status.error { color: var(--danger); }

.footer {
  margin-top: 18px;
  font-size: 0.75rem;
  color: #5f6b76;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  min-height: 48px;
  text-decoration: none;
}

.password-box {
  margin-top: 16px;
  text-align: left;
}

.password-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

.password-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.password-input:focus {
  outline: none;
  border-color: rgba(42, 171, 238, 0.6);
}

.password-error {
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.85rem;
}
