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

:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 8px;
}

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

main.container {
  flex: 1;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  opacity: 1;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

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

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

.btn-outline:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.1rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--primary) 0%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert a {
  color: inherit;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

.alert-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #f5f3ff;
  color: var(--primary);
  border: 1px solid #ddd6fe;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  list-style: none;
}

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

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

.breadcrumb__sep {
  color: var(--border);
}

/* Instructions */
.instruction-step {
  margin-bottom: 16px;
}

.instruction-step h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.instruction-step p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.instruction-step p:last-child {
  margin-bottom: 0;
}

.instruction-step a {
  color: var(--primary);
}

.instruction-step code {
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
}

/* Platform grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.platform-card {
  display: block;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.platform-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

.platform-card h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.platform-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  padding: 24px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* Trial banner */
.trial-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 0 0 48px;
}

.trial-banner__icon {
  font-size: 2.4rem;
  flex-shrink: 0;
}

.trial-banner__body {
  flex: 1;
  min-width: 0;
}

.trial-banner__title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.trial-banner__text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Features grid */
.section-block {
  margin: 0 0 48px;
}

.section-title {
  margin-bottom: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.feature-card__icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.feature-card a {
  color: var(--primary);
  text-decoration: none;
}

/* Auth pages */
.auth-container {
  max-width: 420px;
  margin: 60px auto;
}

.auth-container h1 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
}

.divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider::before { margin-right: 12px; }
.divider::after { margin-left: 12px; }

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--primary);
}

/* Telegram widget container */
.telegram-widget {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

/* Dashboard */
.dashboard-header {
  padding: 32px 0 16px;
}

.dashboard-header h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.dashboard-header p {
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  background: #dcfce7;
  color: var(--success);
}

.status-expired {
  background: #fef2f2;
  color: var(--danger);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

.btn-outline .spinner {
  border-color: rgba(0, 0, 0, 0.15);
  border-top-color: var(--text);
}

.btn.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

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

/* Responsive */
@media (max-width: 720px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .trial-banner {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 2.2rem; }
  .nav-links { gap: 8px; }
}
