/* Batch Scanner – shared design system
   Modern dark theme, green accent, Outfit font */

:root {
  /* Core */
  --bg: #070b12;
  --bg-elevated: #0d1219;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Brand – app green */
  --primary: #06c167;
  --primary-hover: #05a858;
  --primary-muted: rgba(6, 193, 103, 0.2);
  --primary-glow: rgba(6, 193, 103, 0.35);

  /* Text */
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #0ea5e9;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Typography */
  --font: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Outfit", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Subtle background pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(6, 193, 103, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(6, 193, 103, 0.04), transparent),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(6, 193, 103, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

/* Nav */
.nav,
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(7, 11, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) var(--space-xl);
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav .logo,
.logo {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-display);
}

.logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  align-items: flex-start;
}

.logo span {
  background: linear-gradient(135deg, var(--primary) 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.9em;
}

.logo img,
.logo svg {
  width: 44px;
  height: 44px;
  display: block;
  flex-shrink: 0;
}

.nav-links,
.nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
}

.nav-links a,
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

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

/* Language selector */
.language-selector {
  position: relative;
  margin-left: var(--space-md);
}

.language-dropdown {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) 0;
  min-width: 160px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-sm);
  z-index: 1001;
}

.language-dropdown.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.language-dropdown button {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.language-dropdown button:hover {
  background: var(--primary-muted);
  color: var(--primary);
}

.language-dropdown button.active {
  background: var(--primary-muted);
  color: var(--primary);
  font-weight: 600;
}

.language-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.language-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.language-toggle::after {
  content: "▼";
  font-size: 0.65em;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.language-toggle.open::after {
  transform: rotate(180deg);
}

/* Buttons */
.btn,
button.btn,
a.btn,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary,
.button,
button:not(.language-toggle):not(.menu-toggle) {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover,
.button:hover,
button:not(:disabled):hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--primary-glow);
}

button:disabled,
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  box-shadow: none;
}

.btn-danger,
.logout-btn {
  background: var(--error);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover,
.logout-btn:hover {
  background: #dc2626;
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.4);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.card h2 {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.card p,
.card li {
  color: var(--text-muted);
  line-height: 1.65;
}

/* Hero */
.hero-section {
  margin-top: 80px;
  min-height: 60vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-xl);
  z-index: 1;
}

.slide-content {
  max-width: 900px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-content h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: 1.2;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: var(--font-display);
}

.slide-content p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.slide-content .btn-primary {
  padding: var(--space-md) var(--space-xl);
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Feature grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.feature-card .icon {
  font-size: 2.25rem;
  margin-bottom: var(--space-md);
  line-height: 1;
}

.feature-card h3 {
  color: var(--primary);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

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

/* Sections */
.download-section {
  background: transparent;
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  margin-top: var(--space-lg);
  z-index: 1;
}

.download-section h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: var(--space-lg);
  color: var(--text);
  font-weight: 700;
}

.download-section p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  font-size: 1.05rem;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

/* Footer */
.footer {
  background: var(--bg-elevated);
  padding: var(--space-xl);
  text-align: center;
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--border);
  z-index: 1;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.footer p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: var(--space-md);
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
.header-search,
.search-box {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input::placeholder,
input::placeholder {
  color: var(--text-dim);
}

input:focus,
.header-search:focus,
.search-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-muted);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: var(--space-xs);
}

.error {
  margin-top: var(--space-md);
  color: var(--error);
  font-size: 0.9rem;
  padding: var(--space-md);
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.25);
  display: none;
}

.error:not(:empty) {
  display: block;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-lg);
  position: relative;
  z-index: 1;
}

body.page-with-nav .container {
  margin-top: 100px;
}

/* Subscription grid (checkout) */
.subscription-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.subscription-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-card);
}

.subscription-card:hover {
  border-color: var(--primary);
  background: var(--primary-muted);
  transform: translateY(-2px);
}

.subscription-card.selected {
  border-color: var(--primary);
  background: var(--primary-muted);
  box-shadow: 0 0 0 1px var(--primary);
}

.subscription-card h3 {
  color: var(--text);
  margin-bottom: var(--space-sm);
  font-size: 1.1rem;
}

.subscription-card .price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  margin: var(--space-sm) 0;
}

.subscription-card .period {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* User info bar */
.user-info {
  background: var(--primary-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.user-info p {
  margin: 0;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.user-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

/* Loading */
.loading {
  display: none;
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.loading.active {
  display: block;
}

.spinner {
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-md);
}

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

/* Standalone centered pages (success, cancel, settings) */
body.page-standalone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
}

body.page-standalone .container {
  max-width: 480px;
  margin: 0;
  text-align: center;
}

body.page-standalone .card h1 {
  margin-bottom: var(--space-md);
}

body.page-standalone .card p {
  margin-bottom: var(--space-lg);
}

.info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-lg);
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: left;
}

.info strong {
  color: var(--text);
}

/* Success page */
.success-icon {
  width: 72px;
  height: 72px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.success-icon::after {
  content: "✓";
  color: #fff;
  font-size: 2.25rem;
  font-weight: 700;
}

.cancel-icon {
  width: 72px;
  height: 72px;
  background: var(--error);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-lg);
}

.cancel-icon::after {
  content: "✕";
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
}

/* Mobile nav */
.nav .menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
}

@media (max-width: 768px) {
  .nav,
  .navbar {
    padding: var(--space-md) var(--space-lg);
    flex-wrap: wrap;
  }

  .nav .menu-toggle {
    display: block;
  }

  .nav ul,
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
  }

  .nav ul.active,
  .nav-links.active {
    display: flex;
  }

  .nav ul li,
  .nav-links li {
    width: 100%;
    padding: var(--space-sm) 0;
  }

  .nav a,
  .nav-links a {
    display: block;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
  }

  .nav a:hover,
  .nav a.active {
    background: var(--primary-muted);
  }

  .logo span {
    font-size: 0.8em;
  }

  .logo img,
  .logo svg {
    width: 36px;
    height: 36px;
  }

  .slide-content h1 {
    font-size: 1.75rem;
  }

  .slide-content p {
    font-size: 1rem;
  }

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

  .container {
    margin-top: 80px;
    padding: var(--space-md);
  }

  body.page-with-nav {
    padding-top: 80px;
  }
}

/* Checkout: section visibility */
.login-section,
.checkout-section {
  display: none;
}

.login-section.active,
.checkout-section.active {
  display: block;
  animation: fadeInUp 0.4s ease-out;
}

.subtitle {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-xl);
  font-size: 1.1rem;
}

.card h1 {
  color: var(--text);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-sm);
}

.card h1 + .subtitle {
  margin-top: 0;
}

#resetPasswordLink,
a.link-primary {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

#resetPasswordLink:hover,
a.link-primary:hover {
  color: var(--primary-hover);
}

.footer-link {
  margin-top: var(--space-lg);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.footer-link a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link a:hover {
  color: var(--primary-hover);
}

.manage-subscription-btn {
  width: auto;
  min-width: 200px;
}

.cancel-subscription-btn {
  width: auto;
  min-width: 200px;
}

@media (max-width: 480px) {
  .nav,
  .navbar {
    padding: var(--space-sm) var(--space-md);
  }

  .language-toggle {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
  }

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

@media (max-width: 480px) {
  .container {
    padding: var(--space-md);
  }
  .card {
    padding: var(--space-lg);
  }
  .hero-section .slide-content h1 {
    font-size: 1.5rem;
  }
  .hero-section .slide-content p {
    font-size: 0.95rem;
  }
  .features-grid {
    gap: var(--space-md);
  }
  .feature-card {
    padding: var(--space-md);
  }
  input, select, button, .btn {
    min-height: 44px;
  }
}

/* Prevent horizontal overflow */
img, video, iframe {
  max-width: 100%;
  height: auto;
}
