:root {
  color-scheme: dark;
  --bg: #09090b;
  --panel: #111827;
  --panel-strong: #0f172a;
  --border: #27272a;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --accent: #22c55e;
  --accent-strong: #16a34a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

img {
  display: block;
  max-width: 100%;
}

button,
.hero-link-button {
  cursor: pointer;
  border: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-inner h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.header-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.header-inner a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 180ms ease;
}

.header-inner a:hover {
  color: var(--accent);
}

.hero-section {
  position: relative;
  min-height: 90vh;
  background-image: url("https://images.unsplash.com/photo-1627856013091-fed6e4e30025?q=80&w=2070&auto=format&fit=crop");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0.88));
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 900px;
}

.hero-content h2 {
  margin: 0 0 18px;
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  line-height: 0.96;
  color: var(--accent);
}

.hero-content p {
  margin: 0 auto 28px;
  max-width: 700px;
  color: #d4d4d8;
  font-size: 1.15rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.hero-actions .hero-link-button {
  min-width: 170px;
  padding: 16px 28px;
  border-radius: 28px;
  font-weight: 800;
  font-size: 1rem;
  transition: transform 160ms ease, background-color 160ms ease;
}

.hero-actions .hero-link-primary {
  background: var(--accent);
  color: #081c0d;
}

/* Confirmation state for auth buttons (green) */
.hero-link-button.confirm {
  background: #28a745 !important;
  color: #ffffff !important;
  border-color: #28a745 !important;
}

.hero-actions .hero-link-button:not(.hero-link-primary) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.hero-actions .hero-link-button:hover {
  transform: translateY(-2px);
}

.hero-link-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.section-description {
  margin: 0 auto 24px;
  text-align: center;
  max-width: 700px;
  color: #d4d4d8;
  line-height: 1.8;
}

.auth-panel {
  max-width: 520px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 32px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.auth-form label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 8px;
  color: #94a3b8;
}

.auth-form input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: var(--text);
  padding: 14px 18px;
  font-size: 1rem;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Rounded auth buttons */
.auth-actions .hero-link-button,
.auth-actions button {
  border-radius: 28px;
  padding: 14px 20px;
  font-weight: 800;
}

.auth-message {
  margin: 0;
  font-size: 0.98rem;
  min-height: 1.4em;
}

.auth-message.error {
  color: #f87171;
}

.auth-message.success {
  color: #86efac;
}

.section-section {
  padding: 90px 24px;
}

.section-dark {
  background: #0f172a;
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.section-inner h2 {
  margin: 0 0 28px;
  font-size: clamp(2.2rem, 3vw, 4rem);
  text-align: center;
  color: var(--accent);
}

.cards-grid,
.products-grid,
.rules-list {
  display: grid;
  gap: 24px;
}

.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.mode-card,
.product-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  transition: transform 220ms ease, border-color 220ms ease;
}

.mode-card:hover,
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 197, 94, 0.5);
}

.mode-card img,
.product-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.mode-card h3,
.product-card h3 {
  margin: 0 0 12px;
  font-size: 1.75rem;
  color: var(--accent);
}

.mode-card p,
.product-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.7;
}

.mode-card .card-body,
.product-card .card-body {
  padding: 24px;
}

.rules-list {
  grid-template-columns: 1fr;
}

.rules-list div {
  background: var(--panel-strong);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 26px;
  color: #d1d5db;
  font-size: 1.07rem;
}

.products-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.product-card .card-body {
  display: grid;
  gap: 18px;
}

.product-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.product-card .price {
  font-size: 1.8rem;
  font-weight: 900;
}

.product-card button,
.donation-buttons button,
#scanButton {
  background: var(--accent);
  color: #081c0d;
  padding: 14px 22px;
  border-radius: 24px;
  font-weight: 800;
  transition: transform 160ms ease, opacity 160ms ease;
}

.product-card button:hover,
.donation-buttons button:hover,
#scanButton:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.text-center {
  text-align: center;
}

.donation-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.qr-panel {
  display: grid;
  gap: 24px;
  justify-items: center;
  padding: 36px 32px;
  background: linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 36px;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

#qrImage {
  width: 260px;
  height: 260px;
  border-radius: 28px;
  border: 6px solid var(--accent);
  background: #fff;
}

.user-box {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  text-align: center;
}

.user-box strong {
  display: block;
  font-size: 2rem;
  color: var(--accent);
}

.code-entry {
  width: 100%;
  max-width: 420px;
  display: grid;
  gap: 14px;
  text-align: left;
}

.code-entry label {
  color: #94a3b8;
  font-size: 0.95rem;
}

.code-entry input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f172a;
  color: var(--text);
  padding: 14px 18px;
  font-size: 1rem;
}

#validateCodeButton {
  width: 100%;
  padding: 14px 20px;
  border-radius: 24px;
  background: var(--accent-strong);
  color: #081c0d;
  font-weight: 800;
  transition: transform 160ms ease, opacity 160ms ease;
}

#validateCodeButton:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.code-message {
  margin: 0;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: #86efac;
}

.code-message.error {
  color: #f87171;
}

#scanButton:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.access-notice {
  display: none;
  max-width: 620px;
  margin: 0 auto 24px;
  padding: 22px 24px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 24px;
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.download-container {
  width: 100%;
  max-width: 520px;
  margin: 18px auto 0;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
}

.download-label {
  margin: 0 0 12px;
  color: #cbd5e1;
  font-size: 0.97rem;
}

.progress-track {
  width: 100%;
  height: 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.hero-link-button.download-finished {
  opacity: 0.92;
}

.site-footer {
  padding: 26px 24px;
  text-align: center;
  background: #020617;
  color: #64748b;
}

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-content h2 {
    font-size: 3rem;
  }
  .hero-actions {
    width: 100%;
  }
  .hero-actions button {
    width: 100%;
  }
}
