/* AFK Cloud Dashboard - Matching afkdev.app brand */

:root {
  --color-bg: #09090B;
  --color-surface: #18181B;
  --color-border: #27272A;
  --color-muted: #71717A;
  --color-foreground: #FAFAFA;
  --color-green: #22C55E;
  --color-green-dim: rgba(34, 197, 94, 0.15);
  --color-danger: #ef4444;
  --color-warning: #f59e0b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

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

html {
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-foreground);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-foreground);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user-name {
  font-size: 0.875rem;
  color: var(--color-muted);
  display: none;
}

@media (min-width: 480px) {
  .nav-user-name {
    display: block;
  }
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 0;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(250, 250, 250, 0.15);
}

.btn-primary:disabled {
  background: var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

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

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

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn-full {
  width: 100%;
}

/* Cards */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

@media (min-width: 480px) {
  .card {
    padding: 2rem;
  }
}

/* Instance states */
.instance-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-muted);
}

.status-dot.running {
  background: var(--color-green);
}

.status-dot.warning {
  background: var(--color-warning);
  animation: pulse 2s infinite;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.instance-desc {
  font-size: 0.9375rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* Pairing code */
.pairing-code {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 10vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  padding: 1.25rem;
  background: var(--color-bg);
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}

.countdown {
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
}

.empty-state p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* Instructions */
.instructions {
  margin-top: 2rem;
}

.instructions h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.instructions ol {
  padding-left: 1.25rem;
  color: var(--color-muted);
  font-size: 0.9375rem;
}

.instructions li {
  margin-bottom: 0.5rem;
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-foreground);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

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

/* Loading state */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 1rem;
  color: var(--color-muted);
}

/* Hero section for index */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 0;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--color-green);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.0625rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
  max-width: 400px;
}

.hero p strong {
  color: var(--color-foreground);
  font-weight: 500;
}

/* Google sign-in button */
.btn-google {
  background: var(--color-foreground);
  color: var(--color-bg);
  gap: 0.75rem;
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

/* Footer */
footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

footer p {
  font-size: 0.8125rem;
  color: var(--color-muted);
}

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

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

/* Alert / Toast */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--color-danger);
  color: var(--color-danger);
}

/* Logo SVG */
.logo-svg {
  width: 32px;
  height: 32px;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
