:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --accent: #10b981;
  --accent-light: #ecfdf5;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #93c5fd;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --radius-lg: 20px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

.feather {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: middle;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* 1. Верхнее меню */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.95);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-main);
}

.logo-badge {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.logo-badge .feather {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

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

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

/* Hero Section */
.hero {
  padding: 44px 0 20px;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #0f172a;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

/* Main Converter Card */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
  margin-bottom: 48px;
}

/* 2. Поле для загрузки файлов */
.dropzone {
  border: 2px dashed #93c5fd;
  background: #f8fafc;
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 24px;
}

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

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: white;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}

.dropzone-icon .feather {
  width: 34px;
  height: 34px;
  stroke: var(--primary);
}

.dropzone-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
}

.dropzone-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-choose {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
  transition: background 0.2s;
  border: none;
}

.btn-choose:hover {
  background: var(--primary-hover);
}

.btn-choose .feather {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
}

.dropzone-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.demo-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--primary);
  cursor: pointer;
  border: none;
  background: none;
  font-weight: 500;
}

.demo-btn-link .feather {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
}

.demo-btn-link:hover {
  text-decoration: underline;
}

/* 5. Очередь файлов (Карточки в 1 ряд / сетка карточек с превью) */
.file-list-wrapper {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--border);
  display: none;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.file-list-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.file-list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #f1f5f9;
}

.btn-secondary .feather {
  width: 15px;
  height: 15px;
}

.btn-primary-action {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary-action:hover {
  background: #059669;
}

.btn-download-action {
  background: var(--primary);
  color: white;
}

.btn-download-action:hover {
  background: var(--primary-hover);
}

.btn-primary-action .feather {
  width: 16px;
  height: 16px;
  stroke: white;
}

/* Сетка карточек файлов */
.file-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.file-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.file-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.file-card-thumb-wrap {
  width: 100%;
  height: 130px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.file-card-thumb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.75rem;
  gap: 6px;
}

.file-card-thumb-placeholder .feather {
  width: 28px;
  height: 28px;
  stroke: #94a3b8;
}

.btn-card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
  z-index: 2;
}

.btn-card-remove:hover {
  background: rgba(220, 38, 38, 0.9);
}

.btn-card-remove .feather {
  width: 14px;
  height: 14px;
  stroke: white;
}

.file-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.file-card-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.file-card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.file-card-status-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge .feather {
  width: 12px;
  height: 12px;
}

.status-pending { background: #e2e8f0; color: #475569; }
.status-converting { background: #fef3c7; color: #92400e; }
.status-done { background: #d1fae5; color: #065f46; }
.status-error { background: #fee2e2; color: #991b1b; }

.btn-card-download {
  background: var(--primary);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-card-download:hover {
  background: var(--primary-hover);
}

.btn-card-download .feather {
  width: 12px;
  height: 12px;
}

/* 4. Ползунок выбора качества */
.quality-wrapper {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}

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

.quality-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-label .feather {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}

.quality-value {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  background: white;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quality-slider {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  outline: none;
  accent-color: var(--primary);
  cursor: pointer;
}

.quality-presets {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.preset-btn {
  background: white;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.preset-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Опция удаления EXIF */
.exif-option-wrapper {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.checkbox-container {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checkbox-label-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-main);
}

.checkbox-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 3. Выбор конвертера (Без бейджей) */
.section-title-sm {
  font-size: 0.92rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.mode-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.mode-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.mode-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.mode-card input[type="radio"] {
  margin-top: 4px;
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}

.mode-content {
  flex: 1;
}

.mode-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.mode-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-title-wrap .feather {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
}

.mode-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.mode-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* 5. Информационный блок с текстом */
.content-section {
  padding: 36px 0;
}

.section-heading {
  text-align: center;
  margin-bottom: 36px;
}

.section-heading h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.section-heading p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 36px;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.info-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.info-icon .feather {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
}

.info-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.info-card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.comparison-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 40px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.comparison-table th, .comparison-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.comparison-table td {
  font-size: 0.92rem;
}

/* 6. Блок с FAQ */
.faq-section {
  padding: 36px 0 60px;
}

.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-question {
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-icon.feather {
  width: 20px;
  height: 20px;
  stroke: var(--primary);
  transition: transform 0.25s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 24px 20px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  border-top: 1px solid transparent;
}

.faq-item.open .faq-answer {
  display: block;
}

/* 7. Футер (Минималистичный с политикой и соглашением) */
.footer {
  margin-top: auto;
  background: #0f172a;
  color: #94a3b8;
  padding: 36px 0;
  border-top: 1px solid #1e293b;
  text-align: center;
}

.footer-links-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.footer-links-row a {
  color: #94a3b8;
  transition: color 0.2s;
}

.footer-links-row a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-sep {
  color: #475569;
  font-size: 0.8rem;
}

.footer-copyright {
  font-size: 0.9rem;
  color: #64748b;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.footer-copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.footer-copyright a:hover {
  color: #ffffff;
}

@media (max-width: 768px) {
  .quality-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .quality-value {
    align-self: flex-start;
    font-size: 0.85rem;
    padding: 6px 10px;
    line-height: 1.4;
  }
  .converter-card {
    padding: 22px 16px;
  }
  .mode-selector {
    grid-template-columns: 1fr;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .comparison-box {
    padding: 20px 14px;
  }
  .comparison-table {
    min-width: 520px;
  }
  .comparison-table th, .comparison-table td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  .file-list-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .file-list-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .file-list-actions .btn-secondary,
  .file-list-actions .btn-primary-action {
    flex: 1 1 auto;
    justify-content: center;
    padding: 10px 12px;
    font-size: 0.88rem;
    white-space: nowrap;
  }
  .file-list-actions #btnClearAll {
    flex: 0 0 auto;
    padding: 10px 14px;
  }
  .file-items {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .file-card-status-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .file-card-status-row .status-badge {
    align-self: flex-start;
  }
  .file-card-status-row .btn-card-download {
    width: 100%;
    justify-content: center;
    padding: 6px 10px;
  }
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2rem;
  }
  .footer-links-row {
    flex-direction: column;
    gap: 8px;
  }
  .footer-sep {
    display: none;
  }
}
