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

:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #141416;
  --bg-card: #1a1a1e;
  --bg-card-hover: #222228;
  --border: #2a2a30;
  --text-primary: #f0f0f0;
  --text-secondary: #888891;
  --text-muted: #5c5c66;
  --accent: #6c5ce7;
  --accent-hover: #5a4bd6;
  --accent-glow: rgba(108, 92, 231, 0.15);
  --danger: #e74c3c;
  --danger-hover: #c0392b;
  --success: #2ecc71;
  --radius: 8px;
  --radius-lg: 12px;
}

html {
  scroll-behavior: smooth;
}

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

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

a:hover {
  color: var(--accent-hover);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

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

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

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.nav-logo:hover {
  color: var(--accent);
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.nav-email {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  gap: 8px;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

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

.btn-outline:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

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

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
}

/* Hero */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(108, 92, 231, 0.08), transparent 70%);
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  max-width: 750px;
  margin: 0 auto 20px;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Pricing */
.pricing {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 48px;
}

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

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.2s;
}

.pricing-card:hover {
  border-color: var(--accent);
}

.pricing-card.featured {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pricing-card-header {
  margin-bottom: 24px;
}

.pricing-card-header h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 28px;
}

.pricing-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.pricing-features li::before {
  content: '✓ ';
  color: var(--success);
  font-weight: 700;
}

/* Auth pages */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 40px 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 28px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: var(--radius);
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Dashboard */
.dashboard {
  padding: 40px 0;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.usage-indicator {
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
}

.add-asin {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.asin-input {
  flex: 1;
  max-width: 300px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  text-transform: uppercase;
  transition: border-color 0.2s;
}

.asin-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.asin-input::placeholder {
  text-transform: none;
  color: var(--text-muted);
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 24px;
}

.asin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.asin-table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.asin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.asin-table tbody tr:hover {
  background: var(--bg-card);
}

.asin-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-card);
}

.asin-title-cell {
  font-weight: 500;
}

.asin-thumb-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

/* Upgrade section */
.upgrade-section {
  margin-top: 40px;
  padding: 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.upgrade-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex: 1;
  min-width: 200px;
}

.upgrade-section .upgrade-title {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.upgrade-section .upgrade-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 60px 0;
  }
}

@media (max-width: 640px) {
  .asin-thumb {
    width: 36px;
    height: 36px;
  }

  .asin-thumb-placeholder {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .asin-table th:nth-child(5),
  .asin-table td:nth-child(5) {
    display: none;
  }

  .asin-table th:nth-child(2),
  .asin-table td:nth-child(2) {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .asin-table th,
  .asin-table td {
    padding: 10px 10px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .usage-indicator {
    align-self: flex-start;
  }

  .upgrade-section {
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
  }

  .upgrade-section .upgrade-actions {
    justify-content: center;
  }
}
