/* ─────────────────────────────────────────────────────────────
   TryOpenClaw — Styles
   Pure CSS, no framework, dark theme
   ───────────────────────────────────────────────────────────── */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:          #09090b;
  --bg-surface:  #111113;
  --bg-card:     #18181b;
  --bg-elevated: #1e1e23;
  --border:      #27272a;
  --border-light:#3f3f46;

  --text:        #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted:  #71717a;

  --accent:      #06b6d4;
  --accent-hover:#22d3ee;
  --accent-soft: rgba(6, 182, 212, 0.1);
  --accent-glow: rgba(6, 182, 212, 0.25);

  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;

  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --transition:  0.2s ease;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --max-width: 1120px;
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Layout ────────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.section {
  padding: 96px 0;
}
.section-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-header .section-subtitle {
  margin: 0 auto;
}

/* ─── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  padding: 4px;
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--bg-elevated);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); }
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}
.btn-google {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
}
.btn-google:hover {
  background: #f5f5f5;
  border-color: #ccc;
}
.btn-google svg {
  width: 18px;
  height: 18px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 160px 0 96px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 36px;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--border);
}
.hero-stat {
  text-align: center;
}
.hero-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.hero-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Features ──────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
}
.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 20px;
  margin-bottom: 20px;
}
.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─── How It Works ──────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step {
  text-align: center;
  padding: 32px 24px;
}
.step-number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #000;
  font-size: 18px;
  font-weight: 700;
  border-radius: 50%;
  margin: 0 auto 20px;
}
.step h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.step p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ─── Pricing ───────────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: start;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  transition: all var(--transition);
}
.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
  box-shadow: 0 0 40px var(--accent-glow);
}
.pricing-card.featured::before {
  content: 'Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
}
.pricing-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}
.pricing-card .price {
  font-size: 36px;
  font-weight: 700;
  margin: 16px 0 4px;
}
.pricing-card .price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.pricing-card .price-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.pricing-features {
  list-style: none;
  margin-bottom: 28px;
}
.pricing-features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pricing-features li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}
.pricing-card .btn { width: 100%; }

/* ─── FAQ ───────────────────────────────────────────────────── */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.faq-item.open .faq-question::after {
  content: '−';
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 200px;
}
.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 20px;
  line-height: 1.7;
}

/* ─── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
}
.footer-links a:hover { color: var(--text-secondary); }

/* ─── Auth Modal ────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }
.modal h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}
.modal .modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.auth-form { display: none; }
.auth-form.active { display: block; }

/* Form elements */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input::placeholder {
  color: var(--text-muted);
}
.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }
.form-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-message {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--success);
}
.auth-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}
.email-link-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.email-link-section button {
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
}
.email-link-section button:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dashboard ─────────────────────────────────────────────── */
.dashboard {
  padding-top: 80px;
  min-height: 100vh;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}
.dash-name {
  font-size: 15px;
  font-weight: 600;
}
.dash-email {
  font-size: 13px;
  color: var(--text-muted);
}
.instances-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.instance-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.instance-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.instance-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 100px;
}
.instance-status.running {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}
.instance-status.stopped {
  background: rgba(161, 161, 170, 0.1);
  color: var(--text-muted);
}
.instance-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}
.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ─── VNC Viewer ────────────────────────────────────────────── */
.vnc-page {
  padding-top: 64px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.vnc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.vnc-timer {
  font-size: 14px;
  font-weight: 600;
  color: var(--warning);
  font-family: var(--font-mono);
}
.vnc-container {
  flex: 1;
  position: relative;
  background: #000;
}
.vnc-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.vnc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
}
.vnc-loading .spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
  color: var(--accent);
}
.vnc-expired {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(9, 9, 11, 0.95);
  text-align: center;
}
.vnc-expired.active { display: flex; }
.vnc-expired h3 {
  font-size: 22px;
  font-weight: 700;
}
.vnc-expired p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ─── Legal Pages ──────────────────────────────────────────── */
.legal-page {
  padding: 120px 0 80px;
  min-height: 100vh;
}
.legal-container {
  max-width: 720px;
}
.legal-container h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-updated {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 48px;
}
.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}
.legal-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.legal-content ul {
  margin-bottom: 16px;
  padding-left: 24px;
}
.legal-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.legal-content a {
  color: var(--accent);
}
.legal-content a:hover {
  text-decoration: underline;
}

/* ─── Utilities ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .hero { padding: 120px 0 64px; }
  .hero-stats { flex-direction: column; gap: 24px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .footer .container { flex-direction: column; gap: 16px; text-align: center; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
}
@media (max-width: 480px) {
  .section { padding: 64px 0; }
  .section-title { font-size: 28px; }
  .modal { margin: 16px; padding: 24px; }
}
