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

html[data-theme='light'] {
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}

.page {
  max-width: 1100px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

a {
  color: #60a5fa;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1.25rem;
  background: #020617;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid #1f2937;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-img {
  height: 36px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-sub {
  font-size: 0.8rem;
  color: #9ca3af;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  border: none;
  background: #1f2937;
  color: #e5e7eb;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
}

.icon-btn:hover {
  background: #374151;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.hero-text h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.hero-text p {
  margin-bottom: 0.75rem;
  color: #cbd5f5;
}

.bullet-list {
  margin-left: 1.2rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.bullet-list li {
  margin-bottom: 0.25rem;
}

.subscription-box {
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.subscription-box input {
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
}

.small-btn {
  align-self: flex-start;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.info-text {
  min-height: 1.1rem;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.primary-btn {
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: #f9fafb;
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.secondary-btn {
  background: #1f2937;
  color: #e5e7eb;
}

.secondary-btn:hover {
  background: #374151;
}

.hero-btn {
  margin-top: 0.5rem;
}

.hero-scanner {
  background: radial-gradient(circle at top left, #1d4ed8 0, #020617 45%);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.7);
}

.hero-scanner h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.scanner-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.scanner-preview video {
  width: 100%;
  border-radius: 0.75rem;
  background: #000;
  max-height: 260px;
  object-fit: contain;
}

#processingCanvas {
  display: none;
}

.scanner-controls {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.scanner-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.pages-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.pages-preview img {
  width: 72px;
  height: 72px;
  border-radius: 0.6rem;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.7);
}

.scanner-thumbs h3 {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.filter-info {
  margin-top: 0.35rem;
  color: #e5e7eb;
}

.section {
  margin-top: 2.25rem;
}

.section h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}

.price-card {
  background: #020617;
  border-radius: 0.9rem;
  padding: 1rem;
  border: 1px solid #1f2937;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
}

.price-card h3 {
  margin-bottom: 0.25rem;
}

.price-card .price {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.price-card ul {
  margin-left: 1.1rem;
  margin-bottom: 0.7rem;
  font-size: 0.9rem;
}

.price-card li {
  margin-bottom: 0.25rem;
}

.full-width {
  width: 100%;
}

.small {
  font-size: 0.8rem;
  color: #9ca3af;
}

.footer {
  border-top: 1px solid #1f2937;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

.footer-links a {
  margin: 0 0.35rem;
}

.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #020617;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  border: 1px solid #374151;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  z-index: 100;
}

.cookie-banner button {
  border: none;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: #22c55e;
  color: #022c22;
  cursor: pointer;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

.error {
  color: #fca5a5;
}

.success {
  color: #4ade80;
}

.card {
  background: #020617;
  border-radius: 0.9rem;
  padding: 1rem;
  border: 1px solid #1f2937;
  margin-top: 1rem;
}

.card form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.5rem;
}

.card input[type="text"],
.card input[type="email"],
.card input[type="number"],
.card input[type="password"] {
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  border: 1px solid #4b5563;
  background: #020617;
  color: #f9fafb;
  font-size: 0.9rem;
}

.admin-page .page {
  max-width: 850px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .scanner-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
