/* Universe Unlocked — Space ebook store */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2035;
  --text-primary: #f0f0f5;
  --text-secondary: #9ca3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --border: #2a3050;
  --success: #22c55e;
  --max-width: 1100px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

h1, h2, h3, .logo, .price, .btn {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Stars background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 15%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 45%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 80%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 90%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 40%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 50%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 25%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 90%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 60%, rgba(255,255,255,0.3) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* Layout */
header, main, footer {
  position: relative;
  z-index: 1;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 2rem;
  transition: color 0.2s;
}

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

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 0 4rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

/* Product grid */
.products {
  padding: 3rem 0 5rem;
}

.products h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Product card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg-secondary);
}

.product-card-body {
  padding: 1.5rem;
}

.product-card-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-card-body .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}

.product-card-body .description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Product detail page */
.product-detail {
  padding: 4rem 0;
}

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.product-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(99, 102, 241, 0.08);
  transition: box-shadow 0.3s;
}

.product-image:hover {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 50px rgba(99, 102, 241, 0.12);
}

.product-info h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.product-info .price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.product-info .description {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.product-info .features {
  list-style: none;
  margin-bottom: 2rem;
}

.product-info .features li {
  padding: 0.4rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.product-info .features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  margin-right: 0.75rem;
}

/* Consent checkbox */
.consent-group {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.consent-group:has(input:checked) {
  border-color: rgba(99, 102, 241, 0.4);
}

.consent-group label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
  letter-spacing: 0.005em;
}

.consent-group label span {
  display: block;
}

.consent-group label a {
  color: var(--accent);
  text-decoration: none;
}

.consent-group label a:hover {
  text-decoration: underline;
}

.consent-group input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: var(--bg-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}

.consent-group input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.consent-group input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: 2px solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

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

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success page */
.success-page {
  text-align: center;
  padding: 5rem 0;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 80px;
  height: 80px;
  background: rgba(34, 197, 94, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 2.5rem;
}

.success-page h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.success-page p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.download-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}

.download-box h3 {
  margin-bottom: 1rem;
}

.youtube-cta {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.youtube-cta h3 {
  margin-bottom: 0.5rem;
}

.youtube-cta p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.btn-youtube {
  background: #ff0000;
  color: #fff;
  display: inline-flex;
  padding: 0.75rem 1.5rem;
  width: auto;
}

.btn-youtube:hover {
  background: #cc0000;
}

/* Legal pages */
.legal-page {
  padding: 3rem 0 5rem;
  max-width: 750px;
  margin: 0 auto;
}

.legal-page h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.legal-page .updated {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.legal-page p, .legal-page li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.legal-page ul, .legal-page ol {
  padding-left: 1.5rem;
}

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

.legal-page a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.85);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

footer nav a {
  font-size: 0.85rem;
  margin-left: 1.5rem;
}

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

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

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

  .hero p {
    font-size: 1rem;
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  nav a {
    margin-left: 1rem;
  }

  nav a:first-child {
    margin-left: 0;
  }

  footer .container {
    flex-direction: column;
    text-align: center;
  }

  footer nav a {
    margin: 0 0.75rem;
  }
}
