/* ============================================
   Улучши свое фото — main.css
   Modern Liquid Glass 2025–2026
   ============================================ */

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

:root {
  /* Palette */
  --bg: #F5F7FA;
  --bg-white: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --text-primary: #1A1A2E;
  --text-secondary: #4A4A68;
  --text-muted: #8A8AA3;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --violet: #7C3AED;
  --success: #22C55E;
  --warning: #F59E0B;
  --error: #EF4444;
  --border: rgba(255, 255, 255, 0.5);
  --border-subtle: rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-glass: 0 8px 32px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* Typography */
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Glass */
  --glass-blur: 20px;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.5);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* Container */
  --container-max: 1120px;
  --container-padding: 1.25rem;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(99, 102, 241, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* --- Decorative Background --- */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.bg-decoration::before {
  content: '';
  position: absolute;
  top: -15%;
  right: -8%;
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}
.bg-decoration::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.04) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(40px);
}
/* Дополнительный blob через box-shadow на bg-decoration */
.bg-decoration-blob {
  position: fixed;
  top: 40%;
  left: 50%;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  transform: translateX(-50%);
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 0;
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
}
.header-logo img {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.header-logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.header-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: color var(--transition-fast);
  white-space: nowrap;
}
.header-link:hover {
  color: var(--accent);
}
.header-link svg {
  width: 12px;
  height: 12px;
}

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}
.hero h1 span {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto var(--space-lg);
  line-height: 1.5;
}
.hero-badges {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
/* hero-cta removed — replaced by hero-badge-cta */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.hero-badge-cta {
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff !important;
  border-color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
}
.hero-badge-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
  color: #fff;
}

/* --- Demo Notice --- */
.demo-notice {
  text-align: center;
  margin-top: var(--space-md);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Before/After Slider --- */
.slider-section {
  margin: var(--space-xl) auto var(--space-2xl);
  max-width: 640px;
}
.slider-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.slider-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.slider-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.slider-tab:hover:not(.active) {
  background: var(--surface-hover);
}

.comparison-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: col-resize;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.comparison-slider .before-img,
.comparison-slider .after-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.comparison-slider .before-img {
  clip-path: inset(0 50% 0 0);
}
.comparison-slider .slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 3px;
  height: 100%;
  background: #fff;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
}
.comparison-slider .slider-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
}
.slider-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  padding: var(--space-xl);
}

/* --- Upload Section --- */
.upload-section {
  margin: 0 auto var(--space-3xl);
  max-width: 640px;
}
.upload-section .glass-card {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}

.upload-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-bottom: var(--space-lg);
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.upload-dropzone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-md);
  color: var(--accent);
}
.upload-dropzone-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.upload-dropzone-text strong {
  color: var(--accent);
}
.upload-dropzone-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Hidden file input */
#file-input {
  display: none;
}

/* File preview */
.upload-preview {
  display: none;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--accent-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}
.upload-preview.visible {
  display: flex;
}
.upload-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.upload-preview-info {
  flex: 1;
  min-width: 0;
}
.upload-preview-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-preview-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.upload-preview-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.upload-preview-remove:hover {
  background: var(--error);
  color: #fff;
}

/* --- Processing presets --- */
.presets-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}
.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}
.preset-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.preset-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-subtle);
}
.preset-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.preset-icon {
  font-size: 1.375rem;
  line-height: 1;
}
.preset-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Custom prompt — всегда виден */
.custom-prompt {
  margin-bottom: var(--space-lg);
}
.custom-prompt textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
  background: var(--bg-white);
}
.custom-prompt textarea:focus {
  border-color: var(--accent);
}


/* --- Tier selector --- */
.tier-selector {
  margin-bottom: var(--space-lg);
}
.tier-options {
  display: flex;
  gap: var(--space-sm);
}
.tier-option {
  flex: 1;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: var(--surface);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.tier-option:hover {
  background: var(--surface-hover);
}
.tier-option.active {
  border-color: var(--accent);
  background: var(--accent-light);
}
.tier-option-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.tier-option-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* --- Aspect Ratio Selector --- */
.aspect-ratio-selector {
  position: relative;
  margin-bottom: var(--space-lg);
  z-index: 100;
}

.btn-aspect-ratio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-aspect-ratio:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.aspect-ratio-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: dropdownFadeIn 0.2s ease-out;
}

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

.aspect-ratio-dropdown.hidden {
  display: none;
}

.aspect-ratio-option {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-subtle);
}

.aspect-ratio-option:last-child {
  border-bottom: none;
}

.aspect-ratio-option:hover {
  background: var(--accent-light);
}

.aspect-ratio-option.selected {
  background: var(--accent-light);
}

.aspect-ratio-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 50px;
}

.aspect-ratio-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.aspect-ratio-check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

/* --- Warning text --- */
.upload-warning {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* --- CTA Button --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-normal);
  width: 100%;
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Progress --- */
.progress-section {
  display: none;
  text-align: center;
  margin: var(--space-xl) auto;
  max-width: 640px;
}
.progress-section.visible {
  display: block;
}
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin: var(--space-md) 0;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}
.progress-status {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* --- How It Works --- */
.how-section {
  padding: var(--space-3xl) 0;
}
.section-title {
  text-align: center;
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2xl);
  color: var(--text-primary);
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.step-card {
  text-align: center;
}
.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}
.step-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.step-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Pricing --- */
.pricing-section {
  padding: var(--space-3xl) 0;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}
.pricing-card {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition-normal);
}
.pricing-card:hover {
  transform: translateY(-4px);
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-glass), 0 0 0 1px var(--accent);
}
.pricing-card-name {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}
.pricing-card-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.pricing-card-price small {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.pricing-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  line-height: 1.4;
}
.pricing-card-features {
  list-style: none;
  margin-top: var(--space-lg);
  text-align: left;
}
.pricing-card-features li {
  padding: 0.375rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pricing-card-features li::before {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-note {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

/* --- Why section --- */
.why-section {
  padding: var(--space-3xl) 0;
}
.why-section {
  padding: 60px 0;
}
.why-section .section-title {
  text-align: center;
  margin-bottom: var(--space-md);
}
.why-section .use-cases-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.why-section .use-cases-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  flex: 1 1 calc(50% - 10px);
  min-width: 280px;
}
.why-section .use-cases-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.125rem;
}
.why-section .use-cases-content {
  flex: 1;
}
.why-section .use-cases-content h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.why-section .use-cases-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* --- Recovery --- */
.recovery-section {
  padding: var(--space-2xl) 0;
  text-align: center;
}
.recovery-card {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-xl);
}
.recovery-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.recovery-form {
  display: flex;
  gap: var(--space-sm);
}
.recovery-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
  background: var(--bg-white);
  transition: border-color var(--transition-fast);
}
.recovery-input:focus {
  border-color: var(--accent);
}

/* --- FAQ --- */
.faq-section {
  padding: var(--space-3xl) 0;
}
.faq-list {
  max-width: 640px;
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--border-subtle);
}
.faq-question {
  width: 100%;
  text-align: left;
  padding: var(--space-lg) 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}
.faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.faq-item.open .faq-question::after {
  content: '−';
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
}
.faq-item.open .faq-answer {
  max-height: 200px;
  padding-bottom: var(--space-lg);
}
.faq-answer p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --- Footer --- */
.footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-2xl);
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}
.footer-link {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}
.footer-link:hover {
  color: var(--accent);
}
.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-attribution {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: var(--space-md);
  text-align: center;
  opacity: 0.7;
}
.footer-attribution a {
  color: var(--text-muted);
}
.footer-attribution a:hover {
  color: var(--accent);
}

/* --- PWA Banner --- */
.pwa-banner {
  display: none;
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 0.875rem var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  gap: var(--space-md);
  align-items: center;
  white-space: nowrap;
  max-width: calc(100% - 2rem);
}
.pwa-banner.visible {
  display: flex;
}
.pwa-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  font-size: 1.125rem;
}


/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
  }

  body {
    background-image: none;
  }
  .bg-decoration::before,
  .bg-decoration::after {
    display: none;
  }
  .bg-decoration-blob {
    display: none;
  }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

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

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

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

  .footer-links {
    justify-content: center;
  }

  .recovery-form {
    flex-direction: column;
  }

  .how-section,
  .pricing-section,
  .why-section,
  .faq-section {
    padding: var(--space-2xl) 0;
  }

  .header-link span.desktop-only {
    display: none;
  }

  .legal-page {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  .faq-section {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }

  /* Privacy/rules pages — ensure padding */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-badges {
    flex-direction: column;
    align-items: center;
  }

  .tier-options {
    flex-direction: column;
  }
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* --- Result Page --- */
.result-section {
  padding: var(--space-3xl) 0;
  max-width: 720px;
  margin: 0 auto;
}
.result-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-xl);
  background: #eee;
}
.result-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.result-info {
  text-align: center;
}
.result-info .order-uuid {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
}
.result-warning {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--warning);
  margin-top: var(--space-md);
}

/* --- Legal pages --- */
.legal-page {
  padding: var(--space-3xl) 0;
  max-width: 720px;
  margin: 0 auto;
}
.legal-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}
.legal-page .legal-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
}
.legal-page h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}
.legal-page p,
.legal-page li {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}
.legal-page ul,
.legal-page ol {
  padding-left: var(--space-xl);
}
.legal-page li {
  margin-bottom: var(--space-sm);
}

/* --- Utility --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}


/* --- Feedback Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.modal-card {
  max-width: 480px;
  width: 100%;
  position: relative;
  padding: var(--space-xl);
}
.modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.feedback-type-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.feedback-type-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* --- Server Status Indicator --- */
.server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}
.server-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}
.server-dot.online { background: var(--success); }
.server-dot.offline { background: var(--error); }

/* --- Free Counter --- */
.free-counter {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding: 0.5rem;
  background: var(--accent-light);
  border-radius: var(--radius-md);
}

/* --- Yandex Browser fix — ensure minimum readable text --- */
@supports (-webkit-appearance: none) {
  html {
    font-size: max(16px, 1rem);
  }
}

/* --- Fullscreen Comparison --- */
.btn-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-fullscreen:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* Fullscreen overlay fallback */
.comparison-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.comparison-fullscreen-overlay .comparison-slider {
  width: 100%;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 6rem);
  aspect-ratio: auto;
  border-radius: 0;
  position: relative;
}
.comparison-fullscreen-overlay .comparison-slider .before-img,
.comparison-fullscreen-overlay .comparison-slider .after-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.comparison-fullscreen-overlay .slider-labels {
  margin-top: var(--space-sm);
}
.comparison-fullscreen-overlay .slider-label {
  color: rgba(255, 255, 255, 0.7);
}
.comparison-fullscreen-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background var(--transition-fast);
}
.comparison-fullscreen-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Native fullscreen styles */
.comparison-slider:fullscreen,
.comparison-slider:-webkit-full-screen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}
.comparison-slider:fullscreen .before-img,
.comparison-slider:fullscreen .after-img,
.comparison-slider:-webkit-full-screen .before-img,
.comparison-slider:-webkit-full-screen .after-img {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
}

/* Increase base slider size on desktop */
@media (min-width: 769px) {
  .result-section .comparison-slider {
    min-height: 400px;
  }
}

/* --- Slider user-select fix (Yandex Browser blue selection) --- */
.comparison-slider,
.comparison-slider img,
.comparison-slider canvas {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* ====== BETA BANNER (удалить после выхода из беты) ====== */
.beta-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 12px 18px;
  margin: 16px auto;
  max-width: 640px;
  font-size: 0.9rem;
  color: var(--text-primary);
  backdrop-filter: blur(8px);
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #6366F1, #7C3AED);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.beta-text {
  color: var(--text-secondary);
  line-height: 1.4;
}
/* ====== /BETA BANNER ====== */

/* ====== BATCH PANEL (index.html unified upload) ====== */
.batch-panel { margin-bottom: var(--space-lg); }
.batch-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-md); padding: var(--space-sm) 0;
}
.batch-panel-title { font-weight: 700; font-size: 0.9375rem; }
.batch-panel-total { font-size: 0.875rem; color: var(--text-secondary); font-weight: 600; }
.batch-panel .batch-file-list { list-style: none; margin: 0; padding: 0; }
.batch-panel .batch-file-item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xs);
  border: 1px solid var(--border-subtle);
}
.batch-panel .batch-file-thumb {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  object-fit: cover; flex-shrink: 0; background: var(--border-subtle);
}
.batch-panel .batch-file-info { flex: 1; min-width: 0; }
.batch-panel .batch-file-name {
  font-size: 0.8125rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.batch-panel .batch-file-size { font-size: 0.6875rem; color: var(--text-muted); }
.batch-panel .batch-file-remove {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.06); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; flex-shrink: 0; transition: all var(--transition-fast);
}
.batch-panel .batch-file-remove:hover { background: var(--error); color: #fff; }

/* ====== LIBRARY BUTTON ====== */
.btn-library {
  display: block;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(124, 58, 237, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  margin-bottom: var(--space-lg);
}
.btn-library:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(124, 58, 237, 0.1));
  border-color: var(--accent);
}

/* Body scroll lock when library is open */
body.library-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ====== LIBRARY MODAL ====== */
.library-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: var(--space-md);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.library-modal-content {
  background: var(--bg);
  border-radius: var(--radius-lg);
  max-width: 960px;
  width: 100%;
  margin: var(--space-xl) auto;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.library-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  position: sticky;
  top: 0;
  z-index: 1;
}
.library-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.library-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.library-modal-close:hover {
  background: var(--error);
  color: #fff;
}

.library-layout {
  padding: var(--space-lg) var(--space-xl);
}

/* Categories */
.library-categories {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.library-category-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.library-category-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.library-category-tab:hover:not(.active) {
  background: var(--surface-hover);
}

/* Preset cards grid */
.library-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
}
.library-preset-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  height: 100%;
}
.library-preset-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(99, 102, 241, 0.2);
}
.library-preset-card[style*="display: none"] {
  display: none !important;
}
.library-preset-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.library-preset-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}
.library-preset-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.library-preset-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}
.library-preset-card .preset-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.library-preset-card .preset-lifehack {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  line-height: 1.5;
}
.library-preset-card .preset-example {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.library-preset-card .preset-example img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.library-preset-card .preset-example.no-image::before {
  content: 'Пример появится позже';
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-sm);
}
.library-preset-card .preset-example img.loaded + ::before,
.library-preset-card .preset-example:has(img[src]:not(.error))::before {
  display: none;
}
.library-user-prompt {
  margin-top: var(--space-xs);
}
.library-prompt-input {
  width: 100%;
  min-height: 60px;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  resize: vertical;
  outline: none;
  background: var(--bg-white);
  transition: border-color var(--transition-fast);
}
.library-prompt-input:focus {
  border-color: var(--accent);
}
.btn-library-select {
  align-self: flex-start;
  margin-top: auto;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-library-select:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* General tips */
.library-tips {
  padding: var(--space-lg) var(--space-xl);
  border-top: 1px solid var(--border-subtle);
  background: rgba(99, 102, 241, 0.04);
}
.library-tips h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.library-tips ul {
  margin: 0;
  padding-left: var(--space-lg);
}
.library-tips li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}
.library-tips li:last-child {
  margin-bottom: 0;
}

/* Library responsive */
@media (max-width: 768px) {
  .library-modal {
    padding: 0;
    align-items: stretch;
    overscroll-behavior: contain;
  }
  .library-modal-content {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .library-presets {
    grid-template-columns: 1fr;
  }
  .library-layout {
    padding: var(--space-md);
  }
  .library-modal-header {
    padding: var(--space-md);
  }
  .library-tips {
    padding: var(--space-md);
  }
  .library-categories {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-xs);
  }
  .library-categories::-webkit-scrollbar {
    display: none;
  }
}

/* ====== GENERATE SECTION ====== */
.generate-section {
  margin: 0 auto var(--space-3xl);
  max-width: 640px;
}
.generate-section .glass-card {
  padding: var(--space-xl);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.generate-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}
.generate-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}
.generate-textarea {
  width: 100%;
  min-height: 80px;
  padding: var(--space-md);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-fast);
  background: var(--bg-white);
  margin-bottom: var(--space-lg);
}
.generate-textarea:focus {
  border-color: var(--accent);
}

/* ====== FREE COUNTER BANNER ====== */
.free-counter {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.8125rem; color: var(--text-secondary);
  margin-bottom: var(--space-md);
}
.free-counter-icon { font-size: 1rem; flex-shrink: 0; }

/* --- Selected Preset Info (FIX2) --- */
.selected-preset-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-primary);
}
.selected-preset-info .selected-preset-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}
.selected-preset-info .selected-preset-name {
  flex: 1;
  font-weight: 600;
}
.selected-preset-info .selected-preset-change {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.selected-preset-info .selected-preset-change:hover {
  background: rgba(99, 102, 241, 0.1);
}

/* ====== IMAGE OVERLAY (generation tap-to-zoom) ====== */
.image-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.image-overlay img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
}
.image-overlay-close {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
}

/* ====== USE CASES SECTION ====== */
.use-cases-section {
  padding: 60px 0;
  background: var(--bg-secondary, #f8f8f8);
}
.use-cases-section .section-title {
  text-align: center;
  margin-bottom: 8px;
}
.use-cases-section .section-subtitle {
  text-align: center;
  color: var(--text-muted, #666);
  margin-bottom: 40px;
  font-size: 1rem;
}
.use-cases-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.use-cases-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card, #fff);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.use-cases-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1.2;
}
.use-cases-content {
  flex: 1;
}
.use-cases-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px 0;
}
.use-cases-content p {
  font-size: 0.9rem;
  color: var(--text-muted, #555);
  line-height: 1.5;
  margin: 0;
}
.use-cases-bonus {
  background: linear-gradient(135deg, var(--primary-light, #e8f4f8) 0%, var(--bg-card, #fff) 100%);
  border: 1px solid var(--primary, #0099cc);
}
@media (max-width: 600px) {
  .use-cases-item {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  .use-cases-icon {
    font-size: 1.25rem;
  }
}

/* ====== CUSTOM PROMPT LABEL (Изменение D) ====== */
.custom-prompt-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #888);
  margin-bottom: 0.4rem;
}
.custom-prompt-optional {
  font-weight: 400;
  opacity: 0.7;
}

/* ====== MOBILE: main padding for privacy/rules ====== */
@media (max-width: 768px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  main .container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ====== TOOL TOGGLE ====== */
.tool-wrapper {
  margin-top: var(--space-xl, 2rem);
}

.tool-toggle {
  display: flex;
  background: var(--bg-card, rgba(255,255,255,0.6));
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-lg, 1.5rem);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 2px 12px rgba(99,102,241,0.10);
  border: 1px solid rgba(99,102,241,0.12);
}

.tool-toggle-btn {
  flex: 1;
  padding: 10px 28px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted, #888);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}

.tool-toggle-btn.active {
  background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.30);
}

.tool-toggle-btn:not(.active):hover {
  color: var(--text-primary, #333);
  background: rgba(99,102,241,0.07);
}

/* Mobile */
@media (max-width: 480px) {
  .tool-toggle {
    width: 100%;
    border-radius: var(--radius-lg, 12px);
    padding: 4px;
  }
  .tool-toggle-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
}

/* ====== BATCH FILE LIST STYLES ====== */
.batch-panel {
  margin-bottom: var(--space-lg);
}

.batch-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.batch-panel-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.batch-panel-total {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.batch-file-list {
  list-style: none;
  margin-bottom: var(--space-md);
}

.batch-file-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.batch-file-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border-subtle);
}

.batch-file-info {
  flex: 1;
  min-width: 0;
}

.batch-file-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.batch-file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.batch-file-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.batch-file-status.queued {
  background: var(--surface);
  color: var(--text-muted);
}

.batch-file-status.uploading {
  background: var(--accent-light);
  color: var(--accent);
}

.batch-file-status.processing {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.batch-file-status.done {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.batch-file-status.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.batch-file-status.paying {
  background: rgba(124, 58, 237, 0.1);
  color: var(--violet);
}

.batch-file-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.batch-file-actions a,
.batch-file-actions button {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-white);
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.batch-file-actions a:hover,
.batch-file-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.batch-file-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  font-size: 0.875rem;
}

.batch-file-remove:hover {
  background: var(--error);
  color: #fff;
}

.batch-progress-overall {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--accent-light);
  border-radius: var(--radius-md);
  display: none;
}

.batch-progress-overall.visible {
  display: block;
}

.batch-progress-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-align: center;
}

.batch-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
}
