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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: #e0e0e0;
  padding: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #6c63ff, #48cfcb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 28px;
}

.label {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: #ccc;
}

/* Region buttons */
.region-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.region-btn {
  padding: 10px 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: transparent;
  color: #bbb;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.region-btn:hover {
  border-color: #6c63ff;
  color: #fff;
}

.region-btn.selected {
  border-color: #6c63ff;
  background: rgba(108, 99, 255, 0.15);
  color: #fff;
}

/* Primary button */
.primary-btn {
  display: inline-block;
  padding: 12px 40px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6c63ff, #48cfcb);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.primary-btn:hover {
  opacity: 0.9;
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.secondary-btn {
  margin-top: 16px;
  padding: 10px 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  border-color: #6c63ff;
  color: #fff;
}

/* Auth step */
.code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.code-label {
  font-size: 0.8rem;
  color: #888;
}

.code-value {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #48cfcb;
  font-family: "Courier New", monospace;
}

.hint {
  font-size: 0.8rem;
  color: #777;
  margin-bottom: 20px;
}

.hint a {
  color: #6c63ff;
  text-decoration: none;
}

.hint a:hover {
  text-decoration: underline;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.poll-status {
  font-size: 0.85rem;
  color: #999;
}

/* Success */
.success-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #48cfcb, #6c63ff);
  color: #fff;
  font-size: 1.6rem;
  margin: 0 auto 16px;
}

.success-text {
  color: #48cfcb;
  font-weight: 600;
  font-size: 1.1rem;
}

.notification {
  margin: 12px 0;
  padding: 10px 16px;
  background: rgba(108, 99, 255, 0.12);
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #bbb;
}

.token-box {
  margin-top: 20px;
  text-align: left;
}

.token-box label {
  font-size: 0.8rem;
  color: #888;
  display: block;
  margin-bottom: 6px;
}

.token-row {
  display: flex;
  gap: 8px;
}

.token-row input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #e0e0e0;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
}

.copy-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: #6c63ff;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.copy-btn:hover {
  opacity: 0.85;
}

.expires {
  margin-top: 12px;
  font-size: 0.8rem;
  color: #888;
}

/* Error */
.error-text {
  color: #ff6b6b;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

/* Utils */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 480px) {
  .card {
    padding: 28px 20px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .region-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .code-value {
    font-size: 1.2rem;
  }
}
