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

:root {
  --color-bg: #0a0a0a;
  --color-surface: #1a1a1a;
  --color-border: #333;
  --color-text: #e5e5e5;
  --color-text-muted: #888;
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-warning: #f59e0b;
  --color-warning-bg: #422006;
  --color-error: #ef4444;
  --color-error-bg: #450a0a;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tagline {
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

main {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
}

.section {
  animation: fadeIn 0.2s ease;
}

.section.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

p {
  margin-bottom: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.user-info {
  background: var(--color-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.user-info p {
  margin-bottom: 0.5rem;
}

.user-info p:last-child {
  margin-bottom: 0;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.alert-warning {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  color: var(--color-warning);
}

.alert-error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
}

.key-display {
  margin-bottom: 2rem;
}

.key-display label {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.copy-box {
  display: flex;
  align-items: stretch;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.copy-box code,
.copy-box pre {
  flex: 1;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  padding: 0.5rem 1rem;
  background: var(--color-border);
  border: none;
  border-left: 1px solid var(--color-border);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.copy-btn:hover {
  background: var(--color-primary);
}

.copy-btn.copied {
  background: #22c55e;
}

.snippets {
  margin-bottom: 2rem;
}

.snippet {
  margin-bottom: 1.5rem;
}

.snippet:last-child {
  margin-bottom: 0;
}

.snippet-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

footer {
  text-align: center;
  margin-top: 2rem;
  color: var(--color-text-muted);
}

footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--color-text);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

#loading-section {
  text-align: center;
  padding: 3rem 0;
}

/* Button spacing */
#user-section .btn {
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}
