/* ==========================================================================
   GEARBLIZZ QR STUDIO - DESIGN SYSTEM & STYLESHEET
   Brand: GEARBLIZZ | Product: QR STUDIO | Tagline: BUILD FOR GAMERS
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #0B0B0D;
  --bg-secondary: #151519;
  --bg-card: #1C1C22;
  --bg-card-hover: #22222B;
  --bg-input: #121216;

  --accent-primary: #ED2635;
  --accent-secondary: #FF4653;
  --accent-glow: rgba(237, 38, 53, 0.25);
  --accent-muted: rgba(237, 38, 53, 0.12);

  --text-primary: #FFFFFF;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;

  --border-subtle: #272730;
  --border-active: #ED2635;
  --border-focus: #FF4653;

  --status-success: #10B981;
  --status-warning: #F59E0B;
  --status-error: #EF4444;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, Menlo, monospace;

  /* Elevation */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-accent: 0 0 20px rgba(237, 38, 53, 0.35);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Safe area insets for iPhone notch / home bar */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: #FFFFFF;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(11, 11, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo-img {
  height: 70px;
  width: auto;
  display: block;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  background: var(--accent-muted);
  border: 1px solid rgba(237, 38, 53, 0.3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Navigation Menu */
.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-tab-link:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-tab-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.nav-tab-link.active::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  box-shadow: 0 0 6px var(--accent-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-side-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

.client-side-badge .badge-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 8px var(--status-success);
}

.btn-mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
  padding: 48px 0 32px;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(237, 38, 53, 0.08) 0%, transparent 65%);
  border-bottom: 1px solid rgba(39, 39, 48, 0.6);
}

.hero-tagline {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: var(--accent-primary);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-headline {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero-headline span {
  color: var(--accent-secondary);
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  user-select: none;
  min-height: 42px;
  touch-action: manipulation;  /* Removes 300ms tap delay on mobile */
  -webkit-tap-highlight-color: transparent;  /* Remove blue flash on tap */
}

.btn-primary {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-secondary);
  border-color: var(--accent-secondary);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
  color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-subtle);
}
.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  background: var(--accent-muted);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #EF4444;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 34px;
}

.btn-mini {
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-mini:hover {
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

/* ==========================================================================
   WORKSPACE & GRID LAYOUT
   ========================================================================== */

.workspace-section {
  padding: 36px 0 60px;
}

.generator-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-areas:
    "inputs preview"
    "custom preview";
  gap: 28px;
  align-items: start;
}

#card-generator-inputs {
  grid-area: inputs;
}

#card-generator-customization {
  grid-area: custom;
}

#generator-preview-col {
  grid-area: preview;
}

/* Card Surface */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-accent {
  color: var(--accent-primary);
}

/* ==========================================================================
   CONTENT TYPE SELECTOR BAR
   ========================================================================== */

.type-selector-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;  /* Firefox - no scrollbar desktop either */
  -ms-overflow-style: none;
}

.type-selector-bar::-webkit-scrollbar {
  display: none;  /* Chrome/Safari - no scrollbar desktop either */
}

.type-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.type-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.type-tab-btn.active {
  background: var(--accent-muted);
  color: var(--accent-secondary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(237, 38, 53, 0.2);
}

.type-tab-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   FORM INPUTS & CONTROLS
   ========================================================================== */

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

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
.form-row .form-group {
  margin-bottom: 0;
}
.col-4 { flex: 4; }
.col-6 { flex: 6; }
.col-8 { flex: 8; }

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

.form-label .required {
  color: var(--accent-primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.form-textarea {
  resize: vertical;
  min-height: 84px;
  font-family: var(--font-sans);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23A1A1AA' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.input-with-icon {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.input-with-icon:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-prefix {
  padding: 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  user-select: none;
  white-space: nowrap;
}

.input-with-icon .form-input {
  border: none;
  border-radius: 0;
  background: transparent;
}
.input-with-icon .form-input:focus {
  box-shadow: none;
}

.input-password-wrapper {
  position: relative;
}

.input-password-wrapper .form-input {
  padding-right: 44px;
}

.btn-toggle-pass {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 1rem;
}

.char-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* Custom Checkbox */
.custom-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.custom-checkbox input:checked + .checkbox-box {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.custom-checkbox input:checked + .checkbox-box::after {
  content: '✓';
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 800;
}

.checkbox-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   CUSTOMIZATION ACCORDIONS / SECTIONS
   ========================================================================== */

.customization-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Color Controls */
.color-picker-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.color-input-combo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px 8px;
}

.color-swatch-native {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  padding: 0;
}

.color-swatch-native::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-swatch-native::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
}

.color-text-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
}
.color-text-input:focus {
  outline: none;
}

/* Quick Swatches */
.swatches-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.swatches-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.color-preset-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.color-preset-btn:hover {
  transform: scale(1.15);
  border-color: #FFFFFF;
}

/* Style Segmented Buttons (Dots & Corners) */
.style-button-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.style-select-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.style-select-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.style-select-btn.active {
  background: var(--accent-muted);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

.style-preview-icon {
  width: 18px;
  height: 18px;
  display: block;
}

/* Range Sliders */
.slider-group {
  margin-bottom: 16px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slider-val-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-secondary);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-secondary);
}

/* Logo Management */
.logo-upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.logo-preview-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  object-fit: contain;
  padding: 4px;
  display: none;
}

.logo-warning-alert {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
  font-size: 0.8rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  display: none;
}

/* ==========================================================================
   LIVE PREVIEW SIDEBAR CARD
   ========================================================================== */

.preview-card-sticky {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preview-canvas-wrapper {
  background: #0B0B0D;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
  width: 100%;
  max-width: 360px;
  position: relative;
}

#qr-preview-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: var(--radius-md);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.status-verified {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.status-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
}
.pill-dot.warning {
  background: #FBBF24;
}

.qr-matrix-stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Download Action Buttons */
.download-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 12px;
}

.secondary-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.resolution-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.resolution-picker-row select {
  width: auto;
  padding: 4px 28px 4px 10px;
  font-size: 0.8rem;
}

/* Validation Alert Box */
.validation-alert-box {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  display: none;
}

/* ==========================================================================
   QR SCANNER WORKSPACE
   ========================================================================== */

.scanner-container {
  max-width: 820px;
  margin: 0 auto;
}

.scanner-mode-tabs {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.scanner-mode-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.scanner-mode-tab:hover {
  color: var(--text-primary);
}

.scanner-mode-tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Camera Scanner Window */
.camera-scanner-frame {
  background: #000000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: none;
}

#scanner-video {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

/* Cyber Scanning Reticle & Laser Overlay */
.scanner-reticle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reticle-box {
  width: 240px;
  height: 240px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

/* Corner Crosshairs */
.reticle-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent-primary);
  border-style: solid;
}
.reticle-corner.tl { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 14px; }
.reticle-corner.tr { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 14px; }
.reticle-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 14px; }
.reticle-corner.br { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 14px; }

/* Laser Sweep Animation */
.reticle-laser {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-secondary), #FFFFFF, var(--accent-secondary), transparent);
  box-shadow: 0 0 12px var(--accent-primary);
  animation: laserScan 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes laserScan {
  0% { top: 0%; opacity: 0.3; }
  50% { top: 96%; opacity: 1; }
  100% { top: 0%; opacity: 0.3; }
}

/* Camera Placeholder */
.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.placeholder-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.placeholder-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 20px;
}

.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

/* Image Drop Zone */
.dropzone-box {
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--accent-primary);
  background: var(--accent-muted);
}

.dropzone-icon {
  width: 52px;
  height: 52px;
  color: var(--accent-secondary);
  margin-bottom: 14px;
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.dropzone-paste-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  border: 1px solid var(--border-subtle);
}

.upload-preview-thumb {
  max-width: 220px;
  max-height: 220px;
  margin: 16px auto 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: none;
}

/* ==========================================================================
   SCANNED RESULT CARD
   ========================================================================== */

.scanned-result-card {
  margin-top: 28px;
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  box-shadow: 0 4px 20px rgba(237, 38, 53, 0.2);
  display: none;
}

.result-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.result-type-tag {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-secondary);
  background: var(--accent-muted);
  border: 1px solid rgba(237, 38, 53, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.result-title-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
}

.result-raw-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #FFFFFF;
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  margin-bottom: 16px;
}

/* Structured Details Grid (Wi-Fi, vCard, etc.) */
.result-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
  background: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-item.col-span-2 {
  grid-column: span 2;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-val {
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
}
.detail-val.font-bold { font-weight: 700; }
.detail-val.font-mono { font-family: var(--font-mono); }

.detail-password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   ABOUT & FEATURE HIGHLIGHTS
   ========================================================================== */

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.feature-box:hover {
  transform: translateY(-2px);
  border-color: rgba(237, 38, 53, 0.4);
}

.feature-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-muted);
  border: 1px solid rgba(237, 38, 53, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-secondary);
  margin-bottom: 16px;
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 28px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-tagline {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--accent-primary);
  text-transform: uppercase;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-privacy-guarantee {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-full);
}

.footer-privacy-guarantee .lock-icon {
  color: var(--status-success);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */

.toast-notification {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  color: #FFFFFF;
  border: 1px solid var(--border-subtle);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  z-index: 1000;
}

.toast-notification.toast-show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-success { border-color: var(--status-success); }
.toast-warning { border-color: var(--status-warning); }
.toast-error { border-color: var(--status-error); }
.toast-info { border-color: var(--accent-primary); }

/* Disabled Button State */
.disabled-btn {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* Idle Status Pill */
.status-idle {
  background: rgba(113, 113, 122, 0.14);
  border: 1px solid rgba(113, 113, 122, 0.3);
  color: #A1A1AA;
}
.pill-dot.idle {
  background: #71717A;
}

/* Offline Badge */
.offline-banner-badge {
  background: #F59E0B;
  color: #000000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  display: none;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (Mobile, Tablet, Desktop)
   ========================================================================== */

/* ── LARGE TABLET  (900px – 1024px) ── */
@media (max-width: 1024px) {
  .generator-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "inputs"
      "preview"
      "custom";
    gap: 22px;
  }

  #generator-preview-col {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .preview-card-sticky {
    position: static;
    width: 100%;
  }

  .about-features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Slightly reduce hero padding on tablet */
  .hero-section {
    padding: 40px 0 28px;
  }

  /* Ensure no horizontal overflow */
  .generator-grid,
  .card,
  .scanner-container {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* ── TABLET PORTRAIT / LARGE PHONE  (768px) ── */
@media (max-width: 768px) {
  /* Layout Core */
  html, body {
    overflow-x: hidden;
  }

  .container {
    padding: 0 16px;
    max-width: 100vw;
  }

  /* ── HEADER ── */
  .header-inner {
    height: 60px;
    gap: 10px;
  }

  .brand-logo-img {
    height: 30px;
  }

  .brand-badge {
    font-size: 0.6rem;
    padding: 2px 7px;
  }

  .btn-mobile-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(11, 11, 13, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    padding: 12px 16px;
    gap: 6px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .main-nav.nav-open {
    display: flex;
  }

  .nav-tab-link {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    justify-content: flex-start;
    border-radius: var(--radius-md);
  }

  .client-side-badge {
    display: none;
  }

  /* ── HERO ── */
  .hero-section {
    padding: 28px 0 20px;
    background: radial-gradient(circle at 50% 0%, rgba(237, 38, 53, 0.1) 0%, transparent 60%);
  }

  .hero-tagline {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
  }

  .hero-headline {
    font-size: clamp(1.55rem, 7vw, 2.1rem);
    line-height: 1.2;
    margin-bottom: 10px;
  }

  .hero-description {
    font-size: 0.9rem;
    margin-bottom: 18px;
    padding: 0 4px;
  }

  .hero-cta-group {
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hero-cta-group .btn {
    width: 100%;
    max-width: 340px;
    min-height: 48px;
    font-size: 0.95rem;
  }

  /* ── WORKSPACE ── */
  .workspace-section {
    padding: 24px 0 48px;
  }

  /* ── CARDS ── */
  .card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .card-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .card-title {
    font-size: 1rem;
  }

  /* ── FORMS ── */
  .form-row {
    flex-direction: column;
    gap: 14px;
  }

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

  /* iOS Safari auto-zoom prevention: ALL inputs must be >= 16px */
  .form-input,
  .form-textarea,
  .form-select,
  select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  textarea {
    font-size: 16px !important;
    min-height: 44px;
  }

  .form-textarea {
    min-height: 88px;
  }

  /* ── CONTENT TYPE BAR ── */
  .type-selector-bar {
    gap: 6px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .type-selector-bar::-webkit-scrollbar {
    display: none;
  }

  .type-tab-btn {
    padding: 9px 14px;
    font-size: 0.82rem;
    min-height: 40px;
    flex-shrink: 0;
    gap: 5px;
  }

  .type-tab-btn svg {
    width: 13px;
    height: 13px;
  }

  /* ── PREVIEW CARD ── */
  #generator-preview-col {
    max-width: 100%;
  }

  .preview-card-sticky {
    padding: 16px 14px;
    align-items: center;
  }

  .preview-canvas-wrapper {
    max-width: min(260px, 80vw);
    width: 100%;
    padding: 14px;
    margin-bottom: 14px;
    margin-left: auto;
    margin-right: auto;
  }

  #qr-preview-canvas {
    max-width: 100%;
    width: 100%;
    height: auto;
  }

  .qr-matrix-stats {
    font-size: 0.68rem;
    text-align: center;
  }

  .download-actions-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }

  .download-actions-grid .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.9rem;
  }

  .secondary-actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .secondary-actions-grid .btn {
    min-height: 44px;
    font-size: 0.82rem;
    padding: 8px 10px;
  }

  .resolution-picker-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .resolution-picker-row select {
    width: 100%;
    min-height: 40px;
  }

  /* ── CUSTOMIZATION ── */
  .customization-section {
    margin-top: 20px;
    padding-top: 16px;
  }

  .section-subtitle {
    font-size: 0.82rem;
    margin-bottom: 12px;
  }

  .swatches-bar {
    gap: 6px;
    flex-wrap: wrap;
  }

  .color-preset-btn {
    width: 28px;
    height: 28px;
  }

  .slider-group {
    margin-bottom: 14px;
  }

  .logo-upload-box {
    gap: 10px;
  }

  /* ── QR SCANNER ── */
  .scanner-container {
    max-width: 100%;
    padding: 0;
  }

  .scanner-mode-tabs {
    flex-direction: row;  /* Keep horizontal on mobile - better UX */
    gap: 6px;
    padding: 4px;
  }

  .scanner-mode-tab {
    flex: 1;
    min-height: 44px;
    font-size: 0.82rem;
    padding: 8px 10px;
    gap: 6px;
  }

  .scanner-mode-tab svg {
    width: 15px;
    height: 15px;
  }

  .camera-scanner-frame {
    min-height: 300px;
    max-height: 55vh;
    border-radius: var(--radius-md);
  }

  #scanner-video {
    max-height: 55vh;
  }

  .reticle-box {
    width: min(200px, 62vw);
    height: min(200px, 62vw);
  }

  .camera-placeholder {
    padding: 32px 16px;
  }

  .placeholder-icon {
    width: 52px;
    height: 52px;
  }

  .placeholder-title {
    font-size: 1rem;
  }

  .placeholder-desc {
    font-size: 0.82rem;
    max-width: 280px;
  }

  .camera-controls-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
  }

  .camera-controls-bar .btn {
    flex: 1;
    min-width: 110px;
    min-height: 44px;
  }

  /* Drop zone */
  .dropzone-box {
    padding: 32px 16px;
    border-radius: var(--radius-md);
  }

  .dropzone-icon {
    width: 40px;
    height: 40px;
  }

  .dropzone-title {
    font-size: 1rem;
  }

  .dropzone-desc {
    font-size: 0.82rem;
  }

  /* Scan Result Card */
  .scanned-result-card {
    margin-top: 20px;
  }

  .result-header-row {
    gap: 8px;
  }

  .result-title-text {
    font-size: 1.1rem;
  }

  .result-raw-box {
    font-size: 0.8rem;
    max-height: 140px;
  }

  .result-actions-row {
    flex-direction: column;
    gap: 8px;
  }

  .result-actions-row .btn {
    width: 100%;
    min-height: 48px;
  }

  /* ── ABOUT ── */
  .about-features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 18px;
  }

  .feature-box {
    padding: 18px;
  }

  .feature-icon-wrapper {
    width: 38px;
    height: 38px;
    margin-bottom: 12px;
  }

  .feature-title {
    font-size: 0.95rem;
  }

  .feature-text {
    font-size: 0.82rem;
  }

  /* ── SCAN RESULT DETAILS ── */
  .result-details-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .detail-item.col-span-2 {
    grid-column: span 1;
  }

  /* ── FOOTER ── */
  .site-footer {
    padding: 28px 0 20px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }

  .footer-brand {
    align-items: center;
  }

  /* ── TOAST ── */
  .toast-notification {
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}

/* ── SMALL PHONES  (480px) ── */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .hero-headline {
    font-size: clamp(1.4rem, 8vw, 1.9rem);
  }

  .hero-cta-group .btn {
    max-width: 100%;
  }

  .card {
    padding: 14px 12px;
  }

  /* Type tabs - even more compact */
  .type-tab-btn {
    padding: 8px 11px;
    font-size: 0.78rem;
    min-height: 38px;
  }

  /* Scanner tabs stay horizontal but compress */
  .scanner-mode-tabs {
    flex-direction: row;
  }

  .scanner-mode-tab {
    font-size: 0.78rem;
    padding: 8px 6px;
    gap: 4px;
  }

  /* Scanner smaller */
  .camera-scanner-frame {
    min-height: 260px;
    max-height: 50vh;
  }

  #scanner-video {
    max-height: 50vh;
  }

  .reticle-box {
    width: min(180px, 58vw);
    height: min(180px, 58vw);
  }

  .camera-controls-bar .btn {
    min-width: 90px;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  /* Preview compact */
  .preview-canvas-wrapper {
    max-width: min(220px, 76vw);
    padding: 10px;
  }

  /* Section subtitle smaller */
  .section-subtitle {
    font-size: 0.78rem;
  }

  .style-button-group {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
  }

  .style-select-btn {
    padding: 9px 6px;
    font-size: 0.78rem;
    min-height: 44px;
  }

  .color-picker-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .logo-upload-box {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .logo-upload-box .btn {
    width: 100%;
  }

  /* Result card smaller */
  .result-title-text {
    font-size: 1rem;
  }

  .result-raw-box {
    font-size: 0.75rem;
    padding: 10px;
    max-height: 120px;
  }

  /* Footer tighter */
  .site-footer {
    padding: 22px 0 16px;
  }

  .footer-copy {
    font-size: 0.75rem;
  }

  /* Toasts full-width on tiny screens */
  .toast-notification {
    right: 8px;
    left: 8px;
    max-width: calc(100vw - 16px);
  }
}

/* ── ULTRA SMALL (320px – Galaxy Fold, SE first gen) ── */
@media (max-width: 360px) {
  .container {
    padding: 0 10px;
  }

  .brand-logo-img {
    height: 26px;
  }

  .brand-badge {
    display: none; /* hide PRO badge on tiny screens */
  }

  .hero-headline {
    font-size: 1.35rem;
  }

  .type-selector-bar {
    gap: 5px;
  }

  .type-tab-btn {
    padding: 7px 10px;
    font-size: 0.75rem;
  }

  .scanner-mode-tab {
    font-size: 0.72rem;
    padding: 7px 5px;
  }

  .camera-scanner-frame {
    min-height: 220px;
    max-height: 48vh;
  }

  .reticle-box {
    width: 54vw;
    height: 54vw;
  }

  .preview-canvas-wrapper {
    max-width: min(190px, 78vw);
  }

  .download-actions-grid .btn {
    font-size: 0.85rem;
  }

  .secondary-actions-grid .btn {
    font-size: 0.75rem;
    padding: 7px 8px;
  }
}
