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

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text-dim: #9ca3af;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 8px;
}

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

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Landing */
.landing {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}
.google-btn-hero {
  font-size: 1.05rem;
  padding: 0.8rem 2rem;
}
.hero-note {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Products */
.products-section, .how-section {
  margin-top: 3rem;
}
.products-section h2, .how-section h2 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
}
.product-card.featured {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}
.product-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-weight: 600;
}
.product-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}
.product-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}
.product-price span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
}
.product-features {
  list-style: none;
}
.product-features li {
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.product-features li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 600;
}

/* How it works */
.how-steps {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}
.how-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex: 1;
  max-width: 220px;
}
.how-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.how-step strong {
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.2rem;
}
.how-step p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Auth card (kept for backward compat) */
.auth-card {
  max-width: 400px;
  margin: 80px auto;
  text-align: center;
}
.auth-card h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--text-dim); margin-bottom: 1rem; }

/* Trust badges */
.trust-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--success);
  letter-spacing: 0.02em;
}

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 1.5rem; }
.tab {
  flex: 1;
  padding: 0.6rem;
  background: none;
  border: none;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
}
.tab.active {
  border-bottom-color: var(--primary);
  color: var(--text);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

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

/* Forms */
input {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
}
input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn.primary {
  width: 100%;
  background: var(--primary);
  color: white;
}
.btn.primary:hover { background: var(--primary-hover); }
.btn.small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  background: var(--border);
  color: var(--text);
}
.btn.small:hover { background: var(--primary); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error { color: var(--error); font-size: 0.85rem; margin-top: 0.5rem; }

/* Google login button */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #fff;
  color: #3c4043;
  font-weight: 500;
  border: 1px solid #dadce0;
  text-decoration: none;
  font-size: 0.95rem;
}
.google-btn:hover { background: #f7f8f8; }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}
.info-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Nav */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.logo-icon {
  display: flex;
  align-items: center;
  color: var(--primary);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
#user-email { color: var(--text-dim); font-size: 0.85rem; }
.btn-logout {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-logout:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* Dashboard */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}
.header-right { display: flex; align-items: center; gap: 1rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}
.full-width { grid-column: 1 / -1; }

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

/* Status */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
}
.dot.active { background: var(--success); }
.dot.provisioning { background: var(--warning); animation: pulse 1.5s infinite; }
.dot.error { background: var(--error); }
.dot.paused { background: var(--warning); }

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

#agent-info p {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
  color: var(--text-dim);
}
#agent-info span { color: var(--text); }

.actions { margin-top: 1rem; }

/* Steps */
.steps { display: flex; flex-direction: column; gap: 1rem; }
.step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}
.step.done .step-num {
  background: var(--success);
}
.step p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0.2rem 0 0.5rem;
}

/* Activity */
.activity-list { max-height: 300px; overflow-y: auto; }
.activity-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-time { color: var(--text-dim); font-size: 0.75rem; }
.empty { color: var(--text-dim); font-size: 0.85rem; text-align: center; padding: 2rem; }

/* Setup subtitle */
.setup-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: -0.5rem 0 1rem;
}

/* Telegram CTA */
.telegram-cta {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.cta-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.telegram-cta h3 {
  color: var(--success) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  font-size: 1.2rem !important;
  margin-bottom: 0.3rem !important;
}
.telegram-cta p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.telegram-cta .btn.primary {
  width: auto;
  padding: 0.7rem 2rem;
  font-size: 1rem;
}

/* Security */
.security-items { display: flex; flex-direction: column; gap: 1rem; }
.security-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.security-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.security-item strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}
.security-item p {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* Settings */
.form-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}
.select-input, .textarea-input {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}
.select-input:focus, .textarea-input:focus {
  outline: none;
  border-color: var(--primary);
}
.textarea-input { resize: vertical; min-height: 60px; }
.save-status {
  font-size: 0.8rem;
  margin-left: 0.5rem;
  color: var(--success);
}

/* Telegram link */
.telegram-link {
  color: var(--primary);
  text-decoration: none;
}
.telegram-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  .dashboard-grid { grid-template-columns: 1fr; padding: 1rem; }
  .auth-card { margin: 40px 1rem; }
  .products-grid { grid-template-columns: 1fr; }
  .how-steps { flex-direction: column; align-items: center; }
  .hero h1 { font-size: 2rem; }
  .landing { padding: 1rem; }
}
